build-llvm: Add an option --use-linker=

This allows overriding which linker to use.

Currently, building LLVM on Ubuntu 25.10 with these scripts fails,
if LLD is available. This, because the GCC on that distribution
produces object files that LLD (and gold) rejects during linking - see
https://github.com/llvm/llvm-project/issues/156667 for details.

By building with --use-linker=bfd, linking does succeed in that
configuration.

Also pass the same option through from build-all.sh.
This commit is contained in:
Martin Storsjö committed 2025-09-04 23:24:42 +03:00
1 parent 9347c21f74
commit e455d4c3cb
2 files changed
+11 -6

No files matched your search

+2 -2
View File
@@ -24,7 +24,7 @@ HOST_ARGS=""
while [ $# -gt 0 ]; do
case "$1" in
--enable-asserts|--disable-dylib|--with-clang|--thinlto)
--enable-asserts|--disable-dylib|--with-clang|--thinlto|--use-linker=*)
LLVM_ARGS="$LLVM_ARGS $1"
;;
--host-clang|--host-clang=*)
@@ -120,7 +120,7 @@ while [ $# -gt 0 ]; do
shift
done
if [ -z "$PREFIX" ]; then
echo "$0 [--host-clang[=clang]] [--enable-asserts] [--disable-dylib] [--with-clang] [--thinlto] [--full-llvm] [--disable-lldb] [--disable-lldb-mi] [--disable-clang-tools-extra] [--host=triple] [--with-default-win32-winnt=0x601] [--with-default-msvcrt=ucrt] [--enable-cfguard|--disable-cfguard] [--no-runtimes] [--llvm-only] [--no-tools] [--wipe-runtimes] [--clean-runtimes] [--stage1] [--profile[=type]] [--pgo[=profile]] [--full-pgo[=type]] dest [pgo-dest]"
echo "$0 [--host-clang[=clang]] [--enable-asserts] [--disable-dylib] [--with-clang] [--use-linker=linker] [--thinlto] [--full-llvm] [--disable-lldb] [--disable-lldb-mi] [--disable-clang-tools-extra] [--host=triple] [--with-default-win32-winnt=0x601] [--with-default-msvcrt=ucrt] [--enable-cfguard|--disable-cfguard] [--no-runtimes] [--llvm-only] [--no-tools] [--wipe-runtimes] [--clean-runtimes] [--stage1] [--profile[=type]] [--pgo[=profile]] [--full-pgo[=type]] dest [pgo-dest]"
exit 1
fi
if [ -n "$PREFIX_PGO" ] && [ -z "$PGO" ] && [ -z "$FULL_PGO" ]; then