diff options
author | Marcus Meissner <meissner@suse.de> | 2015-02-23 09:51:42 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-02-23 16:50:29 (GMT) |
commit | fe558718b30da989db8b880374012a0e580574e6 (patch) | |
tree | 0946ced3f67d2103cae57cb8691bf38efd3252a7 /Modules/GetPrerequisites.cmake | |
parent | d95d4c2c775e6eb6db1800be869d97b5464628ab (diff) | |
download | CMake-fe558718b30da989db8b880374012a0e580574e6.zip CMake-fe558718b30da989db8b880374012a0e580574e6.tar.gz CMake-fe558718b30da989db8b880374012a0e580574e6.tar.bz2 |
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, ...
Diffstat (limited to 'Modules/GetPrerequisites.cmake')
-rw-r--r-- | Modules/GetPrerequisites.cmake | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake index 712a41c..9fb85fe 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() |