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: 24,096

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 Fellow
Registered: 2012-01-15
Posts: 4,646

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

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

Offline

#5 2025-02-18 00:54:07

tpalmerstudios
Member
From: Chicago, Illinois
Registered: 2016-01-09
Posts: 4

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

He never marked SOLVED. Now I need this problem fixed sad


好好学习,天天向上。If you study, you will improve daily. Fedora 42 Now. Gone from Arch

Offline

#6 2025-02-18 06:02:53

schard
Forum Moderator
From: Hannover
Registered: 2016-05-06
Posts: 2,187
Website

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

This topic is almost five years old.
Please open a new topic for your specific issue.

Closing.


Inofficial first vice president of the Rust Evangelism Strike Force

Offline

Board footer

Powered by FluxBB