mailing list of musl libc
 help / color / mirror / code / Atom feed
* Unable to build with --enable-shared
@ 2016-10-22 20:37 Samuel Sadok
  2016-10-22 21:58 ` Szabolcs Nagy
  0 siblings, 1 reply; 8+ messages in thread
From: Samuel Sadok @ 2016-10-22 20:37 UTC (permalink / raw)
  To: musl

Hi!

I am unable to build musl with --enable-shared. Multiple issues in
unrelated projects (e.g. here: https://bugs.swift.org/browse/SR-1023)
suggest that the culprit is a change in behaviour between binutils
2.25 and 2.26.


This is what I did:

$ make clean
$ ./configure --prefix=/usr/packages/musl --target=x86_64-pc-linux-gnu
CFLAGS='-B/usr/local/bin/x86_64-pc-linux-gnu-' --enable-static
--enable-shared --disable-gcc-wrapper
$ make
[...]
x86_64-pc-linux-gnu-gcc  -D_XOPEN_SOURCE=700 -I./arch/x86_64
-I./arch/generic -Iobj/src/internal -I./src/internal -Iobj/include
-I./include  -include vis.h -B/usr/local/bin/x86_64-pc-linux-gnu-
-fPIC -c -o obj/src/process/posix_spawn.lo src/process/posix_spawn.c
[...]
x86_64-pc-linux-gnu-gcc  -D_XOPEN_SOURCE=700 -I./arch/x86_64
-I./arch/generic -Iobj/src/internal -I./src/internal -Iobj/include
-I./include  -include vis.h -B/usr/local/bin/x86_64-pc-linux-gnu-
-nostdlib -shared -Wl,-e,_dlstart -o lib/libc.so obj/src/aio/aio.lo [a
ton of objects] obj/ldso/dynlink.lo
/usr/local/bin/x86_64-pc-linux-gnu-ld: obj/src/process/posix_spawn.lo:
relocation R_X86_64_PC32 against protected symbol `execve' can not be
used when making a shared object
/usr/local/bin/x86_64-pc-linux-gnu-ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
make: *** [lib/libc.so] Error 1


This is the toolchain I am using:

$ /usr/local/bin/x86_64-pc-linux-gnu-ld -v
GNU ld (GNU Binutils) 2.27

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/usr/local/bin/x86_64-pc-linux-gnu-gcc-original
COLLECT_LTO_WRAPPER=/usr/packages/gcc-x86_64-pc-linux-gnu/libexec/gcc/x86_64-pc-linux-gnu/6.1.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /Data/Projects/Linux/gcc/fetch/gcc-6.1.0/configure
--enable-languages=all --without-headers --disable-multilib
--disable-shared --enable-static --target=x86_64-pc-linux-gnu
--with-gmp=/usr/packages/gmp --with-mpfr=/usr/packages/mpfr
--with-mpc=/usr/packages/mpc
--prefix=/usr/packages/gcc-x86_64-pc-linux-gnu : (reconfigured)
/Data/Projects/Linux/gcc/fetch/gcc-6.1.0/configure
--enable-languages=all --without-headers --disable-multilib
--disable-shared --enable-static --target=x86_64-pc-linux-gnu
--with-gmp=/usr/packages/gmp --with-mpfr=/usr/packages/mpfr
--with-mpc=/usr/packages/mpc
--prefix=/usr/packages/gcc-x86_64-pc-linux-gnu
Thread model: posix
gcc version 6.1.0 (GCC)


Can anyone confirm this issue with binutils >= 2.26? It seems strange
to me that this would not have come up yet, so maybe someone has an
idea what else might be the problem?


Samuel


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-10-24 10:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-22 20:37 Unable to build with --enable-shared Samuel Sadok
2016-10-22 21:58 ` Szabolcs Nagy
2016-10-23  0:22   ` Samuel Sadok
2016-10-23 16:17     ` Rich Felker
2016-10-23 22:20       ` Samuel Sadok
2016-10-24  0:19         ` Laine Gholson
2016-10-24  0:28           ` Rich Felker
2016-10-24 10:22             ` Samuel Sadok

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).