Skip to content

Commit 7d307c3

Browse files
committed
Remove unneeded -Xcc -U_GNU_SOURCE flags on CI, now that tools-support-core has been updated not to need them
1 parent 4563636 commit 7d307c3

File tree

2 files changed

+47
-1
lines changed

2 files changed

+47
-1
lines changed

.github/workflows/sdks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ jobs:
133133
perl -pi -e 's%r26%ndk/27%' swift/stdlib/cmake/modules/AddSwiftStdlib.cmake
134134
LSP_BUILD="--sourcekit-lsp"
135135
else
136+
git apply swift-android-ci-except-release.patch swift-android-foundation-except-release.patch
136137
if [ ${{ matrix.version }} = 'devel' ]; then
137138
perl -pi -e 's%r26%ndk/27%' swift/stdlib/cmake/modules/AddSwiftStdlib.cmake
138139
LSP_BUILD="--sourcekit-lsp"
@@ -141,7 +142,6 @@ jobs:
141142
git apply swift-android-testing-trunk.patch
142143
fi
143144
TESTING_BUILD="--swift-testing --install-swift-testing"
144-
git apply swift-android-ci-except-release.patch swift-android-foundation-except-release.patch
145145
fi
146146
147147
perl -pi -e 's%String\(cString: getpass%\"fake\" //%' swiftpm/Sources/PackageRegistryCommand/PackageRegistryCommand+Auth.swift

swift-android-testing-trunk.patch

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
diff --git a/sourcekit-lsp/Utilities/build-script-helper.py b/sourcekit-lsp/Utilities/build-script-helper.py
2+
index 88141cdd..d264f10c 100755
3+
--- a/sourcekit-lsp/Utilities/build-script-helper.py
4+
+++ b/sourcekit-lsp/Utilities/build-script-helper.py
5+
@@ -136,9 +136,6 @@ def get_swiftpm_options(swift_exec: str, args: argparse.Namespace, suppress_verb
6+
if '-android' in build_target:
7+
swiftpm_args += [
8+
'-Xlinker', '-rpath', '-Xlinker', '$ORIGIN/../lib/swift/android',
9+
+ '-Xlinker', '-landroid-spawn',
10+
- # SwiftPM will otherwise try to compile against GNU strerror_r on
11+
- '-Xlinker', '-landroid-spawn',
12+
- # Android and fail.
13+
- '-Xswiftc', '-Xcc', '-Xswiftc', '-U_GNU_SOURCE',
14+
]
15+
elif not build_os.startswith('macosx'):
16+
# Library rpath for swift, dispatch, Foundation, etc. when installing
117
diff --git a/swiftpm/Sources/PackagePlugin/Plugin.swift b/swiftpm/Sources/PackagePlugin/Plugin.swift
218
index 232543b66..5589c2346 100644
319
--- a/swiftpm/Sources/PackagePlugin/Plugin.swift
@@ -11,6 +27,22 @@ index 232543b66..5589c2346 100644
1127
}
1228
return LibraryHandle(rawValue: handle)
1329
#endif
30+
diff --git a/swiftpm/Utilities/bootstrap b/swiftpm/Utilities/bootstrap
31+
index 156bf002a..d891da556 100755
32+
--- a/swiftpm/Utilities/bootstrap
33+
+++ b/swiftpm/Utilities/bootstrap
34+
@@ -934,10 +934,7 @@ def get_swiftpm_flags(args):
35+
build_flags.extend(["-Xcc", "-I/usr/local/include"])
36+
build_flags.extend(["-Xlinker", "-L/usr/local/lib"])
37+
38+
- # Don't use GNU strerror_r on Android.
39+
- if '-android' in args.build_target:
40+
- build_flags.extend(["-Xswiftc", "-Xcc", "-Xswiftc", "-U_GNU_SOURCE"])
41+
- build_flags.extend(["-Xlinker", "-landroid-spawn"])
42+
+ build_flags.extend(["-Xlinker", "-landroid-spawn"])
43+
44+
cross_compile_hosts = args.cross_compile_hosts
45+
if cross_compile_hosts:
1446
diff --git a/swift-corelibs-xctest/cmake/modules/PlatformInfo.cmake b/swift-corelibs-xctest/cmake/modules/PlatformInfo.cmake
1547
index 468dc61..a90ae3d 100644
1648
--- a/swift-corelibs-xctest/cmake/modules/PlatformInfo.cmake
@@ -26,6 +58,20 @@ index 468dc61..a90ae3d 100644
2658
endif()
2759
execute_process(COMMAND ${print_target_info_invocation} OUTPUT_VARIABLE target_info_json)
2860
message(CONFIGURE_LOG "Swift Target Info: ${print_target_info_invocation}\n"
61+
diff --git a/swift-driver/Utilities/build-script-helper.py b/swift-driver/Utilities/build-script-helper.py
62+
index 6e62b127..5504095b 100755
63+
--- a/swift-driver/Utilities/build-script-helper.py
64+
+++ b/swift-driver/Utilities/build-script-helper.py
65+
@@ -104,9 +104,6 @@ def get_swiftpm_options(args):
66+
if '-android' in args.build_target:
67+
swiftpm_args += [
68+
'-Xlinker', '-rpath', '-Xlinker', '$ORIGIN/../lib/swift/android',
69+
- # SwiftPM will otherwise try to compile against GNU strerror_r on
70+
- # Android and fail.
71+
- '-Xswiftc', '-Xcc', '-Xswiftc', '-U_GNU_SOURCE',
72+
]
73+
else:
74+
# Library rpath for swift, dispatch, Foundation, etc. when installing
2975
diff --git a/swift-testing/Sources/Testing/SourceAttribution/Backtrace.swift b/swift-testing/Sources/Testing/SourceAttribution/Backtrace.swift
3076
index 78227e3..e0db2e9 100644
3177
--- a/swift-testing/Sources/Testing/SourceAttribution/Backtrace.swift

0 commit comments

Comments
 (0)