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

i686-pc-windows-gnu std tests complain about duplicate symbol #59

Open
RalfJung opened this issue Apr 6, 2024 · 0 comments · Fixed by rust-lang/compiler-builtins#586

Comments

@RalfJung
Copy link
Member

RalfJung commented Apr 6, 2024

$ ./run-test.sh std --target i686-pc-windows-gnu --lib f32
[...]
error: multiple definitions of symbol `lgammaf_r`
    --> /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/f32.rs:1196:26
     |
1196 |         let x = unsafe { cmath::lgammaf_r(self, &mut signgamp) };
     |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ multiple definitions of symbol `lgammaf_r`
     |
help: it's first defined here, in crate `compiler_builtins`
    --> /home/r/.cargo/registry/src/index.crates.io-6f17d22bba15001f/compiler_builtins-0.1.108/src/math.rs:102:1
     |
102  | / intrinsics! {
103  | |     pub extern "C" fn lgamma_r(x: f64, s: &mut i32) -> f64 {
104  | |         let r = self::libm::lgamma_r(x);
105  | |         *s = r.1;
...    |
113  | |     }
114  | | }
     | |_^
help: then it's defined here again, in crate `compiler_builtins`
    --> /home/r/.cargo/registry/src/index.crates.io-6f17d22bba15001f/compiler_builtins-0.1.108/src/math.rs:102:1
     |
102  | / intrinsics! {
103  | |     pub extern "C" fn lgamma_r(x: f64, s: &mut i32) -> f64 {
104  | |         let r = self::libm::lgamma_r(x);
105  | |         *s = r.1;
...    |
113  | |     }
114  | | }
     | |_^
     = note: BACKTRACE (of the first span) on thread `f32::tests::test_ln_gamma`:
     = note: inside `realstd::f32::<impl f32>::ln_gamma` at /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/f32.rs:1196:26: 1196:63
note: inside `f32::tests::test_ln_gamma`
    --> library/std/src/f32/tests.rs:677:23
     |
677  |     assert_approx_eq!(1.0f32.ln_gamma().0, 0.0f32);
     |                       ^^^^^^^^^^^^^^^^^
note: inside closure
    --> library/std/src/f32/tests.rs:676:19
     |
675  | #[test]
     | ------- in this procedural macro expansion
676  | fn test_ln_gamma() {
     |                   ^
     = note: this error originates in the macro `intrinsics` which comes from the expansion of the attribute macro `test` (in Nightly builds, run with -Z macro-backtrace for more info)

note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace

error: aborting due to 1 previous error

test f32::tests::test_ln_gamma ... error: test failed, to rerun pass `--lib`

This is of course twice the same symbol. But apparently we're getting compiler_builtins duplicated the same way core/alloc/std are duplicated.

@RalfJung RalfJung changed the title i686-pc-windows-gnu std tests complain about duplicate synbol i686-pc-windows-gnu std tests complain about duplicate symbol Apr 6, 2024
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 a pull request may close this issue.

1 participant