File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,12 @@ function(_get_common_compile_options output_var flags)
21
21
set (compile_options ${LIBC_COMPILE_OPTIONS_DEFAULT} ${ARGN} )
22
22
if (LLVM_COMPILER_IS_GCC_COMPATIBLE )
23
23
list (APPEND compile_options "-fpie" )
24
- list (APPEND compile_options "-ffreestanding" )
24
+
25
+ if (LLVM_LIBC_FULL_BUILD )
26
+ # Only add -ffreestanding flag in full build mode.
27
+ list (APPEND compile_options "-ffreestanding" )
28
+ endif ()
29
+
25
30
list (APPEND compile_options "-fno-builtin" )
26
31
list (APPEND compile_options "-fno-exceptions" )
27
32
list (APPEND compile_options "-fno-lax-vector-conversions" )
Original file line number Diff line number Diff line change @@ -156,8 +156,14 @@ function(create_libc_unittest fq_target_name)
156
156
)
157
157
target_compile_options (
158
158
${fq_build_target_name}
159
- PRIVATE -fpie -ffreestanding ${LIBC_COMPILE_OPTIONS_DEFAULT}
159
+ PRIVATE -fpie ${LIBC_COMPILE_OPTIONS_DEFAULT}
160
160
)
161
+ if (LLVM_LIBC_FULL_BUILD )
162
+ target_compile_options (
163
+ ${fq_build_target_name}
164
+ PRIVATE -ffreestanding
165
+ )
166
+ endif ()
161
167
if (LIBC_UNITTEST_COMPILE_OPTIONS )
162
168
target_compile_options (
163
169
${fq_build_target_name}
You can’t perform that action at this time.
0 commit comments