mirror of
https://github.com/fluencelabs/musl
synced 2025-04-25 07:12:15 +00:00
don't suppress shared libc when linker lacks -Bsymbolic-functions
previous work overhauling the dynamic linker made it so that linking libc with -Bsymbolic-functions was no longer mandatory, but the configure logic that forced --disable-shared when ld failed to accept the option was left in place. this commit removes the hard-coded -Bsymbolic-functions from the Makefile and changes the configure test to one that simply adds it to the auto-detected LDFLAGS on success.
This commit is contained in:
parent
c18d05f0e8
commit
65498f289b
3
Makefile
3
Makefile
@ -159,8 +159,7 @@ obj/%.lo: $(srcdir)/%.c $(GENH) $(IMPH)
|
|||||||
|
|
||||||
lib/libc.so: $(LOBJS) $(LDSO_OBJS)
|
lib/libc.so: $(LOBJS) $(LDSO_OBJS)
|
||||||
$(CC) $(CFLAGS_ALL) $(LDFLAGS_ALL) -nostdlib -shared \
|
$(CC) $(CFLAGS_ALL) $(LDFLAGS_ALL) -nostdlib -shared \
|
||||||
-Wl,-e,_dlstart -Wl,-Bsymbolic-functions \
|
-Wl,-e,_dlstart -o $@ $(LOBJS) $(LDSO_OBJS) $(LIBCC)
|
||||||
-o $@ $(LOBJS) $(LDSO_OBJS) $(LIBCC)
|
|
||||||
|
|
||||||
lib/libc.a: $(AOBJS)
|
lib/libc.a: $(AOBJS)
|
||||||
rm -f $@
|
rm -f $@
|
||||||
|
13
configure
vendored
13
configure
vendored
@ -565,15 +565,10 @@ tryldflag LDFLAGS_AUTO -Wl,--no-undefined
|
|||||||
# versions built without shared library support and pcc are broken.
|
# versions built without shared library support and pcc are broken.
|
||||||
tryldflag LDFLAGS_AUTO -Wl,--exclude-libs=ALL
|
tryldflag LDFLAGS_AUTO -Wl,--exclude-libs=ALL
|
||||||
|
|
||||||
test "$shared" = "no" || {
|
# Linking with -Bsymbolic-functions is no longer mandatory for
|
||||||
# Disable dynamic linking if ld is broken and can't do -Bsymbolic-functions
|
# the dynamic linker to work, but enable it if it works as
|
||||||
LDFLAGS_DUMMY=
|
# a linking optimization.
|
||||||
tryldflag LDFLAGS_DUMMY -Wl,-Bsymbolic-functions || {
|
tryldflag LDFLAGS_AUTO -Wl,-Bsymbolic-functions
|
||||||
test "$shared" = "yes" && fail "$0: error: linker cannot build shared library"
|
|
||||||
printf "warning: disabling dynamic linking support\n"
|
|
||||||
shared=no
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Find compiler runtime library
|
# Find compiler runtime library
|
||||||
test -z "$LIBCC" && tryldflag LIBCC -lgcc && tryldflag LIBCC -lgcc_eh
|
test -z "$LIBCC" && tryldflag LIBCC -lgcc && tryldflag LIBCC -lgcc_eh
|
||||||
|
Loading…
x
Reference in New Issue
Block a user