summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordavidcunado-arm <david.cunado@arm.com>2017-12-19 20:41:53 +0000
committerGitHub <noreply@github.com>2017-12-19 20:41:53 +0000
commit9f36f4c4e76f1a94edc96c60ad26e2ed640b575c (patch)
tree580c70947039961892736b308cb09aa106448fb9
parentdced20e17bd1d52e4833df34c4eb6da6a7a84ce5 (diff)
parentf7ec31db2db3c69a7bd970f4e7fd829e7cc0c53a (diff)
Merge pull request #1195 from davidcunado-arm/dc/fix_pie
Disable PIE compilation option
-rw-r--r--Makefile7
1 files changed, 7 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 51e622ef..1058b396 100644
--- a/Makefile
+++ b/Makefile
@@ -160,6 +160,13 @@ TF_CFLAGS += $(CPPFLAGS) $(TF_CFLAGS_$(ARCH)) \
-ffreestanding -fno-builtin -Wall -std=gnu99 \
-Os -ffunction-sections -fdata-sections
+GCC_V_OUTPUT := $(shell $(CC) -v 2>&1)
+PIE_FOUND := $(findstring --enable-default-pie,${GCC_V_OUTPUT})
+
+ifeq ($(PIE_FOUND),1)
+TF_CFLAGS += -fno-PIE
+endif
+
TF_LDFLAGS += --fatal-warnings -O1
TF_LDFLAGS += --gc-sections
TF_LDFLAGS += $(TF_LDFLAGS_$(ARCH))