Build: Use sh instead of ls for ELF configuration

On RHEL variants, if coreutils-single is installed, ls is a script
that contains:

#!/usr/bin/coreutils --coreutils-prog-shebang=ls

Replace ls with sh, which is supposed to be a binary (or a symlink
to one) everywhere.

Pick-to: 6.6
Change-Id: I2a43ac9e3332a470951bbf3335f2fdf3ae5c698c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 1026e2c98c602ec51bcb722a6597bc7a37a4e6ab)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Orgad Shaneh 2024-01-25 08:47:05 +02:00 committed by Qt Cherry-pick Bot
parent ea47b017d4
commit ea2f804cf6

View File

@ -418,7 +418,7 @@ set_source_files_properties(
# Find ELF interpreter and define a macro for that:
if ((LINUX OR HURD) AND NOT CMAKE_CROSSCOMPILING AND BUILD_SHARED_LIBS)
if (NOT DEFINED ELF_INTERPRETER)
execute_process(COMMAND ${CMAKE_COMMAND} -E env LC_ALL=C readelf -l /bin/ls
execute_process(COMMAND ${CMAKE_COMMAND} -E env LC_ALL=C readelf -l /bin/sh
RESULT_VARIABLE readelf_ok
OUTPUT_VARIABLE readelf_output
)