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)
187
187
if (LLVM_LIBC_FULL_BUILD )
188
188
target_compile_options (
189
189
${fq_build_target_name}
190
- PRIVATE -ffreestanding
190
+ PRIVATE -ffreestanding -fno-exceptions -fno-rtti -fno-unwind-tables -fno-asynchronous-unwind-tables
191
191
)
192
192
endif ()
193
193
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)
4
4
MPFRUtils.h
5
5
mpfr_inc.h
6
6
)
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 ()
10
14
add_dependencies (
11
15
libcMPFRWrapper
12
16
libc.src.__support.CPP.string_view
@@ -19,7 +23,7 @@ if(LIBC_TESTS_CAN_USE_MPFR)
19
23
target_include_directories (libcMPFRWrapper PUBLIC ${LLVM_LIBC_MPFR_INSTALL_PATH} /include )
20
24
target_link_directories (libcMPFRWrapper PUBLIC ${LLVM_LIBC_MPFR_INSTALL_PATH} /lib )
21
25
endif ()
22
- target_link_libraries (libcMPFRWrapper LibcFPTestHelpers.unit LibcTest.unit mpfr gmp )
26
+ target_link_libraries (libcMPFRWrapper PUBLIC LibcFPTestHelpers.unit LibcTest.unit mpfr gmp )
23
27
elseif (NOT LIBC_TARGET_ARCHITECTURE_IS_GPU )
24
28
message (WARNING "Math tests using MPFR will be skipped." )
25
29
endif ()
You can’t perform that action at this time.
0 commit comments