Skip to content

Commit 02e0dc9

Browse files
lrgirdwolgirdwood
authored andcommitted
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: #10070 Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
1 parent 056b149 commit 02e0dc9

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎tools/ctl/CMakeLists.txt‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@ target_link_libraries(sof-ctl PRIVATE
1111
"-lasound"
1212
)
1313

14+
# tools/lib is only needed as a -L link path for a locally built ALSA.
15+
# Do not let CMake also embed it as an ELF RPATH/RUNPATH: it points into
16+
# the build tree and, once stripped to empty on install, leaves an empty
17+
# DT_RUNPATH tag that trips distro ELF security scanners (scanelf reports
18+
# "NULL DT_RUNPATH"). Skip the build RPATH and keep the install RPATH
19+
# empty so no DT_RUNPATH tag is emitted. See thesofproject/sof#10070.
20+
set_target_properties(sof-ctl PROPERTIES
21+
SKIP_BUILD_RPATH TRUE
22+
INSTALL_RPATH "")
23+
1424
target_compile_options(sof-ctl PRIVATE
1525
-Wall -Werror
1626
)

0 commit comments

Comments
 (0)