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 <pavel.v.chupin@intel.com>
diff --git a/core/combo/TARGET_linux-x86.mk b/core/combo/TARGET_linux-x86.mk
index bc13fb9..960c58a 100644
--- a/core/combo/TARGET_linux-x86.mk
+++ b/core/combo/TARGET_linux-x86.mk
@@ -112,7 +112,7 @@
-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 e24f548..2c2fa6b 100644
--- a/core/combo/TARGET_linux-x86_64.mk
+++ b/core/combo/TARGET_linux-x86_64.mk
@@ -112,7 +112,7 @@
-Werror=format-security \
-D_FORTIFY_SOURCE=2 \
-Wstrict-aliasing=2 \
- -fPIC -fPIE \
+ -fPIC \
-ffunction-sections \
-finline-functions \
-finline-limit=300 \