public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Can't I build gcc with multilib support?
@ 2022-09-23  1:35 alexandre schenberg
  2022-09-23  9:35 ` Jonathan Wakely
  0 siblings, 1 reply; 4+ messages in thread
From: alexandre schenberg @ 2022-09-23  1:35 UTC (permalink / raw)
  To: gcc-help

Hi. I am facing a series of error messages when trying to build it with multilib.

/usr/bin/ld: skipping incompatible /media/34GB/Arquivos-de-Programas-Linux/Gcc-4.9.4/lib32//libgcc_s.so when searching for -lgcc_s
/usr/bin/ld: skipping incompatible /media/34GB/Arquivos-de-Programas-Linux/Gcc-4.9.4/lib32//libgcc_s.so when searching for -lgcc_s
checking for default BUILD_CONFIG... bootstrap-debug
checking for --enable-vtable-verify... no
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.3/libgcc.a when searching for -lgcc
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.3/libgcc.a when searching for -lgcc
/usr/bin/ld: cannot find -lgcc
collect2: ld returned 1 exit status
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.

This trying to run configure with:

LDFLAGS=-L/media/34GB/Arquivos-de-Programas-Linux/Gcc-4.9.4/lib32/ ../configure --prefix=/media/34GB/Arquivos-de-Programas-Linux/Gcc-4.9.4 --disable-checking --enable-languages=c,c++ --enable-multiarch --enable-multlib --with-multilib-list=m32,m64 --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu

If I remove the LDFLAGS above I receive:

/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.3/libgcc.a when searching for -lgcc
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.3/libgcc.a when searching for -lgcc
/usr/bin/ld: cannot find -lgcc
collect2: ld returned 1 exit status
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.

I have Gcc 4.9.4 installed in the dir mentioned above, but have a symbolic link to it on /usr/local/bin and a sym link to libstdc++.so.6.0.20 on /usr/lib32. I removed the system provided Gcc 4.4.3, but apparently it left behind libgcc.a and other stuff. No idea about why it is complaining about incompatible libgcc_s.so.

So, what needs to be done to fix it?


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Can't I build gcc with multilib support?
  2022-09-23  1:35 Can't I build gcc with multilib support? alexandre schenberg
@ 2022-09-23  9:35 ` Jonathan Wakely
  2022-09-24  1:03   ` alexandre schenberg
  0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Wakely @ 2022-09-23  9:35 UTC (permalink / raw)
  To: alexandre schenberg; +Cc: gcc-help

On Fri, 23 Sept 2022 at 02:36, alexandre schenberg via Gcc-help
<gcc-help@gcc.gnu.org> wrote:
>
> Hi. I am facing a series of error messages when trying to build it with multilib.
>
> /usr/bin/ld: skipping incompatible /media/34GB/Arquivos-de-Programas-Linux/Gcc-4.9.4/lib32//libgcc_s.so when searching for -lgcc_s
> /usr/bin/ld: skipping incompatible /media/34GB/Arquivos-de-Programas-Linux/Gcc-4.9.4/lib32//libgcc_s.so when searching for -lgcc_s
> checking for default BUILD_CONFIG... bootstrap-debug
> checking for --enable-vtable-verify... no
> /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.3/libgcc.a when searching for -lgcc
> /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.3/libgcc.a when searching for -lgcc
> /usr/bin/ld: cannot find -lgcc
> collect2: ld returned 1 exit status
> 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.
>
> This trying to run configure with:
>
> LDFLAGS=-L/media/34GB/Arquivos-de-Programas-Linux/Gcc-4.9.4/lib32/ ../configure --prefix=/media/34GB/Arquivos-de-Programas-Linux/Gcc-4.9.4 --disable-checking --enable-languages=c,c++ --enable-multiarch --enable-multlib --with-multilib-list=m32,m64 --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
>
> If I remove the LDFLAGS above I receive:
>
> /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.3/libgcc.a when searching for -lgcc
> /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.3/libgcc.a when searching for -lgcc
> /usr/bin/ld: cannot find -lgcc
> collect2: ld returned 1 exit status
> 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.
>
> I have Gcc 4.9.4 installed in the dir mentioned above, but have a symbolic link to it on /usr/local/bin and a sym link to libstdc++.so.6.0.20 on /usr/lib32. I removed the system provided Gcc 4.4.3, but apparently it left behind libgcc.a and other stuff. No idea about why it is complaining about incompatible libgcc_s.so.
>
> So, what needs to be done to fix it?

I'm not really sure what exactly you're doing. Which version of GCC
are you trying to build, 4.9.4? I thought you said you already have
that installed?

If you already have a multilib GCC installed correctly, it should be
able to find its own libgcc.a and libgcc_so.so without any LDFLAGS.

If you aren't using GCC 4.4.3 to build, ld should not be looking in
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/ at all.

So I would recheck your assumptions, something seems strange here.

Why not just reinstall the system provided 4.4.3 and use that to build?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re:Can't I build gcc with multilib support?
  2022-09-23  9:35 ` Jonathan Wakely
@ 2022-09-24  1:03   ` alexandre schenberg
       [not found]     ` <CAH6eHdTcPQEgqNPNhKBpwuDNv=Hhk=G7L2uLdm1nv387UjxYWA@mail.gmail.com>
  0 siblings, 1 reply; 4+ messages in thread
From: alexandre schenberg @ 2022-09-24  1:03 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: gcc-help

Yes, I am trying to build 4.9.4, again. I built it first with multilib support (probably with the help of 32bit libraries installed through the package manager).

However when I try to run any c++ 32bit program (c programs works fine), it ends with segmentation fault. I believe that is due to a conflict  between the 4.9.4 gcc/g++ and libstdc++.so.6.0.20 with the old libraries from gcc 4.4.3 on /usr/lib/...

Finally, I am not sure that only reinstall gcc 4.4.3 would solve it. Reinstall ia32 libs might do it, but first I have a few things to try.

To check Gcc configure.ac and look for the above error messages. Plus, I might created a backup copy of /usr/lib/gcc/x86_64-linux-gnu/4.4.3/ and replace it with /usr/lib/gcc/x86_64-linux-gnu/4.9.4. If that works, I won't even need to do a system wide 4.9.4 install, neither reinstall anything from the package manager (that I would have to uninstall again latter)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Can't I build gcc with multilib support?
       [not found]     ` <CAH6eHdTcPQEgqNPNhKBpwuDNv=Hhk=G7L2uLdm1nv387UjxYWA@mail.gmail.com>
@ 2022-09-24 10:19       ` Jonathan Wakely
  0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Wakely @ 2022-09-24 10:19 UTC (permalink / raw)
  To: alexandre schenberg; +Cc: gcc-help

On Sat, 24 Sept 2022 at 11:18, Jonathan Wakely wrote:
> If you won't do that, I would figure out why the libraries in /usr/libx86_64-linux-gnu/4.4.3 are even being considered by the linker. That's not a standard system path, so GCC 4.9.4 should not be looking in there.
>
> Compile with -v and -Wl,v -Wl,t to see wht paths are being passed to the linker, and which files the linker is looking at. Try that when compiling a C program, and when compiling a C++ program. Check that the 'gcc' nd 'g++' binaries are consistent. It sounds to me like you might have created some kind of hybrid of GCC 4.4.2 and 4.9.4!


And if none of that works, show us **exactly** the configure command
you're using, and the output of 'gcc -v' for all existing GCC
installations on the system, so we can see what's actually happening.
It's hard to debug it from your descriptions so far.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-09-24 10:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-23  1:35 Can't I build gcc with multilib support? alexandre schenberg
2022-09-23  9:35 ` Jonathan Wakely
2022-09-24  1:03   ` alexandre schenberg
     [not found]     ` <CAH6eHdTcPQEgqNPNhKBpwuDNv=Hhk=G7L2uLdm1nv387UjxYWA@mail.gmail.com>
2022-09-24 10:19       ` Can't " Jonathan Wakely

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).