MantisBT - CMake
View Issue Details
0014725CMakeCPackpublic2014-01-31 15:102016-06-10 14:31
Bastian Angermann 
Kitware Robot 
normalminoralways
closedmoved 
PCLinuxUbuntu 13.10
CMake 2.8.12.1 
 
0014725: shared library is mistaken for an executable by is_file_executable
Running fixup_bundle on an executable the depends on libQtCore.so.4 will fail, since libQtCore.so.4 is mistaken for an position independent executable by is_file_executable. The culprit is the following test in GetPrerequisits.cmake:
if("${file_ov}" MATCHES "shared object.*\(uses shared libs\)")
which is not specific enough.

Run
> file libQtCore.so.4
libQtCore.so.4: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), BuildID[sha1]=0x46033c4f1e9e6221817fd9eb4d9ce3fdd7c40791, stripped

The output matched the pattern tested for, even though this is a shared library.
A PIE compiled on the same system yields:
> gcc -fPIE test.cpp
> file a.out
a.out: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=0x7a9ef65567c34d0e38a911c4e29273df9eb34f79, not stripped

The system is question is a Ubuntu 13.10, with the vendor supplied g++. The Qt library in question is not the system Qt, it is compiled from the official Qt 4.8.5 sources.

> g++ --version
g++ (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

> ld --version
GNU ld (GNU Binutils for Ubuntu) 2.23.2
Copyright 2012 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.
No tags attached.
Issue History
2014-01-31 15:10Bastian AngermannNew Issue
2014-02-03 09:27Clinton StimpsonNote Added: 0035022
2016-06-10 14:29Kitware RobotNote Added: 0042472
2016-06-10 14:29Kitware RobotStatusnew => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:29Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0035022)
Clinton Stimpson   
2014-02-03 09:27   
The output of file on an executable built with the linker flag -pie in addition to -fPIE gives this:
testqt: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=0xb8230d46ad31abcbfad543383bc78e65f5742a00, not stripped

Which is exactly identical to the output for libQtCore.so.4.

So, it appears we need to use something other than the file command to find out if it is an executable.

But interestingly, I can do this:
$ /usr/lib64/libQtCore.so.4
This is the QtCore library version 4.8.5
Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
Contact: http://www.qt-project.org/legal [^]

Build key: x86_64 linux g++-4 full-config
Compat build key: | x86_64 Linux g++-4 full-config |
Build date: 2014-01-17
Installation prefix: /usr/lib64/qt4
Library path: /usr/lib64
Include path: /usr/include
Processor features: mmx sse sse2 cmov sse3 ssse3 sse4.1 sse4.2 avx

So, it is an executable, no?.
(0042472)
Kitware Robot   
2016-06-10 14:29   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.