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

cross-compile Qt 5.5 for iMX6 - with or without -no-gcc-sysroot?



  • Hi,
    I'm trying to cross-compile Qt 5.5 for iMX6 (Phytec board with Yocto). I have two questions:

    • can I use g++ compiler from Ubuntu package g++-arm-linux-gnueabi, or do I have to download Linaro?
    • should I run configure with -no-gcc-sysroot?

    At the moment configure fails both with and without -no-gcc-sysroot, but with slightly different error messages related to OpenGL ES 2.0. My configure call looks like this:

    ../5.5/Src/configure 
    -opensource 
    -confirm-license 
    -release 
    -eglfs 
    -no-pch 
    -no-xcb 
    -no-opengl 
    -opengl es2 
    -make libs 
    -nomake tests 
    -nomake examples 
    -device imx6 
    -xplatform linux-arm-gnueabi-g++ 
    -sysroot /opt/yogurt/iMX6-PD15.1.0/sysroots/cortexa9hf-vfp-neon-phytec-linux-gnueabi 
    -prefix /usr/lib/Qt-5.5  
    -v
    

    When -no-gcc-sysroot is excluded as above, library paths to sysroot are propagated to DEFAULT_INCDIRS and DEFAULT_LIBDIRS:

    arm-linux-gnueabi-g++ --sysroot=/opt/yogurt/iMX6-PD15.1.0/sysroots/cortexa9hf-vfp-neon-phytec-linux-gnueabi -o libtest.so -shared -Wl,-Bsymbolic-functions -fPIC bsymbolic_functions.c
    bsymbolic_functions.c:2:2: error: #error "Symbolic function binding on this architecture may be broken, disabling it (see QTBUG-36129)."
    Symbolic function binding disabled.
    DEFAULT_INCDIRS="/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/include
    /usr/lib/gcc-cross/arm-linux-gnueabi/4.7/include-fixed
    /usr/arm-linux-gnueabi/include
    /opt/yogurt/iMX6-PD15.1.0/sysroots/cortexa9hf-vfp-neon-phytec-linux-gnueabi/usr/include
    "
    DEFAULT_LIBDIRS="/usr/arm-linux-gnueabi/lib
    /opt/yogurt/iMX6-PD15.1.0/sysroots/cortexa9hf-vfp-neon-phytec-linux-gnueabi/lib
    /opt/yogurt/iMX6-PD15.1.0/sysroots/cortexa9hf-vfp-neon-phytec-linux-gnueabi/usr/lib
    /usr/lib/gcc-cross/arm-linux-gnueabi/4.7
    "
    

    Failing linker step prints the following output:

    arm-linux-gnueabi-g++ -Wl,-O1 -o opengles2 opengles2.o   --sysroot=/opt/yogurt/iMX6-PD15.1.0/sysroots/cortexa9hf-vfp-neon-phytec-linux-gnueabi -lGLESv2 
    /opt/yogurt/iMX6-PD15.1.0/sysroots/cortexa9hf-vfp-neon-phytec-linux-gnueabi/lib/libpthread.so.0: undefined reference to `__default_rt_sa_restorer@GLIBC_PRIVATE'
    /opt/yogurt/iMX6-PD15.1.0/sysroots/cortexa9hf-vfp-neon-phytec-linux-gnueabi/lib/libpthread.so.0: undefined reference to `__default_sa_restorer@GLIBC_PRIVATE'
    /opt/yogurt/iMX6-PD15.1.0/sysroots/cortexa9hf-vfp-neon-phytec-linux-gnueabi/lib/libpthread.so.0: undefined reference to `__libc_vfork@GLIBC_PRIVATE'
    collect2: error: ld returned 1 exit status
    

    With -no-gcc-sysroot, environment variables are missing paths to sysroot and linker prints this output:

    arm-linux-gnueabi-g++ -Wl,-O1 -o opengles2 opengles2.o   -lGLESv2 
    /usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/bin/ld: cannot find -lGLESv2
    

    I have libgles2-mesa-dev package installed on the host OS (don't know if it matters).


Log in to reply