Skip to content
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

Use now available link name "signal" instead of "bsd_signal" #237

Merged
merged 2 commits into from
Apr 7, 2016

Conversation

Nercury
Copy link
Contributor

@Nercury Nercury commented Mar 19, 2016

On android, the bsd_signal is gone, the signal is available.

While this is the most obvious solution, I am not sure of a few things:

  • How are we going to keep compatibility with older NDKs where signal does not exist;
  • Was something dependent on this being different on android and thus would break (for example, the rust compiler uses this function, so it may break somewhere).

Fixes #236.

@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@alexcrichton
Copy link
Member

Thanks for the PR! Let's continue the discussion on #236 for now until we reach a conclusion, but this definitely seems like one plausible course of action we could take!

@alexcrichton
Copy link
Member

cc rust-lang/rust#32415 (I think we'll also want to accept this one though)

@Nercury
Copy link
Contributor Author

Nercury commented Mar 22, 2016

@alexcrichton Maybe I should add feature bsd_signal so libc users can toggle old link symbol if needed?

@alexcrichton
Copy link
Member

Hm for now let's hold off on new features. I suspect that those which want to support these old versions of Android are pretty small, in which case this can be done on a case-by-case basis (like the standard library) if needed.

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Apr 5, 2016
Currently the minimum supported Android version of the standard library is
API level 18 (android-18). Back in those days [1] the `signal` function was
just an inline wrapper around `bsd_signal`, but starting in API level
android-20 the `signal` symbols was introduced [2]. Finally, in android-21
the API `bsd_signal` was removed [3].

Basically this means that if we want to be binary compatible with multiple
Android releases (oldest being 18 and newest being 21) then we need to check
for both symbols and not actually link against either.

This was first discovered in rust-lang/libc#236 with a fix proposed in
rust-lang/libc#237. I suspect that we'll want to accept rust-lang/libc#237 so
Rust crates at large continue to be compatible with newer releases of Android
and crates, like the standard library, that want to opt into older support can
continue to do so via similar means.

Closes rust-lang/libc#236

[1]: https://chromium.googlesource.com/android_tools/+/20ee6d20/ndk/platforms/android-18/arch-arm/usr/include/signal.h
[2]: https://chromium.googlesource.com/android_tools/+/fbd420/ndk_experimental/platforms/android-20/arch-arm/usr/include/signal.h
[3]: https://chromium.googlesource.com/android_tools/+/20ee6d/ndk/platforms/android-21/arch-arm/usr/include/signal.h
bors added a commit to rust-lang/rust that referenced this pull request Apr 5, 2016
std: Fix linking against `signal` on Android

Currently the minimum supported Android version of the standard library is
API level 18 (android-18). Back in those days [1] the `signal` function was
just an inline wrapper around `bsd_signal`, but starting in API level
android-20 the `signal` symbols was introduced [2]. Finally, in android-21
the API `bsd_signal` was removed [3].

Basically this means that if we want to be binary compatible with multiple
Android releases (oldest being 18 and newest being 21) then we need to check
for both symbols and not actually link against either.

This was first discovered in rust-lang/libc#236 with a fix proposed in
rust-lang/libc#237. I suspect that we'll want to accept rust-lang/libc#237 so
Rust crates at large continue to be compatible with newer releases of Android
and crates, like the standard library, that want to opt into older support can
continue to do so via similar means.

Closes rust-lang/libc#236

[1]: https://chromium.googlesource.com/android_tools/+/20ee6d20/ndk/platforms/android-18/arch-arm/usr/include/signal.h
[2]: https://chromium.googlesource.com/android_tools/+/fbd420/ndk_experimental/platforms/android-20/arch-arm/usr/include/signal.h
[3]: https://chromium.googlesource.com/android_tools/+/20ee6d/ndk/platforms/android-21/arch-arm/usr/include/signal.h
@alexcrichton
Copy link
Member

Ok now that rust-lang/rust#32415 has landed I think that we're ready to land this as well. Could you also remove this exception so we can check this looking into the future?

@Nercury
Copy link
Contributor Author

Nercury commented Apr 6, 2016

@alexcrichton done 🎱

@alexcrichton
Copy link
Member

@bors: r+ 0b7ccdd

@bors
Copy link
Contributor

bors commented Apr 6, 2016

⌛ Testing commit 0b7ccdd with merge 60f90cf...

bors added a commit that referenced this pull request Apr 6, 2016
…crichton

Use now available link name "signal" instead of "bsd_signal"

On android, the `bsd_signal` is gone, the `signal` is available.

While this is the most obvious solution, I am not sure of a few things:
- How are we going to keep compatibility with older NDKs where `signal` does not exist;
- Was something dependent on this being different on android and thus would break (for example, the rust compiler uses this function, so it may break somewhere).

Fixes #236.
@bors
Copy link
Contributor

bors commented Apr 7, 2016

☀️ Test successful - status-appveyor, travis

@bors bors merged commit 0b7ccdd into rust-lang:master Apr 7, 2016
@Nercury Nercury deleted the use-signal-instead-of-bsd-signal branch April 7, 2016 06:25
danielverkamp pushed a commit to danielverkamp/libc that referenced this pull request Apr 28, 2020
* [ci] add powerpc/powerpc64 build bots

* unbreak stdsimd builds for targets without run-time
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.

4 participants