Skip to content

Android: remove build flags that are no longer needed and force unwrap dlerror() #8438

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/PackagePlugin/Plugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ fileprivate enum Library: Sendable {
return LibraryHandle(rawValue: handle)
#else
guard let handle = dlopen(nil, RTLD_NOW | RTLD_LOCAL) else {
throw LibraryOpenError(message: String(cString: dlerror()))
throw LibraryOpenError(message: String(cString: dlerror()!))
}
return LibraryHandle(rawValue: handle)
#endif
Expand Down
4 changes: 0 additions & 4 deletions Utilities/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -934,10 +934,6 @@ def get_swiftpm_flags(args):
build_flags.extend(["-Xcc", "-I/usr/local/include"])
build_flags.extend(["-Xlinker", "-L/usr/local/lib"])

# Don't use GNU strerror_r on Android.
if '-android' in args.build_target:
build_flags.extend(["-Xswiftc", "-Xcc", "-Xswiftc", "-U_GNU_SOURCE"])

cross_compile_hosts = args.cross_compile_hosts
if cross_compile_hosts:
if '-apple-macosx' in args.build_target and cross_compile_hosts.startswith('macosx-'):
Expand Down