sys: add ld runtime linker
This commit is contained in:
24
sys/ld/CMakeLists.txt
Normal file
24
sys/ld/CMakeLists.txt
Normal file
@@ -0,0 +1,24 @@
|
||||
file(GLOB c_sources *.c *.h)
|
||||
file(GLOB arch_sources arch/${CMAKE_SYSTEM_PROCESSOR}/*.S)
|
||||
|
||||
set_property(SOURCE ${arch_sources} PROPERTY LANGUAGE C)
|
||||
|
||||
add_executable(ld ${c_sources} ${arch_sources})
|
||||
set_target_properties(ld PROPERTIES
|
||||
POSITION_INDEPENDENT_CODE ON
|
||||
OUTPUT_NAME "ld64"
|
||||
SUFFIX ".so")
|
||||
|
||||
target_link_libraries(ld ulibc libmango)
|
||||
|
||||
target_compile_options(ld PRIVATE
|
||||
-fPIC -fno-stack-protector -nostdlib -ffreestanding)
|
||||
target_link_options(ld PRIVATE
|
||||
-fPIC -nostdlib -ffreestanding -Wl,-shared)
|
||||
|
||||
sysroot_add_program(
|
||||
NAME ld
|
||||
BIN_DIR /lib)
|
||||
bsp_add_program(
|
||||
NAME ld
|
||||
BIN_DIR /lib)
|
||||
Reference in New Issue
Block a user