Skip to content

Commit 8b7eda3

Browse files
committed
build-script: Remove support for legacy way of building compiler-rt
Addresses rdar://149293315
1 parent e84d560 commit 8b7eda3

File tree

8 files changed

+17
-86
lines changed

8 files changed

+17
-86
lines changed

utils/build-presets.ini

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ swift-install-components=back-deployment;compiler;clang-builtin-headers;libexec;
1919
[preset: mixin_buildbot_install_components_with_clang]
2020

2121
swift-install-components=autolink-driver;back-deployment;compiler;clang-resource-dir-symlink;libexec;stdlib;sdk-overlay;static-mirror-lib;toolchain-tools;license;sourcekit-xpc-service;sourcekit-inproc;swift-remote-mirror;swift-remote-mirror-headers
22-
llvm-install-components=llvm-ar;llvm-ranlib;llvm-cov;llvm-profdata;llvm-objdump;llvm-objcopy;llvm-symbolizer;IndexStore;clang;clang-resource-headers;compiler-rt;clangd;libclang;dsymutil;LTO;clang-features-file;lld
22+
llvm-install-components=llvm-ar;llvm-ranlib;llvm-cov;llvm-profdata;llvm-objdump;llvm-objcopy;llvm-symbolizer;IndexStore;clang;clang-resource-headers;builtins;runtimes;clangd;libclang;dsymutil;LTO;clang-features-file;lld
2323

2424
[preset: mixin_buildbot_trunk_base]
2525
# Build standard library and SDK overlay for iOS device and simulator.
@@ -848,7 +848,7 @@ no-swift-stdlib-assertions
848848
[preset: mixin_linux_install_components_with_clang]
849849

850850
swift-install-components=autolink-driver;compiler;clang-resource-dir-symlink;libexec;stdlib;swift-remote-mirror;sdk-overlay;static-mirror-lib;toolchain-tools;license;sourcekit-inproc
851-
llvm-install-components=llvm-ar;llvm-ranlib;llvm-cov;llvm-profdata;llvm-objdump;llvm-objcopy;llvm-symbolizer;IndexStore;clang;clang-resource-headers;compiler-rt;clangd;libclang;lld;LTO;clang-features-file
851+
llvm-install-components=llvm-ar;llvm-ranlib;llvm-cov;llvm-profdata;llvm-objdump;llvm-objcopy;llvm-symbolizer;IndexStore;clang;clang-resource-headers;builtins;runtimes;clangd;libclang;lld;LTO;clang-features-file
852852

853853
[preset: mixin_linux_installation]
854854
mixin-preset=
@@ -3029,7 +3029,7 @@ darwin-toolchain-display-name-short=Swift Development Snapshot
30293029
darwin-toolchain-display-name=Swift Development Snapshot
30303030
darwin-toolchain-name=swift-DEVELOPMENT-SNAPSHOT
30313031
darwin-toolchain-version=3.999.999
3032-
llvm-install-components=clang;clang-resource-headers;compiler-rt;libclang;libclang-headers;dsymutil;clang-features-file
3032+
llvm-install-components=clang;clang-resource-headers;builtins;runtimes;libclang;libclang-headers;dsymutil;clang-features-file
30333033
swift-install-components=back-deployment;compiler;clang-builtin-headers;stdlib;libexec;sdk-overlay;license;sourcekit-xpc-service;sourcekit-inproc;swift-remote-mirror;swift-remote-mirror-headers
30343034
symbols-package=%(symbols_package)s
30353035
install-symroot=%(install_symroot)s
@@ -3186,7 +3186,7 @@ build-subdir=%(build_subdir)s
31863186
install-destdir=%(install_destdir)s
31873187

31883188
swift-install-components=autolink-driver;compiler;clang-resource-dir-symlink;stdlib;sdk-overlay;toolchain-tools
3189-
llvm-install-components=llvm-ar;llvm-ranlib;clang;clang-resource-headers;compiler-rt;clang-features-file;llvm-symbolizer
3189+
llvm-install-components=llvm-ar;llvm-ranlib;clang;clang-resource-headers;builtins;runtimes;clang-features-file;llvm-symbolizer
31903190

31913191
install-llvm
31923192
install-swift
@@ -3218,7 +3218,7 @@ extra-cmake-options=
32183218
-DLLVM_TARGETS_TO_BUILD=AArch64;X86
32193219

32203220
swift-install-components=autolink-driver;compiler;clang-resource-dir-symlink;stdlib;sdk-overlay;toolchain-tools;license
3221-
llvm-install-components=llvm-ar;llvm-ranlib;clang;clang-resource-headers;compiler-rt;clang-features-file;lld
3221+
llvm-install-components=llvm-ar;llvm-ranlib;clang;clang-resource-headers;builtins;runtimes;clang-features-file;lld
32223222

32233223
build-subdir=%(build_subdir)s
32243224
install-destdir=%(install_destdir)s
@@ -3256,7 +3256,7 @@ build-subdir=%(build_subdir)s
32563256
install-destdir=%(install_destdir)s
32573257

32583258
swift-install-components=autolink-driver;compiler;clang-resource-dir-symlink;stdlib;sdk-overlay;toolchain-tools;license
3259-
llvm-install-components=llvm-ar;llvm-ranlib;clang;clang-resource-headers;compiler-rt;clang-features-file;lld
3259+
llvm-install-components=llvm-ar;llvm-ranlib;clang;clang-resource-headers;builtins;runtimes;clang-features-file;lld
32603260

32613261
install-llvm
32623262
install-swift

utils/build_swift/build_swift/driver_arguments.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1437,11 +1437,6 @@ def create_argument_parser():
14371437
'existing options.',
14381438
default=[])
14391439

1440-
option('--llvm-build-compiler-rt-with-use-runtimes', toggle_true, default=True,
1441-
help='Switch to LLVM_ENABLE_RUNTIMES as the mechanism to build compiler-rt'
1442-
'It will become the default with LLVM 21, this flag is '
1443-
'meant to stage its introduction and account for edge cases')
1444-
14451440
# -------------------------------------------------------------------------
14461441
in_group('Build settings for Android')
14471442

utils/build_swift/tests/expected_options.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,6 @@
234234
'lldb_build_variant': 'Debug',
235235
'lldb_build_with_xcode': '0',
236236
'llvm_assertions': True,
237-
'llvm_build_compiler_rt_with_use_runtimes': True,
238237
'llvm_build_variant': 'Debug',
239238
'llvm_cmake_options': [],
240239
'llvm_enable_modules': False,
@@ -865,7 +864,6 @@ class BuildScriptImplOption(_BaseOption):
865864
AppendOption('--llvm-ninja-targets-for-cross-compile-hosts'),
866865
AppendOption('--llvm-cmake-options'),
867866
AppendOption('--extra-llvm-cmake-options'),
868-
EnableOption('--llvm-build-compiler-rt-with-use-runtimes'),
869867
AppendOption('--darwin-symroot-path-filters'),
870868

871869
UnsupportedOption('--build-jobs'),

utils/swift_build_support/swift_build_support/products/llvm.py

Lines changed: 10 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -356,9 +356,6 @@ def build(self, host_target):
356356

357357
if self.args.build_embedded_stdlib and system() == "Darwin":
358358
# Ask for Mach-O cross-compilation builtins (for Embedded Swift)
359-
llvm_cmake_options.define(
360-
'COMPILER_RT_FORCE_BUILD_BAREMETAL_MACHO_BUILTINS_ARCHS:STRING',
361-
'armv6 armv6m armv7 armv7m armv7em')
362359
llvm_cmake_options.define(
363360
f'BUILTINS_{builtins_runtimes_target_for_darwin}_'
364361
'COMPILER_RT_FORCE_BUILD_BAREMETAL_MACHO_BUILTINS_ARCHS:'
@@ -369,28 +366,13 @@ def build(self, host_target):
369366

370367
if self.args.build_compiler_rt and \
371368
not self.is_cross_compile_target(host_target):
372-
if self.args.llvm_build_compiler_rt_with_use_runtimes:
373-
llvm_enable_runtimes.append('compiler-rt')
374-
# This accounts for previous incremental runs that may have set
375-
# those in the LLVM CMakeCache.txt
376-
llvm_cmake_options.undefine('LLVM_TOOL_COMPILER_RT_BUILD')
377-
llvm_cmake_options.undefine('LLVM_BUILD_EXTERNAL_COMPILER_RT')
378-
else:
379-
# No need to unset anything,
380-
# since we set LLVM_ENABLE_RUNTIMES explicitly
381-
llvm_enable_projects.append('compiler-rt')
382-
llvm_cmake_options.define(
383-
'LLVM_TOOL_COMPILER_RT_BUILD:BOOL', 'TRUE')
384-
llvm_cmake_options.define(
385-
'LLVM_BUILD_EXTERNAL_COMPILER_RT:BOOL', 'TRUE')
386-
else:
387-
if not self.args.llvm_build_compiler_rt_with_use_runtimes:
388-
# No need to unset anything,
389-
# since we set LLVM_ENABLE_RUNTIMES explicitly
390-
llvm_cmake_options.define(
391-
'LLVM_TOOL_COMPILER_RT_BUILD:BOOL', 'FALSE')
392-
llvm_cmake_options.define(
393-
'LLVM_BUILD_EXTERNAL_COMPILER_RT:BOOL', 'FALSE')
369+
llvm_enable_runtimes.append('compiler-rt')
370+
371+
# This accounts for previous incremental runs using the old
372+
# way of build compiler_rt that may have set
373+
# those in the LLVM CMakeCache.txt
374+
llvm_cmake_options.undefine('LLVM_TOOL_COMPILER_RT_BUILD')
375+
llvm_cmake_options.undefine('LLVM_BUILD_EXTERNAL_COMPILER_RT')
394376

395377
if self.args.build_clang_tools_extra:
396378
llvm_enable_projects.append('clang-tools-extra')
@@ -572,10 +554,9 @@ def install(self, host_target):
572554
self.args.llvm_install_components != 'all':
573555
install_targets = []
574556
components = self.args.llvm_install_components.split(';')
575-
if self.args.llvm_build_compiler_rt_with_use_runtimes and \
576-
'compiler-rt' in components:
557+
if 'compiler-rt' in components:
577558
# This is a courtesy fallback to avoid breaking downstream presets
578-
# we are not aware of
559+
# that are still using the old compiler-rt install component
579560
components.remove('compiler-rt')
580561
components.append('builtins')
581562
components.append('runtimes')
@@ -586,7 +567,7 @@ def install(self, host_target):
586567
for component in components:
587568
if self.is_cross_compile_target(host_target) \
588569
or not self.args.build_compiler_rt:
589-
if component in ['compiler-rt', 'builtins', 'runtimes']:
570+
if component in ['builtins', 'runtimes']:
590571
continue
591572
install_targets.append('install-{}'.format(component))
592573

validation-test/BuildSystem/llvm-build-compiler-rt-on-linux.test

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
# REQUIRES: standalone_build
22
# REQUIRES: OS=linux-gnu
33

4-
# RUN: %empty-directory(%t)
5-
# RUN: SKIP_XCODE_VERSION_CHECK=1 SWIFT_BUILD_ROOT=%t %swift_src_root/utils/build-script --dry-run --skip-build --llvm-build-compiler-rt-with-use-runtimes --cmake %cmake 2>&1 | %FileCheck --check-prefix=LINUX %s
6-
# RUN: %empty-directory(%t)
7-
# RUN: SKIP_XCODE_VERSION_CHECK=1 SWIFT_BUILD_ROOT=%t %swift_src_root/utils/build-script --dry-run --skip-build --llvm-build-compiler-rt-with-use-runtimes=1 --cmake %cmake 2>&1 | %FileCheck --check-prefix=LINUX %s
84
# RUN: %empty-directory(%t)
95
# RUN: SKIP_XCODE_VERSION_CHECK=1 SWIFT_BUILD_ROOT=%t %swift_src_root/utils/build-script --dry-run --skip-build --cmake %cmake 2>&1 | %FileCheck --check-prefix=LINUX %s
10-
# RUN: %empty-directory(%t)
11-
# RUN: SKIP_XCODE_VERSION_CHECK=1 SWIFT_BUILD_ROOT=%t %swift_src_root/utils/build-script --dry-run --skip-build --llvm-build-compiler-rt-with-use-runtimes=0 --cmake %cmake 2>&1 | %FileCheck --check-prefix=LINUX %s
126

137
# LINUX: Building llvm
148
# LINUX-DAG: cmake -G Ninja

validation-test/BuildSystem/llvm-build-compiler-rt-on-macosx.test

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
# REQUIRES: OS=macosx
33

44
# RUN: %empty-directory(%t)
5-
# RUN: SKIP_XCODE_VERSION_CHECK=1 SWIFT_BUILD_ROOT=%t %swift_src_root/utils/build-script --dry-run --skip-build --llvm-build-compiler-rt-with-use-runtimes --cmake %cmake 2>&1 | %FileCheck --check-prefix=LLVM-USE-RUNTIMES %s
6-
# RUN: %empty-directory(%t)
7-
# RUN: SKIP_XCODE_VERSION_CHECK=1 SWIFT_BUILD_ROOT=%t %swift_src_root/utils/build-script --dry-run --skip-build --llvm-build-compiler-rt-with-use-runtimes=1 --cmake %cmake 2>&1 | %FileCheck --check-prefix=LLVM-USE-RUNTIMES %s
5+
# RUN: SKIP_XCODE_VERSION_CHECK=1 SWIFT_BUILD_ROOT=%t %swift_src_root/utils/build-script --dry-run --skip-build --cmake %cmake 2>&1 | %FileCheck --check-prefix=LLVM-USE-RUNTIMES %s
86

97
# LLVM-USE-RUNTIMES: Building llvm
108
# LLVM-USE-RUNTIMES-DAG: cmake -G Ninja
@@ -16,13 +14,3 @@
1614
# LLVM-USE-RUNTIMES-NOT: rtsan
1715
# LLVM-USE-RUNTIMES-SAME: -DBUILTINS_{{[^ ]*}}_COMPILER_RT_FORCE_BUILD_BAREMETAL_MACHO_BUILTINS_ARCHS
1816
# LLVM-USE-RUNTIMES-SAME: llvm
19-
20-
# RUN: %empty-directory(%t)
21-
# RUN: SKIP_XCODE_VERSION_CHECK=1 SWIFT_BUILD_ROOT=%t %swift_src_root/utils/build-script --dry-run --skip-build --cmake %cmake 2>&1 | %FileCheck --check-prefix=EXTERNAL-COMPILER-RT %s
22-
# RUN: %empty-directory(%t)
23-
# RUN: SKIP_XCODE_VERSION_CHECK=1 SWIFT_BUILD_ROOT=%t %swift_src_root/utils/build-script --dry-run --skip-build --llvm-build-compiler-rt-with-use-runtimes=0 --cmake %cmake 2>&1 | %FileCheck --check-prefix=EXTERNAL-COMPILER-RT %s
24-
25-
# EXTERNAL-COMPILER-RT: Building llvm
26-
# EXTERNAL-COMPILER-RT-DAG: cmake -G Ninja
27-
# EXTERNAL-COMPILER-RT-SAME: -DCOMPILER_RT_FORCE_BUILD_BAREMETAL_MACHO_BUILTINS_ARCHS
28-
# EXTERNAL-COMPILER-RT-SAME: llvm

validation-test/BuildSystem/llvm-build-compiler-rt-with-enable-external-compiler-rt.test

Lines changed: 0 additions & 21 deletions
This file was deleted.

validation-test/BuildSystem/llvm-build-compiler-rt-with-use-runtimes.test

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
# RUN: %empty-directory(%t)
44
# RUN: SKIP_XCODE_VERSION_CHECK=1 SWIFT_BUILD_ROOT=%t %swift_src_root/utils/build-script --dry-run --skip-build --cmake %cmake 2>&1 | %FileCheck --check-prefix=LLVM-USE-RUNTIMES %s
5-
# RUN: %empty-directory(%t)
6-
# RUN: SKIP_XCODE_VERSION_CHECK=1 SWIFT_BUILD_ROOT=%t %swift_src_root/utils/build-script --dry-run --skip-build --llvm-build-compiler-rt-with-use-runtimes=1 --cmake %cmake 2>&1 | %FileCheck --check-prefix=LLVM-USE-RUNTIMES %s
75

86
# LLVM-USE-RUNTIMES: Building llvm
97
# LLVM-USE-RUNTIMES-DAG: cmake -G Ninja
@@ -15,8 +13,6 @@
1513

1614
# RUN: %empty-directory(%t)
1715
# RUN: SKIP_XCODE_VERSION_CHECK=1 SWIFT_BUILD_ROOT=%t %swift_src_root/utils/build-script --dry-run --skip-build --skip-build-compiler-rt --cmake %cmake 2>&1 | %FileCheck --check-prefix=DONT-BUILD-COMPILER-RT %s
18-
# RUN: %empty-directory(%t)
19-
# RUN: SKIP_XCODE_VERSION_CHECK=1 SWIFT_BUILD_ROOT=%t %swift_src_root/utils/build-script --dry-run --skip-build --llvm-build-compiler-rt-with-use-runtimes=1 --skip-build-compiler-rt --cmake %cmake 2>&1 | %FileCheck --check-prefix=DONT-BUILD-COMPILER-RT %s
2016

2117
# DONT-BUILD-COMPILER-RT: Building llvm
2218
# DONT-BUILD-COMPILER-RT-DAG: cmake -G Ninja

0 commit comments

Comments
 (0)