Version: (using KDE 4.2.0) Compiler: GCC 4.3.3 OS: Linux Installed from: Gentoo Packages KDELibs fails to build when CXXFLAGS contains -finline-limit=1800. Current source code assumes that some functions marked with 'inline' word aren't actually inlined. findLibraryInternal is defined in kdecore/util/kpluginloader.cpp with 'inline' keyword, but is also referenced in kdecore/util/klibrary.cpp with 'extern' keyword. [ 21%] Building CXX object kdecore/CMakeFiles/kdecore.dir/io/klockfile_unix.o [ 21%] Building CXX object kdecore/CMakeFiles/kdecore.dir/util/kshell_unix.o [ 21%] Building CXX object kdecore/CMakeFiles/kdecore.dir/util/kuser_unix.o [ 21%] Building CXX object kdecore/CMakeFiles/kdecore.dir/util/kmacroexpander_unix.o [ 21%] Building C object kdecore/CMakeFiles/kdecore.dir/fakes.o Linking CXX shared library ../lib/libkdecore.so CMakeFiles/kdecore.dir/util/klibrary.o: In function `findLibrary(QString const&, KComponentData const&)': klibrary.cpp:(.text+0x135): undefined reference to `findLibraryInternal(QString const&, KComponentData const&)' CMakeFiles/kdecore.dir/util/klibrary.o: In function `KLibrary::KLibrary(QString const&, int, KComponentData const&, QObject*)': klibrary.cpp:(.text+0x168): undefined reference to `findLibraryInternal(QString const&, KComponentData const&)' CMakeFiles/kdecore.dir/util/klibrary.o: In function `KLibrary::KLibrary(QString const&, int, KComponentData const&, QObject*)': klibrary.cpp:(.text+0x1f8): undefined reference to `findLibraryInternal(QString const&, KComponentData const&)' CMakeFiles/kdecore.dir/util/klibrary.o: In function `KLibrary::KLibrary(QString const&, KComponentData const&, QObject*)': klibrary.cpp:(.text+0x27d): undefined reference to `findLibraryInternal(QString const&, KComponentData const&)' CMakeFiles/kdecore.dir/util/klibrary.o: In function `KLibrary::KLibrary(QString const&, KComponentData const&, QObject*)': klibrary.cpp:(.text+0x2fd): undefined reference to `findLibraryInternal(QString const&, KComponentData const&)' CMakeFiles/kdecore.dir/util/klibrary.o:klibrary.cpp:(.text+0x375): more undefined references to `findLibraryInternal(QString const&, KComponentData const&)'follow collect2: ld returned 1 exit status make[2]: *** [lib/libkdecore.so.5.2.0] Error 1 make[1]: *** [kdecore/CMakeFiles/kdecore.dir/all] Error 2 make: *** [all] Error 2
Created attachment 30972 [details] kdelibs-4.2.0-fix_undefined_references.patch
I enabled that flag and got no errors. Turns out that the "inline" was removed in r917835 because it broke ICC too. Hmm, well, I wonder if my testing is correct though, since I have -fno-inline anyway? Do you know what effect -finline-limit has when using -fno-inline?