Skip to content

[Unix] Use the new -sysroot flag for all non-Darwin Unix platforms, not just Android #1811

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
Feb 19, 2025

Conversation

finagolfin
Copy link
Member

@finagolfin finagolfin commented Feb 16, 2025

This makes two changes:

  1. Use the new flag on all Unix platforms, as in the original frontend pull where it was introduced, Driver: introduce -sysroot option for non-Darwin targets swift#72352.
  2. When compiling for Android and ANDROID_NDK_ROOT is unset, fall back to the -sdk as the sysroot when linking.

I'm primarily concerned with 2., as it got swift-crypto cross-compiling again with my trunk Android SDK bundle, but I went ahead and updated 1. also, when I looked into how that new -sysroot flag was introduced in that linked compiler frontend pull.

I tested this pull on linux x86_64 locally and saw no test regressions.

@compnerd, I'd like to expand this pull to get rid of AndroidNDK.getDefaultSysrootPath(in:) altogether, if you aren't using it anymore. Please review, since you added all this -sysroot code for your new cross-compilation vision.

… not just Android

This makes two changes:

1. Use the new flag on all Unix platforms, as in the original frontend pull where
   it was introduced, swiftlang/swift#72352.
2. When compiling for Android and `ANDROID_NDK_ROOT` is unset, fall back to the
   `-sdk` as the sysroot when linking.
@finagolfin
Copy link
Member Author

@swift-ci please test

@finagolfin
Copy link
Member Author

@swift-ci please smoke test linux

Copy link
Member

@compnerd compnerd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change seems reasonable. We are still using the fallback path, so please do not remove that.

@finagolfin finagolfin merged commit 2b9e404 into swiftlang:main Feb 19, 2025
3 checks passed
@finagolfin finagolfin deleted the droid branch February 19, 2025 20:57
finagolfin added a commit that referenced this pull request Feb 27, 2025
… not just Android (#1811) (#1819)

This makes two changes:

1. Use the new flag on all Unix platforms, as in the original frontend pull where
   it was introduced, swiftlang/swift#72352.
2. When compiling for Android and `ANDROID_NDK_ROOT` is unset, fall back to the
   `-sdk` as the sysroot when linking.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants