[libc-commits] [libc] e5ccc71 - [libc] Add missing -latomic for rv32 (#99337)
via libc-commits
libc-commits at lists.llvm.org
Wed Jul 17 09:41:16 PDT 2024
Author: Mikhail R. Gadelha
Date: 2024-07-17T13:41:12-03:00
New Revision: e5ccc7136dab209d769cc97efd7f1596c12d5bec
URL: https://github.com/llvm/llvm-project/commit/e5ccc7136dab209d769cc97efd7f1596c12d5bec
DIFF: https://github.com/llvm/llvm-project/commit/e5ccc7136dab209d769cc97efd7f1596c12d5bec.diff
LOG: [libc] Add missing -latomic for rv32 (#99337)
On rv32, libatomic is needed to build libc when mpfr and gmp are enabled.
Added:
Modified:
libc/cmake/modules/LLVMLibCCheckMPFR.cmake
libc/test/src/CMakeLists.txt
Removed:
################################################################################
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