Skip to content

Conversation

@barracuda156
Copy link
Contributor

@ConorWilliams Will this work? On ppc it works correctly, test fails and -latomic is added to linker flags:

/opt/local/bin/g++-mp-14 -pipe -Os -DNDEBUG -I/opt/local/include -D_GLIBCXX_USE_CXX11_ABI=0 -arch ppc -mmacosx-version-min=10.6 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -L/opt/local/lib -Wl,-headerpad_max_install_names CMakeFiles/libfork_test.dir/source/algorithm/explicit.cpp.o CMakeFiles/libfork_test.dir/source/algorithm/fold.cpp.o CMakeFiles/libfork_test.dir/source/algorithm/for_each.cpp.o CMakeFiles/libfork_test.dir/source/algorithm/map.cpp.o CMakeFiles/libfork_test.dir/source/algorithm/scan.cpp.o CMakeFiles/libfork_test.dir/source/catch.cpp.o CMakeFiles/libfork_test.dir/source/core/bad_behavior.cpp.o CMakeFiles/libfork_test.dir/source/core/core.cpp.o CMakeFiles/libfork_test.dir/source/core/deque.cpp.o CMakeFiles/libfork_test.dir/source/core/eventually.cpp.o CMakeFiles/libfork_test.dir/source/core/exceptions.cpp.o CMakeFiles/libfork_test.dir/source/core/explicit.cpp.o CMakeFiles/libfork_test.dir/source/core/extern.cpp.o CMakeFiles/libfork_test.dir/source/core/extern_test.cpp.o CMakeFiles/libfork_test.dir/source/core/just.cpp.o CMakeFiles/libfork_test.dir/source/core/lazy_pool.cpp.o CMakeFiles/libfork_test.dir/source/core/result.cpp.o CMakeFiles/libfork_test.dir/source/core/unbalanced.cpp.o CMakeFiles/libfork_test.dir/source/core/wsq.cpp.o CMakeFiles/libfork_test.dir/source/macro.cpp.o CMakeFiles/libfork_test.dir/source/numa.cpp.o CMakeFiles/libfork_test.dir/source/schedule/event_count.cpp.o -o libfork_test  -Wl,-rpath,/opt/local/lib /opt/local/lib/libCatch2Main.a -latomic /opt/local/lib/libCatch2.a

P. S. 1-byte atomics may be needed by RISCV, so I added that too.


find_package(Threads REQUIRED)

if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
Copy link
Owner

Choose a reason for hiding this comment

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

Why only for GNU?

Copy link
Contributor Author

@barracuda156 barracuda156 Jan 17, 2026

Choose a reason for hiding this comment

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

It is a gcc library. It won’t exist without gcc and should not be used by something other than gcc.

(I think clang uses compiler-rt, but not sure and cannot test that.)

@ConorWilliams ConorWilliams merged commit 2f359cd into ConorWilliams:main Jan 17, 2026
4 of 9 checks passed
@barracuda156 barracuda156 deleted the atomic branch January 17, 2026 14:18
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.

2 participants