File tree Expand file tree Collapse file tree 6 files changed +25
-2
lines changed Expand file tree Collapse file tree 6 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,12 @@ set(TARGET_LIBC_ENTRYPOINTS
6363 libc.src.inttypes.imaxdiv
6464 libc.src.inttypes.strtoimax
6565 libc.src.inttypes.strtoumax
66+
67+ # stdio.h entrypoints
68+ libc.src.stdio.sprintf
69+ libc.src.stdio.snprintf
70+ libc.src.stdio.vsprintf
71+ libc.src.stdio.vsnprintf
6672
6773 # stdlib.h entrypoints
6874 libc.src.stdlib.abs
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ set(TARGET_PUBLIC_HEADERS
44 libc.include.errno
55 libc.include.inttypes
66 libc.include.math
7+ libc.include.stdio
78 libc.include.stdlib
89 libc.include.string
910 libc.include.strings
Original file line number Diff line number Diff line change @@ -64,6 +64,12 @@ set(TARGET_LIBC_ENTRYPOINTS
6464 libc.src.inttypes.strtoimax
6565 libc.src.inttypes.strtoumax
6666
67+ # stdio.h entrypoints
68+ libc.src.stdio.sprintf
69+ libc.src.stdio.snprintf
70+ libc.src.stdio.vsprintf
71+ libc.src.stdio.vsnprintf
72+
6773 # stdlib.h entrypoints
6874 libc.src.stdlib.abs
6975 libc.src.stdlib.atoi
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ set(TARGET_PUBLIC_HEADERS
44 libc.include.errno
55 libc.include.inttypes
66 libc.include.math
7+ libc.include.stdio
78 libc.include.stdlib
89 libc.include.string
910 libc.include.strings
Original file line number Diff line number Diff line change @@ -26,6 +26,14 @@ if(NOT LIBC_TARGET_ARCHITECTURE_IS_GPU)
2626 add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /generic)
2727endif ()
2828
29+ if (${LIBC_TARGET_OS} STREQUAL "baremetal" )
30+ list (APPEND printf_copts
31+ "-DLIBC_COPT_PRINTF_DISABLE_FLOAT"
32+ "-DLIBC_COPT_PRINTF_DISABLE_INDEX_MODE"
33+ "-DLIBC_COPT_PRINTF_DISABLE_WRITE_INT"
34+ )
35+ endif ()
36+
2937add_subdirectory (printf_core)
3038add_subdirectory (scanf_core)
3139
@@ -419,13 +427,13 @@ list(APPEND printf_deps
419427 libc.src.stdio.printf_core.vfprintf_internal
420428)
421429if (LLVM_LIBC_FULL_BUILD)
422- list (APPEND printf_deps
430+ list (APPEND printf_deps
423431 libc.src.__support.File.file
424432 libc.src.__support.File.platform_file
425433 libc.src.__support.File.platform_stdout
426434 )
427435else ()
428- set ( printf_copts "-DLIBC_COPT_PRINTF_USE_SYSTEM_FILE" )
436+ list ( APPEND printf_copts "-DLIBC_COPT_PRINTF_USE_SYSTEM_FILE" )
429437endif ()
430438
431439add_entrypoint_object(
Original file line number Diff line number Diff line change @@ -93,6 +93,7 @@ add_object_library(
9393 libc.src.__support.float_to_string
9494 COMPILE_OPTIONS
9595 -DLIBC_COPT_FLOAT_TO_STR_USE_MEGA_LONG_DOUBLE_TABLE
96+ ${printf_copts}
9697)
9798
9899
You can’t perform that action at this time.
0 commit comments