Commit 3832b75e authored by Francesco Gazzetta's avatar Francesco Gazzetta Committed by Anderson Torres
Browse files

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)
parent 48dc37ae
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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`.