All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] Add gc-section support for ARM
@ 2012-05-03  1:37 Charles Manning
  2012-05-14  5:15 ` Mike Frysinger
  0 siblings, 1 reply; 10+ messages in thread
From: Charles Manning @ 2012-05-03  1:37 UTC (permalink / raw)
  To: u-boot

Seems odd that this hasn't been done yet.
Shaves 5k off an omap overo build.

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
---
 arch/arm/config.mk |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/arm/config.mk b/arch/arm/config.mk
index 45f9dca..73e0cce 100644
--- a/arch/arm/config.mk
+++ b/arch/arm/config.mk
@@ -55,6 +55,10 @@ PF_CPPFLAGS_ABI := $(call cc-option,\
 		)
 PLATFORM_CPPFLAGS += $(PF_CPPFLAGS_ARM) $(PF_CPPFLAGS_ABI)
 
+PLATFORM_RELFLAGS += -ffunction-sections
+
+LDFLAGS_FINAL += --gc-sections
+
 # For EABI, make sure to provide raise()
 ifneq (,$(findstring -mabi=aapcs-linux,$(PLATFORM_CPPFLAGS)))
 # This file is parsed many times, so the string may get added multiple
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [U-Boot] [PATCH] Add gc-section support for ARM
  2012-05-03  1:37 [U-Boot] [PATCH] Add gc-section support for ARM Charles Manning
@ 2012-05-14  5:15 ` Mike Frysinger
  2012-05-14 21:01   ` Charles Manning
  0 siblings, 1 reply; 10+ messages in thread
From: Mike Frysinger @ 2012-05-14  5:15 UTC (permalink / raw)
  To: u-boot

On Wednesday 02 May 2012 21:37:51 Charles Manning wrote:
> Seems odd that this hasn't been done yet.
> Shaves 5k off an omap overo build.

my understanding is that it doesn't work for some

> +PLATFORM_RELFLAGS += -ffunction-sections

where's the -fdata-sections ?
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120514/98198026/attachment.pgp>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [U-Boot] [PATCH] Add gc-section support for ARM
  2012-05-14  5:15 ` Mike Frysinger
@ 2012-05-14 21:01   ` Charles Manning
  2012-05-15  5:12     ` Mike Frysinger
  2012-05-29 21:03     ` Wolfgang Denk
  0 siblings, 2 replies; 10+ messages in thread
From: Charles Manning @ 2012-05-14 21:01 UTC (permalink / raw)
  To: u-boot

On Monday 14 May 2012 17:15:50 Mike Frysinger wrote:
> On Wednesday 02 May 2012 21:37:51 Charles Manning wrote:
> > Seems odd that this hasn't been done yet.
> > Shaves 5k off an omap overo build.
>
> my understanding is that it doesn't work for some

It won't work for people that don't set up their lds properly.

>
> > +PLATFORM_RELFLAGS += -ffunction-sections
>
> where's the -fdata-sections ?

I tried that once before and could not get that to work with u-boot. I figure 
doing just the function sections is better than nothing.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [U-Boot] [PATCH] Add gc-section support for ARM
  2012-05-14 21:01   ` Charles Manning
@ 2012-05-15  5:12     ` Mike Frysinger
  2012-05-15  7:01       ` Albert ARIBAUD
  2012-05-15 22:07       ` Charles Manning
  2012-05-29 21:03     ` Wolfgang Denk
  1 sibling, 2 replies; 10+ messages in thread
From: Mike Frysinger @ 2012-05-15  5:12 UTC (permalink / raw)
  To: u-boot

On Monday 14 May 2012 17:01:30 Charles Manning wrote:
> On Monday 14 May 2012 17:15:50 Mike Frysinger wrote:
> > On Wednesday 02 May 2012 21:37:51 Charles Manning wrote:
> > > Seems odd that this hasn't been done yet.
> > > Shaves 5k off an omap overo build.
> > 
> > my understanding is that it doesn't work for some
> 
> It won't work for people that don't set up their lds properly.

current u-boot policy is to not introduce changes that knowingly break other 
platforms.  so if you want to update the common arm config.mk, you need to at 
least compile test all arm boards.

> > > +PLATFORM_RELFLAGS += -ffunction-sections
> > 
> > where's the -fdata-sections ?
> 
> I tried that once before and could not get that to work with u-boot. I
> figure doing just the function sections is better than nothing.

so even your lds isn't setup properly ? :P

other arches are using both fine, so it isn't a problem of common code.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120515/486101de/attachment.pgp>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [U-Boot] [PATCH] Add gc-section support for ARM
  2012-05-15  5:12     ` Mike Frysinger
@ 2012-05-15  7:01       ` Albert ARIBAUD
  2012-05-15 22:07       ` Charles Manning
  1 sibling, 0 replies; 10+ messages in thread
From: Albert ARIBAUD @ 2012-05-15  7:01 UTC (permalink / raw)
  To: u-boot

Le 15/05/2012 07:12, Mike Frysinger a ?crit :
> On Monday 14 May 2012 17:01:30 Charles Manning wrote:
>> On Monday 14 May 2012 17:15:50 Mike Frysinger wrote:
>>> On Wednesday 02 May 2012 21:37:51 Charles Manning wrote:
>>>> Seems odd that this hasn't been done yet.
>>>> Shaves 5k off an omap overo build.
>>>
>>> my understanding is that it doesn't work for some
>>
>> It won't work for people that don't set up their lds properly.
>
> current u-boot policy is to not introduce changes that knowingly break other
> platforms.  so if you want to update the common arm config.mk, you need to at
> least compile test all arm boards.

... and considering this is dependent on toolchain setups, this should 
also be performed for the most common toolchains versions around (ELDK 
4.2 and 5.x; CS 2011, 2010, maybe even 2009; Linaro; LLVM even).

>>>> +PLATFORM_RELFLAGS += -ffunction-sections
>>>
>>> where's the -fdata-sections ?
>>
>> I tried that once before and could not get that to work with u-boot. I
>> figure doing just the function sections is better than nothing.
>
> so even your lds isn't setup properly ? :P
>
> other arches are using both fine, so it isn't a problem of common code.
> -mike

Amicalement,
-- 
Albert.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [U-Boot] [PATCH] Add gc-section support for ARM
  2012-05-15  5:12     ` Mike Frysinger
  2012-05-15  7:01       ` Albert ARIBAUD
@ 2012-05-15 22:07       ` Charles Manning
  2012-05-15 22:25         ` Wolfgang Denk
  1 sibling, 1 reply; 10+ messages in thread
From: Charles Manning @ 2012-05-15 22:07 UTC (permalink / raw)
  To: u-boot

On Tuesday 15 May 2012 17:12:05 Mike Frysinger wrote:
> On Monday 14 May 2012 17:01:30 Charles Manning wrote:
> > On Monday 14 May 2012 17:15:50 Mike Frysinger wrote:
> > > On Wednesday 02 May 2012 21:37:51 Charles Manning wrote:
> > > > Seems odd that this hasn't been done yet.
> > > > Shaves 5k off an omap overo build.
> > >
> > > my understanding is that it doesn't work for some
> >
> > It won't work for people that don't set up their lds properly.
>
> current u-boot policy is to not introduce changes that knowingly break
> other platforms.  so if you want to update the common arm config.mk, you
> need to at least compile test all arm boards.

Doesn't that makes it an impossible task? Not having all the boards makes it 
pretty hard to test them all.


>
> > > > +PLATFORM_RELFLAGS += -ffunction-sections
> > >
> > > where's the -fdata-sections ?
> >
> > I tried that once before and could not get that to work with u-boot. I
> > figure doing just the function sections is better than nothing.
>
> so even your lds isn't setup properly ? :P

Correct. I was aiming to achieve a certain size. Once I achieved that I 
stopped fiddling. The problem was probably in the relocation stuff.

>
> other arches are using both fine, so it isn't a problem of common code.

I might be incorrect, but I have noticed what appears to be some differences 
between different versions of binutils.

-- CHarles

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [U-Boot] [PATCH] Add gc-section support for ARM
  2012-05-15 22:07       ` Charles Manning
@ 2012-05-15 22:25         ` Wolfgang Denk
  2012-05-15 22:45           ` Charles Manning
  0 siblings, 1 reply; 10+ messages in thread
From: Wolfgang Denk @ 2012-05-15 22:25 UTC (permalink / raw)
  To: u-boot

Dear Charles,

In message <201205161007.59560.manningc2@actrix.gen.nz> you wrote:
> On Tuesday 15 May 2012 17:12:05 Mike Frysinger wrote:
...
> > current u-boot policy is to not introduce changes that knowingly break
> > other platforms.  so if you want to update the common arm config.mk, you
> > need to at least compile test all arm boards.
---------------------^^^^^^^^^^^^
> Doesn't that makes it an impossible task? Not having all the boards makes it 
> pretty hard to test them all.

A compile test does not require any actual hardware.

> > other arches are using both fine, so it isn't a problem of common code.
> 
> I might be incorrect, but I have noticed what appears to be some differences 
> between different versions of binutils.

Please be more specific. The same "different versions of binutils"
appear to work fine on other architectures ?

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 at denx.de
Even if you aren't in doubt, consider the mental welfare of the  per-
son who has to maintain the code after you, and who will probably put
parens in the wrong place.          - Larry Wall in the perl man page

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [U-Boot] [PATCH] Add gc-section support for ARM
  2012-05-15 22:25         ` Wolfgang Denk
@ 2012-05-15 22:45           ` Charles Manning
  2012-05-17 18:53             ` Tom Rini
  0 siblings, 1 reply; 10+ messages in thread
From: Charles Manning @ 2012-05-15 22:45 UTC (permalink / raw)
  To: u-boot

On Wednesday 16 May 2012 10:25:26 Wolfgang Denk wrote:
> Dear Charles,
>
> In message <201205161007.59560.manningc2@actrix.gen.nz> you wrote:
> > On Tuesday 15 May 2012 17:12:05 Mike Frysinger wrote:
>
> ...
>
> > > current u-boot policy is to not introduce changes that knowingly break
> > > other platforms.  so if you want to update the common arm config.mk,
> > > you need to at least compile test all arm boards.
>
> ---------------------^^^^^^^^^^^^
>
> > Doesn't that makes it an impossible task? Not having all the boards makes
> > it pretty hard to test them all.
>
> A compile test does not require any actual hardware.

Does the patch fail I submitted fail any compile tests?

AFAIK, it compiles but the resulting binary might just be rubbish on some 
boards.

It worked fine on my overo board without any changes to the overo lds.

I have just verified that it builds on
overo
mx51evk
davinci_sonata

If there is an expectation to build every possible config is there a script 
that will do that?

>
> > > other arches are using both fine, so it isn't a problem of common code.
> >
> > I might be incorrect, but I have noticed what appears to be some
> > differences between different versions of binutils.
>
> Please be more specific. The same "different versions of binutils"
> appear to work fine on other architectures ?

That was based on some observations a year or two ago. I don't know if the 
problem has now gone away and have no way of reproducing it.

-- Charles

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [U-Boot] [PATCH] Add gc-section support for ARM
  2012-05-15 22:45           ` Charles Manning
@ 2012-05-17 18:53             ` Tom Rini
  0 siblings, 0 replies; 10+ messages in thread
From: Tom Rini @ 2012-05-17 18:53 UTC (permalink / raw)
  To: u-boot

On Wed, May 16, 2012 at 10:45:33AM +1200, Charles Manning wrote:
> On Wednesday 16 May 2012 10:25:26 Wolfgang Denk wrote:
> > Dear Charles,
> >
> > In message <201205161007.59560.manningc2@actrix.gen.nz> you wrote:
> > > On Tuesday 15 May 2012 17:12:05 Mike Frysinger wrote:
> >
> > ...
> >
> > > > current u-boot policy is to not introduce changes that knowingly break
> > > > other platforms.  so if you want to update the common arm config.mk,
> > > > you need to at least compile test all arm boards.
> >
> > ---------------------^^^^^^^^^^^^
> >
> > > Doesn't that makes it an impossible task? Not having all the boards makes
> > > it pretty hard to test them all.
> >
> > A compile test does not require any actual hardware.
> 
> Does the patch fail I submitted fail any compile tests?
> 
> AFAIK, it compiles but the resulting binary might just be rubbish on some 
> boards.
> 
> It worked fine on my overo board without any changes to the overo lds.
> 
> I have just verified that it builds on
> overo
> mx51evk
> davinci_sonata
> 
> If there is an expectation to build every possible config is there a script 
> that will do that?

Yes, MAKEALL in the top level.  Assuming you've installed ELDK5.1 or 4.2
to their default locations:
$ source /opt/eldk-5.1/armv7a/environment-setup-armv7a-vfp-neon-linux-gnueabi
$ CROSS_COMPILE=arm-linux-gnueabi- BUILD_DIR=eldk51 ./MAKEALL -a arm
$ CROSS_COMPILE=/opt/eldk-4.2/arm/usr/bin/arm-linux-gnueabi- BUILD_DIR=eldk42 ./MAKEALL -a arm

(I've got the above in a script with a few tweaks to build all TI stuff,
for example).

-- 
Tom

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [U-Boot] [PATCH] Add gc-section support for ARM
  2012-05-14 21:01   ` Charles Manning
  2012-05-15  5:12     ` Mike Frysinger
@ 2012-05-29 21:03     ` Wolfgang Denk
  1 sibling, 0 replies; 10+ messages in thread
From: Wolfgang Denk @ 2012-05-29 21:03 UTC (permalink / raw)
  To: u-boot

Dear Charles Manning,

In message <201205150901.30710.manningc2@actrix.gen.nz> you wrote:
>
> > > +PLATFORM_RELFLAGS += -ffunction-sections
> >
> > where's the -fdata-sections ?
> 
> I tried that once before and could not get that to work with u-boot. I figure 
> doing just the function sections is better than nothing.

What exactly do you mean by "could not get that to work"?  What
exactly was the problem?  And which exact tool chain did you use then?

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 at denx.de
"Why waste negative entropy on comments, when you could use the  same
entropy to create bugs instead?"                        - Steve Elias

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-05-29 21:03 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-03  1:37 [U-Boot] [PATCH] Add gc-section support for ARM Charles Manning
2012-05-14  5:15 ` Mike Frysinger
2012-05-14 21:01   ` Charles Manning
2012-05-15  5:12     ` Mike Frysinger
2012-05-15  7:01       ` Albert ARIBAUD
2012-05-15 22:07       ` Charles Manning
2012-05-15 22:25         ` Wolfgang Denk
2012-05-15 22:45           ` Charles Manning
2012-05-17 18:53             ` Tom Rini
2012-05-29 21:03     ` Wolfgang Denk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.