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

dynamic_lib::tests::test_loading_cosine fails on aarch64-unknown-linux-gnu #45410

Closed
chrisccoulson opened this issue Oct 20, 2017 · 2 comments
Closed
Labels
C-bug Category: This is a bug. O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state O-linux Operating system: Linux O-PowerPC Target: PowerPC processors

Comments

@chrisccoulson
Copy link
Contributor

chrisccoulson commented Oct 20, 2017

When running the tests for 1.20.0 on aarch64-unknown-linux-gnu (compiled on Ubuntu 17.10), I get the following failure:

---- dynamic_lib::tests::test_loading_cosine stdout ----                                                                                                                                                           
        thread 'dynamic_lib::tests::test_loading_cosine' panicked at 'Could not load function cos: /home/ubuntu/src/rustc/rust/build/aarch64-unknown-linux-gnu/stage1-rustc/aarch64-unknown-linux-gnu/release/deps/rustc_back-388893efdcf05f51: undefined symbol: cos', src/librustc_back/dynamic_lib.rs:129:30                                                                                                                       
note: Run with `RUST_BACKTRACE=1` for a backtrace.                                                                                                                                                                 
                                                                                                                                                                                                                   
                                                                                                                                                                                                                   
failures:                                                                                                                                                                                                          
    dynamic_lib::tests::test_loading_cosine                                                                                                                                                                        
                                                                                                                                                                                                                   
test result: FAILED. 72 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out

Despite the comment in src/librustc_back/dynamic_lib.rs "The math library does not need to be loaded since it is already statically linked in", this does not appear to be the case:

$ ldd build/aarch64-unknown-linux-gnu/stage1-rustc/aarch64-unknown-linux-gnu/release/deps/rustc_back-388893efdcf05f51
        linux-vdso.so.1 =>  (0x0000ffff9fef4000)
        libtest-5411e66a07bb6041.so => not found
        libsyntax-5e6bff834b4c594c.so => not found
        libserialize-5db2899038c5db44.so => not found
        libstd-f360fab4c9496629.so => not found
        libdl.so.2 => /lib/aarch64-linux-gnu/libdl.so.2 (0x0000ffff9fe5b000)
        libpthread.so.0 => /lib/aarch64-linux-gnu/libpthread.so.0 (0x0000ffff9fe2e000)
        libgcc_s.so.1 => /lib/aarch64-linux-gnu/libgcc_s.so.1 (0x0000ffff9fe0a000)
        libc.so.6 => /lib/aarch64-linux-gnu/libc.so.6 (0x0000ffff9fcb5000)
        /lib/ld-linux-aarch64.so.1 (0x0000ffff9fec9000)

My build uses all of the default options (including the vendored llvm).

I've not been able to verify whether this is an issue on master yet, because it fails during the build there.

@kennytm kennytm added O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state O-linux Operating system: Linux labels Oct 20, 2017
@TimNN TimNN added the C-bug Category: This is a bug. label Oct 22, 2017
@dezgeg
Copy link

dezgeg commented Dec 2, 2017

NixOS has applied a patch to disable this test on aarch64 as well.

@cuviper
Copy link
Member

cuviper commented Apr 9, 2018

Now this test is in librustc_metadata, but otherwise apparently unchanged. On Fedora, we get failures here on aarch64 and powerpc64le. On the rest of our platforms, readelf -d libtest-*.so shows that they are linked to libm.so.6, but not on aarch64 and powerpc64le. This is true of upstream rust binaries too.

I suspect the test doesn't really care about cosine at all. Perhaps it should exercise something more general, like from libc?

@cuviper cuviper added the O-PowerPC Target: PowerPC processors label Apr 9, 2018
cuviper added a commit to cuviper/rust that referenced this issue Jul 27, 2018
Some platforms don't actually have `libm` already linked in the test
infrastructure, and then `dynamic_lib::tests::test_loading_cosine` would
fail to find the "cos" symbol.  Every platform running this test should
have `libc` and "atoi" though, so try to use that symbol instead.

Fixes rust-lang#45410.
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this issue Jul 27, 2018
…ichton

rustc_metadata: test loading atoi instead of cos

Some platforms don't actually have `libm` already linked in the test
infrastructure, and then `dynamic_lib::tests::test_loading_cosine` would
fail to find the "cos" symbol.  Every platform running this test should
have `libc` and "atoi" though, so try to use that symbol instead.

Fixes rust-lang#45410.
kennytm added a commit to kennytm/rust that referenced this issue Jul 28, 2018
…ichton

rustc_metadata: test loading atoi instead of cos

Some platforms don't actually have `libm` already linked in the test
infrastructure, and then `dynamic_lib::tests::test_loading_cosine` would
fail to find the "cos" symbol.  Every platform running this test should
have `libc` and "atoi" though, so try to use that symbol instead.

Fixes rust-lang#45410.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state O-linux Operating system: Linux O-PowerPC Target: PowerPC processors
Projects
None yet
Development

No branches or pull requests

5 participants