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

linker error "undefined symbol: __aeabi_uidiv" for target thumbv6m-none-eabi #60782

Closed
starblue opened this issue May 13, 2019 · 7 comments · Fixed by #60841
Closed

linker error "undefined symbol: __aeabi_uidiv" for target thumbv6m-none-eabi #60782

starblue opened this issue May 13, 2019 · 7 comments · Fixed by #60841
Labels
A-linkage Area: linking into static, shared libraries and binaries C-bug Category: This is a bug. O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state P-high High priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@starblue
Copy link

Beginning with nightly-2019-05-10 I get the following linker error:

error: linking with `rust-lld` failed: exit code: 1
  |
  = note: "rust-lld" "-flavor" "gnu" "-L" "/home/juergen/.rustup/toolchains/nightly-2019-05-10-x86_64-unknown-linux-gnu/lib/rustlib/thumbv6m-none-eabi/lib" "/home/juergen/rust/dust/dust-test/target/thumbv6m-none-eabi/release/deps/test_uart-988eaff94921fb1c.test_uart.67ne5b40-cgu.0.rcgu.o" "-o" "/home/juergen/rust/dust/dust-test/target/thumbv6m-none-eabi/release/deps/test_uart-988eaff94921fb1c" "--gc-sections" "-L" "/home/juergen/rust/dust/dust-test/target/thumbv6m-none-eabi/release/deps" "-L" "/home/juergen/rust/dust/dust-test/target/release/deps" "-L" "/home/juergen/.rustup/toolchains/nightly-2019-05-10-x86_64-unknown-linux-gnu/lib/rustlib/thumbv6m-none-eabi/lib" "--start-group" "--end-group" "-Bstatic" "/home/juergen/.rustup/toolchains/nightly-2019-05-10-x86_64-unknown-linux-gnu/lib/rustlib/thumbv6m-none-eabi/lib/libcompiler_builtins-afe13c5355265d4c.rlib" "-Tldscripts/lpc802m001.ld" "-Lldscripts" "-Map=output/lpc802m001_test-uart.map" "-Bdynamic"
  = note: rust-lld: error: undefined symbol: __aeabi_uidiv
          >>> referenced by num.rs:204 (src/libcore/fmt/num.rs:204)
          >>>               /home/juergen/rust/dust/dust-test/target/thumbv6m-none-eabi/release/deps/test_uart-988eaff94921fb1c.test_uart.67ne5b40-cgu.0.rcgu.o:(core::fmt::num::imp::fmt_u32::h2131a43fb24cc589)
@jonas-schievink
Copy link
Contributor

Please post a way to reproduce this. What code are you trying to build?

@starblue
Copy link
Author

This is test-code for microcontrollers using my own framework called dust.
I now uploaded it to https://github.com/starblue/dust .
To reproduce go into the dust-test subdirectory and run make clean && make test-uart with some version of nightly (nightly is needed due to inline assembly). For example, I did

rustup run nightly-2019-05-10-x86_64-unknown-linux-gnu bash -c "make clean && make test-uart"

@jonas-schievink jonas-schievink added A-linkage Area: linking into static, shared libraries and binaries C-bug Category: This is a bug. O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. I-nominated labels May 13, 2019
@hellow554
Copy link
Contributor

hellow554 commented May 13, 2019

Maybe these two are related? #60747
The date matches, I wouldn't be surprised

@jonas-schievink jonas-schievink removed the regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. label May 13, 2019
@jonas-schievink
Copy link
Contributor

(removing regression label since this never built on stable)

@mati865
Copy link
Contributor

mati865 commented May 13, 2019

#60491 was merged on 2019-05-09 and modifies compiler-builtins.

cc @alexcrichton

EDIT: Related commit rust-lang/compiler-builtins@4bbc838

alexcrichton added a commit to alexcrichton/compiler-builtins that referenced this issue May 14, 2019
This commit fixes a bug accidentally introduced in rust-lang#285 where some
lingering references remained to `#[cfg(thumbv6m)]` but this, since the
historical revert, was renamed to `#[cfg(thumb_1)]`. This caused on the
thumbv6m platform for the intrinsics to be accidentally omitted because
the build script didn't actually compile them but the Rust code thought
the C code was in use.

After correcting the `#[cfg]` statements the CI configuration for the
`thumb*` family of targets was all updated. The support for xargo
testing was removed from `run.sh` since it had long since bitrotted, and
the script was updated to simply build the intrinsics example to attempt
to link for each of these targets. This in turn exposed the bug locally
and allowed to confirm a fix once the `#[cfg]` statements were
corrected.

cc rust-lang/rust#60782
@alexcrichton
Copy link
Member

Thanks for the report @starblue and the cc @mati865, this should be fixed in rust-lang/compiler-builtins#290.

@pnkfelix
Copy link
Member

triage: P-high. (I'm not 100% sure that prioritization is warranted for this target, but given that it may already be fixed, I don't mind err'ing on the side of too-high a priority.)

@pnkfelix pnkfelix added P-high High priority and removed I-nominated labels May 16, 2019
alexcrichton added a commit to alexcrichton/rust that referenced this issue May 17, 2019
This updates to 0.1.13 for `compiler_builtins`, published to fix a few
issues. The feature changes here are updated because `compiler_builtins`
no longer enables the `c` feature by default but we want to do so
through our build still.

Closes rust-lang#60747
Closes rust-lang#60782
bors added a commit that referenced this issue May 17, 2019
Update the compiler_builtins crate

This updates to 0.1.13 for `compiler_builtins`, published to fix a few
issues. The feature changes here are updated because `compiler_builtins`
no longer enables the `c` feature by default but we want to do so
through our build still.

Closes #60747
Closes #60782
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linkage Area: linking into static, shared libraries and binaries C-bug Category: This is a bug. O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state P-high High priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants