@@ -308,16 +308,16 @@ foreach(target armv6m-none-eabi;armv7m-none-eabi;armv8m.main-none-eabi)
308308 set (BUILTINS_${target} _CMAKE_SYSTEM_PROCESSOR arm CACHE STRING "" )
309309 set (BUILTINS_${target} _CMAKE_SYSROOT "" CACHE STRING "" )
310310 set (BUILTINS_${target} _CMAKE_BUILD_TYPE MinSizeRel CACHE STRING "" )
311- foreach (lang C;CXX;ASM)
312- set (BUILTINS_${target} _CMAKE_${lang} _local_flags "--target=${target} -mthumb" )
313- if (${target} STREQUAL "armv8m.main-none-eabi" )
314- set (BUILTINS_${target} _CMAKE_${lang} _local_flags "${BUILTINS_${target} _CMAKE_${lang} _local_flags} -mfloat-abi=softfp -march=armv8m.main+fp+dsp -mcpu=cortex-m33" CACHE STRING "" )
315- endif ()
316- set (BUILTINS_${target} _CMAKE_${lang} _FLAGS "${BUILTINS_${target} _CMAKE_${lang} _local_flags}" CACHE STRING "" )
317- endforeach ()
318- foreach (type SHARED;MODULE;EXE)
319- set (BUILTINS_${target} _CMAKE_${type} _LINKER_FLAGS "-fuse-ld=lld" CACHE STRING "" )
320- endforeach ()
311+ foreach (lang C;CXX;ASM)
312+ set (BUILTINS_${target} _CMAKE_${lang} _local_flags "--target=${target} -mthumb" )
313+ if (${target} STREQUAL "armv8m.main-none-eabi" )
314+ set (BUILTINS_${target} _CMAKE_${lang} _local_flags "${BUILTINS_${target} _CMAKE_${lang} _local_flags} -mfloat-abi=softfp -march=armv8m.main+fp+dsp -mcpu=cortex-m33" CACHE STRING "" )
315+ endif ()
316+ set (BUILTINS_${target} _CMAKE_${lang} _FLAGS "${BUILTINS_${target} _CMAKE_${lang} _local_flags}" CACHE STRING "" )
317+ endforeach ()
318+ foreach (type SHARED;MODULE;EXE)
319+ set (BUILTINS_${target} _CMAKE_${type} _LINKER_FLAGS "-fuse-ld=lld" CACHE STRING "" )
320+ endforeach ()
321321 set (BUILTINS_${target} _COMPILER_RT_BAREMETAL_BUILD ON CACHE BOOL "" )
322322
323323 list (APPEND RUNTIME_TARGETS "${target} " )
@@ -326,18 +326,18 @@ foreach(target armv6m-none-eabi;armv7m-none-eabi;armv8m.main-none-eabi)
326326 set (RUNTIMES_${target} _CMAKE_SYSROOT "" CACHE STRING "" )
327327 set (RUNTIMES_${target} _CMAKE_BUILD_TYPE MinSizeRel CACHE STRING "" )
328328 set (RUNTIMES_${target} _CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY CACHE STRING "" )
329- foreach (lang C;CXX;ASM)
330- # TODO: The preprocessor defines workaround various issues in libc and libc++ integration.
331- # These should be addressed and removed over time.
332- set (RUNTIMES_${target} _CMAKE_${lang} _local_flags "--target=${target} -mthumb -Wno-atomic-alignment \" -Dvfprintf(stream, format, vlist)=vprintf(format, vlist)\" \" -Dfprintf(stream, format, ...)=printf(format)\" \" -Dtimeval=struct timeval{int tv_sec; int tv_usec;}\" \" -Dgettimeofday(tv, tz)\" -D_LIBCPP_PRINT=1" )
333- if (${target} STREQUAL "armv8m.main-none-eabi" )
334- set (RUNTIMES_${target} _CMAKE_${lang} _local_flags "${RUNTIMES_${target} _CMAKE_${lang} _local_flags} -mfloat-abi=softfp -march=armv8m.main+fp+dsp -mcpu=cortex-m33" CACHE STRING "" )
335- endif ()
336- set (RUNTIMES_${target} _CMAKE_${lang} _FLAGS "${RUNTIMES_${target} _CMAKE_${lang} _local_flags}" CACHE STRING "" )
337- endforeach ()
338- foreach (type SHARED;MODULE;EXE)
339- set (RUNTIMES_${target} _CMAKE_${type} _LINKER_FLAGS "-fuse-ld=lld" CACHE STRING "" )
340- endforeach ()
329+ foreach (lang C;CXX;ASM)
330+ # TODO: The preprocessor defines workaround various issues in libc and libc++ integration.
331+ # These should be addressed and removed over time.
332+ set (RUNTIMES_${target} _CMAKE_${lang} _local_flags "--target=${target} -mthumb -Wno-atomic-alignment \" -Dvfprintf(stream, format, vlist)=vprintf(format, vlist)\" \" -Dfprintf(stream, format, ...)=printf(format)\" \" -Dtimeval=struct timeval{int tv_sec; int tv_usec;}\" \" -Dgettimeofday(tv, tz)\" -D_LIBCPP_PRINT=1" )
333+ if (${target} STREQUAL "armv8m.main-none-eabi" )
334+ set (RUNTIMES_${target} _CMAKE_${lang} _local_flags "${RUNTIMES_${target} _CMAKE_${lang} _local_flags} -mfloat-abi=softfp -march=armv8m.main+fp+dsp -mcpu=cortex-m33" CACHE STRING "" )
335+ endif ()
336+ set (RUNTIMES_${target} _CMAKE_${lang} _FLAGS "${RUNTIMES_${target} _CMAKE_${lang} _local_flags}" CACHE STRING "" )
337+ endforeach ()
338+ foreach (type SHARED;MODULE;EXE)
339+ set (RUNTIMES_${target} _CMAKE_${type} _LINKER_FLAGS "-fuse-ld=lld" CACHE STRING "" )
340+ endforeach ()
341341 set (RUNTIMES_${target} _LLVM_LIBC_FULL_BUILD ON CACHE BOOL "" )
342342 set (RUNTIMES_${target} _LIBC_ENABLE_USE_BY_CLANG ON CACHE BOOL "" )
343343 set (RUNTIMES_${target} _LIBC_USE_NEW_HEADER_GEN OFF CACHE BOOL "" )
@@ -368,12 +368,12 @@ foreach(target riscv32-unknown-elf)
368368 set (BUILTINS_${target} _CMAKE_SYSTEM_PROCESSOR RISCV CACHE STRING "" )
369369 set (BUILTINS_${target} _CMAKE_SYSROOT "" CACHE STRING "" )
370370 set (BUILTINS_${target} _CMAKE_BUILD_TYPE MinSizeRel CACHE STRING "" )
371- foreach (lang C;CXX;ASM)
372- set (BUILTINS_${target} _CMAKE_${lang} _FLAGS "--target=${target} -march=rv32imafc -mabi=ilp32f" CACHE STRING "" )
373- endforeach ()
374- foreach (type SHARED;MODULE;EXE)
375- set (BUILTINS_${target} _CMAKE_${type} _LINKER_FLAGS "-fuse-ld=lld" CACHE STRING "" )
376- endforeach ()
371+ foreach (lang C;CXX;ASM)
372+ set (BUILTINS_${target} _CMAKE_${lang} _FLAGS "--target=${target} -march=rv32imafc -mabi=ilp32f" CACHE STRING "" )
373+ endforeach ()
374+ foreach (type SHARED;MODULE;EXE)
375+ set (BUILTINS_${target} _CMAKE_${type} _LINKER_FLAGS "-fuse-ld=lld" CACHE STRING "" )
376+ endforeach ()
377377 set (BUILTINS_${target} _COMPILER_RT_BAREMETAL_BUILD ON CACHE BOOL "" )
378378
379379 list (APPEND RUNTIME_TARGETS "${target} " )
@@ -382,14 +382,14 @@ foreach(target riscv32-unknown-elf)
382382 set (RUNTIMES_${target} _CMAKE_SYSROOT "" CACHE STRING "" )
383383 set (RUNTIMES_${target} _CMAKE_BUILD_TYPE MinSizeRel CACHE STRING "" )
384384 set (RUNTIMES_${target} _CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY CACHE STRING "" )
385- foreach (lang C;CXX;ASM)
386- # TODO: The preprocessor defines workaround various issues in libc and libc++ integration.
387- # These should be addressed and removed over time.
388- 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)\" \" -Dtimeval=struct timeval{int tv_sec; int tv_usec;}\" \" -Dgettimeofday(tv, tz)\" -D_LIBCPP_PRINT=1" CACHE STRING "" )
389- endforeach ()
390- foreach (type SHARED;MODULE;EXE)
391- set (RUNTIMES_${target} _CMAKE_${type} _LINKER_FLAGS "-fuse-ld=lld" CACHE STRING "" )
392- endforeach ()
385+ foreach (lang C;CXX;ASM)
386+ # TODO: The preprocessor defines workaround various issues in libc and libc++ integration.
387+ # These should be addressed and removed over time.
388+ 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)\" \" -Dtimeval=struct timeval{int tv_sec; int tv_usec;}\" \" -Dgettimeofday(tv, tz)\" -D_LIBCPP_PRINT=1" CACHE STRING "" )
389+ endforeach ()
390+ foreach (type SHARED;MODULE;EXE)
391+ set (RUNTIMES_${target} _CMAKE_${type} _LINKER_FLAGS "-fuse-ld=lld" CACHE STRING "" )
392+ endforeach ()
393393 set (RUNTIMES_${target} _LLVM_LIBC_FULL_BUILD ON CACHE BOOL "" )
394394 set (RUNTIMES_${target} _LIBC_ENABLE_USE_BY_CLANG ON CACHE BOOL "" )
395395 set (RUNTIMES_${target} _LIBC_USE_NEW_HEADER_GEN OFF CACHE BOOL "" )
0 commit comments