Skip to content

armv4t-none-eabi cannot use compiler_fence #140105

Open
@EvansJahja

Description

@EvansJahja

I tried this code:

target: armv4t-none-eabi

compiler_fence(core::sync::atomic::Ordering::Acquire);

I expected to see this happen: compile successfully

Instead, this happened: rust-lld: error: undefined symbol: __sync_synchronize

Meta

rustc --version --verbose:

rustc 1.88.0-nightly (b8c54d635 2025-04-20)
binary: rustc
commit-hash: b8c54d6358926028ac2fab1ec2b8665c70edb1c0
commit-date: 2025-04-20
host: x86_64-pc-windows-msvc
release: 1.88.0-nightly
LLVM version: 20.1.2
Backtrace

   Compiling armv4t-none-eabi-rust-issues v0.1.0 (C:\Users\EvansGrace02\Documents\Workspace\armv4t-none-eabi-rust-issues)
error: linking with `rust-lld` failed: exit code: 1
  |
  = note: "rust-lld" "-flavor" "gnu" "C:\\Users\\EVANSG~1\\AppData\\Local\\Temp\\rustcua9ZTt\\symbols.o" "<2 object files omitted>" "--as-needed" "-Bstatic" "C:\\Users\\EvansGrace02\\Documents\\Workspace\\armv4t-none-eabi-rust-issues\\target\\armv4t-none-eabi\\debug\\deps/{librustc_std_workspace_core-84d0d8d460275600.rlib,libcore-d30cc2520e72557b.rlib,libcompiler_builtins-b57c6847551ab611.rlib}.rlib" "-L" "C:\\Users\\EVANSG~1\\AppData\\Local\\Temp\\rustcua9ZTt\\raw-dylibs" "-Bdynamic" "--eh-frame-hdr" "-z" "noexecstack" "-o" "C:\\Users\\EvansGrace02\\Documents\\Workspace\\armv4t-none-eabi-rust-issues\\target\\armv4t-none-eabi\\debug\\deps\\armv4t_none_eabi_rust_issues-b850b252791fe0bb" "--gc-sections" "-Tlink.x"        
  = note: some arguments are omitted. use `--verbose` to show all linker arguments
  = note: rust-lld: error: undefined symbol: __sync_synchronize␍
          >>> referenced by atomic.rs:4162 (C:\Users\EvansGrace02\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\sync\atomic.rs:4162)␍
          >>>               C:\Users\EvansGrace02\Documents\Workspace\armv4t-none-eabi-rust-issues\target\armv4t-none-eabi\debug\deps\armv4t_none_eabi_rust_issues-b850b252791fe0bb.5j6rvadtm3yiwcqowkfzw4jgj.1tjialn.rcgu.o:(core::sync::atomic::compiler_fence::h9d169d71a0fb354a)␍
          >>> referenced by atomic.rs:4161 (C:\Users\EvansGrace02\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\sync\atomic.rs:4161)␍
          >>>               C:\Users\EvansGrace02\Documents\Workspace\armv4t-none-eabi-rust-issues\target\armv4t-none-eabi\debug\deps\armv4t_none_eabi_rust_issues-b850b252791fe0bb.5j6rvadtm3yiwcqowkfzw4jgj.1tjialn.rcgu.o:(core::sync::atomic::compiler_fence::h9d169d71a0fb354a)␍
          >>> referenced by atomic.rs:4163 (C:\Users\EvansGrace02\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\sync\atomic.rs:4163)␍
          >>>               C:\Users\EvansGrace02\Documents\Workspace\armv4t-none-eabi-rust-issues\target\armv4t-none-eabi\debug\deps\armv4t_none_eabi_rust_issues-b850b252791fe0bb.5j6rvadtm3yiwcqowkfzw4jgj.1tjialn.rcgu.o:(core::sync::atomic::compiler_fence::h9d169d71a0fb354a)␍
          >>> referenced 1 more times␍

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-atomicArea: Atomics, barriers, and sync primitivesA-codegenArea: Code generationC-bugCategory: This is a bug.O-ArmTarget: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 stateT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions