Skip to content

Platform/Linux: fix -latomic on RISCV64 port

Dimitri John Ledkov requested to merge xnox/cmake:riscv64 into master

RISCV64 port on Linux requires -latomic to be linked, as some funcationality required by C/C++ may not be available in hardware, requiring a runtime implementation.

Although, some compilers try to add -latomic, it may or may not work under CMake and --as-needed linking.

This is similar to how some Android toolchain files specify -latomic as well.

Tested on Ubuntu, with this patch fixes failure to build from source of rocksdb, mariadb-10.3, opendht and probably other projects on RISCV64 without modifying their CMake configuration.

Fixes: #20895 (closed)

Merge request reports