[libc-commits] [libc] [libc] Remove -ffreestanding when building MPFR wrapper. (PR #107637)

via libc-commits libc-commits at lists.llvm.org
Fri Sep 6 13:38:55 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: None (lntue)

<details>
<summary>Changes</summary>

MPFR/GMP headers do not work with -ffreestanding flags.

---
Full diff: https://github.com/llvm/llvm-project/pull/107637.diff


1 Files Affected:

- (modified) libc/utils/MPFRWrapper/CMakeLists.txt (+2) 


``````````diff
diff --git a/libc/utils/MPFRWrapper/CMakeLists.txt b/libc/utils/MPFRWrapper/CMakeLists.txt
index e6d3b5af9dc297..941d3cf004d483 100644
--- a/libc/utils/MPFRWrapper/CMakeLists.txt
+++ b/libc/utils/MPFRWrapper/CMakeLists.txt
@@ -5,6 +5,8 @@ if(LIBC_TESTS_CAN_USE_MPFR)
     mpfr_inc.h
   )
   _get_common_test_compile_options(compile_options "" "")
+  # mpfr/gmp headers do not work with -ffreestanding flag.
+  list(REMOVE_ITEM compile_options "-ffreestanding")
   target_compile_options(libcMPFRWrapper PRIVATE -O3 ${compile_options})
   add_dependencies(
     libcMPFRWrapper

``````````

</details>


https://github.com/llvm/llvm-project/pull/107637


More information about the libc-commits mailing list