bug in binutils master specific to msp430-elf

2014-06-01 Thread Peter Bigot
I build msp430-elf toolchains using the latest material in the
gcc-4_9-branch of gcc, master of binutils, and master of newlib.  In
what follows I've set RHINC to point to the include directory from
GCC_RH-20140508  that has the headers and linker scripts.

There is a fault in binutils introduced at 77ac17b8 which causes
msp430-elf-ld to fail to link applications.  I get this behavior:

llc[186]$ cat x.c
#include 

void main (void)
{
}

llc[187]$ /usr/local/msp430-elf-dev-20140601h/bin/msp430-elf-gcc
-mmcu=msp430f5438a -I${RHINC} -T${RHINC}/msp430f5438a.ld x.c

llc[188]$ /usr/local/msp430-elf-dev-20140601j/bin/msp430-elf-gcc
-mmcu=msp430f5438a -I${RHINC} -T${RHINC}/msp430f5438a.ld x.c
/usr/local/msp430-elf-dev-20140601h/lib/gcc/msp430-elf/4.9.1/../../../../msp430-elf/bin/ld:
target  not found
collect2: error: ld returned 1 exit status

The second produces a diagnostic from open_output in ld/ldlang.c where
output_target is an empty string.

The only difference between these two chains is the version of binutils:

llc[189]$  cat /usr/local/msp430-elf-dev-20140601h/.sha1.binutils
77ac17b8453f60adabaa8931930e2bbe0499757d
llc[190]$  cat /usr/local/msp430-elf-dev-20140601j/.sha1.binutils
9854d43d40fc116d72a24583f53e34f91cf4098b

A cursory look at the commit doesn't explain why this might happen,
unless msp430 requires that ${GENSCRIPTS} be invoked for some reason.

77ac17b8453f60adabaa8931930e2bbe0499757d is the first bad commit
commit 77ac17b8453f60adabaa8931930e2bbe0499757d
Author: Hans-Peter Nilsson 
Date:   Wed May 28 18:20:16 2014 +0200

ld: Split GENSCRIPTS rule from dependencies to fix tdir_'s.

* Makefile.am: Change all rules with ${GENSCRIPTS}
invocations to be just dependencies.
($(ALL_EMULATION_SOURCES) $(ALL_64_EMULATION_SOURCES))
(run-genscripts): New rules.
* Makefile.in: Regenerate.

:04 04 bd02f74300dab8958bc24165a23661e0d939889f
388df7b3ae54aabf53d35973a09bcc94fa1f91b5 M  ld

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


Re: bug in binutils master specific to msp430-elf

2014-06-02 Thread Peter Bigot
On Sun, Jun 1, 2014 at 11:15 PM, Alan Modra  wrote:
> On Sun, Jun 01, 2014 at 07:54:58PM -0500, Peter Bigot wrote:
>> 77ac17b8453f60adabaa8931930e2bbe0499757d is the first bad commit
>> commit 77ac17b8453f60adabaa8931930e2bbe0499757d
>> Author: Hans-Peter Nilsson 
>> Date:   Wed May 28 18:20:16 2014 +0200
>>
>> ld: Split GENSCRIPTS rule from dependencies to fix tdir_'s.
>>
>> * Makefile.am: Change all rules with ${GENSCRIPTS}
>> invocations to be just dependencies.
>> ($(ALL_EMULATION_SOURCES) $(ALL_64_EMULATION_SOURCES))
>> (run-genscripts): New rules.
>> * Makefile.in: Regenerate.
>
> It's because msp, along with bfin and score, take an extra argument to
> the genscript invocation.  I think the following should cure the
> problem you're seeing, but it leads to a bunch of warnings
>
> Makefile:2400: warning: overriding commands for target `eelf32bfin.c'
> Makefile:2105: warning: ignoring old commands for target `eelf32bfin.c'
> Makefile:2406: warning: overriding commands for target `eelf32bfinfd.c'
> Makefile:2105: warning: ignoring old commands for target `eelf32bfinfd.c'
> Makefile:2940: warning: overriding commands for target `emsp430.c'
> Makefile:2105: warning: ignoring old commands for target `emsp430.c'
> Makefile:2945: warning: overriding commands for target `emsp430X.c'
> Makefile:2105: warning: ignoring old commands for target `emsp430X.c'
> Makefile:3048: warning: overriding commands for target `escore3_elf.c'
> Makefile:2105: warning: ignoring old commands for target `escore3_elf.c'
> Makefile:3053: warning: overriding commands for target `escore7_elf.c'
> Makefile:2105: warning: ignoring old commands for target `escore7_elf.c'
>
> I think I'll look at a different solution, renaming some ld/emulparams
> files instead.

Thanks; your commit ce46249c155b7 fixes it for me.

Peter

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils