[kde-freebsd] devel/kdebindings4-smoke: link failure with non-base gcc
Raphael Kubo da Costa
kubito at gmail.com
Mon Jul 5 17:11:14 CEST 2010
On Monday 05 July 2010 11:41:35 Andriy Gapon wrote:
> Environment:
> devel/kdebindings4-smoke version 4.4.5
> gcc-4.4.5.20100622
>
> Here's how it fails when gcc44 is used for compilation (and CMAKE_VERBOSE
> is set):
>
> Linking CXX executable bin/smokegen
> cd
> /usr/obj/usr/ports/devel/kdebindings4-smoke/work/kdebindings-4.4.5/generat
> or && /usr/local/bin/cmake -E cmake_link_script
> CMakeFiles/smokegen.dir/link.txt --verbose=1 /usr/local/bin/g++44 -O2
> -pipe -O2 -fno-strict-aliasing -pipe -march=amdfam10 -O2
> -fno-strict-aliasing -pipe -Wl,--export-dynamic
> CMakeFiles/smokegen.dir/main.o
> CMakeFiles/smokegen.dir/generatorenvironment.o
> CMakeFiles/smokegen.dir/generatorvisitor.o
> CMakeFiles/smokegen.dir/generatorpreprocessor.o
> CMakeFiles/smokegen.dir/options.o CMakeFiles/smokegen.dir/type_compiler.o
> CMakeFiles/smokegen.dir/name_compiler.o CMakeFiles/smokegen.dir/type.o -o
> bin/smokegen /usr/local/lib/qt4/libQtCore.so
> /usr/local/lib/qt4/libQtXml.so bin/libcppparser.so
> /usr/local/lib/qt4/libQtCore.so
> -Wl,-rpath,/usr/local/lib/qt4:/usr/obj/usr/ports/devel/kdebindings4-smoke/
> work/kdebindings-4.4.5/generator/bin:
>
> /usr/local/lib/qt4/libQtCore.so: undefined reference to `pthread_create'
> /usr/local/lib/qt4/libQtCore.so: undefined reference to
> `pthread_setschedparam' /usr/local/lib/qt4/libQtCore.so: undefined
> reference to `pthread_getschedparam' collect2: ld returned 1 exit status
> *** Error code 1
>
>
> Here's a patch that seems to help. Not sure if it's proper one.
>
> --- generator/CMakeLists.txt.orig 2010-07-05 17:33:22.894946345 +0300
> +++ generator/CMakeLists.txt 2010-07-05 17:12:20.727257973 +0300
> @@ -29,7 +29,7 @@ set (CMAKE_SKIP_BUILD_RPATH FALSE)
> set (CMAKE_SKIP_RPATH FALSE)
>
> add_executable(smokegen ${generator_SRC})
> -target_link_libraries(smokegen ${QT_QTCORE_LIBRARY} ${QT_QTXML_LIBRARY}
> cppparser) +target_link_libraries(smokegen ${QT_QTCORE_LIBRARY}
> ${QT_QTXML_LIBRARY} pthread cppparser)
> set_target_properties(smokegen PROPERTIES COMPILE_DEFINITIONS
> __GENERATOR_BUILDING ENABLE_EXPORTS TRUE)
>
> install(TARGETS smokegen, DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
It might solve the issue in this case, but the real problem seems to be
located below that in the stack, since kdebindings itself doesn't call pthread
functions directly.
Can you subscribe to the kde-buildsystem mailing list and talk about this
linking problem?
More information about the kde-freebsd
mailing list