[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:21 PDT 2024


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

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

>From 9b694bad75c4968c8c04a05279ffbe326f9e4377 Mon Sep 17 00:00:00 2001
From: Tue Ly <lntue.h at gmail.com>
Date: Fri, 6 Sep 2024 20:36:22 +0000
Subject: [PATCH] [libc] Remove -ffreestanding when building MPFR wrapper.

---
 libc/utils/MPFRWrapper/CMakeLists.txt | 2 ++
 1 file changed, 2 insertions(+)

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



More information about the libc-commits mailing list