Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
llext: fix Windows builds
Under windows the Python interpreter has to be called explicitly.
Without it an attempt to execute a Python script fails silently.

Signed-off-by: Guennadi Liakhovetski <[email protected]>
  • Loading branch information
lyakh committed Jul 11, 2024
commit b7e483752f23d31d3d272ce5cae27dac3b80d08a
14 changes: 13 additions & 1 deletion scripts/xtensa-build-zephyr.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import gzip
import dataclasses
import concurrent.futures as concurrent
import re

from west import configuration as west_config

Expand Down Expand Up @@ -945,7 +946,18 @@ def install_lib(sof_lib_dir, abs_build_dir, platform_wconfig):
llext_input = entry_path / (llext_base + '.llext')
llext_output = entry_path / (llext_file + '.ri')

sign_cmd = [platform_wconfig.get("rimage.path"), "-o", str(llext_output),
# on Windows platform_wconfig.get("rimage.path") returns a string
# with multiple nested single and double quotes, which then break
# execution:
# In dir: D:\a\sof\sof\workspace; running command:
# ''"'"'D:\a\sof\sof\workspace\build-rimage\rimage.EXE'"'"'' -o
# 'D:\a\sof\sof\workspace\build-mtl\zephyr\eq_iir_llext\eq_iir.llext.ri' -e
# -c 'D:\a\sof\sof\workspace\build-mtl\zephyr\eq_iir_llext\rimage_config.toml'
# -k 'D:\a\sof\sof\workspace\sof\keys\otc_private_key_3k.pem' -l
# -r 'D:\a\sof\sof\workspace\build-mtl\zephyr\eq_iir_llext\eq_iir.llext'
# The regex below cleans them up
rimage_cmd = re.sub(r"[\"']", "", platform_wconfig.get("rimage.path"))
sign_cmd = [rimage_cmd, "-o", str(llext_output),
"-e", "-c", str(rimage_cfg),
"-k", str(signing_key), "-l", "-r",
str(llext_input)]
Expand Down
2 changes: 1 addition & 1 deletion zephyr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function(sof_llext_build module)
get_target_property(proc_out_file ${module} pkg_input)
add_llext_command(TARGET ${module}
POST_BUILD
COMMAND ${SOF_BASE}scripts/llext_link_helper.py
COMMAND ${PYTHON_EXECUTABLE} ${SOF_BASE}scripts/llext_link_helper.py
--text-addr="${SOF_LLEXT_TEXT_ADDR}" -f ${proc_in_file} ${CMAKE_C_COMPILER} --
-o ${proc_out_file} ${EXTRA_LINKER_PARAMS}
$<TARGET_OBJECTS:${module}_llext_lib>
Expand Down