Skip to content

Commit a1ac798

Browse files
committed
Pass in CMake 3.30+ linker flag workaround on the command-line on the CI, not in patches
1 parent f490819 commit a1ac798

File tree

3 files changed

+6
-39
lines changed

3 files changed

+6
-39
lines changed

.github/workflows/sdks.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,19 +125,21 @@ jobs:
125125
ANDROID_ARCH=aarch64 BUILD_SWIFT_PM=1 ${TOOLCHAIN}/bin/swift get-packages-and-swift-source.swift
126126
127127
git apply -C1 swift-android.patch swift-android-ci.patch
128+
BUILD_FLAG="--foundation-cmake-options=-DCMAKE_SHARED_LINKER_FLAGS=''"
128129
if ${{ matrix.version == 'release' }}; then
129130
perl -pi -e 's%r26%ndk/27%' swift/stdlib/cmake/modules/AddSwiftStdlib.cmake
130-
BUILD_FLAG="--build-swift-tools=0"
131+
BUILD_FLAG+=" --build-swift-tools=0"
131132
LSP_BUILD="--sourcekit-lsp"
132133
git apply swift-android-ci-release.patch swift-android-testing-release.patch
133134
else
134135
if ${{ matrix.version == 'trunk' }}; then
135136
git apply swift-android-trunk-libdispatch.patch
137+
BUILD_FLAG+=" --libdispatch-cmake-options=-DCMAKE_SHARED_LINKER_FLAGS=''"
136138
else
137139
git apply swift-android-ci-devel.patch swift-android-devel.patch
138140
fi
139141
git apply -C2 swift-android-ci-except-release.patch
140-
BUILD_FLAG="--cross-compile-build-swift-tools=0"
142+
BUILD_FLAG+=" --cross-compile-build-swift-tools=0"
141143
SDK_NAME=$(ls | grep swift-${{ matrix.version }}-android-aarch64)
142144
perl -pi -e 's%33%24%' $ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/execinfo.h
143145
fi

swift-android-trunk-libdispatch.patch

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,3 @@ index 016bf294..5c42986a 100644
1313
endif()
1414

1515
if(dispatch_FOUND)
16-
diff --git a/swift-corelibs-libdispatch/src/swift/CMakeLists.txt b/swift-corelibs-libdispatch/src/swift/CMakeLists.txt
17-
index 38bef37..d0ddf98 100644
18-
--- a/swift-corelibs-libdispatch/src/swift/CMakeLists.txt
19-
+++ b/swift-corelibs-libdispatch/src/swift/CMakeLists.txt
20-
@@ -15,6 +15,7 @@ add_library(swiftDispatch
21-
Source.swift
22-
Time.swift
23-
Wrapper.swift)
24-
+set(CMAKE_SHARED_LINKER_FLAGS "")
25-
target_compile_options(swiftDispatch PRIVATE
26-
"SHELL:-Xcc -fblocks"
27-
"SHELL:-Xcc -fmodule-map-file=${PROJECT_SOURCE_DIR}/dispatch/module.modulemap"

swift-android.patch

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ index 324d1a77eea..e88601a8701 100644
2424

2525
from . import cmake_product
2626
from . import product
27-
@@ -115,6 +117,24 @@ class SwiftTestingCMakeShim(cmake_product.CMakeProduct):
27+
@@ -115,6 +117,25 @@ class SwiftTestingCMakeShim(cmake_product.CMakeProduct):
2828
# FIXME: If we build macros for the builder, specify the path.
2929
self.cmake_options.define('SwiftTesting_MACRO', 'NO')
3030

@@ -44,23 +44,12 @@ index 324d1a77eea..e88601a8701 100644
4444
+ self.cmake_options.define('CMAKE_Swift_FLAGS', flags)
4545
+ self.cmake_options.define('CMAKE_Swift_COMPILER_TARGET', triple)
4646
+ self.cmake_options.define('CMAKE_CXX_COMPILER_WORKS', 'True')
47+
+ self.cmake_options.define('CMAKE_SHARED_LINKER_FLAGS', '')
4748
+ self.cmake_options.define('CMAKE_FIND_ROOT_PATH', self.args.cross_compile_deps_path)
4849
+
4950
self.generate_toolchain_file_for_darwin_or_linux(
5051
host_target, override_macos_deployment_version=override_deployment_version)
5152
self.build_with_cmake([], self.args.build_variant, [],
52-
diff --git a/swift-corelibs-foundation/CMakeLists.txt b/swift-corelibs-foundation/CMakeLists.txt
53-
index 7f290d16..95366592 100644
54-
--- a/swift-corelibs-foundation/CMakeLists.txt
55-
+++ b/swift-corelibs-foundation/CMakeLists.txt
56-
@@ -51,6 +51,7 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL Windows)
57-
endif()
58-
endif()
59-
60-
+set(CMAKE_SHARED_LINKER_FLAGS "")
61-
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
62-
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
63-
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
6453
diff --git a/swift-corelibs-foundation/Sources/Foundation/CMakeLists.txt b/swift-corelibs-foundation/Sources/Foundation/CMakeLists.txt
6554
index 016bf294..5c42986a 100644
6655
--- a/swift-corelibs-foundation/Sources/Foundation/CMakeLists.txt
@@ -91,18 +80,6 @@ index 758dd1df..02970992 100644
9180
guard var spawnAttrs else {
9281
throw NSError(domain: NSPOSIXErrorDomain, code: Int(errno),
9382
userInfo: [NSURLErrorKey:self.executableURL!])
94-
diff --git a/swift-testing/CMakeLists.txt b/swift-testing/CMakeLists.txt
95-
index 1be9a4b..bd7b1bd 100644
96-
--- a/swift-testing/CMakeLists.txt
97-
+++ b/swift-testing/CMakeLists.txt
98-
@@ -28,6 +28,7 @@ list(APPEND CMAKE_MODULE_PATH
99-
${PROJECT_SOURCE_DIR}/cmake/modules
100-
${PROJECT_SOURCE_DIR}/cmake/modules/shared)
101-
102-
+set(CMAKE_SHARED_LINKER_FLAGS "")
103-
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
104-
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
105-
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
10683
diff --git a/swift-testing/Sources/Testing/CMakeLists.txt b/swift-testing/Sources/Testing/CMakeLists.tx
10784
index e40cb1b..ff2f920 100644
10885
--- a/swift-testing/Sources/Testing/CMakeLists.txt

0 commit comments

Comments
 (0)