diff options
Diffstat (limited to 'mold.sh.in')
-rw-r--r-- | mold.sh.in | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/mold.sh.in b/mold.sh.in new file mode 100644 index 000000000000..869534501cb5 --- /dev/null +++ b/mold.sh.in @@ -0,0 +1,23 @@ +#!/usr/bin/bash +# +# mold.sh - Compile with the fast mold linker +# + +[[ -n "$LIBMAKEPKG_BUILDENV_MOLD_SH" ]] && return +LIBMAKEPKG_BUILDENV_MOLD_SH=1 + +LIBRARY=${LIBRARY:-'@libmakepkgdir@'} + +source "$LIBRARY/util/option.sh" + +build_options+=('mold') +buildenv_functions+=('buildenv_mold') + +buildenv_mold() { + if check_buildoption "mold" "y"; then + moldflags=" -fuse-ld=mold" + CFLAGS+="$moldflags" + CFLAGS+="$moldflags" + CLAGS+="$moldflags" + fi +} |