I'm currently building kdelibs 4.8.4 in Mageia Cauldron, it turns to build failure on kshareddatacache.cpp: /home/iurt/rpm/BUILD/kdelibs-4.8.4/kdecore/util/kshareddatacache.cpp: In member function 'bool KSharedDataCache::Private::lock() const': /home/iurt/rpm/BUILD/kdelibs-4.8.4/kdecore/util/kshareddatacache.cpp:1237:5: error: control reaches end of non-void function [-Werror=return-type] /home/iurt/rpm/BUILD/kdelibs-4.8.4/kdecore/util/kshareddatacache.cpp: In function 'unsigned int intCeil(unsigned int, unsigned int)': /home/iurt/rpm/BUILD/kdelibs-4.8.4/kdecore/util/kshareddatacache.cpp:262:29: error: exception handling disabled, use -fexceptions to enable Reproducible: Always
The appropriate incantation to enable exceptions just for kshareddatacache.cpp is on line 387 of kdecore/CMakeLists.txt, from the official kdelibs-4.8.4.tar.xz sources. Does Mageia use an old CMake version or otherwise create differences between the stock tarball on what is being built there? It is a new change for 4.8.4 (to have exceptions for this file) but was introduced to allow for other bug fixes.
Because in cmake/modules/FindKDE4Internal.cmake, there are following lines: if (CMAKE_COMPILER_IS_GNUCXX) if (CMAKE_SYSTEM_NAME MATCHES Linux OR CMAKE_SYSTEM_NAME STREQUAL GNU) # As off Qt 4.6.x we need to override the new exception macros if we want compile with -fno-exceptions set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security -fno-exceptions -DQT_NO_EXCEPTIONS -fno-check-new -fno-common") endif (CMAKE_SYSTEM_NAME MATCHES Linux OR CMAKE_SYSTEM_NAME STREQUAL GNU) endif (CMAKE_COMPILER_IS_GNUCXX) Please not that "-fno-exceptions" are hardcoded, maybe your switch on exceptions should be declared in some other ways.
Check khtml/CMakeLists.txt, it listed as: set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${KDE4_ENABLE_EXCEPTIONS}") Which works for releases.
That enables exceptions for the entire subproject khtml though (which is appropriate there). It would be inappropriate to do the same thing to all of kdecore just for one class where exceptions cannot even propagate out.
The problem is, when building kdecore with -DKDE4_ENABLE_FINAL=ON, all the relative files will be merged into one big kdecore_final_cpp.cpp. Then the kdecore_final_cpp.cpp won't be built separately with the specific compile flag. See here: [ 0%] Building CXX object kdecore/CMakeFiles/kdecore.dir/kdecore_final_cpp.o cd /home/iurt/rpm/BUILD/kdelibs-4.8.4/build/kdecore && /usr/bin/c++ -DMAKE_KDECORE_LIB -DKDE_USE_FINAL -D_BSD_SOURCE -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -DQT_NO_STL -DQT_NO_CAST_TO_ASCII -D_REENTRANT -DKDE_DEPRECATED_WARNINGS -DKDE4_CMAKE_TOPLEVEL_DIR_LENGTH=20 -DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS -DQT_NO_CAST_FROM_ASCII -O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security -fno-exceptions -DQT_NO_EXCEPTIONS -fno-check-new -fno-common -Woverloaded-virtual -fno-threadsafe-statics -fvisibility=hidden -Werror=return-type -fvisibility-inlines-hidden -O2 -DNDEBUG -DQT_NO_DEBUG -fPIC -I/home/iurt/rpm/BUILD/kdelibs-4.8.4/build/kdecore -I/home/iurt/rpm/BUILD/kdelibs-4.8.4/kdecore -I/home/iurt/rpm/BUILD/kdelibs-4.8.4 -I/home/iurt/rpm/BUILD/kdelibs-4.8.4/build -I/home/iurt/rpm/BUILD/kdelibs-4.8.4/interfaces -I/home/iurt/rpm/BUILD/kdelibs-4.8.4/build/kdecore/network -I/home/iurt/rpm/BUILD/kdelibs-4.8.4/build/kdecore/date -I/home/iurt/rpm/BUILD/kdelibs-4.8.4/build/kdecore/compression -I/home/iurt/rpm/BUILD/kdelibs-4.8.4/kdecore/auth -I/home/iurt/rpm/BUILD/kdelibs-4.8.4/kjs -I/home/iurt/rpm/BUILD/kdelibs-4.8.4/build/kjs -I/home/iurt/rpm/BUILD/kdelibs-4.8.4/kdecore/compression -I/home/iurt/rpm/BUILD/kdelibs-4.8.4/kdecore/config -I/home/iurt/rpm/BUILD/kdelibs-4.8.4/kdecore/date -I/home/iurt/rpm/BUILD/kdelibs-4.8.4/kdecore/io -I/home/iurt/rpm/BUILD/kdelibs-4.8.4/kdecore/jobs -I/home/iurt/rpm/BUILD/kdelibs-4.8.4/kdecore/kernel -I/home/iurt/rpm/BUILD/kdelibs-4.8.4/kdecore/network -I/home/iurt/rpm/BUILD/kdelibs-4.8.4/kdecore/services -I/home/iurt/rpm/BUILD/kdelibs-4.8.4/kdecore/localization -I/home/iurt/rpm/BUILD/kdelibs-4.8.4/kdecore/sycoca -I/home/iurt/rpm/BUILD/kdelibs-4.8.4/kdecore/text -I/home/iurt/rpm/BUILD/kdelibs-4.8.4/kdecore/util -I/home/iurt/rpm/BUILD/kdelibs-4.8.4/kdecore/sonnet -I/usr/lib/qt4/include/QtCrypto -I/usr/include/polkit-qt-1 -I/usr/include/QtXmlPatterns -I/usr/include/QtXml -I/usr/include/QtWebKit -I/usr/include/QtUiTools -I/usr/include/QtTest -I/usr/include/QtSvg -I/usr/include/QtSql -I/usr/include/QtScriptTools -I/usr/include/QtScript -I/usr/include/QtOpenGL -I/usr/include/QtNetwork -I/usr/include/QtMultimedia -I/usr/include/QtHelp -I/usr/include/QtDesigner -I/usr/include/QtDeclarative -I/usr/include/QtDBus -I/usr/include/Qt3Support -I/usr/include/QtGui -I/usr/include/QtCore -I/usr/include/Qt -I/usr/lib64/qt4/mkspecs/default -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -o CMakeFiles/kdecore.dir/kdecore_final_cpp.o -c /home/iurt/rpm/BUILD/kdelibs-4.8.4/build/kdecore/kdecore_final_cpp.cpp <snip> In file included from /home/iurt/rpm/BUILD/kdelibs-4.8.4/build/kdecore/kdecore_final_cpp.cpp:196:0: /home/iurt/rpm/BUILD/kdelibs-4.8.4/kdecore/util/kshareddatacache.cpp: In function 'unsigned int intCeil(unsigned int, unsigned int)': /home/iurt/rpm/BUILD/kdelibs-4.8.4/kdecore/util/kshareddatacache.cpp:262:29: error: exception handling disabled, use -fexceptions to enable In file included from /home/iurt/rpm/BUILD/kdelibs-4.8.4/build/kdecore/kdecore_final_cpp.cpp:196:0: /home/iurt/rpm/BUILD/kdelibs-4.8.4/kdecore/util/kshareddatacache.cpp: In member function 'bool KSharedDataCache::Private::lock() const': /home/iurt/rpm/BUILD/kdelibs-4.8.4/kdecore/util/kshareddatacache.cpp:1237:5: error: control reaches end of non-void function [-Werror=return-type]
Proposed patch: http://svnweb.mageia.org/packages/cauldron/kdelibs4/current/SOURCES/kdelibs-4.8.4-correct-use-fexception-switch.patch
Git commit 5b5d1dcd3a0378bd18f85283de3e297d72d0217e by Michael Pyne. Committed on 16/06/2012 at 04:59. Pushed by mpyne into branch 'KDE/4.8'. Fix KSharedDataCache build with KDE4_ENABLE_FINAL set. Support level for "final" builds remains "meh" with the buildsystem types, but this did work in kdelibs 4.8.3 so I've received consensus support for applying a patch provided by the Mageia devs. Thanks to Funda Wang from Mageia for the problem description and proposed fix. The "fixed-in" may be incorrect based on whether we reissue a kdelibs tarball for the Soprano issues but it should be close. FIXED-IN:4.8.5 CCMAIL:kde-packager@kde.org M +9 -2 kdecore/CMakeLists.txt http://commits.kde.org/kdelibs/5b5d1dcd3a0378bd18f85283de3e297d72d0217e
Hello, On macort, kde 4.8.5 could not be compile because this bug isen't fixe See this macport ticket https://trac.macports.org/ticket/34858 and see this ticket for the bug with the kdepim4 macport package. https://trac.macports.org/ticket/35210#comment:7 Can you help the macoprt community to fix this problem and to develop kde on mac os 10.6.8, 10.7, and 10.8. Please help me Best regards mparchet
mparchet: The problem for Mac OS X is that the "KDE4_ENABLE_EXCEPTIONS" variable does not seem to get defined when compiling on Mac OS X. For both GCC and CLang, this should be set to "-fexceptions". So if it's easy for the MacPorts guys, they just need to set that variable in their patched FindKDE4Internal.cmake (I'm assuming they're using a patch, that is). In the meantime when compiling kdelibs, you can use CMake to set its CXXFLAGS to include "-fexceptions" to get it to build as a workaround.