File tree 5 files changed +30
-10
lines changed
swift_build_support/swift_build_support
validation-test/BuildSystem
5 files changed +30
-10
lines changed Original file line number Diff line number Diff line change @@ -1839,16 +1839,8 @@ for host in "${ALL_HOSTS[@]}"; do
1839
1839
llvm_enable_projects+=(" clang-tools-extra" )
1840
1840
fi
1841
1841
1842
- # On non-Darwin platforms, build lld so we can always have a
1843
- # linker that is compatible with the swift we are using to
1844
- # compile the stdlib.
1845
- #
1846
- # This makes it easier to build target stdlibs on systems that
1847
- # have old toolchains without more modern linker features.
1848
- if [[ " $( uname -s) " != " Darwin" ]] ; then
1849
- if [[ ! " ${SKIP_BUILD_LLD} " ]]; then
1850
- llvm_enable_projects+=(" lld" )
1851
- fi
1842
+ if [[ ! " ${SKIP_BUILD_LLD} " ]]; then
1843
+ llvm_enable_projects+=(" lld" )
1852
1844
fi
1853
1845
1854
1846
cmake_options+=(
Original file line number Diff line number Diff line change @@ -736,6 +736,9 @@ def create_argument_parser():
736
736
option (['--build-libparser-only' ], toggle_true ('build_libparser_only' ),
737
737
help = 'build only libParser for SwiftSyntax' )
738
738
739
+ option (['--build-lld' ], toggle_true ('build_lld' ),
740
+ help = 'build lld as part of llvm' )
741
+
739
742
option ('--skip-build-clang-tools-extra' ,
740
743
toggle_false ('build_clang_tools_extra' ),
741
744
default = True ,
Original file line number Diff line number Diff line change 72
72
'build_lldb' : False ,
73
73
'build_libcxx' : False ,
74
74
'build_ninja' : False ,
75
+ 'build_lld' : False ,
75
76
'build_osx' : True ,
76
77
'build_playgroundsupport' : False ,
77
78
'build_runtime_with_host_compiler' : False ,
@@ -538,6 +539,7 @@ class BuildScriptImplOption(_BaseOption):
538
539
EnableOption ('--android' ),
539
540
EnableOption ('--build-external-benchmarks' ),
540
541
EnableOption ('--build-ninja' ),
542
+ EnableOption ('--build-lld' ),
541
543
EnableOption ('--build-runtime-with-host-compiler' ),
542
544
EnableOption ('--build-swift-dynamic-sdk-overlay' ),
543
545
EnableOption ('--build-swift-dynamic-stdlib' ),
Original file line number Diff line number Diff line change @@ -430,6 +430,20 @@ def convert_to_impl_arguments(self):
430
430
"--llvm-install-components=%s" % args .llvm_install_components
431
431
]
432
432
433
+ # On non-Darwin platforms, build lld so we can always have a
434
+ # linker that is compatible with the swift we are using to
435
+ # compile the stdlib.
436
+ #
437
+ # This makes it easier to build target stdlibs on systems that
438
+ # have old toolchains without more modern linker features.
439
+ #
440
+ # On Darwin, only build lld if explicitly requested using --build-lld.
441
+ should_build_lld = (platform .system () != 'Darwin' or args .build_lld )
442
+ if not should_build_lld :
443
+ impl_args += [
444
+ "--skip-build-lld"
445
+ ]
446
+
433
447
if not args .clean_libdispatch :
434
448
impl_args += [
435
449
"--skip-clean-libdispatch"
Original file line number Diff line number Diff line change
1
+ # RUN: %empty-directory(%t)
2
+ # RUN: mkdir -p %t
3
+ # RUN: SKIP_XCODE_VERSION_CHECK=1 SWIFT_BUILD_ROOT=%t %swift_src_root/utils/build-script --dry-run --build-lld 2>&1 | %FileCheck %s
4
+
5
+ # REQUIRES: standalone_build
6
+
7
+ # Check that lld is in LLVM_ENABLE_PROJECTS of the llvm-project/llvm build
8
+
9
+ # CHECK: '-DLLVM_ENABLE_PROJECTS={{[^']*}}lld{{[^']*}}'{{.*}}llvm-project/llvm{{$}}
You can’t perform that action at this time.
0 commit comments