Patchwork Fix libgcc version for Canadian cross compile

login
register
mail settings
Submitter JonY
Date Aug. 3, 2012, 2:01 p.m.
Message ID <501BD9C5.9060106@users.sourceforge.net>
Download mbox | patch
Permalink /patch/174993/
State New
Headers show

Comments

JonY - Aug. 3, 2012, 2:01 p.m.
Hi,

For correctness sake, determine version from BASE-VER file instead of
calling compiler. This allows better toleration with bad Canadian cross
setups where host gcc version is of different version from target.

Patch OK?
Ian Taylor - Aug. 3, 2012, 2:37 p.m.
On Fri, Aug 3, 2012 at 7:01 AM, JonY <jon_y@users.sourceforge.net> wrote:
>
> For correctness sake, determine version from BASE-VER file instead of
> calling compiler. This allows better toleration with bad Canadian cross
> setups where host gcc version is of different version from target.
>
> Patch OK?

The patch is OK but you need a ChangeLog entry.

Thanks.

Ian
JonY - Aug. 3, 2012, 3:02 p.m.
On 8/3/2012 22:37, Ian Lance Taylor wrote:
> On Fri, Aug 3, 2012 at 7:01 AM, JonY <jon_y@users.sourceforge.net> wrote:
>>
>> For correctness sake, determine version from BASE-VER file instead of
>> calling compiler. This allows better toleration with bad Canadian cross
>> setups where host gcc version is of different version from target.
>>
>> Patch OK?
> 
> The patch is OK but you need a ChangeLog entry.
> 
> Thanks.
> 
> Ian
> 

ChangeLog OK?

2012-08-03  Jonathan Yong  <jon_y@users.sourceforge.net>

        * Makefile.in: Use BASE-VER file instead of host compiler
        to better tolerate setups where host gcc version differs from
        target version.
Ian Taylor - Aug. 3, 2012, 3:35 p.m.
On Fri, Aug 3, 2012 at 8:02 AM, JonY <jon_y@users.sourceforge.net> wrote:
> On 8/3/2012 22:37, Ian Lance Taylor wrote:
>> On Fri, Aug 3, 2012 at 7:01 AM, JonY <jon_y@users.sourceforge.net> wrote:
>>>
>>> For correctness sake, determine version from BASE-VER file instead of
>>> calling compiler. This allows better toleration with bad Canadian cross
>>> setups where host gcc version is of different version from target.
>>>
>>> Patch OK?
>>
>> The patch is OK but you need a ChangeLog entry.
>>
>> Thanks.
>>
>> Ian
>>
>
> ChangeLog OK?
>
> 2012-08-03  Jonathan Yong  <jon_y@users.sourceforge.net>
>
>         * Makefile.in: Use BASE-VER file instead of host compiler
>         to better tolerate setups where host gcc version differs from
>         target version.

Missing item you are changing, gives explanation normally omitted from
ChangeLog entries.  I would suggest this:

    * Makefile.in (version): Set to BASE-VER from gcc directory.

Ian
JonY - Aug. 3, 2012, 4:04 p.m.
On 8/3/2012 23:35, Ian Lance Taylor wrote:
> On Fri, Aug 3, 2012 at 8:02 AM, JonY <jon_y@users.sourceforge.net> wrote:
>> On 8/3/2012 22:37, Ian Lance Taylor wrote:
>>> On Fri, Aug 3, 2012 at 7:01 AM, JonY <jon_y@users.sourceforge.net> wrote:
>>>>
>>>> For correctness sake, determine version from BASE-VER file instead of
>>>> calling compiler. This allows better toleration with bad Canadian cross
>>>> setups where host gcc version is of different version from target.
>>>>
>>>> Patch OK?
>>>
>>> The patch is OK but you need a ChangeLog entry.
>>>
>>> Thanks.
>>>
>>> Ian
>>>
>>
>> ChangeLog OK?
>>
>> 2012-08-03  Jonathan Yong  <jon_y@users.sourceforge.net>
>>
>>         * Makefile.in: Use BASE-VER file instead of host compiler
>>         to better tolerate setups where host gcc version differs from
>>         target version.
> 
> Missing item you are changing, gives explanation normally omitted from
> ChangeLog entries.  I would suggest this:
> 
>     * Makefile.in (version): Set to BASE-VER from gcc directory.
> 
> Ian
> 

OK. Btw, I don't actually have write access, so please commit if the
ChangeLog is good.

2012-08-03  Jonathan Yong  <jon_y@users.sourceforge.net>

        * Makefile.in (version): set to BASE-VER file from gcc
        directory.
Ian Taylor - Aug. 3, 2012, 11:42 p.m.
On Fri, Aug 3, 2012 at 9:04 AM, JonY <jon_y@users.sourceforge.net> wrote:
>
> OK. Btw, I don't actually have write access, so please commit if the
> ChangeLog is good.
>
> 2012-08-03  Jonathan Yong  <jon_y@users.sourceforge.net>
>
>         * Makefile.in (version): set to BASE-VER file from gcc
>         directory.

Committed.

Thanks.

Ian
H.J. Lu - Aug. 4, 2012, 5:14 a.m.
On Fri, Aug 3, 2012 at 4:42 PM, Ian Lance Taylor <iant@google.com> wrote:
> On Fri, Aug 3, 2012 at 9:04 AM, JonY <jon_y@users.sourceforge.net> wrote:
>>
>> OK. Btw, I don't actually have write access, so please commit if the
>> ChangeLog is good.
>>
>> 2012-08-03  Jonathan Yong  <jon_y@users.sourceforge.net>
>>
>>         * Makefile.in (version): set to BASE-VER file from gcc
>>         directory.
>
> Committed.

This totally breaks the installed GCC:

[hjl@gnu-35 tmp]$ cat x.c
int
main ()
{
}
[hjl@gnu-35 tmp]$ /export/gnu/import/git/gcc-test-spec/usr/bin/gcc x.c
/usr/local/bin/ld: cannot find crtbegin.o: No such file or directory
/usr/local/bin/ld: cannot find -lgcc
collect2: error: ld returned 1 exit status
[hjl@gnu-35 tmp]$
H.J. Lu - Aug. 4, 2012, 5:24 a.m.
On Fri, Aug 3, 2012 at 10:14 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Fri, Aug 3, 2012 at 4:42 PM, Ian Lance Taylor <iant@google.com> wrote:
>> On Fri, Aug 3, 2012 at 9:04 AM, JonY <jon_y@users.sourceforge.net> wrote:
>>>
>>> OK. Btw, I don't actually have write access, so please commit if the
>>> ChangeLog is good.
>>>
>>> 2012-08-03  Jonathan Yong  <jon_y@users.sourceforge.net>
>>>
>>>         * Makefile.in (version): set to BASE-VER file from gcc
>>>         directory.
>>
>> Committed.
>
> This totally breaks the installed GCC:
>
> [hjl@gnu-35 tmp]$ cat x.c
> int
> main ()
> {
> }
> [hjl@gnu-35 tmp]$ /export/gnu/import/git/gcc-test-spec/usr/bin/gcc x.c
> /usr/local/bin/ld: cannot find crtbegin.o: No such file or directory
> /usr/local/bin/ld: cannot find -lgcc
> collect2: error: ld returned 1 exit status
> [hjl@gnu-35 tmp]$
>
> --
> H.J.

top_srcdir is never defined in libgcc/Makefile.in.
JonY - Aug. 4, 2012, 5:35 a.m.
On 8/4/2012 13:14, H.J. Lu wrote:
> On Fri, Aug 3, 2012 at 4:42 PM, Ian Lance Taylor wrote:
>> On Fri, Aug 3, 2012 at 9:04 AM, JonY wrote:
>>>
>>> OK. Btw, I don't actually have write access, so please commit if the
>>> ChangeLog is good.
>>>
>>> 2012-08-03  Jonathan Yong  <jon_y@users.sourceforge.net>
>>>
>>>         * Makefile.in (version): set to BASE-VER file from gcc
>>>         directory.
>>
>> Committed.
> 
> This totally breaks the installed GCC:
> 
> [hjl@gnu-35 tmp]$ cat x.c
> int
> main ()
> {
> }
> [hjl@gnu-35 tmp]$ /export/gnu/import/git/gcc-test-spec/usr/bin/gcc x.c
> /usr/local/bin/ld: cannot find crtbegin.o: No such file or directory
> /usr/local/bin/ld: cannot find -lgcc
> collect2: error: ld returned 1 exit status
> [hjl@gnu-35 tmp]$
> 

I'm not sure how that happens, did libgcc get installed to the wrong
area? What does adding -v say?
Ian Taylor - Aug. 4, 2012, 5:36 a.m.
On Fri, Aug 3, 2012 at 10:24 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Fri, Aug 3, 2012 at 10:14 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> On Fri, Aug 3, 2012 at 4:42 PM, Ian Lance Taylor <iant@google.com> wrote:
>>> On Fri, Aug 3, 2012 at 9:04 AM, JonY <jon_y@users.sourceforge.net> wrote:
>>>>
>>>> OK. Btw, I don't actually have write access, so please commit if the
>>>> ChangeLog is good.
>>>>
>>>> 2012-08-03  Jonathan Yong  <jon_y@users.sourceforge.net>
>>>>
>>>>         * Makefile.in (version): set to BASE-VER file from gcc
>>>>         directory.
>>>
>>> Committed.
>>
>> This totally breaks the installed GCC:
>>
>> [hjl@gnu-35 tmp]$ cat x.c
>> int
>> main ()
>> {
>> }
>> [hjl@gnu-35 tmp]$ /export/gnu/import/git/gcc-test-spec/usr/bin/gcc x.c
>> /usr/local/bin/ld: cannot find crtbegin.o: No such file or directory
>> /usr/local/bin/ld: cannot find -lgcc
>> collect2: error: ld returned 1 exit status
>> [hjl@gnu-35 tmp]$
>>
>> --
>> H.J.
>
> top_srcdir is never defined in libgcc/Makefile.in.

Thanks for fixing it.

Ian
JonY - Aug. 4, 2012, 5:46 a.m.
On 8/4/2012 13:24, H.J. Lu wrote:
> On Fri, Aug 3, 2012 at 10:14 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> On Fri, Aug 3, 2012 at 4:42 PM, Ian Lance Taylor <iant@google.com> wrote:
>>> On Fri, Aug 3, 2012 at 9:04 AM, JonY <jon_y@users.sourceforge.net> wrote:
>>>>
>>>> OK. Btw, I don't actually have write access, so please commit if the
>>>> ChangeLog is good.
>>>>
>>>> 2012-08-03  Jonathan Yong  <jon_y@users.sourceforge.net>
>>>>
>>>>         * Makefile.in (version): set to BASE-VER file from gcc
>>>>         directory.
>>>
>>> Committed.
>>
>> This totally breaks the installed GCC:
>>
>> [hjl@gnu-35 tmp]$ cat x.c
>> int
>> main ()
>> {
>> }
>> [hjl@gnu-35 tmp]$ /export/gnu/import/git/gcc-test-spec/usr/bin/gcc x.c
>> /usr/local/bin/ld: cannot find crtbegin.o: No such file or directory
>> /usr/local/bin/ld: cannot find -lgcc
>> collect2: error: ld returned 1 exit status
>> [hjl@gnu-35 tmp]$
>>
>> --
>> H.J.
> 
> top_srcdir is never defined in libgcc/Makefile.in.
> 

Thanks, a bit of thinko there.

Patch

Index: gcc-trunk/libgcc/Makefile.in
===================================================================
--- gcc-trunk/libgcc/Makefile.in        (revision 190125)
+++ gcc-trunk/libgcc/Makefile.in        (working copy)
@@ -207,7 +207,7 @@ 
 export toolexecdir
 export toolexeclibdir

-version := $(shell $(CC) -dumpversion)
+version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)

 ifeq ($(decimal_float),yes)
 ifeq ($(enable_decimal_float),bid)