Skip to content
Snippets Groups Projects
Commit 33ee4c92 authored by Joakim Tjernlund's avatar Joakim Tjernlund Committed by Wolfgang Denk
Browse files

PowerPC: Move -fPIC flag to common place


The -fPIC flag belongs with -mrelocatable, move it there.
Also change -fPIC to -fpic as this produces smaller
binaries.
However, currently -mrelocatable promotes -fpic to -fPIC, a
fix for this is in upcoming gcc 4.6 or you can apply this small
patch to gcc:

diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
index 8da8410..e4b8280 100644
--- a/gcc/config/rs6000/sysv4.h
+++ b/gcc/config/rs6000/sysv4.h
@@ -227,7 +227,8 @@ do {									\
     }									\
 									\
   else if (TARGET_RELOCATABLE)						\
-    flag_pic = 2;							\
+    if (!flag_pic)							\
+      flag_pic = 2;							\
 } while (0)

 #ifndef RS6000_BI_ARCH
--

Signed-off-by: default avatarJoakim Tjernlund <Joakim.Tjernlund@transmode.se>
parent 7d2fade7
No related branches found
No related tags found
No related merge requests found
...@@ -25,7 +25,7 @@ CROSS_COMPILE ?= ppc_8xx- ...@@ -25,7 +25,7 @@ CROSS_COMPILE ?= ppc_8xx-
STANDALONE_LOAD_ADDR = 0x40000 STANDALONE_LOAD_ADDR = 0x40000
LDFLAGS_FINAL += --gc-sections LDFLAGS_FINAL += --gc-sections
PLATFORM_RELFLAGS += -mrelocatable -ffunction-sections -fdata-sections PLATFORM_RELFLAGS += -fpic -mrelocatable -ffunction-sections -fdata-sections
PLATFORM_CPPFLAGS += -DCONFIG_PPC -D__powerpc__ PLATFORM_CPPFLAGS += -DCONFIG_PPC -D__powerpc__
PLATFORM_LDFLAGS += -n PLATFORM_LDFLAGS += -n
......
...@@ -21,6 +21,6 @@ ...@@ -21,6 +21,6 @@
# MA 02111-1307 USA # MA 02111-1307 USA
# #
PLATFORM_RELFLAGS += -fPIC -meabi PLATFORM_RELFLAGS += -meabi
PLATFORM_CPPFLAGS += -DCONFIG_74xx_7xx -ffixed-r2 -mstring PLATFORM_CPPFLAGS += -DCONFIG_74xx_7xx -ffixed-r2 -mstring
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
# MA 02111-1307 USA # MA 02111-1307 USA
# #
PLATFORM_RELFLAGS += -fPIC -meabi PLATFORM_RELFLAGS += -meabi
PLATFORM_CPPFLAGS += -DCONFIG_MPC512X -DCONFIG_E300 \ PLATFORM_CPPFLAGS += -DCONFIG_MPC512X -DCONFIG_E300 \
-ffixed-r2 -msoft-float -mcpu=603e -ffixed-r2 -msoft-float -mcpu=603e
...@@ -21,6 +21,6 @@ ...@@ -21,6 +21,6 @@
# MA 02111-1307 USA # MA 02111-1307 USA
# #
PLATFORM_RELFLAGS += -fPIC -meabi PLATFORM_RELFLAGS += -meabi
PLATFORM_CPPFLAGS += -DCONFIG_5xx -ffixed-r2 -mpowerpc -msoft-float PLATFORM_CPPFLAGS += -DCONFIG_5xx -ffixed-r2 -mpowerpc -msoft-float
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
# MA 02111-1307 USA # MA 02111-1307 USA
# #
PLATFORM_RELFLAGS += -fPIC -meabi PLATFORM_RELFLAGS += -meabi
PLATFORM_CPPFLAGS += -DCONFIG_MPC5xxx -ffixed-r2 \ PLATFORM_CPPFLAGS += -DCONFIG_MPC5xxx -ffixed-r2 \
-mstring -mcpu=603e -mmultiple -mstring -mcpu=603e -mmultiple
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
# MA 02111-1307 USA # MA 02111-1307 USA
# #
PLATFORM_RELFLAGS += -fPIC -meabi PLATFORM_RELFLAGS += -meabi
PLATFORM_CPPFLAGS += -DCONFIG_MPC8220 -ffixed-r2 \ PLATFORM_CPPFLAGS += -DCONFIG_MPC8220 -ffixed-r2 \
-mstring -mcpu=603e -mmultiple -mstring -mcpu=603e -mmultiple
...@@ -21,6 +21,6 @@ ...@@ -21,6 +21,6 @@
# MA 02111-1307 USA # MA 02111-1307 USA
# #
PLATFORM_RELFLAGS += -fPIC -meabi PLATFORM_RELFLAGS += -meabi
PLATFORM_CPPFLAGS += -DCONFIG_MPC824X -ffixed-r2 -mstring -mcpu=603e -msoft-float PLATFORM_CPPFLAGS += -DCONFIG_MPC824X -ffixed-r2 -mstring -mcpu=603e -msoft-float
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
# MA 02111-1307 USA # MA 02111-1307 USA
# #
PLATFORM_RELFLAGS += -fPIC -meabi PLATFORM_RELFLAGS += -meabi
PLATFORM_CPPFLAGS += -DCONFIG_8260 -DCONFIG_CPM2 -ffixed-r2 \ PLATFORM_CPPFLAGS += -DCONFIG_8260 -DCONFIG_CPM2 -ffixed-r2 \
-mstring -mcpu=603e -mmultiple -mstring -mcpu=603e -mmultiple
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
# MA 02111-1307 USA # MA 02111-1307 USA
# #
PLATFORM_RELFLAGS += -fPIC -meabi PLATFORM_RELFLAGS += -meabi
PLATFORM_CPPFLAGS += -DCONFIG_MPC83xx -DCONFIG_E300 \ PLATFORM_CPPFLAGS += -DCONFIG_MPC83xx -DCONFIG_E300 \
-ffixed-r2 -msoft-float -ffixed-r2 -msoft-float
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
# MA 02111-1307 USA # MA 02111-1307 USA
# #
PLATFORM_RELFLAGS += -fPIC -meabi PLATFORM_RELFLAGS += -meabi
PLATFORM_CPPFLAGS += -ffixed-r2 -Wa,-me500 -msoft-float -mno-string PLATFORM_CPPFLAGS += -ffixed-r2 -Wa,-me500 -msoft-float -mno-string
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
# MA 02111-1307 USA # MA 02111-1307 USA
# #
PLATFORM_RELFLAGS += -fPIC -meabi PLATFORM_RELFLAGS += -meabi
PLATFORM_CPPFLAGS += -ffixed-r2 -mstring PLATFORM_CPPFLAGS += -ffixed-r2 -mstring
PLATFORM_CPPFLAGS += -maltivec -mabi=altivec -msoft-float PLATFORM_CPPFLAGS += -maltivec -mabi=altivec -msoft-float
...@@ -21,6 +21,6 @@ ...@@ -21,6 +21,6 @@
# MA 02111-1307 USA # MA 02111-1307 USA
# #
PLATFORM_RELFLAGS += -fPIC -meabi PLATFORM_RELFLAGS += -meabi
PLATFORM_CPPFLAGS += -DCONFIG_8xx -ffixed-r2 -mstring -mcpu=860 -msoft-float PLATFORM_CPPFLAGS += -DCONFIG_8xx -ffixed-r2 -mstring -mcpu=860 -msoft-float
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
# MA 02111-1307 USA # MA 02111-1307 USA
# #
PLATFORM_RELFLAGS += -fPIC -meabi PLATFORM_RELFLAGS += -meabi
PLATFORM_CPPFLAGS += -DCONFIG_4xx -ffixed-r2 -mstring -msoft-float PLATFORM_CPPFLAGS += -DCONFIG_4xx -ffixed-r2 -mstring -msoft-float
cfg=$(shell grep configs $(OBJTREE)/include/config.h | sed 's/.*<\(configs.*\)>/\1/') cfg=$(shell grep configs $(OBJTREE)/include/config.h | sed 's/.*<\(configs.*\)>/\1/')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment