Make prefer32 a lambda

prefer32 needs to be set differently for app and native modules.
Make it use lambda provided by the module type instead of trying
to make archMutator figure it out.

Test: m checkbuild
Change-Id: Ibf8af35fdd3e1721725539d1f5452f4439d2125c
diff --git a/cc/cc.go b/cc/cc.go
index d31a38a..d04485d 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -406,6 +406,17 @@
 		c.AddProperties(feature.props()...)
 	}
 
+	c.Prefer32(func(ctx android.BaseModuleContext, base *android.ModuleBase, class android.OsClass) bool {
+		switch class {
+		case android.Device:
+			return ctx.Config().DevicePrefer32BitExecutables()
+		case android.HostCross:
+			// Windows builds always prefer 32-bit
+			return true
+		default:
+			return false
+		}
+	})
 	android.InitAndroidArchModule(c, c.hod, c.multilib)
 
 	android.InitDefaultableModule(c)