Skip to content

compiler-rt does not define aarch64 outline atomics #10086

Closed
@nitsky

Description

@nitsky

Zig Version

0.9.0-dev.1551+8346e011c

Steps to Reproduce

On aarch64 linux:

#include <stdatomic.h>
#include <stdio.h>

int main() {
  atomic_int atomic_counter = 0;
  atomic_counter++;
  printf("%u\n", atomic_counter);
}
  1. gcc main.c
  2. zig cc main.c
  3. gcc -moutline-atomics main.c
  4. zig cc -moutline-atomics main.c

Expected Behavior

I expect all variations to compile and run correctly.

Actual Behavior

zig cc -moutline-atomics main.c fails to compile:

ld.lld: error: undefined symbol: __aarch64_ldadd4_acq_rel

I discovered this issue while attempting to cross compile Rust to aarch64-linux with zig cc. Rust enables outline atomics by default on aarch64-linux and currently prohibits disabling them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    arch-aarch6464-bit ARMbugObserved behavior contradicts documented or intended behaviorenhancementSolving this issue will likely involve adding new logic or components to the codebase.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions