Bug 591035 - gcc -m32 error message not helpful
gcc -m32 error message not helpful
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: gcc (Show other bugs)
13
x86_64 Linux
low Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-05-11 05:49 EDT by Benjamin Otte
Modified: 2010-05-14 08:13 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-05-14 05:52:05 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Benjamin Otte 2010-05-11 05:49:31 EDT
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):
gcc-4.4.4-2

How reproducible:
always

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 05:52:05 EDT
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 08:13:06 EDT
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.