File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -187,7 +187,7 @@ function(create_libc_unittest fq_target_name)
187187 if (LLVM_LIBC_FULL_BUILD)
188188 target_compile_options (
189189 ${fq_build_target_name}
190- PRIVATE -ffreestanding
190+ PRIVATE -ffreestanding -fno-exceptions -fno-rtti -fno-unwind-tables -fno-asynchronous-unwind-tables
191191 )
192192 endif ()
193193 if (LIBC_UNITTEST_COMPILE_OPTIONS)
Original file line number Diff line number Diff line change @@ -4,9 +4,13 @@ if(LIBC_TESTS_CAN_USE_MPFR)
44 MPFRUtils.h
55 mpfr_inc.h
66 )
7- add_compile_options (
8- -O3
9- )
7+ target_compile_options (libcMPFRWrapper PRIVATE -O3)
8+ if (LLVM_LIBC_FULL_BUILD)
9+ # It is not easy to make libcMPFRWrapper a standalone library because gmp.h may unconditionally
10+ # pull in some STL headers. As a result, targets using this library will need to link against
11+ # C++ and unwind libraries. Since we are using MPFR anyway, we directly specifies the GNU toolchain.
12+ target_link_libraries (libcMPFRWrapper PUBLIC -lstdc++ -lgcc_s)
13+ endif ()
1014 add_dependencies (
1115 libcMPFRWrapper
1216 libc.src.__support.CPP.string_view
@@ -19,7 +23,7 @@ if(LIBC_TESTS_CAN_USE_MPFR)
1923 target_include_directories (libcMPFRWrapper PUBLIC ${LLVM_LIBC_MPFR_INSTALL_PATH} /include )
2024 target_link_directories (libcMPFRWrapper PUBLIC ${LLVM_LIBC_MPFR_INSTALL_PATH} /lib)
2125 endif ()
22- target_link_libraries (libcMPFRWrapper LibcFPTestHelpers.unit LibcTest.unit mpfr gmp)
26+ target_link_libraries (libcMPFRWrapper PUBLIC LibcFPTestHelpers.unit LibcTest.unit mpfr gmp)
2327elseif (NOT LIBC_TARGET_ARCHITECTURE_IS_GPU)
2428 message (WARNING "Math tests using MPFR will be skipped." )
2529endif ()
You can’t perform that action at this time.
0 commit comments