diff --git a/common/build_style/gnu-configure.sh b/common/build_style/gnu-configure.sh index 9c52832835d..8177b844e60 100644 --- a/common/build_style/gnu-configure.sh +++ b/common/build_style/gnu-configure.sh @@ -4,16 +4,6 @@ do_configure() { : ${configure_script:=./configure} - # Make sure that shared libraries are built with --as-needed. - # - # http://lists.gnu.org/archive/html/libtool-patches/2004-06/msg00002.html - if [ -z "$broken_as_needed" ]; then - sed -i "s/^\([ \t]*tmp_sharedflag\)='-shared'/\1='-shared -Wl,--as-needed'/" ${configure_script} - fi - # Automatically detect musl toolchains. - for f in $(find ${wrksrc} -type f -name *config*.sub); do - cp -f ${XBPS_CROSSPFDIR}/config.sub ${f} - done ${configure_script} ${configure_args} } diff --git a/common/xbps-src/shutils/common.sh b/common/xbps-src/shutils/common.sh index a7e53216c4b..424c32c5638 100644 --- a/common/xbps-src/shutils/common.sh +++ b/common/xbps-src/shutils/common.sh @@ -340,6 +340,10 @@ setup_pkg() { export CPPFLAGS="$XBPS_CPPFLAGS $XBPS_CROSS_CPPFLAGS $CPPFLAGS" export LDFLAGS="$XBPS_LDFLAGS $XBPS_CROSS_LDFLAGS $LDFLAGS" + if [ -n "$broken_as_needed" ]; then + LDFLAGS="${LDFLAGS/-Wl,--as-needed/}" + fi + export BUILD_CC="cc" export BUILD_CFLAGS="$XBPS_CFLAGS" export CC_FOR_BUILD="cc"