@@ -325,7 +325,9 @@ foreach(target armv6m-unknown-eabi;armv7m-unknown-eabi;armv8m.main-unknown-eabi)
325
325
set (RUNTIMES_${target}_CMAKE_BUILD_TYPE MinSizeRel CACHE STRING "" )
326
326
set (RUNTIMES_${target}_CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY CACHE STRING "" )
327
327
foreach (lang C;CXX;ASM )
328
- set (RUNTIMES_${target}_CMAKE_${lang}_FLAGS "--target=${target} -mthumb -Wno-atomic-alignment" CACHE STRING "" )
328
+ # TODO: The preprocessor defines workaround various issues in libc and libc++ integration.
329
+ # These should be addressed and removed over time.
330
+ set (RUNTIMES_${target}_CMAKE_${lang}_FLAGS "--target=${target} -mthumb -Wno-atomic-alignment -D'vfprintf(stream, format, vlist)=vprintf(format, vlist)' -D'fprintf(stream, format, ...)=printf(format)' -D'timeval=struct timeval{int tv_sec; int tv_usec;}' -D'gettimeofday(tv, tz)' -D_LIBCPP_PRINT=1" CACHE STRING "" )
329
331
endforeach ()
330
332
foreach (type SHARED;MODULE;EXE )
331
333
set (RUNTIMES_${target}_CMAKE_${type}_LINKER_FLAGS "-fuse-ld=lld" CACHE STRING "" )
@@ -335,7 +337,7 @@ foreach(target armv6m-unknown-eabi;armv7m-unknown-eabi;armv8m.main-unknown-eabi)
335
337
set (RUNTIMES_${target}_LIBCXX_ABI_VERSION 2 CACHE STRING "" )
336
338
set (RUNTIMES_${target}_LIBCXX_CXX_ABI none CACHE STRING "" )
337
339
set (RUNTIMES_${target}_LIBCXX_ENABLE_SHARED OFF CACHE BOOL "" )
338
- set (RUNTIMES_${target}_LIBCXX_ENABLE_STATIC OFF CACHE BOOL "" )
340
+ set (RUNTIMES_${target}_LIBCXX_ENABLE_STATIC ON CACHE BOOL "" )
339
341
set (RUNTIMES_${target}_LIBCXX_ENABLE_FILESYSTEM OFF CACHE BOOL "" )
340
342
set (RUNTIMES_${target}_LIBCXX_ENABLE_RANDOM_DEVICE OFF CACHE BOOL "" )
341
343
set (RUNTIMES_${target}_LIBCXX_ENABLE_LOCALIZATION OFF CACHE BOOL "" )
@@ -373,7 +375,9 @@ foreach(target riscv32-unknown-elf)
373
375
set (RUNTIMES_${target}_CMAKE_BUILD_TYPE MinSizeRel CACHE STRING "" )
374
376
set (RUNTIMES_${target}_CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY CACHE STRING "" )
375
377
foreach (lang C;CXX;ASM )
376
- set (RUNTIMES_${target}_CMAKE_${lang}_FLAGS "--target=${target} -march=rv32imafc -mabi=ilp32f" CACHE STRING "" )
378
+ # TODO: The preprocessor defines workaround various issues in libc and libc++ integration.
379
+ # These should be addressed and removed over time.
380
+ set (RUNTIMES_${target}_CMAKE_${lang}_FLAGS "--target=${target} -march=rv32imafc -mabi=ilp32f -D'vfprintf(stream, format, vlist)=vprintf(format, vlist)' -D'fprintf(stream, format, ...)=printf(format)' -D'timeval=struct timeval{int tv_sec; int tv_usec;}' -D'gettimeofday(tv, tz)' -D_LIBCPP_PRINT=1" CACHE STRING "" )
377
381
endforeach ()
378
382
foreach (type SHARED;MODULE;EXE )
379
383
set (RUNTIMES_${target}_CMAKE_${type}_LINKER_FLAGS "-fuse-ld=lld" CACHE STRING "" )
@@ -383,7 +387,7 @@ foreach(target riscv32-unknown-elf)
383
387
set (RUNTIMES_${target}_LIBCXX_ABI_VERSION 2 CACHE STRING "" )
384
388
set (RUNTIMES_${target}_LIBCXX_CXX_ABI none CACHE STRING "" )
385
389
set (RUNTIMES_${target}_LIBCXX_ENABLE_SHARED OFF CACHE BOOL "" )
386
- set (RUNTIMES_${target}_LIBCXX_ENABLE_STATIC OFF CACHE BOOL "" )
390
+ set (RUNTIMES_${target}_LIBCXX_ENABLE_STATIC ON CACHE BOOL "" )
387
391
set (RUNTIMES_${target}_LIBCXX_ENABLE_FILESYSTEM OFF CACHE BOOL "" )
388
392
set (RUNTIMES_${target}_LIBCXX_ENABLE_RANDOM_DEVICE OFF CACHE BOOL "" )
389
393
set (RUNTIMES_${target}_LIBCXX_ENABLE_LOCALIZATION OFF CACHE BOOL "" )
0 commit comments