Skip to content

libatomic linking needed for some archs (arm, ppc) #3546

Closed

Description

@barracuda156

Describe the bug

Some archs require linking to libatomic, otherwise build fails to link with undefined ___atomic_fetch_add_8 etc.

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

On platforms without hardware support for 8-byte atomics, libatomic should be used.

Current Behavior

[  7%] Linking CXX shared library libaws-cpp-sdk-core.dylib
cd /opt/local/var/macports/build/aws-sdk-cpp-14f15bf3/work/build/src/aws-cpp-sdk-core && /opt/local/bin/cmake -E cmake_link_script CMakeFiles/aws-cpp-sdk-core.dir/link.txt --verbose=ON
Undefined symbols for architecture ppc:
  "___atomic_fetch_add_8", referenced from:
      Aws::Utils::Threading::ReaderWriterLock::UnlockWriter() in ub_core.cpp.o
      Aws::Utils::Threading::ReaderWriterLock::LockReader() in ub_core.cpp.o
      Aws::Utils::Threading::ReaderWriterLock::LockWriter() in ub_core.cpp.o
  "___atomic_fetch_sub_8", referenced from:
      Aws::Utils::Threading::ReaderWriterLock::UnlockReader() in ub_core.cpp.o
      Aws::Utils::Threading::ReaderWriterLock::LockWriter() in ub_core.cpp.o
  "___atomic_load_8", referenced from:
      Aws::Client::AWSAuthSigner::GetClockSkewOffset() const in ub_core.cpp.o
  "___atomic_store_8", referenced from:
      Aws::Client::AWSAuthSigner::SetClockSkew(std::chrono::duration<long long, std::ratio<1ll, 1000ll> > const&) in ub_core.cpp.o
      __ZN3Aws6Client13AWSAuthSignerC4Ev in ub_core.cpp.o
ld: symbol(s) not found for architecture ppc
collect2: error: ld returned 1 exit status

Reproduction Steps

Run the build on an affected platform.

Possible Solution

Add a configure test to CMakeLists for support of 8-byte atomics.

Additional Information/Context

Relevant for some 32-bit archs: arm, ppc, possibly mips.

AWS CPP SDK version used

1.11.649

Compiler and Version used

gcc 14.3.0

Operating System and version

macOS 10.6.8

Activity

  1. added
    bugThis issue is a bug.
    needs-triageThis issue or PR still needs to be triaged.
    on Sep 17, 2025
  2. sbaluja commented on Sep 17, 2025

    @sbaluja
    Contributor

    Curious about your current toolchain, the sdk requires libcurl and a libcrypto (openssl/aws-lc) dependency, how are you getting those? are you building them yourself or getting them via other means?

  3. barracuda156 commented on Sep 17, 2025

    @barracuda156
    Author

    @sbaluja I build everything from source, but largely using MacPorts’ ports – and adding mine when something is missing in upstream or needs extra fixes/tweaks. Specifically curl and openssl are from MacPorts. All AWS libs’ ports are mine (loosely based off FreeBSD ones with Darwin-specific fixes).

  4. added
    feature-requestA feature should be added or improved.
    and removed
    bugThis issue is a bug.
    needs-triageThis issue or PR still needs to be triaged.
    on Oct 28, 2025
  5. kai-ion commented on Sep 23, 2026

    @kai-ion
    Contributor

    Converting this to a Discussion. It's an improvements we plan to pursue over time rather than one actionable change with a near-term milestone, so a Discussion better fits collecting the specifics and design input.

  6. locked and limited conversation to collaborators on Sep 23, 2026
  7. converted this issue into a discussion #3939 on Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestA feature should be added or improved.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions