Re: [RFC, patch] Detect lack of 32-bit devel environment on x86_64-linux targets

2014-02-12 Thread Richard Biener
On Wed, Feb 12, 2014 at 11:57 AM, Jakub Jelinek  wrote:
> On Wed, Feb 12, 2014 at 11:52:47AM +0100, Richard Biener wrote:
>> On Tue, Feb 11, 2014 at 5:17 PM, Jakub Jelinek  wrote:
>> > On Fri, Jan 31, 2014 at 03:49:40PM +0100, Richard Biener wrote:
>> >> On Fri, Jan 31, 2014 at 3:45 PM, FX  wrote:
>> >> >> I've just seen that an explicit --enable-multilib is a way to do that.
>> >> >
>> >> > Yes, I was writing that as a reply when I received your email. (Also, 
>> >> > it's written in the configure error message.)
>> >>
>> >> Yeah - you know, that message is quite long and somehow I didn't read it
>> >> carefully.  I suspect that will happen to others, too, so we'll get some
>> >> extra complaints from that ;)
>> >>
>> >> >> Btw, doing the configure check exactly after all-stage1-gcc should be
>> >> >> an early enough and a serialization point, no?  There you can do the
>> >> >> check even for when cross-compiling.
>> >> >
>> >> > Well, you've already built a whole stage, so it's not so early, is it?
>> >>
>> >> Well, building the stage1 compiler is probably the fastest thing nowadays
>> >> (it didn't yet build the target libraries for stage1 with the stage1,
>> >> unoptimized
>> >> and checking-enabled compiler - which is where it would fail in the odd
>> >> way which is what you want to improve).
>> >>
>> >> As I said, you can't "properly" check it at the point you are checking.
>> >> Which is why I complain - you're not checking this properly!
>> >>
>> >> Anyway, I've fixed the "bug" on our side with --enable-multilib.
>> >
>> > Just hit the same thing, while I have (in mock) 32-bit devel libc 
>> > installed,
>> > I don't have 32-bit libgcc_s installed (what for, it will be built by gcc).
>> >
>> > Please revert it, or at least improve it (e.g. by trying to build
>> > with -static-libgcc at least).
>>
>> I wouldn't have static 32bit libgcc installed either.
>
> So perhaps turn that into a check if preprocessing of #include 
> works with -m32 (and never complain when building --with-sysroot*)?
> I mean, if features.h doesn't preprocess successfully (because of missing
> /usr/include/gnu/stubs-32.h), then as long as the compiler is going to
> include the same headers and not some sysroot, multilib building would fail
> in that case too.

That sounds good to me.  Though it still wouldn't work with a
non-multilib built host compiler (maybe detect that and just warn
but not abort for that case?).

Richard.

> Jakub


Re: [RFC, patch] Detect lack of 32-bit devel environment on x86_64-linux targets

2014-02-12 Thread Jakub Jelinek
On Wed, Feb 12, 2014 at 11:52:47AM +0100, Richard Biener wrote:
> On Tue, Feb 11, 2014 at 5:17 PM, Jakub Jelinek  wrote:
> > On Fri, Jan 31, 2014 at 03:49:40PM +0100, Richard Biener wrote:
> >> On Fri, Jan 31, 2014 at 3:45 PM, FX  wrote:
> >> >> I've just seen that an explicit --enable-multilib is a way to do that.
> >> >
> >> > Yes, I was writing that as a reply when I received your email. (Also, 
> >> > it's written in the configure error message.)
> >>
> >> Yeah - you know, that message is quite long and somehow I didn't read it
> >> carefully.  I suspect that will happen to others, too, so we'll get some
> >> extra complaints from that ;)
> >>
> >> >> Btw, doing the configure check exactly after all-stage1-gcc should be
> >> >> an early enough and a serialization point, no?  There you can do the
> >> >> check even for when cross-compiling.
> >> >
> >> > Well, you've already built a whole stage, so it's not so early, is it?
> >>
> >> Well, building the stage1 compiler is probably the fastest thing nowadays
> >> (it didn't yet build the target libraries for stage1 with the stage1,
> >> unoptimized
> >> and checking-enabled compiler - which is where it would fail in the odd
> >> way which is what you want to improve).
> >>
> >> As I said, you can't "properly" check it at the point you are checking.
> >> Which is why I complain - you're not checking this properly!
> >>
> >> Anyway, I've fixed the "bug" on our side with --enable-multilib.
> >
> > Just hit the same thing, while I have (in mock) 32-bit devel libc installed,
> > I don't have 32-bit libgcc_s installed (what for, it will be built by gcc).
> >
> > Please revert it, or at least improve it (e.g. by trying to build
> > with -static-libgcc at least).
> 
> I wouldn't have static 32bit libgcc installed either.

So perhaps turn that into a check if preprocessing of #include 
works with -m32 (and never complain when building --with-sysroot*)?
I mean, if features.h doesn't preprocess successfully (because of missing
/usr/include/gnu/stubs-32.h), then as long as the compiler is going to
include the same headers and not some sysroot, multilib building would fail
in that case too.

Jakub


Re: [RFC, patch] Detect lack of 32-bit devel environment on x86_64-linux targets

2014-02-12 Thread Richard Biener
On Tue, Feb 11, 2014 at 5:17 PM, Jakub Jelinek  wrote:
> On Fri, Jan 31, 2014 at 03:49:40PM +0100, Richard Biener wrote:
>> On Fri, Jan 31, 2014 at 3:45 PM, FX  wrote:
>> >> I've just seen that an explicit --enable-multilib is a way to do that.
>> >
>> > Yes, I was writing that as a reply when I received your email. (Also, it's 
>> > written in the configure error message.)
>>
>> Yeah - you know, that message is quite long and somehow I didn't read it
>> carefully.  I suspect that will happen to others, too, so we'll get some
>> extra complaints from that ;)
>>
>> >> Btw, doing the configure check exactly after all-stage1-gcc should be
>> >> an early enough and a serialization point, no?  There you can do the
>> >> check even for when cross-compiling.
>> >
>> > Well, you've already built a whole stage, so it's not so early, is it?
>>
>> Well, building the stage1 compiler is probably the fastest thing nowadays
>> (it didn't yet build the target libraries for stage1 with the stage1,
>> unoptimized
>> and checking-enabled compiler - which is where it would fail in the odd
>> way which is what you want to improve).
>>
>> As I said, you can't "properly" check it at the point you are checking.
>> Which is why I complain - you're not checking this properly!
>>
>> Anyway, I've fixed the "bug" on our side with --enable-multilib.
>
> Just hit the same thing, while I have (in mock) 32-bit devel libc installed,
> I don't have 32-bit libgcc_s installed (what for, it will be built by gcc).
>
> Please revert it, or at least improve it (e.g. by trying to build
> with -static-libgcc at least).

I wouldn't have static 32bit libgcc installed either.

Richard.


Re: [RFC, patch] Detect lack of 32-bit devel environment on x86_64-linux targets

2014-02-11 Thread Jakub Jelinek
On Fri, Jan 31, 2014 at 03:49:40PM +0100, Richard Biener wrote:
> On Fri, Jan 31, 2014 at 3:45 PM, FX  wrote:
> >> I've just seen that an explicit --enable-multilib is a way to do that.
> >
> > Yes, I was writing that as a reply when I received your email. (Also, it's 
> > written in the configure error message.)
> 
> Yeah - you know, that message is quite long and somehow I didn't read it
> carefully.  I suspect that will happen to others, too, so we'll get some
> extra complaints from that ;)
> 
> >> Btw, doing the configure check exactly after all-stage1-gcc should be
> >> an early enough and a serialization point, no?  There you can do the
> >> check even for when cross-compiling.
> >
> > Well, you've already built a whole stage, so it's not so early, is it?
> 
> Well, building the stage1 compiler is probably the fastest thing nowadays
> (it didn't yet build the target libraries for stage1 with the stage1,
> unoptimized
> and checking-enabled compiler - which is where it would fail in the odd
> way which is what you want to improve).
> 
> As I said, you can't "properly" check it at the point you are checking.
> Which is why I complain - you're not checking this properly!
> 
> Anyway, I've fixed the "bug" on our side with --enable-multilib.

Just hit the same thing, while I have (in mock) 32-bit devel libc installed,
I don't have 32-bit libgcc_s installed (what for, it will be built by gcc).

Please revert it, or at least improve it (e.g. by trying to build
with -static-libgcc at least).

Jakub


Re: [RFC, patch] Detect lack of 32-bit devel environment on x86_64-linux targets

2014-01-31 Thread Joseph S. Myers
On Fri, 31 Jan 2014, Richard Biener wrote:

> Still I think this is odd behavior - as you are matching x86_64-*linux
> you can as well check for /usr/include/gnu/stub{,-64}.h.  I don't know

On Ubuntu those are in /usr/include/x86_64-linux-gnu/gnu/ (and I suppose 
the 32-bit one is /usr/include/i386-linux-gnu/gnu/ but haven't checked).

-- 
Joseph S. Myers
jos...@codesourcery.com


Re: [RFC, patch] Detect lack of 32-bit devel environment on x86_64-linux targets

2014-01-31 Thread FX
> As I said, you can't "properly" check it at the point you are checking.
> Which is why I complain - you're not checking this properly!

This is understood. There is a choice to be made, between an early check (which 
will benefit our casual users) catching this particular special case, and a 
later check. I argued for an earlier check, because it was a particular 
annoying and particularly un-user-friendly error, and wrote the check in a way 
to minimize the number of false negatives. But, as you say, it is not possible 
to write a perfect check at that early point.

FX

Re: [RFC, patch] Detect lack of 32-bit devel environment on x86_64-linux targets

2014-01-31 Thread Richard Biener
On Fri, Jan 31, 2014 at 3:45 PM, FX  wrote:
>> I've just seen that an explicit --enable-multilib is a way to do that.
>
> Yes, I was writing that as a reply when I received your email. (Also, it's 
> written in the configure error message.)

Yeah - you know, that message is quite long and somehow I didn't read it
carefully.  I suspect that will happen to others, too, so we'll get some
extra complaints from that ;)

>> Btw, doing the configure check exactly after all-stage1-gcc should be
>> an early enough and a serialization point, no?  There you can do the
>> check even for when cross-compiling.
>
> Well, you've already built a whole stage, so it's not so early, is it?

Well, building the stage1 compiler is probably the fastest thing nowadays
(it didn't yet build the target libraries for stage1 with the stage1,
unoptimized
and checking-enabled compiler - which is where it would fail in the odd
way which is what you want to improve).

As I said, you can't "properly" check it at the point you are checking.
Which is why I complain - you're not checking this properly!

Anyway, I've fixed the "bug" on our side with --enable-multilib.

Richard.

>
> FX


Re: [RFC, patch] Detect lack of 32-bit devel environment on x86_64-linux targets

2014-01-31 Thread FX
> I've just seen that an explicit --enable-multilib is a way to do that.

Yes, I was writing that as a reply when I received your email. (Also, it’s 
written in the configure error message.)


> Btw, doing the configure check exactly after all-stage1-gcc should be
> an early enough and a serialization point, no?  There you can do the
> check even for when cross-compiling.

Well, you’ve already built a whole stage, so it’s not so early, is it?


FX

Re: [RFC, patch] Detect lack of 32-bit devel environment on x86_64-linux targets

2014-01-31 Thread Richard Biener
On Fri, Jan 31, 2014 at 3:40 PM, Richard Biener
 wrote:
> On Fri, Jan 31, 2014 at 3:33 PM, Richard Biener
>  wrote:
>> On Fri, Dec 13, 2013 at 10:47 PM, FX  wrote:
 The patch is okay, but if other architecture maintainers could add
 similar checks for their ports (SPARC and PPC, I guess), it would be nice.
>>>
>>> Thanks, committed as rev. 205975
>>>
>>> Adding other systems to the list of checks will be easy, once the 
>>> maintainers confirm that they want to opt in into it.
>>
>> In our default build environment for package building GCC no longer builds
>> because of this:
>>
>> [  152s] 
>> /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/
>> ld: skipping incompatible /usr/lib64/gcc/x86_64-suse-linux/4.8/libgcc.a when 
>> sea
>> rching for -lgcc
>> [  152s] 
>> /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/
>> ld: cannot find -lgcc
>> [  152s] 
>> /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld:
>> skipping incompatible /usr/lib64/gcc/x86_64-suse-linux/4.8/libgcc_s.so
>> when searching for -lgcc_s
>> [  152s] 
>> /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld:
>> cannot find -lgcc_s
>> [  152s] collect2: error: ld returned 1 exit status
>> [  152s] configure: error: I suspect your system does not have 32-bit
>> developement libraries (libc and headers). If you have them, rerun
>> configure with --enable-multilib. If you do not have them, and want to
>> build a 64-bit-only compiler, rerun configure with --disable-multilib.
>>
>> the issue is that while we do have 32bit glibc support installed but not all
>> required files for the host compiler to produce 32bit executables - which
>> isn't needed - the compiler we bootstrap will have all the support for this.
>>
>> In fact, a x86_64 multilib GCC can be just bootstrapped fine with a
>> non-multilib x86_64 compiler which you also disallow with the above check.
>>
>> I don't see how you can do this configure check in its current form early,
>> before you've built the stage1 compiler.
>>
>> So - please consider reverting this patch or at least provide a way to
>> override the check.
>
> I've just seen that an explicit --enable-multilib is a way to do that.
>
> Still I think this is odd behavior - as you are matching x86_64-*linux
> you can as well check for /usr/include/gnu/stub{,-64}.h.  I don't know
> of any distribution where you can have the header package installed
> without the corresponding libraries.

Btw, doing the configure check exactly after all-stage1-gcc should be
an early enough and a serialization point, no?  There you can do the
check even for when cross-compiling.

Richard.

> Richard.
>
>> Thanks,
>> Richard.
>>
>>
>>
>>> FX


Re: [RFC, patch] Detect lack of 32-bit devel environment on x86_64-linux targets

2014-01-31 Thread Richard Biener
On Fri, Jan 31, 2014 at 3:33 PM, Richard Biener
 wrote:
> On Fri, Dec 13, 2013 at 10:47 PM, FX  wrote:
>>> The patch is okay, but if other architecture maintainers could add
>>> similar checks for their ports (SPARC and PPC, I guess), it would be nice.
>>
>> Thanks, committed as rev. 205975
>>
>> Adding other systems to the list of checks will be easy, once the 
>> maintainers confirm that they want to opt in into it.
>
> In our default build environment for package building GCC no longer builds
> because of this:
>
> [  152s] 
> /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/
> ld: skipping incompatible /usr/lib64/gcc/x86_64-suse-linux/4.8/libgcc.a when 
> sea
> rching for -lgcc
> [  152s] 
> /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/
> ld: cannot find -lgcc
> [  152s] 
> /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld:
> skipping incompatible /usr/lib64/gcc/x86_64-suse-linux/4.8/libgcc_s.so
> when searching for -lgcc_s
> [  152s] 
> /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld:
> cannot find -lgcc_s
> [  152s] collect2: error: ld returned 1 exit status
> [  152s] configure: error: I suspect your system does not have 32-bit
> developement libraries (libc and headers). If you have them, rerun
> configure with --enable-multilib. If you do not have them, and want to
> build a 64-bit-only compiler, rerun configure with --disable-multilib.
>
> the issue is that while we do have 32bit glibc support installed but not all
> required files for the host compiler to produce 32bit executables - which
> isn't needed - the compiler we bootstrap will have all the support for this.
>
> In fact, a x86_64 multilib GCC can be just bootstrapped fine with a
> non-multilib x86_64 compiler which you also disallow with the above check.
>
> I don't see how you can do this configure check in its current form early,
> before you've built the stage1 compiler.
>
> So - please consider reverting this patch or at least provide a way to
> override the check.

I've just seen that an explicit --enable-multilib is a way to do that.

Still I think this is odd behavior - as you are matching x86_64-*linux
you can as well check for /usr/include/gnu/stub{,-64}.h.  I don't know
of any distribution where you can have the header package installed
without the corresponding libraries.

Richard.

> Thanks,
> Richard.
>
>
>
>> FX


Re: [RFC, patch] Detect lack of 32-bit devel environment on x86_64-linux targets

2014-01-31 Thread Richard Biener
On Fri, Dec 13, 2013 at 10:47 PM, FX  wrote:
>> The patch is okay, but if other architecture maintainers could add
>> similar checks for their ports (SPARC and PPC, I guess), it would be nice.
>
> Thanks, committed as rev. 205975
>
> Adding other systems to the list of checks will be easy, once the maintainers 
> confirm that they want to opt in into it.

In our default build environment for package building GCC no longer builds
because of this:

[  152s] /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/
ld: skipping incompatible /usr/lib64/gcc/x86_64-suse-linux/4.8/libgcc.a when sea
rching for -lgcc
[  152s] /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/
ld: cannot find -lgcc
[  152s] 
/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld:
skipping incompatible /usr/lib64/gcc/x86_64-suse-linux/4.8/libgcc_s.so
when searching for -lgcc_s
[  152s] 
/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld:
cannot find -lgcc_s
[  152s] collect2: error: ld returned 1 exit status
[  152s] configure: error: I suspect your system does not have 32-bit
developement libraries (libc and headers). If you have them, rerun
configure with --enable-multilib. If you do not have them, and want to
build a 64-bit-only compiler, rerun configure with --disable-multilib.

the issue is that while we do have 32bit glibc support installed but not all
required files for the host compiler to produce 32bit executables - which
isn't needed - the compiler we bootstrap will have all the support for this.

In fact, a x86_64 multilib GCC can be just bootstrapped fine with a
non-multilib x86_64 compiler which you also disallow with the above check.

I don't see how you can do this configure check in its current form early,
before you've built the stage1 compiler.

So - please consider reverting this patch or at least provide a way to
override the check.

Thanks,
Richard.



> FX


Re: [RFC, patch] Detect lack of 32-bit devel environment on x86_64-linux targets

2013-12-13 Thread FX
> The patch is okay, but if other architecture maintainers could add
> similar checks for their ports (SPARC and PPC, I guess), it would be nice.

Thanks, committed as rev. 205975

Adding other systems to the list of checks will be easy, once the maintainers 
confirm that they want to opt in into it.

FX

Re: [RFC, patch] Detect lack of 32-bit devel environment on x86_64-linux targets

2013-12-10 Thread Paolo Bonzini
Il 09/12/2013 12:08, Gerald Pfeifer ha scritto:
> On Mon, 9 Dec 2013, FX wrote:
>> > Look at this as a diagnostics bug: our current diagnostics for this 
>> > pretty common situation sucks. It comes late in the compilation, and 
>> > the message itself isn’t helpful.
> Totally seconded.
> 
> Paolo, I have been running into this myself and was confused at
> first.  If that happens to me, building GCC for some 20 years,
> imagine a new user.
> 
> This is really something to be identified at configure time,
> with a reasonable error message.
> 
> If FX's specific patch is not ideal yet, can you help rework it?
> That would be great.

The patch is okay, but if other architecture maintainers could add
similar checks for their ports (SPARC and PPC, I guess), it would be nice.

Paolo


Re: [RFC, patch] Detect lack of 32-bit devel environment on x86_64-linux targets

2013-12-10 Thread Richard Henderson
On 12/09/2013 02:46 AM, Gerald Pfeifer wrote:
> Hmm, it looks like this has not been approved/applied, but I also
> have not seen any NACK.
> 
> This does address an annoying (and hard for novices to understand)
> roadblock for someone installing GCC manually.  Can this go in?

The patch looks ok to me.

Totally agreed with down-thread re avoiding messages to gcc-help for the 99%.


r~


Re: [RFC, patch] Detect lack of 32-bit devel environment on x86_64-linux targets

2013-12-09 Thread Gerald Pfeifer
On Mon, 9 Dec 2013, FX wrote:
> Look at this as a diagnostics bug: our current diagnostics for this 
> pretty common situation sucks. It comes late in the compilation, and 
> the message itself isn’t helpful.

Totally seconded.

Paolo, I have been running into this myself and was confused at
first.  If that happens to me, building GCC for some 20 years,
imagine a new user.

This is really something to be identified at configure time,
with a reasonable error message.

If FX's specific patch is not ideal yet, can you help rework it?
That would be great.

Gerald

Re: [RFC, patch] Detect lack of 32-bit devel environment on x86_64-linux targets

2013-12-09 Thread FX
> I'm not sure why this should be different for x86_64 compared to all
> other bi-arch toolchains?

It’s not, but it’s a particularly common one and has been reported multiple 
times here and on gcc-help. If we can help these users early, we spare 
ourselves the time to reply to such reports. (Also, documentation and this 
patch are not exclusive: in fact, I have also submitted a doc patch to make 
things clearer.)

> I think the right place for this is a "Non-bugs" section in the
> installation manual.

Look at this as a diagnostics bug: our current diagnostics for this pretty 
common situation sucks. It comes late in the compilation, and the message 
itself isn’t helpful.

FX

Re: [RFC, patch] Detect lack of 32-bit devel environment on x86_64-linux targets

2013-12-09 Thread Paolo Bonzini
Il 09/12/2013 11:46, Gerald Pfeifer ha scritto:
> Hmm, it looks like this has not been approved/applied, but I also
> have not seen any NACK.
> 
> This does address an annoying (and hard for novices to understand)
> roadblock for someone installing GCC manually.  Can this go in?

I'm not sure why this should be different for x86_64 compared to all
other bi-arch toolchains?

I think the right place for this is a "Non-bugs" section in the
installation manual.

Paolo