[libc-commits] [libc] [libc] Add missing -latomic for rv32 (PR #99337)
Mikhail R. Gadelha via libc-commits
libc-commits at lists.llvm.org
Wed Jul 17 08:08:55 PDT 2024
https://github.com/mikhailramalho created https://github.com/llvm/llvm-project/pull/99337
On rv32, libatomic is needed to build libc when mpfr and gmp are enabled.
>From f3a49599f7d7e3c2f107098a98394af40f2d3663 Mon Sep 17 00:00:00 2001
From: "Mikhail R. Gadelha" <mikhail at igalia.com>
Date: Thu, 11 Jul 2024 11:57:05 -0300
Subject: [PATCH] [libc] Add missing -latomic for rv32
On rv32, libatomic is needed to build libc when mpfr and gmp are
enabled.
---
libc/cmake/modules/LLVMLibCCheckMPFR.cmake | 2 +-
libc/test/src/CMakeLists.txt | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libc/cmake/modules/LLVMLibCCheckMPFR.cmake b/libc/cmake/modules/LLVMLibCCheckMPFR.cmake
index 45334a54431ef..a27c2dc0c030b 100644
--- a/libc/cmake/modules/LLVMLibCCheckMPFR.cmake
+++ b/libc/cmake/modules/LLVMLibCCheckMPFR.cmake
@@ -13,6 +13,6 @@ else()
SOURCES
${LIBC_SOURCE_DIR}/utils/MPFRWrapper/check_mpfr.cpp
LINK_LIBRARIES
- -lmpfr -lgmp
+ -lmpfr -lgmp -latomic
)
endif()
diff --git a/libc/test/src/CMakeLists.txt b/libc/test/src/CMakeLists.txt
index a5e7a2a4dee72..b9a50a47af75d 100644
--- a/libc/test/src/CMakeLists.txt
+++ b/libc/test/src/CMakeLists.txt
@@ -24,7 +24,7 @@ function(add_fp_unittest name)
message(FATAL_ERROR "Hermetic math test cannot require MPFR.")
endif()
set(test_type UNIT_TEST_ONLY)
- list(APPEND MATH_UNITTEST_LINK_LIBRARIES libcMPFRWrapper -lmpfr -lgmp)
+ list(APPEND MATH_UNITTEST_LINK_LIBRARIES libcMPFRWrapper -lmpfr -lgmp -latomic)
endif()
list(APPEND MATH_UNITTEST_LINK_LIBRARIES LibcFPTestHelpers)
More information about the libc-commits
mailing list