This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GCC configure problem with 32-bit stuff on x86_64


On 11/14/05, Kai Ruottu <karuottu@mbnet.fi> wrote:
> You didn't tell your "x86_64 system" type but let's guess it being
> Linux, not FreeBSD, NetBSD or something else...
>

You guessed correctly, it is a Linux system. Sorry about that...

> Just (pre)install the 32-bit C libraries, they should be in '/lib'
> and '/usr/lib' in the Linux case. The default 64-bit libs then are
> normally in '/lib64' and '/usr/lib64'.

For some reason I have */lib for the 64-bit libs, */lib32 for 32-bit,
and */lib64 symlinked to */lib.

> And you can always preinstall only the 'gcc' components from the
> '$build/gcc' directory via 'make install-gcc' and then try compiling
> and linking a "Hello World" using '-m32', to see if creating 32-bit
> executables will succeed. If not, try to fix the problem before going
> to configure libiberty and libstdc++... If you cannot invent the fix,
> just tell what errors you will get during the "Hello World" linking
> and let people to guess the problem. Using the '-Wl,-verbose' in the
> GCC command line, giving '-verbose' to the GNU linker, could also help
> a lot...

I tried exactly that, after building as much as I could. The command
and output are:


$ x86_64-unknown-linux-gnu-gcc-4.0.2 -o hello -m32 -L/lib32/ -v hello.c
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4.0.2/configure
Thread model: posix
gcc version 4.0.2
 /usr/local/libexec/gcc/x86_64-unknown-linux-gnu/4.0.2/cc1 -quiet -v
hello.c -quiet -dumpbase hello.c -m32 -mtune=k8 -auxbase hello
-version -o /tmp/cc9cB9N0.s
ignoring nonexistent directory "NONE/include"
ignoring nonexistent directory
"/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.0.2/../../../../x86_64-unknown-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.0.2/include
 /usr/include
End of search list.
GNU C version 4.0.2 (x86_64-unknown-linux-gnu)
        compiled by GNU C version 3.3.5 (Debian 1:3.3.5-8ubuntu2).
GGC heuristics: --param ggc-min-expand=98 --param ggc-min-heapsize=128234
 as -V -Qy --32 -o /tmp/cc03Pm1W.o /tmp/cc9cB9N0.s
GNU assembler version 2.15 (x86_64-linux) using BFD version 2.15
 /usr/local/libexec/gcc/x86_64-unknown-linux-gnu/4.0.2/collect2
--eh-frame-hdr -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o hello
/usr/lib/../lib/crt1.o /usr/lib/../lib/crti.o
/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.0.2/32/crtbegin.o
-L/lib32/ -L/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.0.2/32
-L/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.0.2
-L/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.0.2/../../../../lib
-L/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.0.2/../../..
-L/lib/../lib -L/usr/lib/../lib /tmp/cc03Pm1W.o -lgcc --as-needed
-lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed
/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.0.2/32/crtend.o
/usr/lib/../lib/crtn.o
/usr/bin/ld: warning: i386:x86-64 architecture of input file
`/usr/lib/../lib/crt1.o' is incompatible with i386 output
/usr/bin/ld: warning: i386:x86-64 architecture of input file
`/usr/lib/../lib/crti.o' is incompatible with i386 output
/usr/bin/ld: warning: i386:x86-64 architecture of input file
`/usr/lib/../lib/crtn.o' is incompatible with i386 output
/usr/lib/../lib/crt1.o(.text+0x13): In function `_start':
../sysdeps/x86_64/elf/start.S:89: undefined reference to `__libc_csu_fini'
/usr/lib/../lib/crt1.o(.text+0x1a):../sysdeps/x86_64/elf/start.S:90:
undefined reference to `__libc_csu_init'
collect2: ld returned 1 exit status

Any help would be appreciated.

Chris Lu


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]