diff --git a/cc/cc.go b/cc/cc.go
index 3cc0d0d..bac3e88 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -118,7 +118,7 @@
 )
 
 func init() {
-	if android.BuildOs == android.Linux {
+	if android.CurrentHostType() == android.Linux {
 		commonGlobalCflags = append(commonGlobalCflags, "-fdebug-prefix-map=/proc/self/cwd=")
 	}
 
@@ -729,10 +729,11 @@
 func (c *Module) toolchain(ctx BaseModuleContext) Toolchain {
 	if c.cachedToolchain == nil {
 		arch := ctx.Arch()
-		os := ctx.Os()
-		factory := toolchainFactories[os][arch.ArchType]
+		hod := ctx.HostOrDevice()
+		ht := ctx.HostType()
+		factory := toolchainFactories[hod][ht][arch.ArchType]
 		if factory == nil {
-			ctx.ModuleErrorf("Toolchain not found for %s arch %q", os.String(), arch.String())
+			ctx.ModuleErrorf("Toolchain not found for %s %s arch %q", hod.String(), ht.String(), arch.String())
 			return nil
 		}
 		c.cachedToolchain = factory(arch)
@@ -904,13 +905,8 @@
 			return
 		}
 
-		if a.Target().Os != ctx.Os() {
-			ctx.ModuleErrorf("OS mismatch between %q and %q", ctx.ModuleName(), name)
-			return
-		}
-
-		if a.Target().Arch.ArchType != ctx.Arch().ArchType {
-			ctx.ModuleErrorf("Arch mismatch between %q and %q", ctx.ModuleName(), name)
+		if a.HostOrDevice() != ctx.HostOrDevice() {
+			ctx.ModuleErrorf("host/device mismatch between %q and %q", ctx.ModuleName(), name)
 			return
 		}
 
@@ -1085,11 +1081,6 @@
 		flags.LdFlags = append(flags.LdFlags, target, gccPrefix)
 	}
 
-	hod := "host"
-	if ctx.Os().Class == android.Device {
-		hod = "device"
-	}
-
 	if !ctx.noDefaultCompilerFlags() {
 		flags.GlobalFlags = append(flags.GlobalFlags, instructionSetFlags)
 
@@ -1099,7 +1090,7 @@
 			flags.GlobalFlags = append(flags.GlobalFlags,
 				toolchain.ClangCflags(),
 				"${commonClangGlobalCflags}",
-				fmt.Sprintf("${%sClangGlobalCflags}", hod))
+				fmt.Sprintf("${%sClangGlobalCflags}", ctx.HostOrDevice()))
 
 			flags.ConlyFlags = append(flags.ConlyFlags, "${clangExtraConlyflags}")
 		} else {
@@ -1107,7 +1098,7 @@
 			flags.GlobalFlags = append(flags.GlobalFlags,
 				toolchain.Cflags(),
 				"${commonGlobalCflags}",
-				fmt.Sprintf("${%sGlobalCflags}", hod))
+				fmt.Sprintf("${%sGlobalCflags}", ctx.HostOrDevice()))
 		}
 
 		if Bool(ctx.AConfig().ProductVariables.Brillo) {
@@ -1419,7 +1410,7 @@
 	// MinGW spits out warnings about -fPIC even for -fpie?!) being ignored because
 	// all code is position independent, and then those warnings get promoted to
 	// errors.
-	if ctx.Os() != android.Windows {
+	if ctx.HostType() != android.Windows {
 		flags.CFlags = append(flags.CFlags, "-fPIC")
 	}
 
@@ -1872,7 +1863,7 @@
 
 	static := Bool(binary.Properties.Static_executable)
 	if ctx.Host() {
-		if ctx.Os() == android.Linux {
+		if ctx.HostType() == android.Linux {
 			if binary.Properties.Static_executable == nil && Bool(ctx.AConfig().ProductVariables.HostStaticBinaries) {
 				static = true
 			}
@@ -1892,7 +1883,7 @@
 
 	if ctx.Host() && !binary.staticBinary() {
 		flags.LdFlags = append(flags.LdFlags, "-pie")
-		if ctx.Os() == android.Windows {
+		if ctx.HostType() == android.Windows {
 			flags.LdFlags = append(flags.LdFlags, "-Wl,-e_mainCRTStartup")
 		}
 	}
@@ -1900,7 +1891,7 @@
 	// MinGW spits out warnings about -fPIC even for -fpie?!) being ignored because
 	// all code is position independent, and then those warnings get promoted to
 	// errors.
-	if ctx.Os() != android.Windows {
+	if ctx.HostType() != android.Windows {
 		flags.CFlags = append(flags.CFlags, "-fpie")
 	}
 
@@ -1954,7 +1945,7 @@
 	fileName := binary.getStem(ctx) + flags.Toolchain.ExecutableSuffix()
 	outputFile := android.PathForModuleOut(ctx, fileName)
 	ret := outputFile
-	if ctx.Os().Class == android.Host {
+	if ctx.HostOrDevice().Host() {
 		binary.hostToolPath = android.OptionalPathForPath(outputFile)
 	}
 
@@ -2061,7 +2052,7 @@
 	if ctx.Host() {
 		flags.CFlags = append(flags.CFlags, "-O0", "-g")
 
-		switch ctx.Os() {
+		switch ctx.HostType() {
 		case android.Windows:
 			flags.CFlags = append(flags.CFlags, "-DGTEST_OS_WINDOWS")
 		case android.Linux:
