Skip to content

Commit 7f3e183

Browse files
committed
Revert "[windows][toolchain] Enable builtins and sanitizers"
Revert swiftlang#77770 To fix CI https://ci-external.swift.org/job/swift-main-windows-toolchain-arm64/785/consoleText
1 parent 985edf5 commit 7f3e183

File tree

9 files changed

+17
-95
lines changed

9 files changed

+17
-95
lines changed

cmake/caches/Windows-aarch64.cmake

Lines changed: 3 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -26,65 +26,21 @@ set(LLVM_DEFAULT_TARGET_TRIPLE aarch64-unknown-windows-msvc CACHE STRING "")
2626
set(LLVM_APPEND_VC_REV NO CACHE BOOL "")
2727
set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR YES CACHE BOOL "")
2828
set(LLVM_ENABLE_PYTHON YES CACHE BOOL "")
29-
30-
set(default_targets
31-
x86_64-unknown-windows-msvc
29+
set(LLVM_RUNTIME_TARGETS
3230
aarch64-unknown-windows-msvc
33-
i686-unknown-windows-msvc)
34-
set(LLVM_RUNTIME_TARGETS ${default_targets} CACHE STRING "")
35-
36-
# Build the android builtins if NDK path is provided.
37-
if(NOT "$ENV{NDKPATH}" STREQUAL "")
38-
list(APPEND default_targets
39-
aarch64-unknown-linux-android
40-
x86_64-unknown-linux-android
41-
i686-unknown-linux-android
42-
armv7-unknown-linux-androideabi)
43-
endif()
44-
45-
set(LLVM_BUILTIN_TARGETS ${default_targets} CACHE STRING "")
46-
31+
CACHE STRING "")
4732
foreach(target ${LLVM_RUNTIME_TARGETS})
4833
set(RUNTIMES_${target}_LLVM_ENABLE_RUNTIMES
4934
compiler-rt
5035
CACHE STRING "")
5136
set(RUNTIMES_${target}_CMAKE_MT mt CACHE STRING "")
5237
set(RUNTIMES_${target}_CMAKE_SYSTEM_NAME Windows CACHE STRING "")
5338
set(RUNTIMES_${target}_CMAKE_BUILD_TYPE Release CACHE STRING "")
54-
set(RUNTIMES_${target}_COMPILER_RT_BUILD_BUILTINS YES CACHE BOOL "")
5539
set(RUNTIMES_${target}_COMPILER_RT_BUILD_CRT NO CACHE BOOL "")
5640
set(RUNTIMES_${target}_COMPILER_RT_BUILD_LIBFUZZER NO CACHE BOOL "")
57-
set(RUNTIMES_${target}_COMPILER_RT_BUILD_ORC NO CACHE BOOL "")
5841
set(RUNTIMES_${target}_COMPILER_RT_BUILD_PROFILE YES CACHE BOOL "")
59-
set(RUNTIMES_${target}_COMPILER_RT_BUILD_XRAY NO CACHE BOOL "")
60-
# Sanitizers will be configured, but not built. We have separate build
61-
# steps for that, because we need a different shell for each target.
6242
set(RUNTIMES_${target}_COMPILER_RT_BUILD_SANITIZERS NO CACHE BOOL "")
63-
endforeach()
64-
65-
foreach(target ${LLVM_BUILTIN_TARGETS})
66-
set(BUILTINS_${target}_CMAKE_MT mt CACHE STRING "")
67-
if(${target} MATCHES windows-msvc)
68-
set(BUILTINS_${target}_CMAKE_SYSTEM_NAME Windows CACHE STRING "")
69-
elseif(${target} MATCHES linux-android)
70-
# Use a single 'linux' directory and arch-based lib names on Android.
71-
set(BUILTINS_${target}_LLVM_ENABLE_PER_TARGET_RUNTIME_DIR NO CACHE BOOL "")
72-
set(BUILTINS_${target}_CMAKE_SYSTEM_NAME Android CACHE STRING "")
73-
if(${target} MATCHES aarch64)
74-
set(BUILTINS_${target}_CMAKE_ANDROID_ARCH_ABI arm64-v8a CACHE STRING "")
75-
elseif(${target} MATCHES armv7)
76-
set(BUILTINS_${target}_CMAKE_ANDROID_ARCH_ABI armeabi-v7a CACHE STRING "")
77-
elseif(${target} MATCHES i686)
78-
set(BUILTINS_${target}_CMAKE_ANDROID_ARCH_ABI x86 CACHE STRING "")
79-
else()
80-
set(BUILTINS_${target}_CMAKE_ANDROID_ARCH_ABI x86_64 CACHE STRING "")
81-
endif()
82-
set(BUILTINS_${target}_CMAKE_ANDROID_NDK $ENV{NDKPATH} CACHE PATH "")
83-
set(BUILTINS_${target}_CMAKE_ANDROID_API 21 CACHE STRING "")
84-
set(BUILTINS_${target}_CMAKE_C_COMPILER_TARGET "${target}21" CACHE STRING "")
85-
set(BUILTINS_${target}_CMAKE_CXX_COMPILER_TARGET "${target}21" CACHE STRING "")
86-
endif()
87-
set(BUILTINS_${target}_CMAKE_BUILD_TYPE Release CACHE STRING "")
43+
set(RUNTIMES_${target}_COMPILER_RT_BUILD_XRAY NO CACHE BOOL "")
8844
endforeach()
8945

9046
set(LLVM_TARGETS_TO_BUILD AArch64 ARM WebAssembly X86 CACHE STRING "")
@@ -211,7 +167,6 @@ set(LLVM_DISTRIBUTION_COMPONENTS
211167
libclang
212168
libclang-headers
213169
LTO
214-
builtins
215170
runtimes
216171
${LLVM_TOOLCHAIN_TOOLS}
217172
${CLANG_TOOLS}

cmake/caches/Windows-x86_64.cmake

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,24 @@ set(LLVM_APPEND_VC_REV NO CACHE BOOL "")
2727
set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR YES CACHE BOOL "")
2828
set(LLVM_ENABLE_PYTHON YES CACHE BOOL "")
2929

30-
set(default_targets
30+
set(DEFAULT_BUILTIN_TARGETS
3131
x86_64-unknown-windows-msvc
32-
aarch64-unknown-windows-msvc
33-
i686-unknown-windows-msvc)
34-
set(LLVM_RUNTIME_TARGETS ${default_targets} CACHE STRING "")
35-
32+
aarch64-unknown-windows-msvc)
3633
# Build the android builtins if NDK path is provided.
3734
if(NOT "$ENV{NDKPATH}" STREQUAL "")
38-
list(APPEND default_targets
35+
list(APPEND DEFAULT_BUILTIN_TARGETS
3936
aarch64-unknown-linux-android
40-
x86_64-unknown-linux-android
41-
i686-unknown-linux-android
42-
armv7-unknown-linux-androideabi)
37+
x86_64-unknown-linux-android)
4338
endif()
4439

45-
set(LLVM_BUILTIN_TARGETS ${default_targets} CACHE STRING "")
40+
# The builtin targets are used to build the compiler-rt builtins.
41+
set(LLVM_BUILTIN_TARGETS ${DEFAULT_BUILTIN_TARGETS} CACHE STRING "")
42+
43+
# The runtime targets are used to build the compiler-rt profile library.
44+
set(LLVM_RUNTIME_TARGETS
45+
x86_64-unknown-windows-msvc
46+
aarch64-unknown-windows-msvc
47+
CACHE STRING "")
4648

4749
foreach(target ${LLVM_RUNTIME_TARGETS})
4850
set(RUNTIMES_${target}_LLVM_ENABLE_RUNTIMES
@@ -51,15 +53,13 @@ foreach(target ${LLVM_RUNTIME_TARGETS})
5153
set(RUNTIMES_${target}_CMAKE_MT mt CACHE STRING "")
5254
set(RUNTIMES_${target}_CMAKE_SYSTEM_NAME Windows CACHE STRING "")
5355
set(RUNTIMES_${target}_CMAKE_BUILD_TYPE Release CACHE STRING "")
54-
set(RUNTIMES_${target}_COMPILER_RT_BUILD_BUILTINS YES CACHE BOOL "")
56+
set(RUNTIMES_${target}_COMPILER_RT_BUILD_BUILTINS NO CACHE BOOL "")
5557
set(RUNTIMES_${target}_COMPILER_RT_BUILD_CRT NO CACHE BOOL "")
5658
set(RUNTIMES_${target}_COMPILER_RT_BUILD_LIBFUZZER NO CACHE BOOL "")
5759
set(RUNTIMES_${target}_COMPILER_RT_BUILD_ORC NO CACHE BOOL "")
5860
set(RUNTIMES_${target}_COMPILER_RT_BUILD_PROFILE YES CACHE BOOL "")
59-
set(RUNTIMES_${target}_COMPILER_RT_BUILD_XRAY NO CACHE BOOL "")
60-
# Sanitizers will be configured, but not built. We have separate build
61-
# steps for that, because we need a different shell for each target.
6261
set(RUNTIMES_${target}_COMPILER_RT_BUILD_SANITIZERS NO CACHE BOOL "")
62+
set(RUNTIMES_${target}_COMPILER_RT_BUILD_XRAY NO CACHE BOOL "")
6363
endforeach()
6464

6565
foreach(target ${LLVM_BUILTIN_TARGETS})
@@ -72,10 +72,6 @@ foreach(target ${LLVM_BUILTIN_TARGETS})
7272
set(BUILTINS_${target}_CMAKE_SYSTEM_NAME Android CACHE STRING "")
7373
if(${target} MATCHES aarch64)
7474
set(BUILTINS_${target}_CMAKE_ANDROID_ARCH_ABI arm64-v8a CACHE STRING "")
75-
elseif(${target} MATCHES armv7)
76-
set(BUILTINS_${target}_CMAKE_ANDROID_ARCH_ABI armeabi-v7a CACHE STRING "")
77-
elseif(${target} MATCHES i686)
78-
set(BUILTINS_${target}_CMAKE_ANDROID_ARCH_ABI x86 CACHE STRING "")
7975
else()
8076
set(BUILTINS_${target}_CMAKE_ANDROID_ARCH_ABI x86_64 CACHE STRING "")
8177
endif()

test/Driver/sanitize_coverage.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// UNSUPPORTED: OS=windows-msvc
2-
31
// Different sanitizer coverage types
42
// RUN: %swiftc_driver -driver-print-jobs -sanitize-coverage=func -sanitize=address %s | %FileCheck -check-prefix=SANCOV_FUNC %s
53
// RUN: %swiftc_driver -driver-print-jobs -sanitize-coverage=bb -sanitize=address %s | %FileCheck -check-prefix=SANCOV_BB %s

test/IRGen/address_sanitizer_use_odr_indicator.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// UNSUPPORTED: OS=windows-msvc
21
// REQUIRES: asan_runtime
32

43
// Default instrumentation that does not use ODR indicators

test/Interpreter/indirect_enum.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// UNSUPPORTED: OS=windows-msvc
2-
31
// RUN: %target-swiftc_driver %s -g -sanitize=address -o %t_asan-binary
42
// RUN: %target-codesign %t_asan-binary
53
// RUN: env ASAN_OPTIONS=detect_leaks=0 %target-run %t_asan-binary

test/Reflection/typeref_decoding_asan.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// UNSUPPORTED: OS=linux-gnu && CPU=aarch64
2-
// UNSUPPORTED: OS=windows-msvc
32

43
// rdar://100805115
54
// UNSUPPORTED: CPU=arm64e

test/Sanitizers/asan/asan.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// UNSUPPORTED: OS=windows-msvc
2-
31
// RUN: %target-swiftc_driver %s -g -sanitize=address -o %t_asan-binary
42
// RUN: %target-codesign %t_asan-binary
53
// RUN: env %env-ASAN_OPTIONS=abort_on_error=0 not %target-run %t_asan-binary 2>&1 | %FileCheck %s

test/Sanitizers/sanitizer_coverage.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
// For now restrict this test to platforms where we know this test will pass
1010
// REQUIRES: CPU=x86_64
1111
// UNSUPPORTED: remote_run
12-
// UNSUPPORTED: OS=windows-msvc
1312

1413
func sayHello() {
1514
print("Hello")

utils/build.ps1

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1848,21 +1848,6 @@ function Build-CURL([Platform]$Platform, $Arch) {
18481848
})
18491849
}
18501850

1851-
function Build-Sanitizers([Platform]$Platform, $Arch, $InstallTo) {
1852-
Isolate-EnvVars {
1853-
# Use configured compilers
1854-
Build-CMakeProject `
1855-
-Src $SourceCache\llvm-project\runtimes `
1856-
-Bin "$(Get-HostProjectBinaryCache Compilers)\runtimes\runtimes-$($Arch.LLVMTarget)-bins" `
1857-
-InstallTo $InstallTo `
1858-
-Arch $Arch `
1859-
-Platform $Platform `
1860-
-Defines (@{
1861-
COMPILER_RT_BUILD_SANITIZERS = "YES"
1862-
})
1863-
}
1864-
}
1865-
18661851
function Build-Runtime([Platform]$Platform, $Arch) {
18671852
$PlatformDefines = @{}
18681853
if ($Platform -eq [Platform]::Android) {
@@ -2873,11 +2858,6 @@ if (-not $SkipBuild) {
28732858
Invoke-BuildStep Build-CMark $HostArch
28742859
Invoke-BuildStep Build-XML2 Windows $HostArch
28752860
Invoke-BuildStep Build-Compilers $HostArch
2876-
2877-
$InstallTo = "$($HostArch.ToolchainInstallRoot)\usr"
2878-
foreach ($Arch in $WindowsSDKArchs) {
2879-
Invoke-BuildStep Build-Sanitizers Windows $Arch $InstallTo
2880-
}
28812861
}
28822862

28832863
if ($Clean) {

0 commit comments

Comments
 (0)