Implemented malloc, abort, exit
This commit is contained in:
@@ -20,14 +20,20 @@ message(STATUS "Target: ${machine}-${platform}")
|
||||
set(CMAKE_EXE_LINKER_FLAGS
|
||||
"${CMAKE_EXE_LINKER_FLAGS} -ffreestanding -nostdlib -lgcc")
|
||||
|
||||
set(malloc_impl dlmalloc)
|
||||
set(photon_libc_sources "")
|
||||
set(generic_dirs string stdio)
|
||||
set(generic_dirs string stdio internal)
|
||||
|
||||
message(STATUS "Memory allocator: ${malloc_impl}")
|
||||
|
||||
foreach (dir ${generic_dirs})
|
||||
file(GLOB dir_sources ${CMAKE_CURRENT_SOURCE_DIR}/photon/libc/${dir}/*.c)
|
||||
set(photon_libc_sources ${photon_libc_sources} ${dir_sources})
|
||||
endforeach (dir)
|
||||
|
||||
file(GLOB malloc_sources
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/photon/libc/stdlib/${malloc_impl}/*.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/photon/libc/stdlib/${malloc_impl}/*.h)
|
||||
file(GLOB_RECURSE photon_libc_headers ${CMAKE_CURRENT_SOURCE_DIR}/photon/libc/include/*.h)
|
||||
|
||||
file(GLOB photon_libc_crt
|
||||
@@ -48,7 +54,7 @@ file(GLOB platform_headers
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/photon/sys/${platform}/*.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/photon/sys/${platform}/machine/${machine}/*.h)
|
||||
|
||||
set(photon_libc_sources ${photon_libc_sources} ${platform_sources})
|
||||
set(photon_libc_sources ${photon_libc_sources} ${malloc_sources} ${platform_sources})
|
||||
set(photon_libc_headers ${photon_libc_headers} ${platform_headers})
|
||||
|
||||
add_library(c SHARED ${photon_libc_sources} ${photon_libc_headers})
|
||||
|
||||
Reference in New Issue
Block a user