summaryrefslogtreecommitdiff
path: root/build.rs
diff options
context:
space:
mode:
authorAlan Somers <asomers@gmail.com>2021-12-10 09:05:37 -0700
committerAlan Somers <asomers@gmail.com>2021-12-10 09:05:37 -0700
commit727d37a0162108381baea64ffabca7c9a8714600 (patch)
treed9052297a014bf0bce7fa309b365399f56d8bc91 /build.rs
parent6b9d5099d103df9b076778d97c3607b2ed2729a9 (diff)
downloadrust-libc-727d37a0162108381baea64ffabca7c9a8714600.tar.gz
Revert "Fix invalid freebsd version selection"
This reverts commit 53e79b886bf4e4d3682ae6669e3585b3586e5255. PR #2581 unintentionally changed libc's bindings from the FreeBSD 11 ABI to the native ABI of the build host. This is causing breakage for many downstream crates.
Diffstat (limited to 'build.rs')
-rw-r--r--build.rs12
1 files changed, 7 insertions, 5 deletions
diff --git a/build.rs b/build.rs
index 39eeb3b785..61acba646d 100644
--- a/build.rs
+++ b/build.rs
@@ -25,11 +25,13 @@ fn main() {
// 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(10) => println!("cargo:rustc-cfg=freebsd10"),
- Some(11) => println!("cargo:rustc-cfg=freebsd11"),
- Some(12) => println!("cargo:rustc-cfg=freebsd12"),
- Some(13) => println!("cargo:rustc-cfg=freebsd13"),
- Some(14) => println!("cargo:rustc-cfg=freebsd14"),
+ Some(10) if libc_ci || rustc_dep_of_std => {
+ println!("cargo:rustc-cfg=freebsd10")
+ }
+ 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(14) if libc_ci => println!("cargo:rustc-cfg=freebsd14"),
Some(_) | None => println!("cargo:rustc-cfg=freebsd11"),
}