Skip to content

Commit 30a5986

Browse files
committed
[lld] Allow opt-out from building lld via --skip-build-lld
1 parent 2d61e3d commit 30a5986

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

utils/build_swift/build_swift/driver_arguments.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -830,8 +830,10 @@ def create_argument_parser():
830830
option('--build-ninja', toggle_true,
831831
help='build the Ninja tool')
832832

833-
option(['--build-lld'], toggle_true('build_lld'),
833+
option(['--build-lld'], toggle_true('build_lld'), default=True,
834834
help='build lld as part of llvm')
835+
option(['--skip-build-lld'], toggle_false('build_lld'),
836+
help='skip building lld as part of llvm')
835837

836838
option('--skip-build-clang-tools-extra',
837839
toggle_false('build_clang_tools_extra'),

utils/swift_build_support/swift_build_support/products/llvm.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,13 +324,14 @@ def build(self, host_target):
324324
if self.args.build_clang_tools_extra:
325325
llvm_enable_projects.append('clang-tools-extra')
326326

327-
# Always build lld -- on non-Darwin so we can always have a
327+
# Building lld is on by default -- on non-Darwin so we can always have a
328328
# linker that is compatible with the swift we are using to
329329
# compile the stdlib, but on Darwin too for Embedded Swift use cases.
330330
#
331331
# This makes it easier to build target stdlibs on systems that
332332
# have old toolchains without more modern linker features.
333-
llvm_enable_projects.append('lld')
333+
if self.args.build_lld:
334+
llvm_enable_projects.append('lld')
334335

335336
llvm_cmake_options.define('LLVM_ENABLE_PROJECTS',
336337
';'.join(llvm_enable_projects))

0 commit comments

Comments
 (0)