فهرست منبع

- make sure to pass the correct PIE flags to gcc (Peter S. Mazinger)

Bernhard Reutner-Fischer 16 سال پیش
والد
کامیت
9324e66665
1فایلهای تغییر یافته به همراه3 افزوده شده و 2 حذف شده
  1. 3 2
      Rules.mak

+ 3 - 2
Rules.mak

@@ -427,9 +427,10 @@ export PIEFLAG:=$(call check_gcc,$(PIEFLAG_NAME),$(PICFLAG))
 endif
 endif
 # We need to keep track of both the CC PIE flag (above) as
 # We need to keep track of both the CC PIE flag (above) as
 # well as the LD PIE flag (below) because we can't rely on
 # well as the LD PIE flag (below) because we can't rely on
-# gcc passing -pie if we used -fPIE
+# gcc passing -pie if we used -fPIE. We need to directly use -pie
+# instead of -Wl,-pie as gcc picks up the wrong startfile/endfile
 ifndef LDPIEFLAG
 ifndef LDPIEFLAG
-export LDPIEFLAG:=$(shell $(LD) --help 2>/dev/null | grep -q -- -pie && echo "-Wl,-pie")
+export LDPIEFLAG:=$(shell $(LD) --help 2>/dev/null | grep -q -- -pie && echo "-pie")
 endif
 endif
 
 
 # Check for AS_NEEDED support in linker script (binutils>=2.16.1 has it)
 # Check for AS_NEEDED support in linker script (binutils>=2.16.1 has it)