MantisBT - CMake
View Issue Details
0013364CMakeCMakepublic2012-06-30 12:282012-12-03 07:46
Michael Palimaka 
Clinton Stimpson 
CMake 2.8.8 
CMake 2.8.9CMake 2.8.9 
0013364: BundleUtilities test fails
With both 2.8.8 release and git experimental build, the BundleUtilities test fails.

The details can be seen here on the dashboard: [^]
No tags attached.
patch test.patch (2,618) 2012-06-30 17:12
txt link.txt (8,011) 2012-07-03 13:58
Issue History
2012-06-30 12:28Michael PalimakaNew Issue
2012-06-30 17:12Clinton StimpsonNote Added: 0029866
2012-06-30 17:12Clinton StimpsonFile Added: test.patch
2012-07-01 12:38Michael PalimakaNote Added: 0029868
2012-07-02 06:57Michael PalimakaNote Added: 0029873
2012-07-02 10:43Clinton StimpsonNote Added: 0029874
2012-07-02 10:57Michael PalimakaNote Added: 0029875
2012-07-02 11:05Clinton StimpsonNote Added: 0029876
2012-07-02 11:22Michael PalimakaNote Added: 0029877
2012-07-02 12:24Clinton StimpsonNote Added: 0029878
2012-07-02 12:37Michael PalimakaNote Added: 0029879
2012-07-02 12:48Clinton StimpsonNote Added: 0029880
2012-07-02 12:56Michael PalimakaNote Added: 0029881
2012-07-03 13:52Clinton StimpsonNote Added: 0029898
2012-07-03 13:58Michael PalimakaFile Added: link.txt
2012-07-03 13:59Michael PalimakaNote Added: 0029899
2012-07-03 14:02Clinton StimpsonNote Added: 0029900
2012-07-05 14:50Clinton StimpsonNote Added: 0029920
2012-07-05 14:50Clinton StimpsonStatusnew => resolved
2012-07-05 14:50Clinton StimpsonResolutionopen => fixed
2012-07-05 14:50Clinton StimpsonAssigned To => Clinton Stimpson
2012-07-09 16:23David ColeFixed in Version => CMake 2.8.9
2012-07-09 16:23David ColeTarget Version => CMake 2.8.9
2012-12-03 07:46David ColeNote Added: 0031808
2012-12-03 07:46David ColeStatusresolved => closed

Clinton Stimpson   
2012-06-30 17:12   
Can you help diagnose this, as I'm not able to reproduce this.

What does this command give you?
$ file /home/michael/dev/cmake/Tests/BundleUtilities/testbundleutils1

I get this:
./testbundleutils1: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, not stripped

Also, can you try the patch I'm attaching to see if it changes anything?
Michael Palimaka   
2012-07-01 12:38   
I get a similar output:

/home/michael/dev/cmake/Tests/BundleUtilities/testbundleutils1: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped

Unfortunately, the patch doesn't change the test output in any way.

Thanks for the response, and please let me know anything else I can provide to help track this down.
Michael Palimaka   
2012-07-02 06:57   
When running the test manually:

./testbundleutils1: error while loading shared libraries: cannot open shared object file: No such file or directory
Clinton Stimpson   
2012-07-02 10:43   
The problem is that your file command did not print the keyword "executable"
We need to find out why and fix that, modify getprerequisites.cmake to recognize the alternate output, or use a different tool.

The problem running it is because it has absolute rpaths built in that it needs to be installed to run, but your install step in the test doesn't work.
Michael Palimaka   
2012-07-02 10:57   
What version of file are you using? I have 5.11 here.
Clinton Stimpson   
2012-07-02 11:05   
I'm using 5.04 and my /etc/magic and /usr/share/misc/magic are empty.

Perhaps you have local definitions that change these words (the man page says to avoid that).
Michael Palimaka   
2012-07-02 11:22   
I get the same output with 5.04, and both those are empty too.
Clinton Stimpson   
2012-07-02 12:24   
Does "objdump -f testbundleutils1" give EXEC_P among others?
What compile flags were used to build it?
What does "file" give?
Michael Palimaka   
2012-07-02 12:37   
$ objdump -f Tests/BundleUtilities/testbundleutils1
Tests/BundleUtilities/testbundleutils1: file format elf64-x86-64
architecture: i386:x86-64, flags 0x00000150:
start address 0x00000000000009f0

$ file Tests/BundleUtilities/
Tests/BundleUtilities/ ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, not stripped

No flags were specified when building.
Clinton Stimpson   
2012-07-02 12:48   
Try this:
cd Tests/BundleUtilities
rm testbundleutils1
make VERBOSE=1 testbundleutils1/fast

My flags building the thing are:
/usr/bin/c++ CMakeFiles/testbundleutils1.dir/testbundleutils1.cpp.o -o testbundleutils1 -rdynamic -ldl -Wl,-rpath,/home/cjstimp/cmake/build/Tests/BundleUtilities/testdir1

What do you have?
Michael Palimaka   
2012-07-02 12:56   
/usr/bin/c++ CMakeFiles/testbundleutils1.dir/testbundleutils1.cpp.o -o testbundleutils1 -rdynamic -ldl -Wl,-rpath,/home/michael/dev/cmake/Tests/BundleUtilities/testdir1

Sorry, I thought you meant something else. My mistake.
Clinton Stimpson   
2012-07-03 13:52   
Hmm... I'm not sure where the difference is coming from. Which OS is this?
And why don't the elf headers for these binaries have the executable bit marked.

Maybe there is a different default compiler or linker flag.
Can you attach the link.txt file created from the following command?
echo "int main(){}" > test.cpp && g++ -v -Wl,--verbose test.cpp >& link.txt
Michael Palimaka   
2012-07-03 13:59   
The requested output has been attached.

I'm running Gentoo Linux, with GCC 4.7.1
Clinton Stimpson   
2012-07-03 14:02   
Ok, that's it... If I add the -pie linker flag, I get the same problem!
Clinton Stimpson   
2012-07-05 14:50   
A fix has been pushed.;a=commit;h=ac7a19 [^]
David Cole   
2012-12-03 07:46   
Closing resolved issues that have not been updated in more than 4 months.