From Alberto Luaces, "he new GNU linker, "gold", is going to replace soon the current ld in

almost all Linux distributions. Although it is 100% compatible with ld,
by default it gives an error if a library has unresolved symbols at link
time, that is, it has set -Wl,--no-undefined by default. Debian folks
have found that libosg.so and libosgDB.so use some functions belonging
to libdl.so {dlsym,dlopen,dlclose,dlerror} without linking to it.

My changes link those two libraries to libdl.so explicitly in the same
way it is already done for libm.so and librt.so."
This commit is contained in:
Robert Osfield 2010-02-11 11:17:55 +00:00
parent 3ec1a5618f
commit 2c63a71694
3 changed files with 3 additions and 2 deletions

View File

@ -152,6 +152,7 @@ IF(UNIX)
FIND_PACKAGE(X11) FIND_PACKAGE(X11)
# Some Unicies need explicit linkage to the Math library or the build fails. # Some Unicies need explicit linkage to the Math library or the build fails.
FIND_LIBRARY(MATH_LIBRARY m) FIND_LIBRARY(MATH_LIBRARY m)
FIND_LIBRARY(DL_LIBRARY dl)
IF( CMAKE_SYSTEM MATCHES "Linux" ) IF( CMAKE_SYSTEM MATCHES "Linux" )
FIND_LIBRARY( RT_LIBRARY rt ) FIND_LIBRARY( RT_LIBRARY rt )
ENDIF( CMAKE_SYSTEM MATCHES "Linux" ) ENDIF( CMAKE_SYSTEM MATCHES "Linux" )

View File

@ -331,7 +331,7 @@ ADD_LIBRARY(${LIB_NAME}
LINK_INTERNAL(${LIB_NAME} LINK_INTERNAL(${LIB_NAME}
OpenThreads OpenThreads
) )
LINK_EXTERNAL(${LIB_NAME} ${CMAKE_THREAD_LIBS_INIT} ${MATH_LIBRARY} ${RT_LIBRARY} ) LINK_EXTERNAL(${LIB_NAME} ${CMAKE_THREAD_LIBS_INIT} ${MATH_LIBRARY} ${RT_LIBRARY} ${DL_LIBRARY})
LINK_CORELIB_DEFAULT(${LIB_NAME} ${CMAKE_THREAD_LIBS_INIT} ${MATH_LIBRARY} ${RT_LIBRARY} ) LINK_CORELIB_DEFAULT(${LIB_NAME} ${CMAKE_THREAD_LIBS_INIT} ${MATH_LIBRARY} ${RT_LIBRARY} )
INCLUDE(ModuleInstall OPTIONAL) INCLUDE(ModuleInstall OPTIONAL)

View File

@ -135,7 +135,7 @@ LINK_INTERNAL(${LIB_NAME}
osg osg
OpenThreads OpenThreads
) )
LINK_EXTERNAL(${LIB_NAME} ${OSGDB_PLATFORM_SPECIFIC_LIBRARIES}) LINK_EXTERNAL(${LIB_NAME} ${OSGDB_PLATFORM_SPECIFIC_LIBRARIES} ${DL_LIBRARY})
LINK_WITH_VARIABLES(${LIB_NAME} ${COMPRESSION_LIBRARIES}) LINK_WITH_VARIABLES(${LIB_NAME} ${COMPRESSION_LIBRARIES})
LINK_CORELIB_DEFAULT(${LIB_NAME}) LINK_CORELIB_DEFAULT(${LIB_NAME})