[uClibc-cvs] svn commit: trunk/uClibc
vapier at uclibc.org
vapier at uclibc.org
Thu Aug 11 22:52:45 UTC 2005
Author: vapier
Date: 2005-08-11 16:52:44 -0600 (Thu, 11 Aug 2005)
New Revision: 11115
Log:
add back in the LDPIEFLAG since -fPIE does not imply -pie
Modified:
trunk/uClibc/Rules.mak
Changeset:
Modified: trunk/uClibc/Rules.mak
===================================================================
--- trunk/uClibc/Rules.mak 2005-08-11 22:36:11 UTC (rev 11114)
+++ trunk/uClibc/Rules.mak 2005-08-11 22:52:44 UTC (rev 11115)
@@ -222,6 +222,12 @@
ifeq ($(strip $(TARGET_ARCH)),frv)
CPU_LDFLAGS-$(CONFIG_FRV)+=-melf32frvfd
CPU_CFLAGS-$(CONFIG_FRV)+=-mfdpic
+ # Using -pie causes the program to have an interpreter, which is
+ # forbidden, so we must make do with -shared. Unfortunately,
+ # -shared by itself would get us global function descriptors
+ # and calls through PLTs, dynamic resolution of symbols, etc,
+ # which would break as well, but -Bsymbolic comes to the rescue.
+ export LDPIEFLAG:=-shared -Bsymbolic
UCLIBC_LDSO=ld.so.1
endif
@@ -230,9 +236,19 @@
ifneq ($(UCLIBC_BUILD_PIE),y)
export PIEFLAG:=
else
-export PIEFLAG:=$(call check_gcc,$(PIEFLAG_NAME),)
+export PIEFLAG:=$(call check_gcc,$(PIEFLAG_NAME),$(PICFLAG))
endif
endif
+# 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
+# gcc passing -pie if we used -fPIE
+ifndef LDPIEFLAG
+ifneq ($(UCLIBC_BUILD_PIE),y)
+export LDPIEFLAG:=
+else
+export LDPIEFLAG:=$(shell $(LD) --help | grep -q pie && echo "-Wl,-pie")
+endif
+endif
# Use '-Os' optimization if available, else use -O2, allow Config to override
OPTIMIZATION+=$(call check_gcc,-Os,-O2)
More information about the uClibc-cvs
mailing list