MantisBT - CMake
View Issue Details
0013429CMakeCMakepublic2012-07-20 09:592015-03-02 08:57
Mika Fischer 
Brad King 
normalminoralways
closedfixed 
ArchLinux3.4.4
CMake 2.8.8 
CMake 3.1CMake 3.1 
0013429: Symlinked lib directories confuse cmake
Since Arch Linux replaced /lib and /lib64 with symlinks to /usr/lib, I get tons of these:

 CMake Warning at CMakeLists.txt:19 (ADD_EXECUTABLE):
   Cannot generate a safe runtime search path for target Foo because files in
   some directories may conflict with libraries in implicit directories:

     runtime library [libpthread.so] in /usr/lib may be hidden by files in:
       /lib64

   Some of these libraries may not be found correctly.

The issues is that /usr/lib and /lib64 are in fact the same directory, so there cannot possibly be any problem.

So I guess cmake should take into account in its conflict resolution, whether some of the lib directories under consideration are actually identical.
No tags attached.
diff cmake-fix-issue-13429.diff (1,345) 2014-09-08 17:36
https://public.kitware.com/Bug/file/5249/cmake-fix-issue-13429.diff
patch 0001-Tolerate-symlinks-during-RPATH-ordering-13429.patch (1,999) 2014-09-09 09:03
https://public.kitware.com/Bug/file/5250/0001-Tolerate-symlinks-during-RPATH-ordering-13429.patch
Issue History
2012-07-20 09:59Mika FischerNew Issue
2012-07-20 14:29Brad KingNote Added: 0030099
2012-07-20 14:29Brad KingStatusnew => backlog
2014-09-08 17:36mylesFile Added: cmake-fix-issue-13429.diff
2014-09-08 17:41mylesNote Added: 0036751
2014-09-09 09:03Brad KingAssigned To => Brad King
2014-09-09 09:03Brad KingStatusbacklog => assigned
2014-09-09 09:03Brad KingTarget Version => CMake 3.1
2014-09-09 09:03Brad KingFile Added: 0001-Tolerate-symlinks-during-RPATH-ordering-13429.patch
2014-09-09 09:04Brad KingNote Added: 0036755
2014-09-09 13:52mylesNote Added: 0036759
2014-09-09 13:53mylesNote Edited: 0036759bug_revision_view_page.php?bugnote_id=36759#r1562
2014-09-09 15:29Brad KingNote Added: 0036760
2014-09-11 13:04Brad KingStatusassigned => resolved
2014-09-11 13:04Brad KingResolutionopen => fixed
2014-09-11 13:04Brad KingFixed in Version => CMake 3.1
2015-03-02 08:57Robert MaynardNote Added: 0038115
2015-03-02 08:57Robert MaynardStatusresolved => closed

Notes
(0030099)
Brad King   
2012-07-20 14:29   
The relevant code is here:

 http://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmOrderDirectories.cxx;hb=v2.8.8#l31 [^]

Try fixing up tests of the form

 if(dir != this->Directory && ...

to also check if both directories have the same realpath.
(0036751)
myles   
2014-09-08 17:41   
Following the above advice, I made the changes in the attached file cmake-fix-issue-13429.diff .

Seems to fix it (warning goes away) but needs checking by an expert.

I also think this bug deserves higher Severity because it effects every Arch Linux user and sometimes spews a whole screenful of warnings, thus obscuring other messages.
(0036755)
Brad King   
2014-09-09 09:04   
Re 0013429:0036751: Thanks. I revised the patch as "0001-Tolerate-symlinks-during-RPATH-ordering-13429.patch". Please test it.
(0036759)
myles   
2014-09-09 13:52   
(edited on: 2014-09-09 13:53)
Thanks very much, it works. I tried compiling the thing that gave me lots of warnings. The spurious warnings due to symlinks were eliminated and a couple of valid warnings still showed up.

(0036760)
Brad King   
2014-09-09 15:29   
Re 0013429:0036759: Thanks for testing. Applied:

 Tolerate symlinks during RPATH ordering
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f99cc9c3 [^]
(0038115)
Robert Maynard   
2015-03-02 08:57   
Closing resolved issues that have not been updated in more than 4 months.