aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYing Wang <wangying@google.com>2014-04-04 14:37:33 -0700
committerYing Wang <wangying@google.com>2014-04-04 14:38:14 -0700
commitfaf3d5ed0fe24acef0b14a1297d78058bcedb016 (patch)
tree8cdac53152b3e4284a7c9afdc840ca58b5a371b8
parentb9d6f6f15c7ea54a55f892654a450fff609b1f5f (diff)
downloadbuild-faf3d5ed0fe24acef0b14a1297d78058bcedb016.tar.gz
Disable host -fPIE if BUILD_HOST_static is set.
It turns out -static doesn't work with -fPIE. Bug: 13568878 Change-Id: I66951a5517dece1c5f4f22c329cf703bd99b5163
-rw-r--r--core/definitions.mk7
1 files changed, 6 insertions, 1 deletions
diff --git a/core/definitions.mk b/core/definitions.mk
index 107813ba02..adf8d40df5 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -1395,6 +1395,11 @@ endef
###########################################################
## Commands for running gcc to link a host executable
###########################################################
+ifdef BUILD_HOST_static
+HOST_FPIE_FLAGS :=
+else
+HOST_FPIE_FLAGS := -fPIE -pie
+endif
ifneq ($(HOST_CUSTOM_LD_COMMAND),true)
define transform-host-o-to-executable-inner
@@ -1412,7 +1417,7 @@ $(hide) $(PRIVATE_CXX) \
$(HOST_GLOBAL_LD_DIRS) \
$(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \
$(PRIVATE_HOST_GLOBAL_LDFLAGS) \
- -fPIE -pie \
+ $(HOST_FPIE_FLAGS) \
) \
$(PRIVATE_LDFLAGS) \
-o $@ \