This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Use fpie-ccflag variable so that arches can override (andoverride on sparc/sparc64)


I was asked to resend my patch here "for help in
formulating the ChangeLog entry."

2008-07-24  Tom "spot" Callaway <tcallawa@redhat.com>

	* create and use fpie-ccflag so that arches can override   
          -fpie default
	* override -fpie default and use -fPIE on sparc32 and sparc64

Thanks in advance,

~tom

P.S. I'm not subscribed to libc-help, please CC me on replies.
diff -up glibc-20080716T0944/elf/Makefile.BAD glibc-20080716T0944/elf/Makefile
--- glibc-20080716T0944/elf/Makefile.BAD	2008-07-24 12:24:21.000000000 -0400
+++ glibc-20080716T0944/elf/Makefile	2008-07-24 12:24:45.000000000 -0400
@@ -800,7 +800,7 @@ $(objpfx)tst-array5-static.out: $(objpfx
 	cmp $@ tst-array5-static.exp > /dev/null
 
 ifeq (yesyes,$(have-fpie)$(build-shared))
-CFLAGS-tst-pie1.c += -fpie
+CFLAGS-tst-pie1.c += $(pie-ccflag)
 
 $(objpfx)tst-pie1.out: $(objpfx)tst-pie1
 	$(elf-objpfx)$(rtld-installed-name) \
diff -up glibc-20080716T0944/Makeconfig.BAD glibc-20080716T0944/Makeconfig
--- glibc-20080716T0944/Makeconfig.BAD	2008-07-24 12:19:21.000000000 -0400
+++ glibc-20080716T0944/Makeconfig	2008-07-24 12:20:09.000000000 -0400
@@ -712,6 +712,10 @@ pic-ccflag = -fPIC
 # This one should always stay like this unless there is a very good reason.
 PIC-ccflag = -fPIC
 endif
+# This can be changed by a sysdep makefile
+pie-ccflag = -fpie
+# This one should always stay like this unless there is a very good reason.
+PIE-ccflag = -fPIE
 ifeq (yes,$(build-profile))
 # Under --enable-profile, we will build a static library of profiled objects.
 # The profiled object files are named foo.op.
diff -up glibc-20080716T0944/nscd/Makefile.BAD glibc-20080716T0944/nscd/Makefile
--- glibc-20080716T0944/nscd/Makefile.BAD	2008-07-24 12:24:58.000000000 -0400
+++ glibc-20080716T0944/nscd/Makefile	2008-07-24 12:25:15.000000000 -0400
@@ -90,7 +90,7 @@ CFLAGS-nscd_initgroups.c = -fexceptions
 
 nscd-cflags = -DIS_IN_nscd=1 -D_FORTIFY_SOURCE=2
 ifeq (yesyes,$(have-fpie)$(build-shared))
-nscd-cflags += -fpie
+nscd-cflags += $(pie-ccflag)
 endif
 ifeq (yes,$(have-ssp))
 nscd-cflags += -fstack-protector
diff -up glibc-20080716T0944/sysdeps/sparc/sparc32/Makefile.BAD glibc-20080716T0944/sysdeps/sparc/sparc32/Makefile
--- glibc-20080716T0944/sysdeps/sparc/sparc32/Makefile.BAD	2008-07-24 12:22:25.000000000 -0400
+++ glibc-20080716T0944/sysdeps/sparc/sparc32/Makefile	2008-07-24 12:22:35.000000000 -0400
@@ -55,3 +55,5 @@ ifeq ($(with-cvs),yes)
 endif
 
 sysdep-realclean := $(sysdep-realclean) $(divrem:%=sysdeps/sparc/sparc32/%.S)
+
+fpie-ccflag = -fPIE
diff -up glibc-20080716T0944/sysdeps/sparc/sparc64/Makefile.BAD glibc-20080716T0944/sysdeps/sparc/sparc64/Makefile
--- glibc-20080716T0944/sysdeps/sparc/sparc64/Makefile.BAD	2008-07-24 12:21:50.000000000 -0400
+++ glibc-20080716T0944/sysdeps/sparc/sparc64/Makefile	2008-07-24 12:22:04.000000000 -0400
@@ -6,3 +6,5 @@ endif
 ifeq ($(subdir),csu)
 CFLAGS-initfini.s += -mcpu=v9
 endif
+
+fpie-ccflag = -fPIE

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]