Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

cross platform build Qt 5.12, failed on link libQt5Core.so.5.12



  • I'm trying to build qt for Jetson TX2, build failed on here

     /home/linger/crossbuild/usr/lib/aarch64-linux-gnu/libpcre.a -pthread -L/home/linger/crossbuild/usr/lib/aarch64-linux-gnu -L/home/linger/crossbuild/usr/lib -L/home/linger/crossbuild/lib/aarch64-linux-gnu
    /home/linger/crossbuild/gcc-linaro-5.5.0-2017.10-x86_64_aarch64-linux-gnu/bin/../lib/gcc/aarch64-linux-gnu/5.5.0/../../../../aarch64-linux-gnu/bin/ld: /home/linger/crossbuild/usr/lib/aarch64-linux-gnu/libglib-2.0.a(libglib_2_0_la-gslice.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against external symbol `__stack_chk_guard@@GLIBC_2.17' can not be used when making a shared object; recompile with -fPIC
    /home/linger/crossbuild/gcc-linaro-5.5.0-2017.10-x86_64_aarch64-linux-gnu/bin/../lib/gcc/aarch64-linux-gnu/5.5.0/../../../../aarch64-linux-gnu/bin/ld: /home/linger/crossbuild/usr/lib/aarch64-linux-gnu/libglib-2.0.a(libglib_2_0_la-gslice.o)(.text+0x4): unresolvable R_AARCH64_ADR_PREL_PG_HI21 relocation against symbol `__stack_chk_guard@@GLIBC_2.17'
    /home/linger/crossbuild/gcc-linaro-5.5.0-2017.10-x86_64_aarch64-linux-gnu/bin/../lib/gcc/aarch64-linux-gnu/5.5.0/../../../../aarch64-linux-gnu/bin/ld: final link failed: Bad value
    collect2: error: ld returned 1 exit status
    make[3]: *** [Makefile:1321: ../../lib/libQt5Core.so.5.12.10] Error 1
    make[3]: Leaving directory '/home/linger/crossbuild/qt-everywhere-src-5.12.10/qtbase/src/corelib'
    make[2]: *** [Makefile:226: sub-corelib-make_first] Error 2
    make[2]: Leaving directory '/home/linger/crossbuild/qt-everywhere-src-5.12.10/qtbase/src'
    make[1]: *** [Makefile:51: sub-src-make_first] Error 2
    make[1]: Leaving directory '/home/linger/crossbuild/qt-everywhere-src-5.12.10/qtbase'
    make: *** [Makefile:86: module-qtbase-make_first] Error 2
    

    libglib-2.0.a(libglib_2_0_la-gslice.o)(.text+0x4): unresolvable R_AARCH64_ADR_PREL_PG_HI21 relocation against symbol `__stack_chk_guard@@GLIBC_2.17'

    recording this -> https://stackoverflow.com/questions/19894541/libm-relocation-error-when-building-qt-5-for-nitrogen6x
    i try to replace libglib-2.0.so :

    ln -sf $PWD/lib/aarch64-linux-gnu/libglib-2.0.so.0.4800.2 $PWD/usr/lib/aarch64-linux-gnu/libglib-2.0.so
    

    but still failed.

    all libs and headers is sync from the em-linux.

    and configure by this:

    ./configure -shared -c++std c++14 \
     -opensource -release --confirm-license -pkg-config -shared \
     -device linux-jetson-tx1-g++ \
     -device-option CROSS_COMPILE=/home/linger/crossbuild/gcc-linaro-5.5.0-2017.10-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu- \
     -sysroot /home/linger/crossbuild \
     -nomake examples -nomake tests \
     -prefix /home/linger/crossbuild/JetsonTX2/qt5 \
     -extprefix /home/linger/crossbuild/JetsonTX2/qt5 \
     -hostprefix /home/linger/crossbuild/JetsonTX2/qt5-host \
     -opengl es2 \
     -pch
    

    this result looks fine and no warning and error output.



  • I cannot find the right version of libglib-2.0.a , just use -no-glib to disable it.

    re-building now everything looks fine...



  • I cannot find the right version of libglib-2.0.a , just use -no-glib to disable it.

    re-building now everything looks fine...



  • @alluLinger said in cross platform build Qt 5.12, failed on link libQt5Core.so.5.12:

    now everything looks fine

    great, so please don't forget to mark your post as solved!


Log in to reply