Subject: [PATCH] gnu: gperftools: Fix build on riscv64-linux.
From: Zheng Junjie <[email-masked]>
To: [email-masked]
Date: Sat, 9 Mar 2024 16:27:57 +0800
List-Id: <debbugs-submit.debbugs.gnu.org>

* gnu/packages/cpp.scm(gperftools)[arguments]: When building for riscv64-linux
always link with libatomic.

Change-Id: I067087fffd8c142759b6d113f993c3e2ab1aef9b
---
 gnu/packages/cpp.scm | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 3b65ce9f4a..d451eea2fd 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -30,7 +30,7 @@
 ;;; Copyright © 2022 Attila Lendvai <[email-masked]>
 ;;; Copyright © 2022 Arun Isaac <[email-masked]>
 ;;; Copyright © 2022, 2023, 2024 David Elsing <[email-masked]>
-;;; Copyright © 2022, 2023 Zheng Junjie <[email-masked]>
+;;; Copyright © 2022-2024 Zheng Junjie <[email-masked]>
 ;;; Copyright © 2022, 2023, 2024 Maxim Cournoyer <[email-masked]>
 ;;; Copyright © 2022 Antero Mejr <[email-masked]>
 ;;; Copyright © 2023 Sughosha <[email-masked]>
@@ -907,9 +907,12 @@ (define-public gperftools
        (file-name (git-file-name name version))))
     (build-system gnu-build-system)
     (arguments
-      ;; The tests are flaky when run in parallel. For more info:
-      ;; https://bugs.gnu.org/46562
-     '(#:parallel-tests? #f))
+     ;; The tests are flaky when run in parallel. For more info:
+     ;; https://bugs.gnu.org/46562
+     `(#:parallel-tests? #f
+       ,@(if (target-riscv64?)
+             `(#:make-flags (list "LDFLAGS=-latomic"))
+             '())))
     (native-inputs
      (list autoconf automake libtool
            ;; For tests.

base-commit: a10cce5246e333be52acd7d334f59228895db89a
prerequisite-patch-id: 5a904c413bc4e5484fed86ec8a7862b20ef3156e
prerequisite-patch-id: a70182b0cf360548e7a3ae659e40c58ee3ddad71
-- 
2.41.0