Skip to content

Commit 3824d15

Browse files
committed
fixes
1 parent 77d042f commit 3824d15

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

builtins-test/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,11 +405,12 @@ macro_rules! apfloat_fallback {
405405
}};
406406
}
407407

408-
#[cfg(target_arch = "s390x")]
409408
mod bootstrap {
410409
// Needed for testing other symbols,
411410
#[linkage = "weak"]
412411
#[unsafe(no_mangle)]
412+
#[cfg(f16_enabled)]
413+
#[cfg(target_arch = "s390x")]
413414
pub extern "C" fn __extendhfsf2(a: f16) -> f32 {
414415
compiler_builtins::float::extend::__extendhfsf2(a)
415416
}

libm/configure.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,16 @@ impl Config {
3333
.map(|s| s.to_lowercase().replace("_", "-"))
3434
.collect();
3535

36+
let target_arch = env::var("CARGO_CFG_TARGET_ARCH").unwrap();
37+
let bootstrapping_f16 = target_arch == "x86";
38+
3639
Self {
3740
target_triple,
3841
manifest_dir: PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap()),
3942
out_dir: PathBuf::from(env::var("OUT_DIR").unwrap()),
4043
opt_level: env::var("OPT_LEVEL").unwrap(),
4144
cargo_features,
42-
target_arch: env::var("CARGO_CFG_TARGET_ARCH").unwrap(),
45+
target_arch,
4346
target_env: env::var("CARGO_CFG_TARGET_ENV").unwrap(),
4447
target_family: env::var("CARGO_CFG_TARGET_FAMILY").ok(),
4548
target_os: env::var("CARGO_CFG_TARGET_OS").unwrap(),
@@ -50,7 +53,7 @@ impl Config {
5053
// with `RUSTC_BOOTSTRAP=1` (which is required to use the types anyway).
5154
// reliable_f128: env::var_os("CARGO_CFG_TARGET_HAS_RELIABLE_F128").is_some(),
5255
// reliable_f16: env::var_os("CARGO_CFG_TARGET_HAS_RELIABLE_F16").is_some(),
53-
reliable_f16: true,
56+
reliable_f16: !bootstrapping_f16,
5457
reliable_f128: true,
5558
}
5659
}

0 commit comments

Comments
 (0)