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 @@ -1833,16 +1833,8 @@ for host in "${ALL_HOSTS[@]}"; do
1833
1833
llvm_enable_projects+=(" clang-tools-extra" )
1834
1834
fi
1835
1835
1836
- # On non-Darwin platforms, build lld so we can always have a
1837
- # linker that is compatible with the swift we are using to
1838
- # compile the stdlib.
1839
- #
1840
- # This makes it easier to build target stdlibs on systems that
1841
- # have old toolchains without more modern linker features.
1842
- if [[ " $( uname -s) " != " Darwin" ]] ; then
1843
- if [[ ! " ${SKIP_BUILD_LLD} " ]]; then
1844
- llvm_enable_projects+=(" lld" )
1845
- fi
1836
+ if [[ ! " ${SKIP_BUILD_LLD} " ]]; then
1837
+ llvm_enable_projects+=(" lld" )
1846
1838
fi
1847
1839
1848
1840
cmake_options+=(
Original file line number Diff line number Diff line change @@ -721,6 +721,9 @@ def create_argument_parser():
721
721
option (['--build-libparser-only' ], toggle_true ('build_libparser_only' ),
722
722
help = 'build only libParser for SwiftSyntax' )
723
723
724
+ option (['--build-lld' ], toggle_true ('build_lld' ),
725
+ help = 'build lld as part of llvm' )
726
+
724
727
option ('--skip-build-clang-tools-extra' ,
725
728
toggle_false ('build_clang_tools_extra' ),
726
729
default = True ,
Original file line number Diff line number Diff line change 71
71
'build_lldb' : False ,
72
72
'build_libcxx' : False ,
73
73
'build_ninja' : False ,
74
+ 'build_lld' : False ,
74
75
'build_osx' : True ,
75
76
'build_playgroundsupport' : False ,
76
77
'build_runtime_with_host_compiler' : False ,
@@ -531,6 +532,7 @@ class BuildScriptImplOption(_BaseOption):
531
532
EnableOption ('--android' ),
532
533
EnableOption ('--build-external-benchmarks' ),
533
534
EnableOption ('--build-ninja' ),
535
+ EnableOption ('--build-lld' ),
534
536
EnableOption ('--build-runtime-with-host-compiler' ),
535
537
EnableOption ('--build-swift-dynamic-sdk-overlay' ),
536
538
EnableOption ('--build-swift-dynamic-stdlib' ),
Original file line number Diff line number Diff line change @@ -427,6 +427,20 @@ def convert_to_impl_arguments(self):
427
427
"--llvm-install-components=%s" % args .llvm_install_components
428
428
]
429
429
430
+ # On non-Darwin platforms, build lld so we can always have a
431
+ # linker that is compatible with the swift we are using to
432
+ # compile the stdlib.
433
+ #
434
+ # This makes it easier to build target stdlibs on systems that
435
+ # have old toolchains without more modern linker features.
436
+ #
437
+ # On Darwin, only build lld if explicitly requested using --build-lld.
438
+ should_build_lld = (platform .system () != 'Darwin' or args .build_lld )
439
+ if not should_build_lld :
440
+ impl_args += [
441
+ "--skip-build-lld"
442
+ ]
443
+
430
444
if not args .clean_libdispatch :
431
445
impl_args += [
432
446
"--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