When I try to compile a simple 32-bit C program using GCC on 64-bit Linux, I get the following message:
[teo.samarzija@teos-acer-laptop debug]$ gcc -m32 -o program program.c
/usr/local/bin/../libexec/gcc/x86_64-pc-linux-gnu/8.3.1/ld: skipping incompatible /usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/8.3.1/libgcc.a when searching for -lgcc
/usr/local/bin/../libexec/gcc/x86_64-pc-linux-gnu/8.3.1/ld: /usr/local/lib/gcc/x86_64-pc-linux-gnu/8.3.1/32/libgcc.a(_muldi3.o): unable to initialize decompress status for section .debug_info
/usr/local/bin/../libexec/gcc/x86_64-pc-linux-gnu/8.3.1/ld: /usr/local/lib/gcc/x86_64-pc-linux-gnu/8.3.1/32/libgcc.a(_muldi3.o): unable to initialize decompress status for section .debug_info
/usr/local/bin/../libexec/gcc/x86_64-pc-linux-gnu/8.3.1/ld: skipping incompatible /usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/8.3.1/libgcc.a when searching for -lgcc
/usr/local/bin/../libexec/gcc/x86_64-pc-linux-gnu/8.3.1/ld: /usr/local/lib/gcc/x86_64-pc-linux-gnu/8.3.1/32/libgcc.a(_muldi3.o): unable to initialize decompress status for section .debug_info
/usr/local/bin/../libexec/gcc/x86_64-pc-linux-gnu/8.3.1/ld: /usr/local/lib/gcc/x86_64-pc-linux-gnu/8.3.1/32/libgcc.a(_muldi3.o): unable to initialize decompress status for section .debug_info
/usr/local/bin/../libexec/gcc/x86_64-pc-linux-gnu/8.3.1/ld: skipping incompatible /usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/8.3.1/libgcc.a when searching for -lgcc
/usr/local/bin/../libexec/gcc/x86_64-pc-linux-gnu/8.3.1/ld: /usr/local/lib/gcc/x86_64-pc-linux-gnu/8.3.1/32/libgcc.a(_muldi3.o): unable to initialize decompress status for section .debug_info
/usr/local/bin/../libexec/gcc/x86_64-pc-linux-gnu/8.3.1/ld: /usr/local/lib/gcc/x86_64-pc-linux-gnu/8.3.1/32/libgcc.a(_muldi3.o): unable to initialize decompress status for section .debug_info
/usr/local/bin/../libexec/gcc/x86_64-pc-linux-gnu/8.3.1/ld: skipping incompatible /usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/8.3.1/libgcc.a when searching for -lgcc
/usr/local/bin/../libexec/gcc/x86_64-pc-linux-gnu/8.3.1/ld: /usr/local/lib/gcc/x86_64-pc-linux-gnu/8.3.1/32/libgcc.a(_muldi3.o): unable to initialize decompress status for section .debug_info
/usr/local/bin/../libexec/gcc/x86_64-pc-linux-gnu/8.3.1/ld: /usr/local/lib/gcc/x86_64-pc-linux-gnu/8.3.1/32/libgcc.a(_muldi3.o): unable to initialize decompress status for section .debug_info
/usr/local/bin/../libexec/gcc/x86_64-pc-linux-gnu/8.3.1/ld: i386:x86-64 architecture of input file `/usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/8.3.1/crtbegin.o' is incompatible with i386 output
/usr/local/bin/../libexec/gcc/x86_64-pc-linux-gnu/8.3.1/ld: i386:x86-64 architecture of input file `/usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/8.3.1/crtend.o' is incompatible with i386 output
collect2: error: ld returned 1 exit status
What should I do?
Looking at another GPS-related question, it seems that GPS comes with GCC compiled without support for multilib. If you run gcc -v
, you'll notice the --disable-multilib
option mentioned in the output.
I suppose you're out of luck then. You'll either have to build GCC yourself, or install it from some other source unrelated to GPS: e.g. from the repositories of your Linux distribution. Then you'll have to somehow tell GPS to use this other version of GCC.