Bug 591035 - gcc -m32 error message not helpful
Summary: gcc -m32 error message not helpful
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 13
Hardware: x86_64
OS: Linux
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2010-05-11 09:49 UTC by Benjamin Otte
Modified: 2010-05-14 12:13 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2010-05-14 09:52:05 UTC
Type: ---

Attachments (Terms of Use)

Description Benjamin Otte 2010-05-11 09:49:31 UTC
Description of problem:
When compiling a simple file with gcc -m32 on a 64bit box, the error message is not very helpful.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Install a x86_64 system.
2. Install required i686 devel packages to build: glibc-devel.i686 is enough for a simple test program.
3. Run `gcc -m32 test.c` 
Actual results:
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.4.4/libgcc_s.so when searching for -lgcc_s
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.4.4/libgcc_s.so when searching for -lgcc_s
/usr/bin/ld: cannot find -lgcc_s
collect2: ld returned 1 exit status

Expected results:
The "libgcc.i686" package gets pulled in by glibc-devel.
Or at least I get an error message that hints at the problem. I'd even settle for ld reporting that usr/lib/gcc/x86_64-redhat-linux/4.4.4/32/libgcc_s.so is a dangling symlink.

Additional info:
I wanted to test some of my code on 32bit and googling showed that it's easy to achieve with CC="gcc -m32". When doing that, I ran into this problem and that took me quite a bit of time to figure this missing package out, as it's not at all obvious that it's not installed automatically.

Comment 1 Jakub Jelinek 2010-05-14 09:52:05 UTC
That error is from the linker, not from gcc.  And gcc certainly can't require the 32-bit devel packages in 64-bit gcc, they aren't necessary for building 64-bit code.

Comment 2 Benjamin Otte 2010-05-14 12:13:06 UTC
So you're saying it's intended behavior that by default gcc fails and the user is left with an unhelpful error message?

Note You need to log in before you can comment on or make changes to this bug.