Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-76293

ld: error: cannot find -lc++ with Android NDK r20

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.12.3, 5.13.0
    • Fix Version/s: 5.12.5, 5.13.1
    • Component/s: Build System
    • Labels:
      None
    • Environment:
      Fedora 30
    • Platform/s:
      Android
    • Commits:
      067664531853a1e857c777c1cc56fc64b272e021

      Description

      Building Qt with Android NDK r20 gives following error:

      This is the Qt Open Source Edition.
      
      You have already accepted the terms of the Open Source license.
      
      Running configuration tests...
      Checking for gold linker... 
      + cd /home/alexey/projects/tremotesf-android/3rdparty/qt/build-armeabi-v7a/config.tests && /home/alexey/Android/android-ndk-r20//toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -D__ANDROID_API__=16 -target armv7-none-linux-androideabi -gcc-toolchain /home/alexey/Android/android-ndk-r20//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 -fno-limit-debug-info -DANDROID_HAS_WSTRING --sysroot=/home/alexey/Android/android-ndk-r20//sysroot -isystem /home/alexey/Android/android-ndk-r20//sysroot/usr/include/arm-linux-androideabi -isystem /home/alexey/Android/android-ndk-r20//sources/cxx-stl/llvm-libc++/include -isystem /home/alexey/Android/android-ndk-r20//sources/android/support/include -isystem /home/alexey/Android/android-ndk-r20//sources/cxx-stl/llvm-libc++abi/include -fstack-protector-strong -DANDROID -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -fno-builtin-memmove -fuse-ld=gold -o conftest-out conftest.cpp
      > /home/alexey/Android/android-ndk-r20//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.gold: error: cannot open crtbegin_dynamic.o: No such file or directory
      > /home/alexey/Android/android-ndk-r20//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.gold: error: cannot open crtend_android.o: No such file or directory
      > /home/alexey/Android/android-ndk-r20//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.gold: error: cannot find -lc++
      > clang++: error: linker command failed with exit code 1 (use -v to see invocation)
      test config.qtbase.tests.use_gold_linker FAILED
      Checking for valid makespec... 
      + cd /home/alexey/projects/tremotesf-android/3rdparty/qt/build-armeabi-v7a/config.tests/verifyspec && /home/alexey/projects/tremotesf-android/3rdparty/qt/build-armeabi-v7a/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" 'INCLUDEPATH += /home/alexey/projects/tremotesf-android/3rdparty/openssl/install-armeabi-v7a/include' -early "CONFIG += cross_compile" /home/alexey/projects/tremotesf-android/3rdparty/qt/qtbase/config.tests/verifyspec
      > Info: creating stash file /home/alexey/projects/tremotesf-android/3rdparty/qt/build-armeabi-v7a/config.tests/.qmake.stash
      + cd /home/alexey/projects/tremotesf-android/3rdparty/qt/build-armeabi-v7a/config.tests/verifyspec && MAKEFLAGS= /usr/bin/gmake
      > /home/alexey/Android/android-ndk-r20//toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -c -D__ANDROID_API__=16 -target armv7-none-linux-androideabi -gcc-toolchain /home/alexey/Android/android-ndk-r20//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 -fno-limit-debug-info -DANDROID_HAS_WSTRING --sysroot=/home/alexey/Android/android-ndk-r20//sysroot -isystem /home/alexey/Android/android-ndk-r20//sysroot/usr/include/arm-linux-androideabi -isystem /home/alexey/Android/android-ndk-r20//sources/cxx-stl/llvm-libc++/include -isystem /home/alexey/Android/android-ndk-r20//sources/android/support/include -isystem /home/alexey/Android/android-ndk-r20//sources/cxx-stl/llvm-libc++abi/include -fstack-protector-strong -DANDROID -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -fno-builtin-memmove -mthumb -Oz -fPIC  -I/home/alexey/projects/tremotesf-android/3rdparty/qt/qtbase/config.tests/verifyspec -I. -I/home/alexey/projects/tremotesf-android/3rdparty/openssl/install-armeabi-v7a/include -I/home/alexey/projects/tremotesf-android/3rdparty/qt/qtbase/mkspecs/android-clang -o verifyspec.o /home/alexey/projects/tremotesf-android/3rdparty/qt/qtbase/config.tests/verifyspec/verifyspec.cpp
      > /home/alexey/Android/android-ndk-r20//toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -D__ANDROID_API__=16 -target armv7-none-linux-androideabi -gcc-toolchain /home/alexey/Android/android-ndk-r20//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 -fno-limit-debug-info -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a -Wl,--exclude-libs,libunwind.a --sysroot=/home/alexey/Android/android-ndk-r20//platforms/android-16/arch-arm/ -Wl,-soname,libverifyspec.so -Wl,--no-undefined -Wl,-z,noexecstack -shared -o libverifyspec.so verifyspec.o     -L/home/alexey/Android/android-ndk-r20//sources/cxx-stl/llvm-libc++/libs/armeabi-v7a /home/alexey/Android/android-ndk-r20//sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libc++.so.16 -llog -lz -lm -ldl -lc
      > /home/alexey/Android/android-ndk-r20//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lc++
      > clang++: error: linker command failed with exit code 1 (use -v to see invocation)
      > gmake: *** [Makefile:68: libverifyspec.so] Error 1
      Note: Also available for Linux: linux-clang linux-icc
      
      ERROR: Cannot compile a minimal program. The toolchain or QMakeSpec is broken.
      

      It builds fine with NDK r19c.

        Attachments

          Issue Links

          For Gerrit Dashboard: QTBUG-76293
          # Subject Branch Project Status CR V

            Activity

              People

              • Assignee:
                jbornema Joerg Bornemann
                Reporter:
                equeim Alexey
              • Votes:
                5 Vote for this issue
                Watchers:
                18 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes