diff options
Diffstat (limited to 'ZZ-lto.sh.in')
-rw-r--r-- | ZZ-lto.sh.in | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/ZZ-lto.sh.in b/ZZ-lto.sh.in deleted file mode 100644 index 58452c6419de..000000000000 --- a/ZZ-lto.sh.in +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/bash -# -# ZZ-lto.sh - Compile with link-time optimization -# - -[[ -n "$LIBMAKEPKG_BUILDENV_LTO_SH" ]] && return -LIBMAKEPKG_BUILDENV_LTO_SH=1 - -LIBRARY=${LIBRARY:-'@libmakepkgdir@'} - -source "$LIBRARY/util/option.sh" - -build_options+=('lto' 'lto-thin' 'lto-clang' 'lto-thin-clang') -buildenv_functions+=('buildenv_lto') - -buildenv_lto() { - if check_buildoption "lto" "y" || check_buildoption "lto-thin" "y" || \ - check_buildoption "lto-clang" "y" || check_buildoption "lto-thin-clang" "y"; then - ltoflags=" -flto" - check_buildoption "lto-thin-clang" "y" && ltoflags+="=thin" - check_buildoption "lto-thin" "y" || check_buildoption "lto" "y" && \ - [[ -f "$(gcc -print-search-dirs | grep install | awk '{print $2 "liblto_plugin.so"}')" ]] && \ - ltoflags+="=auto -fno-fat-lto-objects" - check_buildoption "lto" "y" && ltoflags+=" -flto-partition=none" - - CFLAGS+="$ltoflags" - CXXFLAGS+="$ltoflags" - LDFLAGS+=" -fuse-linker-plugin $CFLAGS $CXXFLAGS" - ltoplugin="$(gcc -print-search-dirs | grep install | awk '{print $2 "liblto_plugin.so"}')" - ARFLAGS+=" --plugin $ltoplugin" - RANLIBFLAGS+=" --plugin $ltoplugin" - NMFLAGS+=" --plugin $ltoplugin" - fi -} |