Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Building Qt with -xplatform android-clang in GNU/Linux fails
Forum Updated to NodeBB v4.3 + New Features

Building Qt with -xplatform android-clang in GNU/Linux fails

Scheduled Pinned Locked Moved Solved Installation and Deployment
5 Posts 2 Posters 2.2k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hipersayan_x
    wrote on last edited by
    #1

    Trying to build Qt with

    Command line: -confirm-license -opensource -silent -prefix /opt/android-qt5/arm64-v8a -docdir /opt/android-qt5/arm64-v8a/doc -xplatform android-clang -nomake tests -nomake examples -android-ndk /opt/android-ndk -android-sdk /opt/android-sdk -android-ndk-host linux-x86_64 -android-toolchain-version 4.9 -skip qttranslations -skip qtserialport -no-warnings-are-errors -no-pkg-config -qt-zlib -qt-freetype -android-arch arm64-v8a -android-ndk-platform android-21
    executing config test use_gold_linker
    

    Building the first test

    /opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -D__ANDROID_API__=21 -target aarch64-none-linux-android -gcc-toolchain /opt/android-ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -DANDROID_HAS_WSTRING --sysroot=/opt/android-ndk/sysroot -isystem /opt/android-ndk/sysroot/usr/include/aarch64-linux-android -isystem /opt/android-ndk/sources/cxx-stl/llvm-libc++/include -isystem /opt/android-ndk/sources/android/support/include -isystem /opt/android-ndk/sources/cxx-stl/llvm-libc++abi/include -fstack-protector-strong -DANDROID -fuse-ld=gold -o conftest-out conftest.cpp
    

    Gives me the following error

    > /opt/android-ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin/ld.gold: error: cannot open crtbegin_dynamic.o: No such file or directory
    > /opt/android-ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin/ld.gold: error: cannot open crtend_android.o: No such file or directory
    > /opt/android-ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin/ld.gold: error: cannot find -lstdc++
    > /opt/android-ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin/ld.gold: error: cannot find -lm
    > /opt/android-ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin/ld.gold: error: cannot find -ldl
    > /opt/android-ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin/ld.gold: error: cannot find -lc
    > /opt/android-ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin/ld.gold: error: cannot find -ldl
    
    > clang++: error: linker command failed with exit code 1 (use -v to see invocation)
    
    test config.qtbase.tests.use_gold_linker FAILED
    

    Any help?

    1 Reply Last reply
    0
    • H Offline
      H Offline
      hipersayan_x
      wrote on last edited by hipersayan_x
      #2

      Ok, found many problems with the build, some heavy patch are required, here is the progress (there are some hardcoded paths for testing).

      Would not mind some help :-)

      Pablo J. RoginaP 1 Reply Last reply
      0
      • H hipersayan_x

        Ok, found many problems with the build, some heavy patch are required, here is the progress (there are some hardcoded paths for testing).

        Would not mind some help :-)

        Pablo J. RoginaP Offline
        Pablo J. RoginaP Offline
        Pablo J. Rogina
        wrote on last edited by
        #3

        @hipersayan_x so it is not an issue anymore? Please mark your post as solved if such. Thanks

        Upvote the answer(s) that helped you solve the issue
        Use "Topic Tools" button to mark your post as Solved
        Add screenshots via postimage.org
        Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

        H 1 Reply Last reply
        0
        • Pablo J. RoginaP Pablo J. Rogina

          @hipersayan_x so it is not an issue anymore? Please mark your post as solved if such. Thanks

          H Offline
          H Offline
          hipersayan_x
          wrote on last edited by
          #4

          @Pablo-J.-Rogina I will consider solved once it fully compile, and it does not right now. Will post updates later.

          1 Reply Last reply
          0
          • H Offline
            H Offline
            hipersayan_x
            wrote on last edited by
            #5

            Ok, solved! for those having problem compiling with NDK r18 the following files must be modified:

            qtbase/mkspecs/android-clang/qmake.conf:

            In QMAKE_CFLAGS change

            --sysroot=$$NDK_ROOT/sysroot
            

            with

            --sysroot=$$ANDROID_PLATFORM_ROOT_PATH
            

            and add -isystem $$NDK_ROOT/sysroot/usr/include at the end.
            And in ANDROID_CXX_STL_LIBS change -lc++ with -lc++_shared.

            qtlocation/src/plugins/geoservices/geoservices.pro:

            Remove all lines related to qtConfig(geoservices_mapboxgl).

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved