From 6f82abb4bb588652e939b6cb53c692a7586d03a1 Mon Sep 17 00:00:00 2001 From: Bernd Kuhls Date: Sun, 10 Jul 2022 13:50:13 +0200 Subject: [cmake] Allow specifying HOST_CAN_EXECUTE_TARGET Executing the target binary will not work when cross-compiling to a uClibc-based target on a glibc-based host. https://github.com/xbmc/xbmc/commit/b9a0c7b1f402613e96876ccfec316831801352bd broke cross-compiling in this case: -- Found Python3: /home/buildroot/buildroot/output/per-package/kodi/host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/python3.10 (found suitable exact version "3.10.5") found components: Development Development.Module Development.Embed -- Could NOT find Python3 (missing: Interpreter) (Required is exact version "3.10") Reason given by package: Interpreter: Cannot run the interpreter "/home/buildroot/buildroot/output/per-package/kodi/host/x86_64-buildroot-linux-uclibc/sysroot/usr/bin/python3.10" $ file /home/buildroot/buildroot/output/per-package/kodi/host/x86_64-buildroot-linux-uclibc/sysroot/usr/bin/python3.10 /home/buildroot/buildroot/output/per-package/kodi/host/x86_64-buildroot-linux-uclibc/sysroot/usr/bin/python3.10: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib/ld64-uClibc.so.0, not stripped This patch allows to force -DHOST_CAN_EXECUTE_TARGET=FALSE to avoid executing the target version of python3 although the host version was set in configure options: -DPYTHON_EXECUTABLE=/home/buildroot/buildroot/output/per-package/kodi/host/bin/python3.10 $ file /home/buildroot/buildroot/output/per-package/kodi/host/bin/python3.10 /home/buildroot/buildroot/output/per-package/kodi/host/bin/python3.10: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=0502eef4c126feb4162aea6d36f321387f2a58fc, for GNU/Linux 3.2.0, with debug_info, not stripped --- cmake/scripts/common/ArchSetup.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmake') diff --git a/cmake/scripts/common/ArchSetup.cmake b/cmake/scripts/common/ArchSetup.cmake index 97a09b4433..a59fcb52f7 100644 --- a/cmake/scripts/common/ArchSetup.cmake +++ b/cmake/scripts/common/ArchSetup.cmake @@ -59,7 +59,7 @@ endif() # this variable is set if we can execute build artefacts on the host system (for example unit tests). if(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL CMAKE_SYSTEM_PROCESSOR AND CMAKE_HOST_SYSTEM_NAME STREQUAL CMAKE_SYSTEM_NAME) - if(NOT HOST_CAN_EXECUTE_TARGET) + if(NOT DEFINED HOST_CAN_EXECUTE_TARGET) set(HOST_CAN_EXECUTE_TARGET TRUE) endif() else() -- cgit v1.2.3