Message ID | 1291642606-4290-1-git-send-email-Joakim.Tjernlund@transmode.se |
---|---|
State | Accepted, archived |
Headers | show |
Dear Joakim Tjernlund, In message <1291642606-4290-1-git-send-email-Joakim.Tjernlund@transmode.se> you wrote: > 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: Joakim Tjernlund <Joakim.Tjernlund@transmode.se> Applied, thanks. Best regards, Wolfgang Denk
Dear Joakim Tjernlund, In message <1291642606-4290-1-git-send-email-Joakim.Tjernlund@transmode.se> you wrote: > 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: Unfortunately this patch breaks a number of boards: Bisecting: 0 revisions left to test after this (roughly 0 steps) [33ee4c92339ee386662c0ee2d221098c5cc8b07e] PowerPC: Move -fPIC flag to common place They fail to build like this: ... Configuring for TQM855L board... /work/tmp-8xx/u-boot.lds:74 cannot move location counter backwards (from 4000800c to 40008000) make: *** [/work/tmp-8xx/u-boot] Error 1 ppc_6xx-size: '/work/tmp-8xx/u-boot': No such file ... Configuring for TQM860L board... /work/tmp-8xx/u-boot.lds:74 cannot move location counter backwards (from 4000802c to 40008000) make: *** [/work/tmp-8xx/u-boot] Error 1 ppc_6xx-size: '/work/tmp-8xx/u-boot': No such file It seems this change increases the code size somehow - which I would not expect from your comment above. Please have a look. Thanks. Best regards, Wolfgang Denk
> > Dear Joakim Tjernlund, > > In message <1291642606-4290-1-git-send-email-Joakim.Tjernlund@transmode.se> you wrote: > > 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: > > Unfortunately this patch breaks a number of boards: > > Bisecting: 0 revisions left to test after this (roughly 0 steps) > [33ee4c92339ee386662c0ee2d221098c5cc8b07e] PowerPC: Move -fPIC flag to > common place > > > They fail to build like this: > > ... > Configuring for TQM855L board... > /work/tmp-8xx/u-boot.lds:74 cannot move location counter backwards (from 4000800c to 40008000) > make: *** [/work/tmp-8xx/u-boot] Error 1 > ppc_6xx-size: '/work/tmp-8xx/u-boot': No such file > ... > Configuring for TQM860L board... > /work/tmp-8xx/u-boot.lds:74 cannot move location counter backwards (from 4000802c to 40008000) > make: *** [/work/tmp-8xx/u-boot] Error 1 > ppc_6xx-size: '/work/tmp-8xx/u-boot': No such file > > It seems this change increases the code size somehow - which I would > not expect from your comment above. Please have a look. Very strange, I had a quick look(that is all I can do ATM). It appers that 8xx is the only ppc arch which doesn't have its own u-boot.lds under arch/powerpc/cpu/mpc8xx, is that intentional? Is it only 8xx that has this problem? My guess would be that 8xx missed out on an earlier patch http://git.denx.de/?p=u-boot.git;a=commitdiff;h=337f5f50f539cc1ea1e0533c096e237228f12cae Jocke
Dear Joakim Tjernlund, In message <OF484EFF4D.45D9734B-ONC1257870.002E25B2-C1257870.002F0BE0@transmode.se> you wrote: > > > It seems this change increases the code size somehow - which I would > > not expect from your comment above. Please have a look. > > Very strange, I had a quick look(that is all I can do ATM). It appers > that 8xx is the only ppc arch which doesn't have its own u-boot.lds under > arch/powerpc/cpu/mpc8xx, is that intentional? Is it only 8xx that has this > problem? I did not look closer, but it appears that these boards are all boards that use an embedded environment, and thus their own, usually manually tuned linker script. > My guess would be that 8xx missed out on an earlier patch > http://git.denx.de/?p=u-boot.git;a=commitdiff;h=337f5f50f539cc1ea1e0533c096e237228f12cae Or, more correctly, that this patch failed to patch these boards. Can you please provide a fix? I'd like to get rid of this build error ASAP. We could, of course, simply revert these commits. Best regards, Wolfgang Denk
Wolfgang Denk <wd@denx.de> wrote on 2011/04/19 22:25:25: > > Dear Joakim Tjernlund, > > In message <OF484EFF4D.45D9734B-ONC1257870.002E25B2-C1257870.002F0BE0@transmode.se> you wrote: > > > > > It seems this change increases the code size somehow - which I would > > > not expect from your comment above. Please have a look. > > > > Very strange, I had a quick look(that is all I can do ATM). It appers > > that 8xx is the only ppc arch which doesn't have its own u-boot.lds under > > arch/powerpc/cpu/mpc8xx, is that intentional? Is it only 8xx that has this > > problem? > > I did not look closer, but it appears that these boards are all boards > that use an embedded environment, and thus their own, usually manually > tuned linker script. > > > My guess would be that 8xx missed out on an earlier patch > > http://git.denx.de/?p=u-boot.git;a=commitdiff;h=337f5f50f539cc1ea1e0533c096e237228f12cae > > Or, more correctly, that this patch failed to patch these boards. > > Can you please provide a fix? I'd like to get rid of this build error > ASAP. We could, of course, simply revert these commits. Grepping shows a boat load of u-boot.lds files under board. I don't have time to patch them all ATM. They really needs to be consolidated somehow but that is over my head. Jocke
Dear Joakim Tjernlund, In message <OFC3D6185B.85DCE339-ONC1257877.007406B0-C1257877.00746A1D@transmode.se> you wrote: > > > Can you please provide a fix? I'd like to get rid of this build error > > ASAP. We could, of course, simply revert these commits. > > Grepping shows a boat load of u-boot.lds files under board. I don't > have time to patch them all ATM. They really needs to be consolidated > somehow but that is over my head. That means I will revert the two commits? Best regards, Wolfgang Denk
Wolfgang Denk <wd@denx.de> wrote on 2011/04/19 23:35:40: > > Dear Joakim Tjernlund, > > In message <OFC3D6185B.85DCE339-ONC1257877.007406B0-C1257877.00746A1D@transmode.se> you wrote: > > > > > Can you please provide a fix? I'd like to get rid of this build error > > > ASAP. We could, of course, simply revert these commits. > > > > Grepping shows a boat load of u-boot.lds files under board. I don't > > have time to patch them all ATM. They really needs to be consolidated > > somehow but that is over my head. > > That means I will revert the two commits? One, you only claimed that: > 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: Broke all those 8xx boards. Jocke
Dear Joakim Tjernlund, In message <OFC5A52DF3.355573B0-ONC1257877.0078430F-C1257877.0078910D@transmode.se> you wrote: > > > That means I will revert the two commits? > > One, you only claimed that: > > 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: > Broke all those 8xx boards. Yes, but you yorself pointed out that commit 337f5f5 missed a large number of boards, leaving the tree in a inconsistent state. Should we not revert that one as well? Best regards, Wolfgang Denk
Wolfgang Denk <wd@denx.de> wrote on 2011/04/20 00:05:27: > From: Wolfgang Denk <wd@denx.de> > To: Joakim Tjernlund <joakim.tjernlund@transmode.se> > Cc: u-boot@lists.denx.de > Date: 2011/04/20 00:05 > Subject: Re: [U-Boot] [PATCH] PowerPC: Move -fPIC flag to common place > > Dear Joakim Tjernlund, > > In message <OFC5A52DF3.355573B0-ONC1257877.0078430F-C1257877.0078910D@transmode.se> you wrote: > > > > > That means I will revert the two commits? > > > > One, you only claimed that: > > > 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: > > Broke all those 8xx boards. > > Yes, but you yorself pointed out that commit 337f5f5 missed a large > number of boards, leaving the tree in a inconsistent state. Should we > not revert that one as well? It is not too bad, just not complete yet. Reverting all just makes it harder to get it all done. I still don't get why it broke really. hmm, did you by any chance include my patches to gcc too? if so I you should only have to fixup arch/powerpc/config.mk: - PLATFORM_RELFLAGS += -fpic -mrelocatable -ffunction-sections -fdata-sections - PLATFORM_RELFLAGS += $(call cc-option,-msingle-pic-base,) + PLATFORM_RELFLAGS += -fPIC -mrelocatable -ffunction-sections -fdata-sections
Dear Joakim Tjernlund, In message <OFBC9C03BC.436C27C7-ONC1257877.00797190-C1257877.007A0FD7@transmode.se> you wrote: > > > Yes, but you yorself pointed out that commit 337f5f5 missed a large > > number of boards, leaving the tree in a inconsistent state. Should we > > not revert that one as well? > > It is not too bad, just not complete yet. Reverting all just makes > it harder to get it all done. > I still don't get why it broke really. > hmm, did you by any chance include my patches to gcc too? > if so I you should only have to fixup arch/powerpc/config.mk: > - PLATFORM_RELFLAGS += -fpic -mrelocatable -ffunction-sections -fdata-sections > - PLATFORM_RELFLAGS += $(call cc-option,-msingle-pic-base,) > + PLATFORM_RELFLAGS += -fPIC -mrelocatable -ffunction-sections -fdata-sections Can you please have a look at this yourslef? You understand much better than me which of your patches are doing what, and how they might interact. I don't have the time to dig into this any deeper. If we cannot find a quick solution, I suggest to back out all this stuff and redo once the problems have been sorted out. Sorry for applying the stuff to mainline without more thorough testing, I should have noticed these issues earlier and never checked in all that stuff. Best regards, Wolfgang Denk
Wolfgang Denk <wd@denx.de> wrote on 2011/04/20 00:41:01: > > Dear Joakim Tjernlund, > > In message <OFBC9C03BC.436C27C7-ONC1257877.00797190-C1257877.007A0FD7@transmode.se> you wrote: > > > > > Yes, but you yorself pointed out that commit 337f5f5 missed a large > > > number of boards, leaving the tree in a inconsistent state. Should we > > > not revert that one as well? > > > > It is not too bad, just not complete yet. Reverting all just makes > > it harder to get it all done. > > I still don't get why it broke really. > > hmm, did you by any chance include my patches to gcc too? > > if so I you should only have to fixup arch/powerpc/config.mk: > > - PLATFORM_RELFLAGS += -fpic -mrelocatable -ffunction-sections -fdata-sections > > - PLATFORM_RELFLAGS += $(call cc-option,-msingle-pic-base,) > > + PLATFORM_RELFLAGS += -fPIC -mrelocatable -ffunction-sections -fdata-sections > > Can you please have a look at this yourslef? You understand much > better than me which of your patches are doing what, and how they > might interact. Tell me this first: "hmm, did you by any chance include my patches to gcc too?" and I might have a fix for you. tmw, need to sleep now > > I don't have the time to dig into this any deeper. If we cannot find > a quick solution, I suggest to back out all this stuff and redo once > the problems have been sorted out. Sorry for applying the stuff to > mainline without more thorough testing, I should have noticed these > issues earlier and never checked in all that stuff. > > Best regards, > > Wolfgang Denk > > -- > DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel > HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany > Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de > Another megabytes the dust.
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: Joakim Tjernlund <Joakim.Tjernlund@transmode.se> --- arch/powerpc/config.mk | 2 +- arch/powerpc/cpu/74xx_7xx/config.mk | 2 +- arch/powerpc/cpu/mpc512x/config.mk | 2 +- arch/powerpc/cpu/mpc5xx/config.mk | 2 +- arch/powerpc/cpu/mpc5xxx/config.mk | 2 +- arch/powerpc/cpu/mpc8220/config.mk | 2 +- arch/powerpc/cpu/mpc824x/config.mk | 2 +- arch/powerpc/cpu/mpc8260/config.mk | 2 +- arch/powerpc/cpu/mpc83xx/config.mk | 2 +- arch/powerpc/cpu/mpc85xx/config.mk | 2 +- arch/powerpc/cpu/mpc86xx/config.mk | 2 +- arch/powerpc/cpu/mpc8xx/config.mk | 2 +- arch/powerpc/cpu/ppc4xx/config.mk | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/arch/powerpc/config.mk b/arch/powerpc/config.mk index 2912604..b04e968 100644 --- a/arch/powerpc/config.mk +++ b/arch/powerpc/config.mk @@ -25,7 +25,7 @@ CROSS_COMPILE ?= ppc_8xx- STANDALONE_LOAD_ADDR = 0x40000 -PLATFORM_RELFLAGS += -mrelocatable -ffunction-sections -fdata-sections +PLATFORM_RELFLAGS += -fpic -mrelocatable -ffunction-sections -fdata-sections PLATFORM_CPPFLAGS += -DCONFIG_PPC -D__powerpc__ PLATFORM_LDFLAGS += -n --gc-sections diff --git a/arch/powerpc/cpu/74xx_7xx/config.mk b/arch/powerpc/cpu/74xx_7xx/config.mk index df1f6ac..fb0c715 100644 --- a/arch/powerpc/cpu/74xx_7xx/config.mk +++ b/arch/powerpc/cpu/74xx_7xx/config.mk @@ -21,6 +21,6 @@ # MA 02111-1307 USA # -PLATFORM_RELFLAGS += -fPIC -meabi +PLATFORM_RELFLAGS += -meabi PLATFORM_CPPFLAGS += -DCONFIG_74xx_7xx -ffixed-r2 -mstring diff --git a/arch/powerpc/cpu/mpc512x/config.mk b/arch/powerpc/cpu/mpc512x/config.mk index baf55cc..8fceded 100644 --- a/arch/powerpc/cpu/mpc512x/config.mk +++ b/arch/powerpc/cpu/mpc512x/config.mk @@ -20,7 +20,7 @@ # MA 02111-1307 USA # -PLATFORM_RELFLAGS += -fPIC -meabi +PLATFORM_RELFLAGS += -meabi PLATFORM_CPPFLAGS += -DCONFIG_MPC512X -DCONFIG_E300 \ -ffixed-r2 -msoft-float -mcpu=603e diff --git a/arch/powerpc/cpu/mpc5xx/config.mk b/arch/powerpc/cpu/mpc5xx/config.mk index 1c7df00..ab55040 100644 --- a/arch/powerpc/cpu/mpc5xx/config.mk +++ b/arch/powerpc/cpu/mpc5xx/config.mk @@ -21,6 +21,6 @@ # MA 02111-1307 USA # -PLATFORM_RELFLAGS += -fPIC -meabi +PLATFORM_RELFLAGS += -meabi PLATFORM_CPPFLAGS += -DCONFIG_5xx -ffixed-r2 -mpowerpc -msoft-float diff --git a/arch/powerpc/cpu/mpc5xxx/config.mk b/arch/powerpc/cpu/mpc5xxx/config.mk index 832909f..fb87980 100644 --- a/arch/powerpc/cpu/mpc5xxx/config.mk +++ b/arch/powerpc/cpu/mpc5xxx/config.mk @@ -21,7 +21,7 @@ # MA 02111-1307 USA # -PLATFORM_RELFLAGS += -fPIC -meabi +PLATFORM_RELFLAGS += -meabi PLATFORM_CPPFLAGS += -DCONFIG_MPC5xxx -ffixed-r2 \ -mstring -mcpu=603e -mmultiple diff --git a/arch/powerpc/cpu/mpc8220/config.mk b/arch/powerpc/cpu/mpc8220/config.mk index 9142b91..2c638b5 100644 --- a/arch/powerpc/cpu/mpc8220/config.mk +++ b/arch/powerpc/cpu/mpc8220/config.mk @@ -21,7 +21,7 @@ # MA 02111-1307 USA # -PLATFORM_RELFLAGS += -fPIC -meabi +PLATFORM_RELFLAGS += -meabi PLATFORM_CPPFLAGS += -DCONFIG_MPC8220 -ffixed-r2 \ -mstring -mcpu=603e -mmultiple diff --git a/arch/powerpc/cpu/mpc824x/config.mk b/arch/powerpc/cpu/mpc824x/config.mk index 65a1771..82b8cc6 100644 --- a/arch/powerpc/cpu/mpc824x/config.mk +++ b/arch/powerpc/cpu/mpc824x/config.mk @@ -21,6 +21,6 @@ # MA 02111-1307 USA # -PLATFORM_RELFLAGS += -fPIC -meabi +PLATFORM_RELFLAGS += -meabi PLATFORM_CPPFLAGS += -DCONFIG_MPC824X -ffixed-r2 -mstring -mcpu=603e -msoft-float diff --git a/arch/powerpc/cpu/mpc8260/config.mk b/arch/powerpc/cpu/mpc8260/config.mk index 5e4645a..f091fa9 100644 --- a/arch/powerpc/cpu/mpc8260/config.mk +++ b/arch/powerpc/cpu/mpc8260/config.mk @@ -21,7 +21,7 @@ # MA 02111-1307 USA # -PLATFORM_RELFLAGS += -fPIC -meabi +PLATFORM_RELFLAGS += -meabi PLATFORM_CPPFLAGS += -DCONFIG_8260 -DCONFIG_CPM2 -ffixed-r2 \ -mstring -mcpu=603e -mmultiple diff --git a/arch/powerpc/cpu/mpc83xx/config.mk b/arch/powerpc/cpu/mpc83xx/config.mk index 0dced88..a79729e 100644 --- a/arch/powerpc/cpu/mpc83xx/config.mk +++ b/arch/powerpc/cpu/mpc83xx/config.mk @@ -20,7 +20,7 @@ # MA 02111-1307 USA # -PLATFORM_RELFLAGS += -fPIC -meabi +PLATFORM_RELFLAGS += -meabi PLATFORM_CPPFLAGS += -DCONFIG_MPC83xx -DCONFIG_E300 \ -ffixed-r2 -msoft-float diff --git a/arch/powerpc/cpu/mpc85xx/config.mk b/arch/powerpc/cpu/mpc85xx/config.mk index 66d1741..68ac57d 100644 --- a/arch/powerpc/cpu/mpc85xx/config.mk +++ b/arch/powerpc/cpu/mpc85xx/config.mk @@ -21,7 +21,7 @@ # MA 02111-1307 USA # -PLATFORM_RELFLAGS += -fPIC -meabi +PLATFORM_RELFLAGS += -meabi PLATFORM_CPPFLAGS += -ffixed-r2 -Wa,-me500 -msoft-float -mno-string diff --git a/arch/powerpc/cpu/mpc86xx/config.mk b/arch/powerpc/cpu/mpc86xx/config.mk index ca2f837..92ff7bf 100644 --- a/arch/powerpc/cpu/mpc86xx/config.mk +++ b/arch/powerpc/cpu/mpc86xx/config.mk @@ -21,7 +21,7 @@ # MA 02111-1307 USA # -PLATFORM_RELFLAGS += -fPIC -meabi +PLATFORM_RELFLAGS += -meabi PLATFORM_CPPFLAGS += -ffixed-r2 -mstring PLATFORM_CPPFLAGS += -maltivec -mabi=altivec -msoft-float diff --git a/arch/powerpc/cpu/mpc8xx/config.mk b/arch/powerpc/cpu/mpc8xx/config.mk index f5e08a5..aa61980 100644 --- a/arch/powerpc/cpu/mpc8xx/config.mk +++ b/arch/powerpc/cpu/mpc8xx/config.mk @@ -21,6 +21,6 @@ # MA 02111-1307 USA # -PLATFORM_RELFLAGS += -fPIC -meabi +PLATFORM_RELFLAGS += -meabi PLATFORM_CPPFLAGS += -DCONFIG_8xx -ffixed-r2 -mstring -mcpu=860 -msoft-float diff --git a/arch/powerpc/cpu/ppc4xx/config.mk b/arch/powerpc/cpu/ppc4xx/config.mk index d862bb4..f5cbbbd 100644 --- a/arch/powerpc/cpu/ppc4xx/config.mk +++ b/arch/powerpc/cpu/ppc4xx/config.mk @@ -21,7 +21,7 @@ # MA 02111-1307 USA # -PLATFORM_RELFLAGS += -fPIC -meabi +PLATFORM_RELFLAGS += -meabi PLATFORM_CPPFLAGS += -DCONFIG_4xx -ffixed-r2 -mstring -msoft-float cfg=$(shell grep configs $(OBJTREE)/include/config.h | sed 's/.*<\(configs.*\)>/\1/')