From: Mike Frysinger <vapier@gentoo.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] Fix all linker scripts for older binutils versions (pre-2.16)
Date: Sun, 23 Aug 2009 02:09:09 -0400 [thread overview]
Message-ID: <200908230209.10484.vapier@gentoo.org> (raw)
In-Reply-To: <20090823053438.F2678833DBD2@gemini.denx.de>
On Sunday 23 August 2009 01:34:38 Wolfgang Denk wrote:
> Mike Frysinger wrote:
> > On Monday 17 August 2009 08:00:53 Wolfgang Denk wrote:
> > > --- a/config.mk
> > > +++ b/config.mk
> > > @@ -166,11 +166,21 @@ endif
> > > +# Special flags for CPP when processing the linker script
> > > +# Linker versions prior to 2.16 don't understand the builting
> > > +# functions SORT_BY_ALIGNMENT() and SORT_BY_NAME(), so disable these
> > > +ifeq ($(shell $(LD) -v | \
> > > + sed -ne 's/GNU ld version \([0-9][0-9]*\)\.\([0-9][0-9]*\) .*/[ \1
> > > -lt 2 ] || [ \2 -lt 16 ] \&\& echo old_ld/p' | \ + sh),old_ld)
> > > +LDPPFLAGS +=3D -D'SORT_BY_ALIGNMENT(x)=3Dx' -D'SORT_BY_NAME(x)=3Dx'
> > > +endif
> >
> > this check will fail with binutils 3.0+ because of the minor check for 16
> > without a corresponding major check.
>
> Well, the "\1 -lt 2" is the major check, isn't it?
here is how the shell code looks:
[ $major -lt 2 ] || [ $minor -lt 16 ] && echo old_ld
and the way shell logic works, the echo is executed if either of those tests
fail. what you really wanted was:
[ $major -lt 2 ] || [ $major -eq 2 -a $minor -lt 16 ] && echo old_ld
fairly common bug that comes up when people try processing tool versions on a
major.minor.micro basis
but this is largely irrelevant if we move the logic from the build system to
the header file as this will (should) get fixed in the process
> > the way it's written now causes ld to get executed every time config.mk
> > is included. my current test shows that is like 80 times, or 79 useless
> > runs. even if we make this a bit smarter (saving the output in a var and
> > exporting it), that cuts things down to like 60 executions. considering
> > this test is only used by the linker script code, why not keep it in the
> > top-level Makefile.
>
> Patches welcome...
i wanted to make sure we were on the same page before sending patches
-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/20090823/82efd88f/attachment.pgp
next prev parent reply other threads:[~2009-08-23 6:09 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-17 12:00 [U-Boot] [PATCH] Fix all linker scripts for older binutils versions (pre-2.16) Wolfgang Denk
2009-08-17 19:14 ` Mike Frysinger
2009-08-17 19:31 ` Wolfgang Denk
2009-08-17 20:15 ` Mike Frysinger
2009-08-17 20:24 ` Wolfgang Denk
2009-08-17 20:31 ` Mike Frysinger
2009-08-21 21:14 ` Wolfgang Denk
2009-08-22 23:50 ` [U-Boot] [PATCH] Blackfin: use common code to preprocess linker script Mike Frysinger
2009-08-23 20:25 ` Wolfgang Denk
2009-08-23 0:00 ` [U-Boot] [PATCH] Fix all linker scripts for older binutils versions (pre-2.16) Mike Frysinger
2009-08-23 5:34 ` Wolfgang Denk
2009-08-23 6:09 ` Mike Frysinger [this message]
2009-08-23 19:30 ` Wolfgang Denk
2009-08-23 6:47 ` [U-Boot] [PATCH] start a linker script helper file Mike Frysinger
2009-08-23 20:41 ` Wolfgang Denk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200908230209.10484.vapier@gentoo.org \
--to=vapier@gentoo.org \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox