0

While I was trying to build Plasma5 on Ubuntu Trusty, I got an issue related to eglibc 2.19.

/usr/lib/x86_64-linux-gnu/libc_nonshared.a(lstat64.oS): In function ``lstat64': (.text+0xc): undefined reference to ``__lxstat64'

I have no idea how to fix this. Thanks.

Edit

Appended -v to g++ and ld, got: COLLECT_GCC=/etc/alternatives/g++ COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.3.0-3ubuntu1~14.04' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=gcc4-compatible --disable-libstdcxx-dual-abi --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 5.3.0 20151204 (Ubuntu 5.3.0-3ubuntu1~14.04) COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/ LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/ COLLECT_GCC_OPTIONS='-v' '-fPIC' '-pipe' '-D' 'QT_STRICT_ITERATORS' '-D' 'QURL_NO_CAST_FROM_STRING' '-D' 'QT_NO_HTTP' '-D' 'QT_NO_FTP' '-Wformat=1' '-Werror=format-security' '-Werror=return-type' '-Wno-variadic-macros' '-Wlogical-op' '-Wmissing-include-dirs' '-std=c++11' '-std=c++11' '-fno-exceptions' '-Wall' '-Wextra' '-Wcast-align' '-Wchar-subscripts' '-Wformat-security' '-Wno-long-long' '-Wpointer-arith' '-Wundef' '-Wnon-virtual-dtor' '-Woverloaded-virtual' '-Werror=return-type' '-Wpedantic' '-g' '-shared' '-o' 'baloosearch.so' '-shared-libgcc' '-mtune=generic' '-march=x86-64' /usr/lib/gcc/x86_64-linux-gnu/5/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper -plugin-opt=-fresolution=/tmp/cc8S8VVK.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -shared -z relro -o baloosearch.so /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/5/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/5/../../.. -v --no-undefined --fatal-warnings --enable-new-dtags -soname baloosearch.so CMakeFiles/kio_baloosearch.dir/kio_search.cpp.o CMakeFiles/kio_baloosearch.dir/kio_baloosearch_automoc.cpp.o /opt/kde/install/lib/x86_64-linux-gnu/libKF5KIOCore.so.5.20.0 /opt/kde/install/lib/x86_64-linux-gnu/libKF5I18n.so.5.20.0 ../../lib/libKF5Baloo.so.5.20.0 /opt/kde/install/lib/x86_64-linux-gnu/libKF5Service.so.5.20.0 /opt/kde/install/lib/x86_64-linux-gnu/libKF5FileMetaData.so.5.20.0 /opt/kde/install/lib/x86_64-linux-gnu/libKF5I18n.so.5.20.0 /opt/kde/install/lib/x86_64-linux-gnu/libKF5ConfigCore.so.5.20.0 /opt/kde/install/lib/x86_64-linux-gnu/libKF5CoreAddons.so.5.20.0 /opt/Qt5.5.1/5.5/gcc_64/lib/libQt5Core.so.5.5.1 -rpath /opt/kde/install/lib/x86_64-linux-gnu:/opt/kde/build/baloo/src/lib:/opt/Qt5.5.1/5.5/gcc_64/lib:/opt/kde/build/baloo/src/engine: -rpath-link /opt/Qt5.5.1/5.5/gcc_64/lib:/opt/kde/install/lib/x86_64-linux-gnu:/opt/kde/build/baloo/src/engine -lstdc++ -lm -lgcc_s -lc -lgcc_s /usr/lib/gcc/x86_64-linux-gnu/5/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o collect2 version 5.3.0 20151204 /usr/bin/ld -plugin /usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper -plugin-opt=-fresolution=/tmp/cc8S8VVK.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -shared -z relro -o baloosearch.so /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/5/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/5/../../.. -v --no-undefined --fatal-warnings --enable-new-dtags -soname baloosearch.so CMakeFiles/kio_baloosearch.dir/kio_search.cpp.o CMakeFiles/kio_baloosearch.dir/kio_baloosearch_automoc.cpp.o /opt/kde/install/lib/x86_64-linux-gnu/libKF5KIOCore.so.5.20.0 /opt/kde/install/lib/x86_64-linux-gnu/libKF5I18n.so.5.20.0 ../../lib/libKF5Baloo.so.5.20.0 /opt/kde/install/lib/x86_64-linux-gnu/libKF5Service.so.5.20.0 /opt/kde/install/lib/x86_64-linux-gnu/libKF5FileMetaData.so.5.20.0 /opt/kde/install/lib/x86_64-linux-gnu/libKF5I18n.so.5.20.0 /opt/kde/install/lib/x86_64-linux-gnu/libKF5ConfigCore.so.5.20.0 /opt/kde/install/lib/x86_64-linux-gnu/libKF5CoreAddons.so.5.20.0 /opt/Qt5.5.1/5.5/gcc_64/lib/libQt5Core.so.5.5.1 -rpath /opt/kde/install/lib/x86_64-linux-gnu:/opt/kde/build/baloo/src/lib:/opt/Qt5.5.1/5.5/gcc_64/lib:/opt/kde/build/baloo/src/engine: -rpath-link /opt/Qt5.5.1/5.5/gcc_64/lib:/opt/kde/install/lib/x86_64-linux-gnu:/opt/kde/build/baloo/src/engine -lstdc++ -lm -lgcc_s -lc -lgcc_s /usr/lib/gcc/x86_64-linux-gnu/5/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o GNU ld (GNU Binutils for Ubuntu) 2.24 /usr/lib/x86_64-linux-gnu/libc_nonshared.a(lstat64.oS): In function `lstat64': (.text+0xc): undefined reference to `__lxstat64' collect2: error: ld returned 1 exit status

Magicloud
  • 818
  • 1
  • 7
  • 17
  • `/lib/x86_64-linux-gnu/libc.so.6` (there is that nice little tool called `grep`...). – Marc Glisse Feb 29 '16 at 07:32
  • Sorry, I meant where is it during link. – Magicloud Feb 29 '16 at 09:16
  • Strange. I don't see anything suspicious... Do you also get the same error if instead of those tons of libs you just compile an empty file (with the same options), adding `-u lstat64` to the command line? Unless someone spots something, you may need to reduce the testcase (compile a smaller file, pass fewer options to the linker, etc) until it is of manageable size and the issue becomes obvious. – Marc Glisse Feb 29 '16 at 21:04
  • Could not get a clue.... Anyway, thanks for the help. – Magicloud Mar 01 '16 at 05:16

1 Answers1

1

I ran into the exact same problem trying to do the exact same thing. I don't know if this is a good solution, but I found three ways to fix this problem.

  • run the compile command and add "/usr/lib/x86_64-linux-gnu/libc_nonshared.a" to it
  • run the compile command and add "-lc" to it
  • the best solution if you're using kdesrc-build is to add the option to the baloo module in your .kdesrc-buildrc like this:

    options baloo 
        cmake-options -DCMAKE_CXX_FLAGS="-lc" 
    end options
    

After some hoops and hurdles I was able to build and run Plasma 5 on Ubuntu 14.04 and will probably write a guide on how to do it.

Don Nguyen
  • 176
  • 2
  • 5