Skip to content

Check if libatomic is needed#201

Merged
djw8605 merged 1 commit intoscitokens:masterfrom
ellert:atomic
Feb 26, 2026
Merged

Check if libatomic is needed#201
djw8605 merged 1 commit intoscitokens:masterfrom
ellert:atomic

Conversation

@ellert
Copy link
Contributor

@ellert ellert commented Feb 2, 2026

/usr/bin/powerpc-linux-gnu-ld.bfd: CMakeFiles/scitokens-integration-test.dir/integration_test.cpp.o: undefined reference to symbol '__atomic_load_8@@LIBATOMIC_1.0'
/usr/bin/powerpc-linux-gnu-ld.bfd: /usr/lib/powerpc-linux-gnu/libatomic.so.1: error adding symbols: DSO missing from command line

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses linker errors on PowerPC architecture by adding CMake detection and linking for libatomic. On PowerPC (and some other architectures), 64-bit atomic operations like std::atomic<uint64_t> require linking against libatomic rather than being provided as compiler built-ins.

Changes:

  • Adds cmake/FindAtomic.cmake module to detect whether libatomic is required
  • Modifies test/CMakeLists.txt to find and link libatomic for the integration test executable

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
cmake/FindAtomic.cmake New CMake module that detects atomic support and creates std::atomic interface target
test/CMakeLists.txt Calls find_package(Atomic) and links integration test against std::atomic

/usr/bin/powerpc-linux-gnu-ld.bfd: CMakeFiles/scitokens-integration-test.dir/integration_test.cpp.o: undefined reference to symbol '__atomic_load_8@@LIBATOMIC_1.0'
/usr/bin/powerpc-linux-gnu-ld.bfd: /usr/lib/powerpc-linux-gnu/libatomic.so.1: error adding symbols: DSO missing from command line

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@djw8605 djw8605 merged commit 0a3a2a1 into scitokens:master Feb 26, 2026
18 checks passed
@ellert ellert deleted the atomic branch February 27, 2026 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants