* ld testsuite breaks with latest GCC-4.0
@ 2005-01-02 4:45 Greg Schafer
2005-01-02 5:11 ` Daniel Jacobowitz
0 siblings, 1 reply; 9+ messages in thread
From: Greg Schafer @ 2005-01-02 4:45 UTC (permalink / raw)
To: binutils
Hi
In case you haven't already heard, GCC-4.0 no longer installs a "specs"
file. See these threads:
http://gcc.gnu.org/ml/gcc-patches/2004-12/msg01459.html
http://gcc.gnu.org/ml/gcc-patches/2004-12/msg01574.html
The ld testsuite currently attempts some grovelling around in the gcc specs
file to find out various bits of information. This from ld/configure.host
(excuse the wrap):
*-*-linux*)
HOSTING_CRT0='-dynamic-linker `egrep "ld[^ ]*\.so" \`${CC} --print-file-name=specs\` | sed
-e "s,.*-dynamic-linker[ ][ ]*\(.*/ld[^ ]*\.so..\).*,\1,"` `${CC} --print-file-name=crt1.o`
`${CC} --print-file-name=crti.o` `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else
${CC} --print-file-name=crtbegin.o; fi`'
With latest GCC-4.0, `gcc --print-file-name=specs' spits out nothing which
breaks the whole ld testsuite:
Using /temptools/src/binutils-2.15.94.0.2/ld/testsuite/config/default.exp as tool-and-target-specific interface file.
ERROR: tcl error sourcing tool-and-target-specific interface file /temptools/src/binutils-2.15.94.0.2/ld/testsuite/config/default.exp.
Error getting native link files: -dynamic-linker /usr/lib/crt1.o /usr/lib/crti.o /temptools/lib/gcc/i686-pc-linux-gnu/4.0.0/crtbegin.o
grep: specs: No such file or directory
Error getting native link files: -dynamic-linker /usr/lib/crt1.o /usr/lib/crti.o /temptools/lib/gcc/i686-pc-linux-gnu/4.0.0/crtbegin.o
grep: specs: No such file or directory
while executing
Clearly, changes will be needed. I'm not sure what the best solution is but
I have a feeling that it will probably involve:
`gcc -dumpspecs'
but that might have the potential to break older GCC's. Dunno.
Thoughts?
Thanks
Greg
PS - I'm using the latest HJ release but the code in question from CVS trunk
looks the same.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: ld testsuite breaks with latest GCC-4.0
2005-01-02 4:45 ld testsuite breaks with latest GCC-4.0 Greg Schafer
@ 2005-01-02 5:11 ` Daniel Jacobowitz
2005-01-02 6:24 ` [PATCH] " Greg Schafer
0 siblings, 1 reply; 9+ messages in thread
From: Daniel Jacobowitz @ 2005-01-02 5:11 UTC (permalink / raw)
To: Greg Schafer; +Cc: binutils
On Sun, Jan 02, 2005 at 03:44:51PM +1100, Greg Schafer wrote:
> Clearly, changes will be needed. I'm not sure what the best solution is but
> I have a feeling that it will probably involve:
>
> `gcc -dumpspecs'
>
> but that might have the potential to break older GCC's. Dunno.
That should work, as far back as I know of.
--
Daniel Jacobowitz
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH] Re: ld testsuite breaks with latest GCC-4.0
2005-01-02 5:11 ` Daniel Jacobowitz
@ 2005-01-02 6:24 ` Greg Schafer
2005-01-03 20:51 ` James E Wilson
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Greg Schafer @ 2005-01-02 6:24 UTC (permalink / raw)
To: binutils
[-- Attachment #1: Type: text/plain, Size: 665 bytes --]
On Sun, Jan 02, 2005 at 12:11:44AM -0500, Daniel Jacobowitz wrote:
> On Sun, Jan 02, 2005 at 03:44:51PM +1100, Greg Schafer wrote:
> > Clearly, changes will be needed. I'm not sure what the best solution is but
> > I have a feeling that it will probably involve:
> >
> > `gcc -dumpspecs'
> >
> > but that might have the potential to break older GCC's. Dunno.
>
> That should work, as far back as I know of.
I was just worried that some installations may be using an altered "on disk"
specs file.
Anyhow, the attached patch makes it work for me on i686-pc-linux-gnu. But it
also affects the ia64-*-aix* target but I have no way of testing that.
Regards
Greg
[-- Attachment #2: ld.patch --]
[-- Type: text/plain, Size: 2246 bytes --]
2005-01-02 Greg Schafer <gschafer@zip.com.au>
* configure.host: Use "${CC} -dumpspecs" instead of
"${CC} --print-file-name=specs" to appease GCC versions >= 4.0.
Index: ld/configure.host
===================================================================
RCS file: /cvs/src/src/ld/configure.host,v
retrieving revision 1.36
diff -u -r1.36 configure.host
--- ld/configure.host 17 May 2004 19:50:16 -0000 1.36
+++ ld/configure.host 2 Jan 2005 06:03:40 -0000
@@ -33,7 +33,7 @@
;;
*-*-linux*)
- HOSTING_CRT0='-dynamic-linker `egrep "ld[^ ]*\.so" \`${CC} --print-file-name=specs\` | sed -e "s,.*-dynamic-linker[ ][ ]*\(.*/ld[^ ]*\.so..\).*,\1,"` `${CC} --print-file-name=crt1.o` `${CC} --print-file-name=crti.o` `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} --print-file-name=crtbegin.o; fi`'
+ HOSTING_CRT0='-dynamic-linker `${CC} -dumpspecs | egrep "ld[^ ]*\.so" | sed -e "s,.*-dynamic-linker[ ][ ]*\(.*/ld[^ ]*\.so..\).*,\1,"` `${CC} --print-file-name=crt1.o` `${CC} --print-file-name=crti.o` `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} --print-file-name=crtbegin.o; fi`'
HOSTING_LIBS='-L`dirname \`${CC} --print-file-name=libc.so\`` '"$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`'
;;
@@ -146,7 +146,7 @@
;;
ia64-*-aix*)
- HOSTING_CRT0='-dynamic-linker `egrep "libc.so" \`${CC} --print-file-name=specs\` | sed -e "s,.*-dynamic-linker[ ][ ]*\(.*/libc.so..\).*,\1,"` `${CC} --print-file-name=crt1.o` `${CC} --print-file-name=crti.o` `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} --print-file-name=crtbegin.o; fi`'
+ HOSTING_CRT0='-dynamic-linker `${CC} -dumpspecs | egrep "libc.so" | sed -e "s,.*-dynamic-linker[ ][ ]*\(.*/libc.so..\).*,\1,"` `${CC} --print-file-name=crt1.o` `${CC} --print-file-name=crti.o` `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} --print-file-name=crtbegin.o; fi`'
HOSTING_LIBS='-L`dirname \`${CC} --print-file-name=libc.so\`` '"$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`'
;;
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] Re: ld testsuite breaks with latest GCC-4.0
2005-01-02 6:24 ` [PATCH] " Greg Schafer
@ 2005-01-03 20:51 ` James E Wilson
2005-01-04 10:30 ` Nick Clifton
2005-01-04 10:43 ` Jakub Jelinek
2 siblings, 0 replies; 9+ messages in thread
From: James E Wilson @ 2005-01-03 20:51 UTC (permalink / raw)
To: Greg Schafer; +Cc: binutils
On Sat, 2005-01-01 at 22:24, Greg Schafer wrote:
> Anyhow, the attached patch makes it work for me on i686-pc-linux-gnu. But it
> also affects the ia64-*-aix* target but I have no way of testing that.
ia64-aix was never released to the public. It is a dead target. Go
ahead and change it anyway you like, no one will care.
The ia64-aix support was already removed from bfd, but I see it is still
in gas and ld, and maybe also other places I didn't look. I should
really clean that up someday.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] Re: ld testsuite breaks with latest GCC-4.0
2005-01-02 6:24 ` [PATCH] " Greg Schafer
2005-01-03 20:51 ` James E Wilson
@ 2005-01-04 10:30 ` Nick Clifton
2005-01-04 10:43 ` Jakub Jelinek
2 siblings, 0 replies; 9+ messages in thread
From: Nick Clifton @ 2005-01-04 10:30 UTC (permalink / raw)
To: Greg Schafer; +Cc: binutils
Hi Greg,
> Anyhow, the attached patch makes it work for me on i686-pc-linux-gnu. But it
> also affects the ia64-*-aix* target but I have no way of testing that.
> 2005-01-02 Greg Schafer <gschafer@zip.com.au>
>
> * configure.host: Use "${CC} -dumpspecs" instead of
> "${CC} --print-file-name=specs" to appease GCC versions >= 4.0.
Approved - please apply.
Cheers
Nick
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] Re: ld testsuite breaks with latest GCC-4.0
2005-01-02 6:24 ` [PATCH] " Greg Schafer
2005-01-03 20:51 ` James E Wilson
2005-01-04 10:30 ` Nick Clifton
@ 2005-01-04 10:43 ` Jakub Jelinek
2005-01-04 22:47 ` Greg Schafer
2 siblings, 1 reply; 9+ messages in thread
From: Jakub Jelinek @ 2005-01-04 10:43 UTC (permalink / raw)
To: Greg Schafer; +Cc: binutils
On Sun, Jan 02, 2005 at 05:24:00PM +1100, Greg Schafer wrote:
> 2005-01-02 Greg Schafer <gschafer@zip.com.au>
>
> * configure.host: Use "${CC} -dumpspecs" instead of
> "${CC} --print-file-name=specs" to appease GCC versions >= 4.0.
If there is a specs file, configure.host should use that and only use
-dumpspecs if it is not present.
-dumpspecs dumps the built-in specs, not the ones it finds on the
filesystem.
This can make a difference if specs is hand edited.
So, I think the patch should use ${CC} --print-file-name=specs,
if that prints just specs, it should use ${CC} -dumpspecs,
otherwise cat the specs file.
specs=`${CC} --print-file-name=specs`
{ if [ x"$specs" = xspecs ]; then ${CC} -dumpspecs; else cat "$specs"; fi; } \
| egrep ...
Jakub
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] Re: ld testsuite breaks with latest GCC-4.0
2005-01-04 10:43 ` Jakub Jelinek
@ 2005-01-04 22:47 ` Greg Schafer
2005-01-06 12:25 ` Greg Schafer
0 siblings, 1 reply; 9+ messages in thread
From: Greg Schafer @ 2005-01-04 22:47 UTC (permalink / raw)
To: Jakub Jelinek; +Cc: binutils
On Tue, Jan 04, 2005 at 11:43:26AM +0100, Jakub Jelinek wrote:
> If there is a specs file, configure.host should use that and only use
> -dumpspecs if it is not present.
> -dumpspecs dumps the built-in specs, not the ones it finds on the
> filesystem.
> This can make a difference if specs is hand edited.
Agreed. That is the exact scenario I was concerned about and alluded to up
thread.
> So, I think the patch should use ${CC} --print-file-name=specs,
> if that prints just specs, it should use ${CC} -dumpspecs,
> otherwise cat the specs file.
> specs=`${CC} --print-file-name=specs`
> { if [ x"$specs" = xspecs ]; then ${CC} -dumpspecs; else cat "$specs"; fi; } \
> | egrep ...
Yes. That would seem saner and definitely more robust. I'll try to make a
new patch and test it but am running short on time right now.. so if someone
beats me to it.. go right ahead. Also, prolly best to remove that ia64-aix cruft
as confirmed by Jim Wilson.
Thanks
Greg
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] Re: ld testsuite breaks with latest GCC-4.0
2005-01-04 22:47 ` Greg Schafer
@ 2005-01-06 12:25 ` Greg Schafer
2005-01-10 14:58 ` Nick Clifton
0 siblings, 1 reply; 9+ messages in thread
From: Greg Schafer @ 2005-01-06 12:25 UTC (permalink / raw)
To: binutils; +Cc: Jakub Jelinek
[-- Attachment #1: Type: text/plain, Size: 761 bytes --]
On Wed, Jan 05, 2005 at 09:47:30AM +1100, Greg Schafer wrote:
> On Tue, Jan 04, 2005 at 11:43:26AM +0100, Jakub Jelinek wrote:
>
> > So, I think the patch should use ${CC} --print-file-name=specs,
> > if that prints just specs, it should use ${CC} -dumpspecs,
> > otherwise cat the specs file.
> > specs=`${CC} --print-file-name=specs`
> > { if [ x"$specs" = xspecs ]; then ${CC} -dumpspecs; else cat "$specs"; fi; } \
> > | egrep ...
>
> Yes. That would seem saner and definitely more robust. I'll try to make a
> new patch and test it
Here is a new patch that tested out fine for me with gcc-4 and gcc-3.4.3.
Nick approved the previous patch, so if this one is also approved, could
someone please apply it as I don't have commit priv's.
Thanks
Greg
[-- Attachment #2: ld.patch.new --]
[-- Type: text/plain, Size: 2313 bytes --]
2005-01-02 Jakub Jelinek <jakub@redhat.com>
Greg Schafer <gschafer@zip.com.au>
* configure.host (*-*-linux*): Allow HOSTING_CRT0 to handle GCC
versions >= 4.0 that don't install a specs file.
(ia64-*-aix*): Remove support.
Index: ld/configure.host
===================================================================
RCS file: /cvs/src/src/ld/configure.host,v
retrieving revision 1.36
diff -u -r1.36 configure.host
--- ld/configure.host 17 May 2004 19:50:16 -0000 1.36
+++ ld/configure.host 6 Jan 2005 10:17:37 -0000
@@ -33,7 +33,7 @@
;;
*-*-linux*)
- HOSTING_CRT0='-dynamic-linker `egrep "ld[^ ]*\.so" \`${CC} --print-file-name=specs\` | sed -e "s,.*-dynamic-linker[ ][ ]*\(.*/ld[^ ]*\.so..\).*,\1,"` `${CC} --print-file-name=crt1.o` `${CC} --print-file-name=crti.o` `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} --print-file-name=crtbegin.o; fi`'
+ HOSTING_CRT0='-dynamic-linker `specs=\`${CC} --print-file-name=specs\`; { if [ x"$specs" = xspecs ]; then ${CC} -dumpspecs; else cat "$specs"; fi; } | egrep "ld[^ ]*\.so" | sed -e "s,.*-dynamic-linker[ ][ ]*\(.*/ld[^ ]*\.so..\).*,\1,"` `${CC} --print-file-name=crt1.o` `${CC} --print-file-name=crti.o` `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} --print-file-name=crtbegin.o; fi`'
HOSTING_LIBS='-L`dirname \`${CC} --print-file-name=libc.so\`` '"$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`'
;;
@@ -145,11 +145,6 @@
HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,ld\[^ \]*\*,ld-linux-ia64,g"`
;;
-ia64-*-aix*)
- HOSTING_CRT0='-dynamic-linker `egrep "libc.so" \`${CC} --print-file-name=specs\` | sed -e "s,.*-dynamic-linker[ ][ ]*\(.*/libc.so..\).*,\1,"` `${CC} --print-file-name=crt1.o` `${CC} --print-file-name=crti.o` `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} --print-file-name=crtbegin.o; fi`'
- HOSTING_LIBS='-L`dirname \`${CC} --print-file-name=libc.so\`` '"$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`'
- ;;
-
mips*-sgi-irix4* | mips*-sgi-irix5*)
HOSTING_CRT0=/usr/lib/crt1.o
HOSTING_LIBS="$HOSTING_LIBS"' /usr/lib/crtn.o'
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] Re: ld testsuite breaks with latest GCC-4.0
2005-01-06 12:25 ` Greg Schafer
@ 2005-01-10 14:58 ` Nick Clifton
0 siblings, 0 replies; 9+ messages in thread
From: Nick Clifton @ 2005-01-10 14:58 UTC (permalink / raw)
To: Greg Schafer; +Cc: binutils, Jakub Jelinek
Hi Greg,
> Here is a new patch that tested out fine for me with gcc-4 and gcc-3.4.3.
> Nick approved the previous patch, so if this one is also approved, could
> someone please apply it as I don't have commit priv's.
Done. I used this, updated, ChangeLog entry:
ld/ChangeLog
2005-01-10 Greg Schaffer <gschafer@zip.com.au>
* configure.host (linux targets): Use "${CC} -dumpspecs" instead
of "${CC} --print-file-name=specs" to appease GCC versions >= 4.0.
(ia64-*-aix): Delete - this target is obsolete, and would be
broken by this patch.
Cheers
Nick
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2005-01-10 14:58 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-02 4:45 ld testsuite breaks with latest GCC-4.0 Greg Schafer
2005-01-02 5:11 ` Daniel Jacobowitz
2005-01-02 6:24 ` [PATCH] " Greg Schafer
2005-01-03 20:51 ` James E Wilson
2005-01-04 10:30 ` Nick Clifton
2005-01-04 10:43 ` Jakub Jelinek
2005-01-04 22:47 ` Greg Schafer
2005-01-06 12:25 ` Greg Schafer
2005-01-10 14:58 ` Nick Clifton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).