about summary refs log tree commit diff
path: root/pkgs/by-name/cm
diff options
context:
space:
mode:
authorFrancesco Gazzetta <fgaz@fgaz.me>2023-11-20 17:41:08 +0100
committerAnderson Torres <torres.anderson.85@protonmail.com>2023-11-22 16:10:35 -0300
commit3832b75e4e37be74c0311b4f03191c6e221966f0 (patch)
tree1f15f88123367e8933c78138537865d5c76c2b93 /pkgs/by-name/cm
parent48dc37ae96adf8bb4a952712aadb7c236d39ca02 (diff)
downloadnixlib-3832b75e4e37be74c0311b4f03191c6e221966f0.tar
nixlib-3832b75e4e37be74c0311b4f03191c6e221966f0.tar.gz
nixlib-3832b75e4e37be74c0311b4f03191c6e221966f0.tar.bz2
nixlib-3832b75e4e37be74c0311b4f03191c6e221966f0.tar.lz
nixlib-3832b75e4e37be74c0311b4f03191c6e221966f0.tar.xz
nixlib-3832b75e4e37be74c0311b4f03191c6e221966f0.tar.zst
nixlib-3832b75e4e37be74c0311b4f03191c6e221966f0.zip
cmake: fix risc-v build failure
riscv64 is failing due to missing atomic ops in gcc 12.
This commit works around the problem by linking against libatomic.

It can be reverted when we switch to gcc 13 (#268097)
Diffstat (limited to 'pkgs/by-name/cm')
-rw-r--r--pkgs/by-name/cm/cmake/package.nix2
1 files changed, 2 insertions, 0 deletions
diff --git a/pkgs/by-name/cm/cmake/package.nix b/pkgs/by-name/cm/cmake/package.nix
index a57314791501..1b8aefd1b911 100644
--- a/pkgs/by-name/cm/cmake/package.nix
+++ b/pkgs/by-name/cm/cmake/package.nix
@@ -138,6 +138,8 @@ stdenv.mkDerivation (finalAttrs: {
     "CFLAGS=-D_FILE_OFFSET_BITS=64"
     "CXXFLAGS=-D_FILE_OFFSET_BITS=64"
   ]
+  # Workaround missing atomic ops with gcc <13
+  ++ lib.optional stdenv.hostPlatform.isRiscV "LDFLAGS=-latomic"
   ++ [
     "--"
     # We should set the proper `CMAKE_SYSTEM_NAME`.