bin/139146: gcc -m32 doesn't quite work
Philip M. Gollucci
pgollucci at FreeBSD.org
Sat Sep 26 00:10:02 UTC 2009
>Number: 139146
>Category: bin
>Synopsis: gcc -m32 doesn't quite work
>Confidential: no
>Severity: critical
>Priority: medium
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sat Sep 26 00:10:01 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator: Philip M. Gollucci
>Release: FreeBSD 7.2-STABLE
>Organization:
Apache Software Foundation
>Environment:
FreeBSD minotaur.apache.org 7.2-STABLE FreeBSD 7.2-STABLE #0: Wed Aug 5 01:05:27 UTC 2009 root at loki.apache.org:/usr/obj/usr/src/sys/MINOTAUR amd64
>Description:
https://issues.apache.org/jira/browse/INFRA-2077
gcc can successfully generate 64-bit binaries but when invoked with the -m32 option to generate 32-bit code the linker fails to find the corresponding 32-bit libgcc.so (see below). It appears as though the compiler driver doesn't pass -L/usr/lib32 (the location of the 32-bit libgcc) to the linker. Unfortunately, specifying -L/usr/lib32 manually gives the error: /usr/bin/ld: skipping incompatible /usr/lib/libgcc.a when searching for -lgcc.
>How-To-Repeat:
$ uname -sr && echo "int main () { }" > t.c && gcc -v --help 2>&1 | grep m32 && gcc -m32 t.c
FreeBSD 7.2-STABLE
-m32 Generate 32bit i386 code
/usr/bin/ld: skipping incompatible /usr/lib/libgcc.a when searching for -lgcc
/usr/bin/ld: skipping incompatible /usr/lib/libgcc.a when searching for -lgcc
/usr/bin/ld: cannot find -lgcc
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list