Commit 241a9d0
committed
Auto merge of #32415 - alexcrichton:android-signal, r=alexcrichton
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.h4 files changed
+38
-10
lines changed- .travis.yml+1-3
- Cargo.toml+1-1
- appveyor.yml-4
- ci/landing-page-footer.html+3-7
- ci/landing-page-head.html+7-4
- libc-test/Cargo.lock+12-25
- libc-test/build.rs+10
- libc-test/generate-files/Cargo.lock+5-5
- src/lib.rs+3-1
- src/unix/bsd/apple/b32.rs+3
- src/unix/bsd/apple/b64.rs+3
- src/unix/bsd/apple/mod.rs+101-1
- src/unix/bsd/freebsdlike/dragonfly/mod.rs+18-1
- src/unix/bsd/freebsdlike/freebsd/mod.rs+19-2
- src/unix/bsd/freebsdlike/mod.rs+46-4
- src/unix/bsd/mod.rs+10-1
- src/unix/bsd/openbsdlike/bitrig.rs+27
- src/unix/bsd/openbsdlike/mod.rs+27-4
- src/unix/bsd/openbsdlike/netbsd.rs+27
- src/unix/bsd/openbsdlike/openbsd.rs+27
- src/unix/mod.rs+17-4
- src/unix/notbsd/android/mod.rs+9-1
- src/unix/notbsd/linux/mips.rs+7
- src/unix/notbsd/linux/mod.rs+10-21
- src/unix/notbsd/linux/musl/b32/arm.rs+1
- src/unix/notbsd/linux/musl/b32/mips.rs+1
- src/unix/notbsd/linux/musl/b32/mod.rs+3-1
- src/unix/notbsd/linux/musl/b32/x86.rs+1
- src/unix/notbsd/linux/musl/b64/aarch64.rs+1
- src/unix/notbsd/linux/musl/b64/mod.rs+14-1
- src/unix/notbsd/linux/musl/b64/powerpc64.rs+1
- src/unix/notbsd/linux/musl/b64/x86_64.rs+3
- src/unix/notbsd/linux/musl/mod.rs+5
- src/unix/notbsd/linux/other/b32/arm.rs+1
- src/unix/notbsd/linux/other/b32/mod.rs+1-1
- src/unix/notbsd/linux/other/b32/powerpc.rs+1
- src/unix/notbsd/linux/other/b32/x86.rs+1
- src/unix/notbsd/linux/other/b64/aarch64.rs+1
- src/unix/notbsd/linux/other/b64/mod.rs+3-1
- src/unix/notbsd/linux/other/b64/powerpc64.rs+1
- src/unix/notbsd/linux/other/b64/x86_64.rs+1
- src/unix/notbsd/linux/other/mod.rs+8-1
- src/unix/notbsd/mod.rs+84-4
- src/unix/solaris/mod.rs+15-3
- src/windows.rs+3-1
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
94 | 128 | | |
95 | 129 | | |
96 | 130 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
393 | 393 | | |
394 | 394 | | |
395 | 395 | | |
396 | | - | |
| 396 | + | |
397 | 397 | | |
398 | 398 | | |
399 | 399 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
| 78 | + | |
85 | 79 | | |
0 commit comments