Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Wed, 4 Sep 2013 23:07:35 +0800
From: 邓尧 <>
Subject: Hidden symbol '__muldc3' referenced when compiled with gcc-4.8.1


I'm trying to build a musl based toolchain. My approach works well with
gcc-4.7.3, however when upgrading gcc to 4.8.1, I run into such problem.

Firstly comiple cross binutils:
    ../binutils-2.23.2/configure --prefix=... --target=...
    make && make DESTDIR=... install
Then compile cross gcc (compiler only)
    ../gcc-4.8.1/configure --prefix --target=... --with-sysroot=...
    make all-gcc && make DESTDIR=... install-gcc
Compile musl-0.9.13:
    CC=$TARGET-gcc CFLAGS=-O2 ./configure --prefix=..
    make && make DESTDIR=... install
Finally compile fully working cross compiler, this is where I got problems:
    ../gcc-4.8.1/configure --prefix --target=... --with-sysroot=...
    make && make DESTDIR=... install
In the final step, the build system will check whether the compiler (xgcc)
could create executable. xgcc failed when linking, showed some error
messages like the following:
x86_64-unknown-linux-musl/bin/ld: a.out: hidden symbol `__muldc3' in
musl/build/cross-4.8.1-gcc/./gcc/libgcc.a(_muldc3.o) is referenced by DSO.

It seems is referencing some hidden symbol defined in libgcc.a. The
linking problem could be resolved by statically linking libgcc when libc is
statically linked, and dynamic link libgcc when libc is dynamic linked.
However the dynamic loader (ld-musl) refuses to load dynamic linked
executables, and shows the following error messages:
Error relocating /lib64/ __muldc3: symbol not found
Error relocating /lib64/ __mulsc3: symbol not found
Error relocating /lib64/ __mulxc3: symbol not found

Statically linked executables seem to be fine.

Not sure whether it's a bug in gcc or musl, or it's simply a mistake in my
building process. Any ideas ?


Content of type "text/html" skipped

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.