Building Qt5.5(single) from source for Olimex A10Lime



  • Hello,

    I am a newbie on cross compiling and trying to compile Qt for my development board. My development board is Olimex A10Lime, it has ARM Cortex-A8 processor and using official images distributed from Olimex. I have just dd on SD card that image and it is perfectly booting and working.

    Those are my target's image specs;

    • Linux a10Lime 3.4.90+ #3 PREEMPT Tue Jun 10 09:17:04 EEST 2014 armv7l GNU/Linux
    • ldd (Debian EGLIBC 2.13-38+deb7u8) 2.13
    • gcc (Debian 4.7.2-5) 4.7.2
    • GNU ld (GNU Binutils for Debian) 2.22

    And on my host machine, I am using VBox to virtualize;

    • Linux debian 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt11-1+deb8u2 (2015-07-17) x86_64 GNU/Linux
    • ldd (Debian GLIBC 2.19-18) 2.19
    • gcc (Debian 4.9.2-10) 4.9.2
    • GNU ld (GNU Binutils for Debian) 2.25

    and using gcc-linaro-4.9-2015.02-3-x86_64_arm-linux-gnueabihf as toolchain

    Actually I would like to develop some Qt project on my host machine to run on my target machine in the future.

    So right now I am buiilding Qt from source. I've add my device to '/qt-everywhere-opensource-src-5.5.0/qtbase/mkspecs/devices/' and fixed my symlinks with cross compiler tools (fixQualifiedLibraryPaths).

    By the way, /mnt/lime-rootfs is where i am mounting my GNU/Linux image.

    The problem show up when i start to run ./configure file (with parameters). It actually build qmake perfectly. But after it just start to 'Determining architecture... ()' everything starts to go wrong and it gives error like,

    /mnt/lime-rootfs/usr/lib/arm-linux-gnueabihf/librt.so: undefined reference to `__clock_getcpuclockid@GLIBC_PRIVATE'

    or like,

    libjpeg.cpp:37:21: fatal error: jpeglib.h: No such file or directory

    (since there is so many error messages like that i don't want to spam.. I guess those are enough to find out what is going worng :S)

    At this point my question is, is this problem rises because of some missing dependencies? if it is yes, is there any list of dependencies and minimum version required for those? or any other suggestions for my case?

    Thanks for your helps,
    Sina


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    The missing headers errors is an indication of the features that will be disabled. Depending on your needs you need to install the corresponding dev packages on your target.

    You're also using pretty different compiler/glibc versions between your target and your cross-compiling environment.



  • @SGaist Hello,
    Thanks for your reply, I guess I have to hunt down does headers and install does to my target to complete the compilation? Also I am missing something, I am getting those error messages just after it says "Running configuration tests...", so do I need those headers in my target machine(SYSROOT) or in my toolchain or on my host machine?

    Also I am getting a message like, "Could not determine the target architecture!" I would like to know why it can not determine it.

    Here is my a part of my error message (where everything starts to go wrong),

    ==========================================================================================
    Creating qmake...
    make: Nothing to be done for 'first'.
    Running configuration tests...
    Found pkg-config from $PATH: /usr/bin/pkg-config
    Note: PKG_CONFIG_LIBDIR automatically set to /mnt/lime-rootfs//usr/lib/pkgconfig:/mnt/lime-rootfs//usr/share/pkgconfig:/mnt/lime-rootfs//usr/lib/arm-linux-gnueabihf/pkgconfig
    Note: PKG_CONFIG_SYSROOT_DIR automatically set to /mnt/lime-rootfs/
    Determining architecture... ()
    /home/sina/toolchains/gcc-linaro-arm-linux-gnueabihf-4.8-2013.09_linux/bin/arm-linux-gnueabihf-g++ -c -pipe -march=armv7-a -mtune=cortex-a8 -mfpu=neon -DLINUX=1 -DEGL_API_FB=1 -mfloat-abi=hard --sysroot=/mnt/lime-rootfs/ -g -Wall -W -fPIC -I. -I../../mkspecs/devices/linux-a10lime-g++ -o arch.o arch.cpp
    /home/sina/toolchains/gcc-linaro-arm-linux-gnueabihf-4.8-2013.09_linux/bin/arm-linux-gnueabihf-g++ -o arch arch.o -lrt -lpthread -ldl --sysroot=/mnt/lime-rootfs/
    /mnt/lime-rootfs/usr/lib/arm-linux-gnueabihf/librt.so: undefined reference to __pthread_get_minstack@GLIBC_PRIVATE' /mnt/lime-rootfs/usr/lib/arm-linux-gnueabihf/librt.so: undefined reference to__clock_settime@GLIBC_PRIVATE'
    /mnt/lime-rootfs/usr/lib/arm-linux-gnueabihf/librt.so: undefined reference to __clock_getcpuclockid@GLIBC_PRIVATE' /mnt/lime-rootfs/usr/lib/arm-linux-gnueabihf/librt.so: undefined reference to__clock_nanosleep@GLIBC_PRIVATE'
    /mnt/lime-rootfs/usr/lib/arm-linux-gnueabihf/librt.so: undefined reference to __clock_getres@GLIBC_PRIVATE' /mnt/lime-rootfs/usr/lib/arm-linux-gnueabihf/librt.so: undefined reference to__clock_gettime@GLIBC_PRIVATE'
    collect2: error: ld returned 1 exit status
    Makefile:105: recipe for target 'arch' failed
    make: *** [arch] Error 1
    Unable to determine architecture!

    Could not determine the target architecture!
    Turn on verbose messaging (-v) to see the final report.
    Determining architecture... ()
    g++ -c -pipe -g -Wall -W -fPIC -I. -I../../mkspecs/linux-g++ -o arch.o arch.cpp
    g++ -o arch arch.o
    Found architecture in binary
    CFG_HOST_ARCH="x86_64"
    CFG_HOST_CPUFEATURES=" mmx sse sse2"
    System architecture: 'unknown'
    Host architecture: 'x86_64'
    C++11 auto-detection... ()

    • And at the end of the compilation, it just says,

    ==========================================================================================
    collect2: error: ld returned 1 exit status
    Makefile:105: recipe for target 'opengles2' failed
    make: *** [opengles2] Error 1
    OpenGL disabled.
    The OpenGL ES 2.0 functionality test failed!
    You might need to modify the include and library search paths by editing
    QMAKE_INCDIR_OPENGL_ES2, QMAKE_LIBDIR_OPENGL_ES2 and QMAKE_LIBS_OPENGL_ES2 in
    /home/sina/qt-src/qt-everywhere-opensource-src-5.5.0/qtbase/mkspecs/devices/linux-a10lime-g++.

    By the way after do you mean my host machine with "cross-compiling environment"? Is that versions really depends on my host machine? I have just thought the it depends the difference between with my target and toolchain.

    Do I need to lower also my host machine compiler and glibc?

    Thanks for your help,
    Sina



  • @SGaist Hello again,

    I have just upgraded my glibc of my target device like you said, so it just succeeded!

    I am building now but since there absolute pathed symlinks it just failing, so I am changing those to relative path when everytime it fails.

    But I'd like to ask that do I need to make clean before make again?

    Thanks for help,
    Sina


  • Lifetime Qt Champion

    Yes, better to make clean build



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