@@ -125,6 +125,7 @@ KNOWN_SETTINGS=(
125
125
skip-build-benchmarks " " " set to skip building Swift Benchmark Suite"
126
126
skip-build-clang-tools-extra " " " set to skip building clang-tools-extra as part of llvm"
127
127
skip-build-compiler-rt " " " set to skip building Compiler-RT"
128
+ skip-build-lld " " " set to skip building lld as part of llvm (linux only)"
128
129
skip-build-cygwin " " " set to skip building Swift stdlibs for Cygwin"
129
130
skip-build-external-benchmarks " 1" " set to skip building the external Swift Benchmark Suite. (skipped by default)"
130
131
skip-build-freebsd " " " set to skip building Swift stdlibs for FreeBSD"
@@ -1490,6 +1491,7 @@ for host in "${ALL_HOSTS[@]}"; do
1490
1491
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO=" -O2 -DNDEBUG"
1491
1492
-DCMAKE_BUILD_TYPE:STRING=" ${LLVM_BUILD_TYPE} "
1492
1493
-DLLVM_TOOL_SWIFT_BUILD:BOOL=NO
1494
+ -DLLVM_TOOL_LLD_BUILD:BOOL=TRUE
1493
1495
-DLLVM_INCLUDE_DOCS:BOOL=TRUE
1494
1496
-DLLVM_ENABLE_LTO:STRING=" ${LLVM_ENABLE_LTO} "
1495
1497
-DCOMPILER_RT_INTERCEPT_LIBDISPATCH=ON
@@ -1506,12 +1508,20 @@ for host in "${ALL_HOSTS[@]}"; do
1506
1508
llvm_enable_projects+=(" clang-tools-extra" )
1507
1509
fi
1508
1510
1509
- cmake_options+=(
1510
- -DLLVM_ENABLE_PROJECTS=" $( join " ;" ${llvm_enable_projects[@]} ) "
1511
- )
1511
+ # On non-Darwin platforms, build lld so we can always have a
1512
+ # linker that is compatible with the swift we are using to
1513
+ # compile the stdlib.
1514
+ #
1515
+ # This makes it easier to build target stdlibs on systems that
1516
+ # have old toolchains without more modern linker features.
1517
+ if [[ " $( uname -s) " != " Darwin" ]] ; then
1518
+ if [[ ! " ${SKIP_BUILD_LLD} " ]]; then
1519
+ llvm_enable_projects+=(" lld" )
1520
+ fi
1521
+ fi
1512
1522
1513
1523
cmake_options+=(
1514
- -DLLVM_TOOL_LLD_BUILD:BOOL=TRUE
1524
+ -DLLVM_ENABLE_PROJECTS= " $( join " ; " ${llvm_enable_projects[@]} ) "
1515
1525
)
1516
1526
1517
1527
if [[ " ${BUILD_TOOLCHAIN_ONLY} " ]]; then
0 commit comments