Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions scripts/llext_merge_sections.ld
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
SECTIONS
{
.text 0 : { *(.literal .text .literal.* .text.*) }
.cold 0 : { *(.cold.literal .cold.literal.* .cold .cold.*) }
.rodata 0 : { *(.rodata .rodata.*) }
.data 0 : { *(.data .data.* .data.rel.ro .data.rel.ro.*) }
.bss 0 : { *(.bss .bss.* COMMON) }
Expand Down
22 changes: 22 additions & 0 deletions zephyr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,28 @@ function(sof_llext_build module)
set(EXTRA_LINKER_PARAMS -nostdlib -nodefaultlibs -shared)
endif()

if(CMAKE_C_COMPILER_ID STREQUAL "Clang" OR
CMAKE_C_COMPILER_ID STREQUAL "AppleClang")
if(CMAKE_C_COMPILER_TARGET)
list(PREPEND EXTRA_LINKER_PARAMS "--target=${CMAKE_C_COMPILER_TARGET}")
endif()
if(CMAKE_EXE_LINKER_FLAGS)
string(REPLACE ";" " " _exe_linker_flags_str "${CMAKE_EXE_LINKER_FLAGS}")
separate_arguments(_exe_linker_flags NATIVE_COMMAND "${_exe_linker_flags_str}")
set(_expect_ld_path FALSE)
foreach(_flag IN LISTS _exe_linker_flags)
if(_expect_ld_path)
list(APPEND EXTRA_LINKER_PARAMS "--ld-path=${_flag}")
set(_expect_ld_path FALSE)
elseif(_flag STREQUAL "--ld-path")
set(_expect_ld_path TRUE)
elseif(_flag MATCHES "^--ld-path=(.+)$")
list(APPEND EXTRA_LINKER_PARAMS "--ld-path=${CMAKE_MATCH_1}")
endif()
endforeach()
endif()
endif()

foreach(path ${SOF_LLEXT_LIBS_PATH})
llext_link_options(${module} -L${path})
set(EXTRA_LINKER_PARAMS ${EXTRA_LINKER_PARAMS} -L${path})
Expand Down
Loading