summaryrefslogtreecommitdiffstats
path: root/core/combo/TARGET_linux-mips64.mk
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2014-08-06 12:36:46 -0700
committerDan Albert <danalbert@google.com>2014-08-07 10:20:58 -0700
commit4803ce2696950f8c27c83de4fe46ae196f35af16 (patch)
tree121e2ae9ccd32131d8c3975219bdd9a03714f7cb /core/combo/TARGET_linux-mips64.mk
parentce06199a047f81d6afe522ab4e6f489deecb46f3 (diff)
downloadbuild-4803ce2696950f8c27c83de4fe46ae196f35af16.zip
build-4803ce2696950f8c27c83de4fe46ae196f35af16.tar.gz
build-4803ce2696950f8c27c83de4fe46ae196f35af16.tar.bz2
Fix uses of -fPIC and -fPIE.
We've been using -fPIC and -fPIE together in the global cflags all this time. These options are incompatible. The only reason we haven't been hit by this before is because of the forced -Bsymbolic in GCC. To fix this, pass -fpic when compiling objects for shared libraries and -fpie when compiling objects for executables. For static libraries, also use -fpic. We have to do this because static libraries might be included in either a shared library or an executable. Code compiled with -fpie cannot be included in a shared library, but code compiled with -fpic may be included in an executable. We've also been using -fpic and -fPIC together. These are different options, and only the latter will take effect. http://stackoverflow.com/a/967010 The final thing this fixes is that we had -f(PIC|PIE) flags being passed to link commands. These are compile time flags, and don't do anything at link time. Bug: 16823325 Change-Id: Ic76f47e63dc2c81b7e1a8058bae1b3dc8565d606
Diffstat (limited to 'core/combo/TARGET_linux-mips64.mk')
-rw-r--r--core/combo/TARGET_linux-mips64.mk3
1 files changed, 1 insertions, 2 deletions
diff --git a/core/combo/TARGET_linux-mips64.mk b/core/combo/TARGET_linux-mips64.mk
index 463c7a4..d255e10 100644
--- a/core/combo/TARGET_linux-mips64.mk
+++ b/core/combo/TARGET_linux-mips64.mk
@@ -84,7 +84,6 @@ android_config_h := $(call select-android-config-h,linux-mips64)
TARGET_GLOBAL_CFLAGS += \
$(TARGET_mips_CFLAGS) \
-U__unix -U__unix__ -Umips \
- -fpic -fPIE\
-ffunction-sections \
-fdata-sections \
-funwind-tables \
@@ -198,7 +197,7 @@ $(hide) $(PRIVATE_CXX) \
endef
define transform-o-to-executable-inner
-$(hide) $(PRIVATE_CXX) -nostdlib -Bdynamic -fPIE -pie \
+$(hide) $(PRIVATE_CXX) -nostdlib -Bdynamic -pie \
-Wl,-dynamic-linker,/system/bin/linker64 \
-Wl,--gc-sections \
-Wl,-z,nocopyreloc \