Bug#718369: soprano: FTBFS with with clucene 2.x: undefined symbol lucene::util::atomic_threads::atomic_decrement
Package: soprano
Version: 2.9.2+dfsg.1-1
Severity: serious
Tags: patch
Hi,
soprano fails to build with the recently updated clucene 2.x:
[...]
/usr/bin/c++ -fPIC -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -D_FORTIFY_SOURCE=2 -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security -fno-check-new -fno-common -fvisibility=hidden -fvisibility-inlines-hidden -fexceptions -fvisibility=default -fno-visibility-inlines-hidden -Wl,-z,relro -Wl,--as-needed -Wl,--no-undefined -shared -Wl,-soname,libsopranoindex.so.1 -o libsopranoindex.so.1.1.0 CMakeFiles/sopranoindex.dir/cluceneindex.cpp.o CMakeFiles/sopranoindex.dir/clucenedocumentwrapper.cpp.o CMakeFiles/sopranoindex.dir/cluceneutils.cpp.o CMakeFiles/sopranoindex.dir/indexfiltermodel.cpp.o CMakeFiles/sopranoindex.dir/tstring.cpp.o CMakeFiles/sopranoindex.dir/indexqueryhit.cpp.o CMakeFiles/sopranoindex.dir/indexqueryhititeratorbackend.cpp.o CMakeFiles/sopranoindex.dir/queryhitwrapperresultiteratorbackend.cpp.o -lQtCore -lpthread ../soprano/libsoprano.so.4.3.0 -lclucene-core -lQtCore -lpthread -Wl,-rpath,/tmp/soprano-2.9.2+dfsg.1/Build/soprano:
CMakeFiles/sopranoindex.dir/cluceneindex.cpp.o: In function `Soprano::Index::CLuceneIndex::Private::commit()':
/tmp/soprano-2.9.2+dfsg.1/Build/index/../../index/cluceneindex.cpp:248: undefined reference to `lucene::util::atomic_threads::atomic_decrement(unsigned int*)'
collect2: error: ld returned 1 exit status
make[4]: *** [index/libsopranoindex.so.1.1.0] Error 1
make[4]: Leaving directory `/tmp/soprano-2.9.2+dfsg.1/Build'
make[3]: *** [index/CMakeFiles/sopranoindex.dir/all] Error 2
make[3]: Leaving directory `/tmp/soprano-2.9.2+dfsg.1/Build'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/tmp/soprano-2.9.2+dfsg.1/Build'
dh_auto_build: make -j1 returned exit code 2
make[1]: *** [pre_build_dh_auto_build] Error 2
make[1]: Leaving directory `/tmp/soprano-2.9.2+dfsg.1'
make: *** [debian/dhmk_build] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2
That symbol is in libclucene-shared:
$ objdump -T /usr/lib/x86_64-linux-gnu/libclucene-core.so | c++filt | grep lucene::util::atomic_threads::atomic_decrement
0000000000000000 DF *UND* 0000000000000000 lucene::util::atomic_threads::atomic_decrement(unsigned int*)
$ objdump -T /usr/lib/x86_64-linux-gnu/libclucene-shared.so | c++filt | grep lucene::util::atomic_threads::atomic_decrement
0000000000005f20 g DF .text 000000000000000e Base lucene::util::atomic_threads::atomic_decrement(unsigned int*)
Thanks to Barry deFreese on IRC who pointed me to the upstream patch, which is
http://lists.kde.org/?l=kde-commits&m=136932825018555&w=2
Debdiff attached.
Regards,
Rene
diff -Nru soprano-2.9.2+dfsg.1/debian/changelog soprano-2.9.2+dfsg.1/debian/changelog
--- soprano-2.9.2+dfsg.1/debian/changelog 2013-05-11 13:25:56.000000000 +0000
+++ soprano-2.9.2+dfsg.1/debian/changelog 2013-07-30 20:38:25.000000000 +0000
@@ -1,3 +1,10 @@
+soprano (2.9.2+dfsg.1-2) UNRELEASED; urgency=low
+
+ * backort http://lists.kde.org/?l=kde-commits&m=136932825018555&w=2 to fix
+ build with clucene 2.x
+
+ -- Rene Engelhard <rene@debian.org> Tue, 30 Jul 2013 18:22:15 +0000
+
soprano (2.9.2+dfsg.1-1) unstable; urgency=low
* New upstream release.
diff -Nru soprano-2.9.2+dfsg.1/debian/patches/find-clucene-shared.diff soprano-2.9.2+dfsg.1/debian/patches/find-clucene-shared.diff
--- soprano-2.9.2+dfsg.1/debian/patches/find-clucene-shared.diff 1970-01-01 00:00:00.000000000 +0000
+++ soprano-2.9.2+dfsg.1/debian/patches/find-clucene-shared.diff 2013-07-30 20:19:49.000000000 +0000
@@ -0,0 +1,103 @@
+Description: backport http://lists.kde.org/?l=kde-commits&m=136932825018555&w=2
+Author: Rene Engelhard <rene@debian.org>
+
+---
+Origin: upstream, http://lists.kde.org/?l=kde-commits&m=136932825018555&w=2
+Forwarded: http://lists.kde.org/?l=kde-commits&m=136932825018555&w=2
+
+--- soprano-2.9.2+dfsg.1.orig/cmake/modules/FindCLucene.cmake
++++ soprano-2.9.2+dfsg.1/cmake/modules/FindCLucene.cmake
+@@ -4,7 +4,8 @@
+ #
+ # CLUCENE_INCLUDE_DIR = where CLucene/StdHeader.h can be found
+ # CLUCENE_LIBRARY_DIR = where CLucene/clucene-config.h can be found
+-# CLUCENE_LIBRARY = the library to link against CLucene
++# CLUCENE_LIBRARY = the library to link against CLucene DEPRECATED Use CLUCENE_LIBRARIES
++# CLUCENE_LIBRARIES = the libraries to link against CLucene
+ # CLUCENE_VERSION = The CLucene version string
+ # CLucene_FOUND = set to 1 if clucene is found
+ #
+@@ -36,13 +37,27 @@ SET(TRIAL_INCLUDE_PATHS
+ /sw/include
+ /usr/pkg/include
+ )
++
+ FIND_LIBRARY_WITH_DEBUG(CLUCENE_LIBRARY
+ WIN32_DEBUG_POSTFIX d
+ NAMES clucene clucene-core
+ PATHS ${TRIAL_LIBRARY_PATHS})
+-IF (CLUCENE_LIBRARY)
+- MESSAGE(STATUS "Found CLucene library: ${CLUCENE_LIBRARY}")
+-ENDIF (CLUCENE_LIBRARY)
++# On Linux, Soprano needs both clucene-core and clucene-shared
++# CLUCENE_LIBRARIES contains both entries if available
++set(CLUCENE_LIBRARIES ${CLUCENE_LIBRARY})
++
++find_library(CLUCENE_SHARED_LIBRARY
++ NAMES clucene-shared
++ HINTS ${TRIAL_LIBRARY_PATHS}
++)
++
++if(CLUCENE_SHARED_LIBRARY)
++ set(CLUCENE_LIBRARIES ${CLUCENE_LIBRARIES} ${CLUCENE_SHARED_LIBRARY})
++endif()
++
++IF(CLUCENE_LIBRARIES)
++ message(STATUS "Found CLucene: ${CLUCENE_LIBRARIES}")
++ENDIF (CLUCENE_LIBRARIES)
+ FIND_PATH(CLUCENE_INCLUDE_DIR
+ NAMES CLucene.h
+ PATHS ${TRIAL_INCLUDE_PATHS})
+@@ -77,13 +92,13 @@ IF (CLUCENE_LIBRARY_DIR)
+ ENDIF (CLMATCH)
+ ENDIF (CLUCENE_LIBRARY_DIR)
+
+-IF(CLUCENE_INCLUDE_DIR AND CLUCENE_LIBRARY AND CLUCENE_LIBRARY_DIR AND CLUCENE_GOOD_VERSION)
++IF(CLUCENE_INCLUDE_DIR AND CLUCENE_LIBRARIES AND CLUCENE_LIBRARY_DIR AND CLUCENE_GOOD_VERSION)
+ SET(CLucene_FOUND TRUE)
+-ENDIF(CLUCENE_INCLUDE_DIR AND CLUCENE_LIBRARY AND CLUCENE_LIBRARY_DIR AND CLUCENE_GOOD_VERSION)
++ENDIF(CLUCENE_INCLUDE_DIR AND CLUCENE_LIBRARIES AND CLUCENE_LIBRARY_DIR AND CLUCENE_GOOD_VERSION)
+
+ IF(CLucene_FOUND)
+ IF(NOT CLucene_FIND_QUIETLY)
+- MESSAGE(STATUS "Found CLucene: ${CLUCENE_LIBRARY}")
++ MESSAGE(STATUS "Found CLucene: ${CLUCENE_LIBRARIES}")
+ ENDIF(NOT CLucene_FIND_QUIETLY)
+ ELSE(CLucene_FOUND)
+ IF(CLucene_FIND_REQUIRED)
+@@ -94,5 +109,7 @@ ENDIF(CLucene_FOUND)
+ MARK_AS_ADVANCED(
+ CLUCENE_INCLUDE_DIR
+ CLUCENE_LIBRARY_DIR
++ CLUCENE_SHARED_LIBRARY
+ CLUCENE_LIBRARY
++ CLUCENE_LIBRARIES
+ )
+--- soprano-2.9.2+dfsg.1.orig/index/CMakeLists.txt
++++ soprano-2.9.2+dfsg.1/index/CMakeLists.txt
+@@ -46,7 +46,7 @@ target_link_libraries(
+ sopranoindex
+ ${QT_QTCORE_LIBRARY}
+ soprano
+- ${CLUCENE_LIBRARY}
++ ${CLUCENE_LIBRARIES}
+ )
+
+ set_target_properties(
+--- soprano-2.9.2+dfsg.1.orig/test/CMakeLists.txt
++++ soprano-2.9.2+dfsg.1/test/CMakeLists.txt
+@@ -156,12 +156,12 @@ if(BUILD_CLUCENE_INDEX)
+ # TString test
+ qt4_automoc(tstringtest tstringtest.cpp)
+ add_executable(tstringtest tstringtest.cpp stringpool.cpp ../index/tstring.cpp)
+- target_link_libraries(tstringtest ${QT_QTCORE_LIBRARY} ${QT_QTTEST_LIBRARY} ${CLUCENE_LIBRARY})
++ target_link_libraries(tstringtest ${QT_QTCORE_LIBRARY} ${QT_QTTEST_LIBRARY} ${CLUCENE_LIBRARIES})
+ add_test(tstringtest ${EXECUTABLE_OUTPUT_PATH}/tstringtest)
+
+ qt4_automoc(cluceneindextest cluceneindextest.cpp)
+ add_executable(cluceneindextest cluceneindextest.cpp stringpool.cpp)
+- target_link_libraries(cluceneindextest soprano sopranoindex ${QT_QTCORE_LIBRARY} ${QT_QTTEST_LIBRARY} ${CLUCENE_LIBRARY})
++ target_link_libraries(cluceneindextest soprano sopranoindex ${QT_QTCORE_LIBRARY} ${QT_QTTEST_LIBRARY} ${CLUCENE_LIBRARIES})
+ add_test(cluceneindextest ${EXECUTABLE_OUTPUT_PATH}/cluceneindextest)
+
+ qt4_automoc(indexmodelmultithreadingtest indexmodelmultithreadingtest.cpp)
diff -Nru soprano-2.9.2+dfsg.1/debian/patches/series soprano-2.9.2+dfsg.1/debian/patches/series
--- soprano-2.9.2+dfsg.1/debian/patches/series 2013-05-11 13:25:56.000000000 +0000
+++ soprano-2.9.2+dfsg.1/debian/patches/series 2013-07-30 20:11:32.000000000 +0000
@@ -1 +1,2 @@
redland_raptor2_support.h
+find-clucene-shared.diff
Reply to: