am 14ed738d: Merge "Ensure that we only compile the proper bitwidth bitcode for an architecture."
* commit '14ed738d702861137663653cf0301fd680e8ae15':
Ensure that we only compile the proper bitwidth bitcode for an architecture.
diff --git a/Android.mk b/Android.mk
index c35d499..ecfea90 100644
--- a/Android.mk
+++ b/Android.mk
@@ -14,9 +14,6 @@
# limitations under the License.
#
-# Don't build for unbundled branches
-ifeq (,$(TARGET_BUILD_APPS))
-
LOCAL_PATH := $(call my-dir)
LIBBCC_ROOT_PATH := $(LOCAL_PATH)
include $(LIBBCC_ROOT_PATH)/libbcc.mk
@@ -37,10 +34,6 @@
# Device Shared Library libbcc
#=====================================================================
ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
-ifeq ($(TARGET_ARCH),arm64)
-$(info TODOArm64: $(LOCAL_PATH)/Android.mk Enable libbcc build)
-endif
-
ifeq ($(TARGET_ARCH),mips64)
$(info TODOMips64: $(LOCAL_PATH)/Android.mk Enable libbcc build)
endif
@@ -77,6 +70,9 @@
# Host Shared Library libbcc
#=====================================================================
+# Don't build for unbundled branches
+ifeq (,$(TARGET_BUILD_APPS))
+
include $(CLEAR_VARS)
LOCAL_MODULE := libbcc
diff --git a/bcinfo/Android.mk b/bcinfo/Android.mk
index 6e073c1..cb6af97 100644
--- a/bcinfo/Android.mk
+++ b/bcinfo/Android.mk
@@ -14,9 +14,6 @@
# limitations under the License.
#
-# Don't build for unbundled branches
-ifeq (,$(TARGET_BUILD_APPS))
-
local_cflags_for_libbcinfo := -Wall -Wno-unused-parameter -Werror
ifneq ($(TARGET_BUILD_VARIANT),eng)
local_cflags_for_libbcinfo += -D__DISABLE_ASSERTS
@@ -72,6 +69,9 @@
include $(BUILD_SHARED_LIBRARY)
endif
+# Don't build for unbundled branches
+ifeq (,$(TARGET_BUILD_APPS))
+
include $(CLEAR_VARS)
LOCAL_MODULE := libbcinfo
diff --git a/include/bcc/Renderscript/RSScript.h b/include/bcc/Renderscript/RSScript.h
index 5f9e405..cd4385f 100644
--- a/include/bcc/Renderscript/RSScript.h
+++ b/include/bcc/Renderscript/RSScript.h
@@ -21,10 +21,6 @@
#include "bcc/Renderscript/RSInfo.h"
#include "bcc/Support/Sha1Util.h"
-namespace llvm {
- class Module;
-} // end namespace llvm
-
namespace bcc {
class RSScript;
diff --git a/lib/Support/CompilerConfig.cpp b/lib/Support/CompilerConfig.cpp
index 25ae709..817ba0b 100644
--- a/lib/Support/CompilerConfig.cpp
+++ b/lib/Support/CompilerConfig.cpp
@@ -135,7 +135,15 @@
#if defined(TARGET_BUILD)
if (!getProperty("debug.rs.arm-no-tune-for-cpu")) {
+#ifndef FORCE_CPU_VARIANT_32
setCPU(llvm::sys::getHostCPUName());
+#else
+#define XSTR(S) #S
+#define STR(S) XSTR(S)
+ setCPU(STR(FORCE_CPU_VARIANT_32));
+#undef STR
+#undef XSTR
+#endif
}
#endif // TARGET_BUILD
@@ -147,7 +155,16 @@
case llvm::Triple::aarch64:
#if defined(TARGET_BUILD)
if (!getProperty("debug.rs.arm-no-tune-for-cpu")) {
+#ifndef FORCE_CPU_VARIANT_64
setCPU(llvm::sys::getHostCPUName());
+#else
+#define XSTR(S) #S
+#define STR(S) XSTR(S)
+ setCPU(STR(FORCE_CPU_VARIANT_64));
+#undef STR
+#undef XSTR
+#endif
+
}
#endif // TARGET_BUILD
break;
diff --git a/libbcc-device-build.mk b/libbcc-device-build.mk
index 5324e15..0dc21b0 100644
--- a/libbcc-device-build.mk
+++ b/libbcc-device-build.mk
@@ -24,6 +24,15 @@
$(RS_VERSION_DEFINE) \
$(LOCAL_CFLAGS)
+
+ifneq ($(BOARD_OVERRIDE_RS_CPU_VARIANT_32),)
+LOCAL_CFLAGS += -DFORCE_CPU_VARIANT_32=$(BOARD_OVERRIDE_RS_CPU_VARIANT_32)
+endif
+
+ifneq ($(BOARD_OVERRIDE_RS_CPU_VARIANT_64),)
+LOCAL_CFLAGS += -DFORCE_CPU_VARIANT_64=$(BOARD_OVERRIDE_RS_CPU_VARIANT_64)
+endif
+
ifeq ($(TARGET_BUILD_VARIANT),eng)
LOCAL_CFLAGS += -DANDROID_ENGINEERING_BUILD
else
diff --git a/libbcc-host-build.mk b/libbcc-host-build.mk
index d9b4cdd..440081f 100644
--- a/libbcc-host-build.mk
+++ b/libbcc-host-build.mk
@@ -26,6 +26,14 @@
$(RS_VERSION_DEFINE) \
$(LOCAL_CFLAGS)
+ifneq ($(BOARD_OVERRIDE_RS_CPU_VARIANT_32),)
+LOCAL_CFLAGS += -DFORCE_CPU_VARIANT_32=$(BOARD_OVERRIDE_RS_CPU_VARIANT_32)
+endif
+
+ifneq ($(BOARD_OVERRIDE_RS_CPU_VARIANT_64),)
+LOCAL_CFLAGS += -DFORCE_CPU_VARIANT_64=$(BOARD_OVERRIDE_RS_CPU_VARIANT_64)
+endif
+
ifeq ($(TARGET_BUILD_VARIANT),eng)
libbcc_CFLAGS += -DANDROID_ENGINEERING_BUILD
else
diff --git a/tools/bcc_strip_attr/Android.mk b/tools/bcc_strip_attr/Android.mk
index 14ac4a3..a8296bc 100644
--- a/tools/bcc_strip_attr/Android.mk
+++ b/tools/bcc_strip_attr/Android.mk
@@ -16,9 +16,6 @@
LOCAL_PATH := $(call my-dir)
-# Don't build for unbundled branches
-ifeq (,$(TARGET_BUILD_APPS))
-
# Executable for host
# ========================================================
include $(CLEAR_VARS)
@@ -40,5 +37,3 @@
include $(LIBBCC_HOST_BUILD_MK)
include $(LLVM_HOST_BUILD_MK)
include $(BUILD_HOST_EXECUTABLE)
-
-endif # Don't build for unbundled branches