MantisBT - CMake | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0013352 | CMake | CMake | public | 2012-06-26 14:52 | 2013-01-09 10:56 |
Reporter | Daniel Richard G. | ||||
Assigned To | Brad King | ||||
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | PowerPC | OS | AIX | OS Version | 5.3 |
Product Version | CMake 2.8.8 | ||||
Target Version | CMake 2.8.9 | Fixed in Version | CMake 2.8.9 | ||
Summary | 0013352: Incorrect linking of shared-library dependencies on AIX with GNU compiler | ||||
Description | This report is borne of this failing dashboard test: http://open.cdash.org/testDetails.php?test=150972101&build=2394658 [^] Some tinkering around in the test directory: cport@vibraslap:~/Dashboards/MyTests/CMake-build/Tests/CustomCommand/PerConfig> env OBJECT_MODE=32 /usr/bin/gcc -mminimal-toc -O0 CMakeFiles/perconfig.dir/perconfig.c.o -o ../bin/perconfig ../bin/libpcStatic.a ../bin/libpcShared.so -Wl,-blibpath:/home/cport/Dashboards/MyTests/CMake-build/Tests/CustomCommand/bin:/usr/lib:/lib cport@vibraslap:~/Dashboards/MyTests/CMake-build/Tests/CustomCommand/PerConfig> ldd ../bin/perconfig ../bin/perconfig needs: /usr/lib/libc.a(shr.o) ../bin/libpcShared.so /unix /usr/lib/libcrypt.a(shr.o) cport@vibraslap:~/Dashboards/MyTests/CMake-build/Tests/CustomCommand/PerConfig> ln -s ../bin/libpcShared.so . cport@vibraslap:~/Dashboards/MyTests/CMake-build/Tests/CustomCommand/PerConfig> env OBJECT_MODE=32 /usr/bin/gcc -mminimal-toc -O0 CMakeFiles/perconfig.dir/perconfig.c.o -o ../bin/perconfig ../bin/libpcStatic.a libpcShared.so -Wl,-blibpath:/home/cport/Dashboards/MyTests/CMake-build/Tests/CustomCommand/bin:/usr/lib:/lib cport@vibraslap:~/Dashboards/MyTests/CMake-build/Tests/CustomCommand/PerConfig> ldd ../bin/perconfig ../bin/perconfig needs: /usr/lib/libc.a(shr.o) /home/cport/Dashboards/MyTests/CMake-build/Tests/CustomCommand/bin/libpcShared.so /unix /usr/lib/libcrypt.a(shr.o) Notice how when the linker is given "../bin/libpcShared.so", it records exactly that in the executable's dependencies, and fails to find the library dependency. Only if I link in "libpcShared.so", without a path prefix, does the executable build correctly. Looking through the ld(1) man page, these bits appear relevant: Note: If you specify a shared object, or an archive file containing a shared object, with an absolute or relative path name, instead of with the -lName flag, the path name is included in the import file ID string in the loader section of the output file. You can override this behavior with the -bnoipath option. [...] noipath For shared objects listed on the command-line, rather than specified with the -l flag, use a null path component when listing the shared object in the loader section of the output file. A null path component is always used for shared objects specified with the -l flag. This option does not affect the specification of a path component by using a line beginning with #! in an import file. The default is the ipath option. Adding -Wl,-bnoipath allows the original link invocation to produce a correct binary. | ||||
Steps To Reproduce | |||||
Additional Information | |||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | ![]() https://public.kitware.com/Bug/file/4387/* | ||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2012-06-26 14:52 | Daniel Richard G. | New Issue | |||
2012-07-09 09:19 | Brad King | Note Added: 0030000 | |||
2012-07-09 09:19 | Brad King | Status | new => acknowledged | ||
2012-07-09 09:19 | Brad King | Summary | Incorrect linking of shared-library dependencies on AIX => Incorrect linking of shared-library dependencies on AIX with GNU compiler | ||
2012-07-09 09:24 | Brad King | Note Added: 0030001 | |||
2012-07-09 16:44 | Daniel Richard G. | File Added: CustomCommand-duplicate-main.patch | |||
2012-07-09 16:45 | Daniel Richard G. | Note Added: 0030009 | |||
2012-07-09 17:21 | Brad King | Note Added: 0030010 | |||
2012-07-09 17:21 | Brad King | Assigned To | => Brad King | ||
2012-07-09 17:21 | Brad King | Status | acknowledged => resolved | ||
2012-07-09 17:21 | Brad King | Resolution | open => fixed | ||
2012-08-09 19:42 | David Cole | Fixed in Version | => CMake 2.8.9 | ||
2012-08-09 19:42 | David Cole | Target Version | => CMake 2.8.9 | ||
2013-01-09 10:56 | Robert Maynard | Note Added: 0032034 | |||
2013-01-09 10:56 | Robert Maynard | Status | resolved => closed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|