From 3a8d2bf39213c5b88c3d4889e33e0ed6d3ce99e3 Mon Sep 17 00:00:00 2001 From: Pavel Chupin Date: Wed, 2 Jul 2014 13:52:21 +0400 Subject: [PATCH] Fix PIC default to be -fPIC -fPIC is more restrictive than -fPIE, but when "-fPIC -fPIE" used together the latter overrides. It may lead to issues when building DSO where -fPIC and not -fPIE is required. For executables -fPIE -pie shoudld be added and it's fine to override -fPIC as it is done now. The reason why we don't have these issues so far is probably related to -Bsymbolic added by default. But any attempt to remove it reveals these problems: https://android-review.googlesource.com/#/c/98061/ Change-Id: If0f10628b7cc41e564221a7a37298f7d65f859a8 Signed-off-by: Pavel Chupin --- core/combo/TARGET_linux-x86.mk | 2 +- core/combo/TARGET_linux-x86_64.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/combo/TARGET_linux-x86.mk b/core/combo/TARGET_linux-x86.mk index bc13fb99e..960c58a2e 100644 --- a/core/combo/TARGET_linux-x86.mk +++ b/core/combo/TARGET_linux-x86.mk @@ -112,7 +112,7 @@ $(combo_2nd_arch_prefix)TARGET_GLOBAL_CFLAGS += \ -Werror=format-security \ -D_FORTIFY_SOURCE=2 \ -Wstrict-aliasing=2 \ - -fPIC -fPIE \ + -fPIC \ -ffunction-sections \ -finline-functions \ -finline-limit=300 \ diff --git a/core/combo/TARGET_linux-x86_64.mk b/core/combo/TARGET_linux-x86_64.mk index e24f548cb..2c2fa6b7f 100644 --- a/core/combo/TARGET_linux-x86_64.mk +++ b/core/combo/TARGET_linux-x86_64.mk @@ -112,7 +112,7 @@ TARGET_GLOBAL_CFLAGS += \ -Werror=format-security \ -D_FORTIFY_SOURCE=2 \ -Wstrict-aliasing=2 \ - -fPIC -fPIE \ + -fPIC \ -ffunction-sections \ -finline-functions \ -finline-limit=300 \