Merge "Add frameworks/wilhelm to Android.bp."
diff --git a/android/arch.go b/android/arch.go
index 7ccd003..606de48 100644
--- a/android/arch.go
+++ b/android/arch.go
@@ -267,12 +267,12 @@
 		return
 	}
 
-	osClasses := module.base().OsClassSupported()
-
-	if len(osClasses) == 0 {
+	if !module.base().ArchSpecific() {
 		return
 	}
 
+	osClasses := module.base().OsClassSupported()
+
 	var moduleTargets []Target
 	primaryModules := make(map[int]bool)
 
diff --git a/android/makevars.go b/android/makevars.go
index 149f2f8..e431f11 100644
--- a/android/makevars.go
+++ b/android/makevars.go
@@ -170,6 +170,7 @@
 else
   $(1) := $$(SOONG_$(1))
 endif
+.KATI_READONLY := $(1) SOONG_$(1)
 endef
 
 my_check_failed := false
diff --git a/android/module.go b/android/module.go
index f815ced..00219ae 100644
--- a/android/module.go
+++ b/android/module.go
@@ -152,6 +152,7 @@
 
 	// Set by InitAndroidModule
 	HostOrDeviceSupported HostOrDeviceSupported `blueprint:"mutated"`
+	ArchSpecific          bool                  `blueprint:"mutated"`
 }
 
 type hostAndDeviceProperties struct {
@@ -176,6 +177,7 @@
 	DeviceSupported
 	HostAndDeviceSupported
 	HostAndDeviceDefault
+	NeitherHostNorDeviceSupported
 )
 
 func InitAndroidModule(m Module,
@@ -197,6 +199,7 @@
 	base := m.base()
 	base.commonProperties.HostOrDeviceSupported = hod
 	base.commonProperties.Default_multilib = string(defaultMultilib)
+	base.commonProperties.ArchSpecific = true
 
 	switch hod {
 	case HostAndDeviceSupported:
@@ -305,6 +308,10 @@
 	return a.Target().Arch
 }
 
+func (a *ModuleBase) ArchSpecific() bool {
+	return a.commonProperties.ArchSpecific
+}
+
 func (a *ModuleBase) OsClassSupported() []OsClass {
 	switch a.commonProperties.HostOrDeviceSupported {
 	case HostSupported:
diff --git a/cc/config/global.go b/cc/config/global.go
index 0a7bdc5..ae43301 100644
--- a/cc/config/global.go
+++ b/cc/config/global.go
@@ -95,6 +95,7 @@
 	pctx.PrefixedPathsForOptionalSourceVariable("CommonGlobalIncludes", "-I",
 		[]string{
 			"system/core/include",
+			"frameworks/native/include",
 		})
 	pctx.PrefixedPathsForOptionalSourceVariable("CommonGlobalSystemIncludes", "-isystem ",
 		[]string{
@@ -103,7 +104,6 @@
 			"hardware/libhardware_legacy/include",
 			"hardware/ril/include",
 			"libnativehelper/include",
-			"frameworks/native/include",
 			"frameworks/native/opengl/include",
 			"frameworks/av/include",
 			"frameworks/base/include",
diff --git a/cc/test.go b/cc/test.go
index 5a34d1d..9c7c0de 100644
--- a/cc/test.go
+++ b/cc/test.go
@@ -16,6 +16,7 @@
 
 import (
 	"path/filepath"
+	"runtime"
 	"strings"
 
 	"github.com/google/blueprint"
@@ -301,6 +302,16 @@
 }
 
 func NewBenchmark(hod android.HostOrDeviceSupported) *Module {
+	// Benchmarks aren't supported on Darwin
+	if runtime.GOOS == "darwin" {
+		switch hod {
+		case android.HostAndDeviceSupported:
+			hod = android.DeviceSupported
+		case android.HostSupported:
+			hod = android.NeitherHostNorDeviceSupported
+		}
+	}
+
 	module, binary := NewBinary(hod)
 	module.multilib = android.MultilibBoth
 	binary.baseInstaller = NewTestInstaller()