diff --git a/autopackage.sh b/autopackage.sh index d73801901..776c6ab1c 100755 --- a/autopackage.sh +++ b/autopackage.sh @@ -75,6 +75,11 @@ timing_enter build_release config_params="$(get_config_params | sed 's/--enable-debug//g')" if [ $(uname -s) = Linux ]; then + # LTO needs a special compiler to work under clang. See detect_cc.sh for details. + if [[ $CC == *clang* ]]; then + LD=$(type -P ld.gold) + export LD + fi ./configure $config_params --enable-lto else # LTO needs a special compiler to work on BSD.