You are not logged in.

#1 2020-03-29 01:17:09

vcapra1
Member
Registered: 2020-03-29
Posts: 2

Can't compile 32-bit binaries with gcc

I cannot compile 32-bit binaries with gcc.  I get the following errors:

$ gcc -m32 test.c  
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-pc-linux-gnu/8.4.0/libgcc.a when searching for -lgcc
/usr/bin/ld: cannot find -lgcc
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-pc-linux-gnu/8.4.0/libgcc_s.so.1 when searching for libgcc_s.so.1
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-pc-linux-gnu/8.4.0/libgcc.a when searching for -lgcc
/usr/bin/ld: cannot find -lgcc
collect2: error: ld returned 1 exit status

I know I used to be able to do this, but recently it stopped working.  The following packages are installed:

lib32-gcc-libs 9.3.0-1
lib32-libltdl 2.4.6+42+gb88cebd5-1
lib32-glib2 2.64.1-1y
lib32-fakeroot 1.24-1

Obviously there are others installed but these are the ones that I've read need to be installed when researching this problem.

Thanks in advance

Offline

#2 2020-03-29 09:38:08

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 12,211

Re: Can't compile 32-bit binaries with gcc

Why is it trying to load/find libraries for a 8.4 version of gcc?

type -a gcc
pacman -Qs gcc
printenv

Last edited by V1del (2020-03-29 09:39:03)

Offline

#3 2020-03-29 14:22:34

vcapra1
Member
Registered: 2020-03-29
Posts: 2

Re: Can't compile 32-bit binaries with gcc

Well, now I feel dumb.  I worked with Nvidia CUDA a long time ago and during some changes to my ~.profile config, I must have accidentally put the cuda/bin folder before /usr/bin and /bin, so it was using the wrong gcc.  Removing that fixed the problem, thanks!

Offline

#4 2020-03-29 22:42:49

2ManyDogs
Forum Moderator
Registered: 2012-01-15
Posts: 3,533

Re: Can't compile 32-bit binaries with gcc

Please remember to mark your thread [SOLVED] (edit the title of your first post).


"The prettier the user interface, and the fewer odd replies the system allows you to make, the dumber you once appeared in the mind of the designer." -- Ellen Ullman
-----
How to post

Offline

Board footer

Powered by FluxBB