2026-02-19 19:30:07 +00:00
|
|
|
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")
|
|
|
|
|
|
2026-03-06 20:19:46 +00:00
|
|
|
target_link_libraries(ld
|
|
|
|
|
libc-core libc-malloc libmango librosetta
|
|
|
|
|
interface::fs)
|
2026-02-19 19:30:07 +00:00
|
|
|
|
|
|
|
|
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)
|