Turn 64-bit-related warnings into errors on 64-bit builds.
I don't think we can realistically turn this on for 32-bit builds any
time soon.
Also, fix the arm64 stack-protector hack.
Change-Id: Ie1e7c875bbc06fb21bb372b8ca99879a23ef53d4
diff --git a/core/combo/TARGET_linux-arm64.mk b/core/combo/TARGET_linux-arm64.mk
index 76ee567..83fda7b 100644
--- a/core/combo/TARGET_linux-arm64.mk
+++ b/core/combo/TARGET_linux-arm64.mk
@@ -78,6 +78,11 @@
android_config_h := $(call select-android-config-h,linux-arm64)
+# HACK: globally disable -fstack-protector until the toolchain supports it
+TARGET_GLOBAL_UNSUPPORTED_CFLAGS := \
+ -fstack-protector \
+ -fstack-protector-all \
+
TARGET_GLOBAL_CFLAGS += \
-fpic -fPIE \
-ffunction-sections \
@@ -91,8 +96,10 @@
-include $(android_config_h) \
-I $(dir $(android_config_h))
-# HACK: globally disable -fstack-protector until the toolchain supports it
-TARGET_GLOBAL_UNSUPPORTED_CFLAGS := -fstack-protector
+# Help catch common 32/64-bit errors.
+TARGET_GLOBAL_CFLAGS += \
+ -Werror=pointer-to-int-cast \
+ -Werror=int-to-pointer-cast \
# TODO - remove __ANDROID__ after the next aarch64 toolchain refresh
TARGET_GLOBAL_CFLAGS += -D__ANDROID__=1