Skip to content

undefined reference to __atomic_load_4 on Rust versions newer than nightly-2022-08-12 #297

@Lymia

Description

@Lymia

Discussed in #296

This appears to be a rustc bug. See: rust-lang/rust#100619

When compiling on nightly-2022-08-13 or later, the following happens:

+ cargo build --release --target thumbv4t-none-eabi
   Compiling the-purple-night v0.1.0 (/home/aino/data/projects/crates/agb/examples/the-purple-night)
error: linking with `arm-none-eabi-ld` failed: exit status: 1
  |
  = note: "arm-none-eabi-ld" "/tmp/rustconD6i5/symbols.o" "/home/aino/data/projects/crates/agb/target/thumbv4t-none-eabi/release/deps/the_purple_night-b8ba75b4faeb98b5.the_purple_night.62ef94b1-cgu.0.rcgu.o" "--as-needed" "-L" "/home/aino/data/projects/crates/agb/target/thumbv4t-none-eabi/release/deps" "-L" "/home/aino/data/projects/crates/agb/target/release/deps" "-L" "/home/aino/data/projects/crates/agb/target/thumbv4t-none-eabi/release/build/agb-5ac9222d9e5ae2ce/out" "-L" "/home/aino/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/thumbv4t-none-eabi/lib" "--start-group" "--end-group" "-Bstatic" "/home/aino/data/projects/crates/agb/target/thumbv4t-none-eabi/release/deps/libcompiler_builtins-3b5407e0191965f8.rlib" "-Bdynamic" "--eh-frame-hdr" "-znoexecstack" "-L" "/home/aino/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/thumbv4t-none-eabi/lib" "-o" "/home/aino/data/projects/crates/agb/target/thumbv4t-none-eabi/release/deps/the_purple_night-b8ba75b4faeb98b5" "--gc-sections" "-O1" "-Tgba.ld"
  = note: arm-none-eabi-ld: /home/aino/data/projects/crates/agb/target/thumbv4t-none-eabi/release/deps/libcompiler_builtins-3b5407e0191965f8.rlib(compiler_builtins-3b5407e0191965f8.compiler_builtins.01837706-cgu.0.rcgu.o): in function `compiler_builtins::mem::memmove':
          compiler_builtins.01837706-cgu.0:(.text._ZN17compiler_builtins3mem7memmove17h382c238f4a6131d3E+0x66): undefined reference to `__atomic_load_4'
          arm-none-eabi-ld: compiler_builtins.01837706-cgu.0:(.text._ZN17compiler_builtins3mem7memmove17h382c238f4a6131d3E+0xe8): undefined reference to `__atomic_load_4'
          
  = help: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
  = note: use the `-l` flag to specify native libraries to link
  = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-libkindname)

error: could not compile `the-purple-night` due to previous error
error: Recipe `_build-rom` failed with exit code 101
error: Recipe `build-roms` failed on line 51 with exit code 101

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions