Implemented printf and friends

This commit is contained in:
Max Wash
2020-04-03 19:21:22 +01:00
parent 4e7c3c20b1
commit ea2651bd55
17 changed files with 1033 additions and 5 deletions

View File

@@ -3,7 +3,7 @@ file(GLOB test_sources ${CMAKE_CURRENT_SOURCE_DIR}/*.c)
foreach (test ${test_sources})
get_filename_component(test_name ${test} NAME_WE)
add_executable(${test_name} ${test} $<TARGET_OBJECTS:crt>)
target_compile_options(${test_name} PRIVATE -ffreestanding -nostdlib -nostdinc)
target_compile_options(${test_name} PRIVATE -ffreestanding -nostdlib)
target_include_directories(${test_name} PRIVATE
${CMAKE_CURRENT_BINARY_DIR}/../sysroot/usr/include)
target_link_libraries(${test_name} c)

View File

@@ -3,6 +3,6 @@
int main(int argc, char **argv)
{
fputs("Hello, world!\n", stdout);
printf("Hello, world!\n");
return 0;
}