MantisBT - CMake
View Issue Details
0008654CMakeCMakepublic2009-03-02 15:152009-03-02 16:03
David Faure 
Brad King 
normalmajoralways
closedfixed 
CMake-2-6 
 
0008654: cmake -E cmake_symlink_library fails without error message
Output of make:

Linking CXX shared library ../../../lib/libkonq.so
make[2]: *** [lib/libkonq.so.5.3.0] Error 1
make[1]: *** [apps/lib/konq/CMakeFiles/konq.dir/all] Error 2
make: *** [all] Error 2

Not really clear about what the problem is.
Output of VERBOSE=1 make:

Linking CXX shared library ../../../lib/libkonq.so
cd /d/kde/build/t/kdebase/apps/lib/konq && /d/other/inst/bin/cmake -E cmake_link_script CMakeFiles/konq.dir/link.txt --verbose=1
/usr/lib/icecc/bin/c++ -fPIC -pipe -pedantic -Wno-long-long -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security -fno-exceptions -fno-check-new -fno-common -Woverloaded-virtual -fno-threadsafe-statics -fvisibility=hidden -fvisibility-inlines-hidden -O2 -g -DNDEBUG -DQT_NO_DEBUG -Wl,--enable-new-dtags -Wl,--fatal-warnings -Wl,--no-undefined -lc -shared -Wl,-soname,libkonq.so.5 -o ../../../lib/libkonq.so.5.3.0 CMakeFiles/konq.dir/konq_automoc.o CMakeFiles/konq.dir/konq_popupmenu.o CMakeFiles/konq.dir/konq_popupmenuinformation.o CMakeFiles/konq.dir/konq_popupmenuplugin.o CMakeFiles/konq.dir/knewmenu.o CMakeFiles/konq.dir/konq_menuactions.o CMakeFiles/konq.dir/konq_copytomenu.o CMakeFiles/konq.dir/konq_operations.o CMakeFiles/konq.dir/konq_events.o CMakeFiles/konq.dir/konq_filetip.o CMakeFiles/konq.dir/konqmimedata.o CMakeFiles/konq.dir/konq_fileitemcapabilities.o -L/d/kde/inst/kde-trunk/lib -L/d/qt/4/qt-copy-trunk/lib /d/kde/inst/kde-trunk/lib/libkparts.so.4.3.0 /d/kde/inst/kde-trunk/lib/libkio.so.5.3.0 /d/qt/4/qt-copy-trunk/lib/libQtNetwork.so /d/qt/4/qt-copy-trunk/lib/libQtXml.so /d/kde/inst/kde-trunk/lib/libkdeui.so.5.3.0 /d/qt/4/qt-copy-trunk/lib/libQtSvg.so /d/kde/inst/kde-trunk/lib/libkdecore.so.5.3.0 /d/qt/4/qt-copy-trunk/lib/libQtDBus.so /d/qt/4/qt-copy-trunk/lib/libQtCore.so -lpthread /d/qt/4/qt-copy-trunk/lib/libQtGui.so -Wl,-rpath,/d/kde/inst/kde-trunk/lib:/d/qt/4/qt-copy-trunk/lib:::::::::::::::::::::::::: -Wl,-rpath-link,/d/kde/inst/kde-trunk/lib
cd /d/kde/build/t/kdebase/apps/lib/konq && /d/other/inst/bin/cmake -E cmake_symlink_library ../../../lib/libkonq.so.5.3.0 ../../../lib/libkonq.so.5 ../../../lib/libkonq.so
make[2]: *** [lib/libkonq.so.5.3.0] Error 1
make[1]: *** [apps/lib/konq/CMakeFiles/konq.dir/all] Error 2
make: *** [all] Error 2

Not better. Only stracing the "cmake -E cmake_symlink_library" call showed
what the problem was...
access("../../../lib/libkonq.so.5", R_OK) = -1 ENOENT (No such file or directory)
symlink("libkonq.so.5.3.0", "../../../lib/libkonq.so.5") = -1 EEXIST (File exists)
access("../../../lib/libkonq.so.5", R_OK) = -1 ENOENT (No such file or directory)
symlink("libkonq.so.5", "../../../lib/libkonq.so") = -1 EEXIST (File exists)

This is because
libkonq.so.5 is a broken symlink to libkonq.so.5.2.0, which doesn't exist anymore
(the version number was increased so it's 5.3.0 now).

This seems to indicate two bugs
1) cmake -E cmake_symlink_library should output an error on stderr when it fails,
so that the user is given a hint about the fact that it's the symlinking that failed
and not the actual linking with ld.
2) the symlink should be removed before being re-created; or should be tested
with lstat() rather than access(), and then removed.
No tags attached.
Issue History
2009-03-02 15:15David FaureNew Issue
2009-03-02 15:28Bill HoffmanStatusnew => assigned
2009-03-02 15:28Bill HoffmanAssigned To => Alex Neundorf
2009-03-02 15:59Brad KingAssigned ToAlex Neundorf => Brad King
2009-03-02 16:02Brad KingNote Added: 0015499
2009-03-02 16:03Brad KingNote Added: 0015500
2009-03-02 16:03Brad KingStatusassigned => closed
2009-03-02 16:03Brad KingResolutionopen => fixed

Notes
(0015499)
Brad King   
2009-03-02 16:02   
BUG: Gracefully handle broken version symlinks
/cvsroot/CMake/CMake/Source/cmake.cxx,v <-- Source/cmake.cxx
new revision: 1.407; previous revision: 1.406
(0015500)
Brad King   
2009-03-02 16:03   
I've scheduled this for 2.6.4.