Skip to content

Commit c4f0e4b

Browse files
authored
Android: remove build flags that are no longer needed and force unwrap dlerror() (#8438)
Removing the definition of `_GNU_SOURCE` is no longer needed since swiftlang/swift-tools-support-core#500 made sure the right `strerror_r()` is used, and `dlerror()` has to be unwrapped because of its `_Nullable` annotation.
1 parent e64232e commit c4f0e4b

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

Sources/PackagePlugin/Plugin.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ fileprivate enum Library: Sendable {
595595
return LibraryHandle(rawValue: handle)
596596
#else
597597
guard let handle = dlopen(nil, RTLD_NOW | RTLD_LOCAL) else {
598-
throw LibraryOpenError(message: String(cString: dlerror()))
598+
throw LibraryOpenError(message: String(cString: dlerror()!))
599599
}
600600
return LibraryHandle(rawValue: handle)
601601
#endif

Utilities/bootstrap

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -934,10 +934,6 @@ def get_swiftpm_flags(args):
934934
build_flags.extend(["-Xcc", "-I/usr/local/include"])
935935
build_flags.extend(["-Xlinker", "-L/usr/local/lib"])
936936

937-
# Don't use GNU strerror_r on Android.
938-
if '-android' in args.build_target:
939-
build_flags.extend(["-Xswiftc", "-Xcc", "-Xswiftc", "-U_GNU_SOURCE"])
940-
941937
cross_compile_hosts = args.cross_compile_hosts
942938
if cross_compile_hosts:
943939
if '-apple-macosx' in args.build_target and cross_compile_hosts.startswith('macosx-'):

0 commit comments

Comments
 (0)