From fe558718b30da989db8b880374012a0e580574e6 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Mon, 23 Feb 2015 10:51:42 +0100 Subject: [PATCH] GetPrerequisites: Update output matching for newer 'file' versions Detect PIE binaries with newer 'file' (5.22). It no longer prints "(uses shared libraries)" but does print "interpreter": # file 5.19 $ file /usr/bin/su /usr/bin/su: ... shared object, ..., dynamically linked (uses shared libs), ... # file 5.22 $ file /usr/bin/su /usr/bin/su: ... shared object, ..., dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, ... --- Modules/GetPrerequisites.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake index 712a41ce8..9fb85feb1 100644 --- a/Modules/GetPrerequisites.cmake +++ b/Modules/GetPrerequisites.cmake @@ -260,6 +260,13 @@ function(is_file_executable file result_var) return() endif() + # "file" version 5.22 does not print "(used shared libraries)" + # but uses "interpreter" + if("${file_ov}" MATCHES "shared object.*interpreter") + set(${result_var} 1 PARENT_SCOPE) + return() + endif() + else() message(STATUS "warning: No 'file' command, skipping execute_process...") endif()