Skip to content

Nightly fails to compile core with Xargo on thumbv6m due to missing AtomicPtr #45802

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
starblue opened this issue Nov 6, 2017 · 4 comments · Fixed by #45882
Closed

Nightly fails to compile core with Xargo on thumbv6m due to missing AtomicPtr #45802

starblue opened this issue Nov 6, 2017 · 4 comments · Fixed by #45882
Labels
C-bug Category: This is a bug. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@starblue
Copy link

starblue commented Nov 6, 2017

Here is the verbose output:


RUSTFLAGS="-C`` link-arg=-Tlayout_lpc1114.ld" xargo build --release --target thumbv6m-none-eabi --features "lpc1114" --verbose
+ "rustc" "--print" "sysroot"
+ "rustc" "--print" "target-list"
+ RUSTFLAGS="-C link-arg=-Tlayout_lpc1114.ld --sysroot /home/juergen/.xargo -Z force-unstable-if-unmarked"
+ "cargo" "build" "--release" "--manifest-path" "/tmp/xargo.jJOPpAK3kHEu/Cargo.toml" "--target" "thumbv6m-none-eabi" "-v" "-p" "core"
   Compiling core v0.0.0 (file:///home/juergen/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcore)
     Running `rustc --crate-name core /home/juergen/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcore/lib.rs --crate-type lib --emit=dep-info,link -C opt-level=3 -C metadata=30eb9fdc2904bb34 -C extra-filename=-30eb9fdc2904bb34 --out-dir /tmp/xargo.jJOPpAK3kHEu/target/thumbv6m-none-eabi/release/deps --target thumbv6m-none-eabi -L dependency=/tmp/xargo.jJOPpAK3kHEu/target/thumbv6m-none-eabi/release/deps -L dependency=/tmp/xargo.jJOPpAK3kHEu/target/release/deps -C link-arg=-Tlayout_lpc1114.ld --sysroot /home/juergen/.xargo -Z force-unstable-if-unmarked`
error[E0412]: cannot find type `AtomicPtr` in this scope
   --> /home/juergen/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcore/sync/atomic.rs:931:26
    |
931 | impl<T> From<*mut T> for AtomicPtr<T> {
    |                          ^^^^^^^^^ not found in this scope

error: aborting due to previous error

error: Could not compile `core`.

Caused by:
  process didn't exit successfully: `rustc --crate-name core /home/juergen/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcore/lib.rs --crate-type lib --emit=dep-info,link -C opt-level=3 -C metadata=30eb9fdc2904bb34 -C extra-filename=-30eb9fdc2904bb34 --out-dir /tmp/xargo.jJOPpAK3kHEu/target/thumbv6m-none-eabi/release/deps --target thumbv6m-none-eabi -L dependency=/tmp/xargo.jJOPpAK3kHEu/target/thumbv6m-none-eabi/release/deps -L dependency=/tmp/xargo.jJOPpAK3kHEu/target/release/deps -C link-arg=-Tlayout_lpc1114.ld --sysroot /home/juergen/.xargo -Z force-unstable-if-unmarked` (exit code: 101)
error: `"cargo" "build" "--release" "--manifest-path" "/tmp/xargo.jJOPpAK3kHEu/Cargo.toml" "--target" "thumbv6m-none-eabi" "-v" "-p" "core"` failed with exit code: Some(101)

@kennytm kennytm added C-bug Category: This is a bug. O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state labels Nov 6, 2017
@kennytm
Copy link
Member

kennytm commented Nov 6, 2017

cc @strake #45610

All the impl From<T> for Atomic<T> needs to have #[cfg(target_has_atomic)].

@kennytm kennytm added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Nov 6, 2017
@Freyskeyd
Copy link
Contributor

If @strake is busy I can try it.

@kennytm
Copy link
Member

kennytm commented Nov 7, 2017

(Note: affects msp430 as well)

@japaric
Copy link
Member

japaric commented Nov 8, 2017

I saw no open PR to fix this so I opened #45882. (I hope no one minds)

japaric added a commit to rust-embedded/heapless that referenced this issue Nov 8, 2017
japaric added a commit to rust-embedded/heapless that referenced this issue Nov 9, 2017
kennytm added a commit to kennytm/rust that referenced this issue Nov 10, 2017
fix core for targets with max-atomic-width = 0

closes rust-lang#45802

cc @kennytm
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
C-bug Category: This is a bug. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants