Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Wed, 4 Sep 2013 13:26:50 -0400
From: Rich Felker <dalias@...ifal.cx>
To: musl@...ts.openwall.com
Subject: Re: Hidden symbol '__muldc3' referenced when compiled with
 gcc-4.8.1

On Thu, Sep 05, 2013 at 01:20:50AM +0800, 邓尧 wrote:
> >
> >
> > More details on this would be helpful.
> >
> 1. build binutils
> .../binutils-2.23.2/configure --disable-nls
> --prefix=/home/hoolala/musl/tools --disable-werror
> --target=x86_64-unknown-linux-musl --with-sysroot=/home/hoolala/musl/sysroot
> make && make install
> 
> 2. build gcc (compiler only):
> .../gcc-4.8.1/configure --prefix=/home/hoolala/musl/tools
> --target=x86_64-unknown-linux-musl
> --with-sysroot=/home/hoolala/musl/sysroot --disable-plugin --disable-lto
> --with-newlib --without-headers --with-local-prefix=/usr --disable-nls
> --disable-multilib --disable-decimal-float --disable-threads
> --disable-libmudflap --disable-libssp --disable-libgomp
> --disable-libquadmath --enable-languages=c --disable-libstdcxx
> --disable-static --enable-shared
  ^^^^^^^^^^^^^^^^

Here is your problem. You built a gcc that's missing libgcc.a....

> make all-gcc && make install-gcc
> 
> 3. build musl
> ../configure --prefix=/usr --libdir=/usr/lib/x86_64-unknown-linux-musl
> --includedir=/usr/include --disable-gcc-wrapper
> make && make DESTDIR=/home/hoolala/musl/sysroot install
> 
> 4. build gcc:
> this time, gcc is configure'd exactly the same as last time, but built &
> installed with command:
> make && make install
> 
> 
> > > It seems libc.so is referencing some hidden symbol defined in libgcc.a.
> > The
> >
> > What it means is that libc.so was linked incorrectly and does not have
> > its own (should be hidden) copy of __muldc3 and other libgcc functions
> > in it. Could you show us your config.mak from building musl?
> >
> 
> The following is the generated config.mak
> 
> # This version of config.mak was generated by:
> # ./configure --prefix=/usr --libdir=/usr/lib/x86_64-unknown-linux-musl
> --includedir=/usr/include --disable-gcc-wrapper
> # Any changes made here will be lost if configure is re-run
> ARCH = x86_64
> SUBARCH =
> ASMSUBARCH =
> prefix = /usr
> exec_prefix = $(prefix)
> bindir = $(exec_prefix)/bin
> libdir = /usr/lib/x86_64-unknown-linux-musl
> includedir = /usr/include
> syslibdir = /lib
> CC = x86_64-unknown-linux-musl-gcc
> CFLAGS= -pipe -fomit-frame-pointer -fno-unwind-tables
> -fno-asynchronous-unwind-tables -Wa,--noexecstack
> -Werror=implicit-function-declaration -Werror=implicit-int
> -Werror=pointer-sign -Werror=pointer-arith -fno-stack-protector -O2
> CFLAGS_C99FSE = -std=c99 -nostdinc -ffreestanding
> -fexcess-precision=standard -frounding-math
> CFLAGS_MEMOPS = -fno-tree-loop-distribute-patterns
> CPPFLAGS =
> LDFLAGS = -Wl,--hash-style=both
> CROSS_COMPILE =
> LIBCC =
  ^^^^^^^^

So musl was unable to obtain and link to libgcc.a.

Rich

Powered by blists - more mailing lists

Your e-mail address:

Powered by Openwall GNU/*/Linux - Powered by OpenVZ