diff mbox

Fix libgcc version for Canadian cross compile

Message ID 501BD9C5.9060106@users.sourceforge.net
State New
Headers show

Commit Message

JonY Aug. 3, 2012, 2:01 p.m. UTC
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?

Comments

Ian Lance Taylor Aug. 3, 2012, 2:37 p.m. UTC | #1
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. UTC | #2
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 Lance Taylor Aug. 3, 2012, 3:35 p.m. UTC | #3
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. UTC | #4
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 Lance Taylor Aug. 3, 2012, 11:42 p.m. UTC | #5
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. UTC | #6
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. UTC | #7
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. UTC | #8
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 Lance Taylor Aug. 4, 2012, 5:36 a.m. UTC | #9
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. UTC | #10
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.
diff mbox

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)