aboutsummaryrefslogtreecommitdiff
path: root/libc/build.rs
diff options
context:
space:
mode:
authorDaniel Mueller <deso@posteo.net>2019-08-15 08:11:13 -0700
committerDaniel Mueller <deso@posteo.net>2019-08-15 08:11:13 -0700
commit155f9b7e7f36975240ef93f3daf983b228592a11 (patch)
treeb407ef697d1241cdbc46bc0b5a8545c63a7bafad /libc/build.rs
parent49f5194e16db47b6de9847b79840c6fe35e0df8c (diff)
downloadnitrocli-155f9b7e7f36975240ef93f3daf983b228592a11.tar.gz
nitrocli-155f9b7e7f36975240ef93f3daf983b228592a11.tar.bz2
Update libc crate to 0.2.62
This change updates the libc crate to version 0.2.62. Import subrepo libc/:libc at 37f8f8dc233a79ea9cc89b102aa30ff6e402fe94
Diffstat (limited to 'libc/build.rs')
-rw-r--r--libc/build.rs28
1 files changed, 20 insertions, 8 deletions
diff --git a/libc/build.rs b/libc/build.rs
index 8452940..efc95b6 100644
--- a/libc/build.rs
+++ b/libc/build.rs
@@ -5,21 +5,27 @@ use std::str;
fn main() {
let rustc_minor_ver =
rustc_minor_version().expect("Failed to get rustc version");
- let rustc_dep_of_std =
- std::env::var("CARGO_FEATURE_RUSTC_DEP_OF_STD").is_ok();
- let align_cargo_feature = std::env::var("CARGO_FEATURE_ALIGN").is_ok();
+ let rustc_dep_of_std = env::var("CARGO_FEATURE_RUSTC_DEP_OF_STD").is_ok();
+ let align_cargo_feature = env::var("CARGO_FEATURE_ALIGN").is_ok();
+ #[allow(unused)]
+ let libc_ci = env::var("LIBC_CI").is_ok();
- if std::env::var("CARGO_FEATURE_USE_STD").is_ok() {
+ if env::var("CARGO_FEATURE_USE_STD").is_ok() {
println!(
"cargo:warning=\"libc's use_std cargo feature is deprecated since libc 0.2.55; \
please consider using the `std` cargo feature instead\""
);
}
- if std::env::var("LIBC_CI").is_ok() {
- if let Some(12) = which_freebsd() {
- println!("cargo:rustc-cfg=freebsd12");
- }
+ // The ABI of libc is backward compatible with FreeBSD 11.
+ //
+ // On CI, we detect the actual FreeBSD version and match its ABI exactly,
+ // running tests to ensure that the ABI is correct.
+ match which_freebsd() {
+ Some(11) if libc_ci => println!("cargo:rustc-cfg=freebsd11"),
+ Some(12) if libc_ci => println!("cargo:rustc-cfg=freebsd12"),
+ Some(13) if libc_ci => println!("cargo:rustc-cfg=freebsd13"),
+ Some(_) | None => println!("cargo:rustc-cfg=freebsd11"),
}
// Rust >= 1.15 supports private module use:
@@ -53,6 +59,11 @@ fn main() {
if rustc_minor_ver >= 33 || rustc_dep_of_std {
println!("cargo:rustc-cfg=libc_packedN");
}
+
+ // #[thread_local] is currently unstable
+ if rustc_dep_of_std {
+ println!("cargo:rustc-cfg=libc_thread_local");
+ }
}
fn rustc_minor_version() -> Option<u32> {
@@ -96,6 +107,7 @@ fn which_freebsd() -> Option<i32> {
match &stdout {
s if s.starts_with("11") => Some(11),
s if s.starts_with("12") => Some(12),
+ s if s.starts_with("13") => Some(13),
_ => None,
}
}