From 777530647f280ddb7081a50c7460e77ca0c4b05e Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Thu, 2 Jul 2026 14:31:54 +0100 Subject: [PATCH] tools: ctl: drop build-tree RUNPATH from sof-ctl sof-ctl adds tools/lib as a link directory so it can link against a locally built ALSA. CMake also embeds that directory in the ELF RPATH/RUNPATH, so the binary carries a reference into the build tree. On install the path is stripped to an empty string, which leaves an empty DT_RUNPATH tag behind. Distro ELF security scanners reject that: scanelf reports "Security problem NULL DT_RUNPATH". Keep tools/lib as a -L link path only: skip the build RPATH and keep the install RPATH empty so no DT_RUNPATH tag is emitted at all. The installed binary resolves libasound through the normal loader search path. Link: https://github.com/thesofproject/sof/issues/10070 Signed-off-by: Liam Girdwood --- tools/ctl/CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/ctl/CMakeLists.txt b/tools/ctl/CMakeLists.txt index 5c4c2dd315b5..ba897c99d126 100644 --- a/tools/ctl/CMakeLists.txt +++ b/tools/ctl/CMakeLists.txt @@ -11,6 +11,16 @@ target_link_libraries(sof-ctl PRIVATE "-lasound" ) +# tools/lib is only needed as a -L link path for a locally built ALSA. +# Do not let CMake also embed it as an ELF RPATH/RUNPATH: it points into +# the build tree and, once stripped to empty on install, leaves an empty +# DT_RUNPATH tag that trips distro ELF security scanners (scanelf reports +# "NULL DT_RUNPATH"). Skip the build RPATH and keep the install RPATH +# empty so no DT_RUNPATH tag is emitted. See thesofproject/sof#10070. +set_target_properties(sof-ctl PROPERTIES + SKIP_BUILD_RPATH TRUE + INSTALL_RPATH "") + target_compile_options(sof-ctl PRIVATE -Wall -Werror )