Skip to content

Commit 38f6364

Browse files
authored
[Fuchsia] Add fputs workaround in baremetal targets (#150565)
When building LLVM baremetal targets with LLVM libcxx and LLVM libc, certain FILE related C functions do not exist and this causes build failures. This patch updates the workaround for this to mitigate a build failure after d750c6d got landed.
1 parent f361dd7 commit 38f6364

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang/cmake/caches/Fuchsia-stage2.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ foreach(target armv6m-none-eabi;armv7m-none-eabi;armv7em-none-eabi;armv8m.main-n
340340
foreach(lang C;CXX;ASM)
341341
# TODO: The preprocessor defines workaround various issues in libc and libc++ integration.
342342
# These should be addressed and removed over time.
343-
set(RUNTIMES_${target}_CMAKE_${lang}_local_flags "--target=${target} -Wno-atomic-alignment \"-Dvfprintf(stream, format, vlist)=vprintf(format, vlist)\" \"-Dfprintf(stream, format, ...)=printf(format)\" -D_LIBCPP_PRINT=1")
343+
set(RUNTIMES_${target}_CMAKE_${lang}_local_flags "--target=${target} -Wno-atomic-alignment \"-Dvfprintf(stream, format, vlist)=vprintf(format, vlist)\" \"-Dfprintf(stream, format, ...)=printf(format)\" \"-Dfputs(string, stream)=puts(string)\" -D_LIBCPP_PRINT=1")
344344
if(NOT ${target} STREQUAL "aarch64-none-elf")
345345
set(RUNTIMES_${target}_CMAKE_${lang}_local_flags "${RUNTIMES_${target}_CMAKE_${lang}_local_flags} -mthumb")
346346
endif()
@@ -405,7 +405,7 @@ foreach(target riscv32-unknown-elf)
405405
foreach(lang C;CXX;ASM)
406406
# TODO: The preprocessor defines workaround various issues in libc and libc++ integration.
407407
# These should be addressed and removed over time.
408-
set(RUNTIMES_${target}_CMAKE_${lang}_FLAGS "--target=${target} -march=rv32imafc -mabi=ilp32f -Wno-atomic-alignment \"-Dvfprintf(stream, format, vlist)=vprintf(format, vlist)\" \"-Dfprintf(stream, format, ...)=printf(format)\" -D_LIBCPP_PRINT=1" CACHE STRING "")
408+
set(RUNTIMES_${target}_CMAKE_${lang}_FLAGS "--target=${target} -march=rv32imafc -mabi=ilp32f -Wno-atomic-alignment \"-Dvfprintf(stream, format, vlist)=vprintf(format, vlist)\" \"-Dfprintf(stream, format, ...)=printf(format)\" \"-Dfputs(string, stream)=puts(string)\" -D_LIBCPP_PRINT=1" CACHE STRING "")
409409
endforeach()
410410
foreach(type SHARED;MODULE;EXE)
411411
set(RUNTIMES_${target}_CMAKE_${type}_LINKER_FLAGS "-fuse-ld=lld" CACHE STRING "")

0 commit comments

Comments
 (0)