Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 Sep 2009 00:00:07 GMT
From:      "Philip M. Gollucci" <pgollucci@FreeBSD.org>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   bin/139146: gcc -m32 doesn't quite work
Message-ID:  <200909260000.n8Q007bt037257@www.freebsd.org>
Resent-Message-ID: <200909260010.n8Q0A1p2092983@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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@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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200909260000.n8Q007bt037257>