Build qtbase for Android arm64-v8a on OSX



  • I'm currently trying to build qtbase using OSX as host.

    I have this article as reference : http://blog.qt.io/blog/2017/02/24/building-latest-greatest-android-aarch64-vulkan-teaser/

    Unfortunately the configure process fails :

    ./configure -developer-build -release -platform darwin-g++ -xplatform android-g++ -android-arch arm64-v8a -android-ndk /Users/mickaelb/dev/libs/android-ndk-r16b -android-sdk /Users/mickaelb/dev/libs/android-sdk -sdk macosx10.13 -android-ndk-host darwin-x86_64 -android-ndk-platform android-24 -android-toolchain-version 4.9 -opensource -confirm-license -nomake tests -nomake examples -recheck-all -v
    
    
    <srcbase> = /Users/mickaelb/dev/libs/Qt/qtbase
    <outbase> = /Users/mickaelb/dev/libs/Qt/qtbase
    Creating qmake...
    QMAKE_MAC_SDK must be set when building on Mac
    QMAKE_MAC_SDK must be set when building on Mac
    QMAKE_MAC_SDK must be set when building on Mac
    QMAKE_MAC_SDK must be set when building on Mac
    QMAKE_MAC_SDK must be set when building on Mac
    QMAKE_MAC_SDK must be set when building on Mac
    QMAKE_MAC_SDK must be set when building on Mac
    QMAKE_MAC_SDK must be set when building on Mac
    make: Nothing to be done for `first'.
    Command line: -developer-build -release -platform darwin-g++ -xplatform android-g++ -android-arch arm64-v8a -android-ndk /Users/mickaelb/dev/libs/android-ndk-r16b -android-sdk /Users/mickaelb/dev/libs/android-sdk -sdk macosx10.13 -android-ndk-host darwin-x86_64 -android-ndk-platform android-24 -android-toolchain-version 4.9 -opensource -confirm-license -nomake tests -nomake examples -recheck-all -v
    
    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 /Users/mickaelb/dev/libs/Qt/qtbase/config.tests && /Users/mickaelb/dev/libs/android-ndk-r16b/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/bin/aarch64-linux-android-g++ -fuse-ld=gold -o conftest-out conftest.cpp
    > /Users/mickaelb/dev/libs/android-ndk-r16b/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/bin/../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
    > /Users/mickaelb/dev/libs/android-ndk-r16b/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/bin/../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
    > /Users/mickaelb/dev/libs/android-ndk-r16b/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/bin/../lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin/ld.gold: error: cannot find -lstdc++
    > /Users/mickaelb/dev/libs/android-ndk-r16b/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/bin/../lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin/ld.gold: error: cannot find -lm
    > /Users/mickaelb/dev/libs/android-ndk-r16b/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/bin/../lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin/ld.gold: error: cannot find -lc
    > /Users/mickaelb/dev/libs/android-ndk-r16b/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/bin/../lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin/ld.gold: error: cannot find -ldl
    > collect2: error: ld returned 1 exit status
    test config.qtbase.tests.use_gold_linker FAILED
    Checking for valid makespec...
    + cd /Users/mickaelb/dev/libs/Qt/qtbase/config.tests/verifyspec && /Users/mickaelb/dev/libs/Qt/qtbase/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" -early "CONFIG += cross_compile" /Users/mickaelb/dev/libs/Qt/qtbase/config.tests/verifyspec
    + cd /Users/mickaelb/dev/libs/Qt/qtbase/config.tests/verifyspec && MAKEFLAGS= /usr/bin/make clean && MAKEFLAGS= /usr/bin/make
    > rm -f verifyspec.o
    > rm -f *~ core *.core
    > /Users/mickaelb/dev/libs/android-ndk-r16b/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/bin/aarch64-linux-android-g++ -c -D__ANDROID_API__=24 --sysroot=/Users/mickaelb/dev/libs/android-ndk-r16b/sysroot -isystem /Users/mickaelb/dev/libs/android-ndk-r16b/sysroot/usr/include/aarch64-linux-android -isystem /Users/mickaelb/dev/libs/android-ndk-r16b/sources/cxx-stl/gnu-libstdc++/4.9/include -isystem /Users/mickaelb/dev/libs/android-ndk-r16b/sources/cxx-stl/gnu-libstdc++/4.9/libs/arm64-v8a/include -fstack-protector-strong -DANDROID -O2 -O2 -std=gnu++11 -fPIC  -I. -I/Users/mickaelb/dev/libs/Qt/qtbase/mkspecs/android-g++ -o verifyspec.o verifyspec.cpp
    > /Users/mickaelb/dev/libs/android-ndk-r16b/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/bin/aarch64-linux-android-g++ --sysroot=/Users/mickaelb/dev/libs/android-ndk-r16b/platforms/android-24/arch-arm64/ -Wl,-soname,libverifyspec.so -Wl,--no-undefined -Wl,-z,noexecstack -shared -o libverifyspec.so verifyspec.o   -L/Users/mickaelb/dev/libs/android-ndk-r16b/sources/cxx-stl/gnu-libstdc++/4.9/libs/arm64-v8a -L/Users/mickaelb/dev/libs/android-ndk-r16b/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/bin/../lib/gcc/aarch64-linux-android/4.9.x -lgnustl_shared -lgcc -llog -lz -lm -ldl -lc
    test config.qtbase.tests.verifyspec succeeded
    Checking for target architecture...
    + cd /Users/mickaelb/dev/libs/Qt/qtbase/config.tests/arch && /Users/mickaelb/dev/libs/Qt/qtbase/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" -early "CONFIG += cross_compile" /Users/mickaelb/dev/libs/Qt/qtbase/config.tests/arch
    + cd /Users/mickaelb/dev/libs/Qt/qtbase/config.tests/arch && MAKEFLAGS= /usr/bin/make clean && MAKEFLAGS= /usr/bin/make
    > rm -f arch.o
    > rm -f *~ core *.core
    > /Users/mickaelb/dev/libs/android-ndk-r16b/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/bin/aarch64-linux-android-g++ -c -D__ANDROID_API__=24 --sysroot=/Users/mickaelb/dev/libs/android-ndk-r16b/sysroot -isystem /Users/mickaelb/dev/libs/android-ndk-r16b/sysroot/usr/include/aarch64-linux-android -isystem /Users/mickaelb/dev/libs/android-ndk-r16b/sources/cxx-stl/gnu-libstdc++/4.9/include -isystem /Users/mickaelb/dev/libs/android-ndk-r16b/sources/cxx-stl/gnu-libstdc++/4.9/libs/arm64-v8a/include -fstack-protector-strong -DANDROID -O2 -O2 -std=gnu++11 -fPIC  -I. -I/Users/mickaelb/dev/libs/Qt/qtbase/mkspecs/android-g++ -o arch.o arch.cpp
    > /Users/mickaelb/dev/libs/android-ndk-r16b/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/bin/aarch64-linux-android-g++ --sysroot=/Users/mickaelb/dev/libs/android-ndk-r16b/platforms/android-24/arch-arm64/ -Wl,-soname,libarch.so -Wl,--no-undefined -Wl,-z,noexecstack -shared -o libarch.so arch.o   -L/Users/mickaelb/dev/libs/android-ndk-r16b/sources/cxx-stl/gnu-libstdc++/4.9/libs/arm64-v8a -L/Users/mickaelb/dev/libs/android-ndk-r16b/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/bin/../lib/gcc/aarch64-linux-android/4.9.x -lgnustl_shared -lgcc -llog -lz -lm -ldl -lc
    Detected architecture: arm64 (neon)
    test config.qtbase.tests.architecture gave result arm64
    Checking for host architecture...
    + cd /Users/mickaelb/dev/libs/Qt/qtbase/config.tests/arch && /Users/mickaelb/dev/libs/Qt/qtbase/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" -early "CONFIG += cross_compile" /Users/mickaelb/dev/libs/Qt/qtbase/config.tests/arch/arch_host.pro
    > Project ERROR: Cannot run host compiler 'c++'. Output:
    > ===================
    > Apple LLVM version 9.0.0 (clang-900.0.39.2)
    > Target: x86_64-apple-darwin17.4.0
    > Thread model: posix
    > InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
    > clang: warning: no such sysroot directory: '-E' [-Wmissing-sysroot]
    >  "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.13.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name - -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -fno-strict-return -masm-verbose -munwind-tables -target-cpu penryn -target-linker-version 305 -v -dwarf-column-info -debugger-tuning=lldb -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0 -isysroot -E -stdlib=libc++ -fdeprecated-macro -fdebug-compilation-dir /Users/mickaelb/dev/libs/Qt/qtbase/mkspecs/features -ferror-limit 19 -fmessage-length 0 -stack-protector 1 -fblocks -fobjc-runtime=macosx-10.13.0 -fencode-extended-block-signature -fcxx-exceptions -fexceptions -fmax-type-align=16 -fdiagnostics-show-option -o /var/folders/74/f_tysq852x35m01xtyrzgjv00000gn/T/--e33938.o -x c++ -
    > clang -cc1 version 9.0.0 (clang-900.0.39.2) default target x86_64-apple-darwin17.4.0
    > ignoring nonexistent directory "-E/usr/include/c++/v1"
    > ignoring nonexistent directory "-E/usr/local/include"
    > ignoring nonexistent directory "-E/usr/include"
    > ignoring nonexistent directory "-E/System/Library/Frameworks"
    > ignoring nonexistent directory "-E/Library/Frameworks"
    > #include "..." search starts here:
    > #include <...> search starts here:
    >  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1
    >  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/include
    >  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
    > End of search list.
    >  "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -no_deduplicate -dynamic -arch x86_64 -macosx_version_min 10.13.0 -syslibroot -E -o a.out /var/folders/74/f_tysq852x35m01xtyrzgjv00000gn/T/--e33938.o -lc++ -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/lib/darwin/libclang_rt.osx.a
    > ld: library not found for -lc++
    > clang: error: linker command failed with exit code 1 (use -v to see invocation)
    > ===================
    > Maybe you forgot to setup the environment?
    Project ERROR: Could not determine host architecture. See config.log for details.
    

    Is there any possibility to build it from OSX ? Thank you.



  • This post is deleted!

Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.