Error cannot compile a minimal program the toolchain or qmakespec is broken

Hello Everyone, i am trying to configure the qt code for RPi. I am getting the following message: /home/bot1/tmp/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++ -mfloat-abi=hard --sysroot=/home/bot1/raspi/s...

This topic has been deleted. Only users with topic management privileges can see it.

  • Hello Everyone, i am trying to configure the qt code for RPi.
    I am getting the following message:

    /home/bot1/tmp/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++ -mfloat-abi=hard —sysroot=/home/bot1/raspi/sysroot -Wl,-O1 -Wl,-rpath-link,/home/bot1/raspi/sysroot/opt/vc/lib -Wl,-rpath-link,/home/bot1/raspi/sysroot/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link,/home/bot1/raspi/sysroot/lib/arm-linux-gnueabihf -o verifyspec verifyspec.o
    /home/bot1/tmp/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find crt1.o: No such file or directory
    /home/bot1/tmp/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find crti.o: No such file or directory
    /home/bot1/tmp/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lm
    collect2: error: ld returned 1 exit status
    Makefile:68: recipe for target ‘verifyspec’ failed
    make: *** [verifyspec] Error 1
    Note: Also available for Linux: linux-clang linux-icc

    ERROR: Cannot compile a minimal program. The toolchain or QMakeSpec is broken.

    I suppose its an issue with the crt*.o files and a relative path.

    Thank you!

  • I think that the main problem lays in the «ld» file, which does not incorporate crt1,crti and also -lm

  • It is worth mentioning that i am using this command to configure the project:

    ../qt-5.12.3-src/configure -release -opengl es2 -device linux-rasp-pi3-g++ -device-option CROSS_COMPILE=/home/bot1/tmp/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf- -sysroot ~/raspi/sysroot -opensource -confirm-license -make libs -prefix /usr -extprefix ~/raspi/sysroot/usr -hostprefix ~/raspi/qt5 -v -no-use-gold-linker -webengine-embedded-build -webengine-pepper-plugins -webengine-printing-and-pdf -webengine-proprietary-codecs -webengine-spellchecker -qt-sqlite -feature-webengine-embedded-build -feature-webengine-printing-and-pdf -skip qtscript -webengine-webrtc
    
  • Hi and welcome to devnet,

    I would try to get a more recent version of your cross-compiler. Gcc 4.8.3 is a bit outdated.

  • 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... yes
    Checking for machine tuple... yes
    Checking for valid makespec... Note: Also available for Linux: linux-clang linux-icc
    
    ERROR: Cannot compile a minimal program. The toolchain or QMakeSpec is broken.
    
    Check config.log for details.
    
    Command line: -release -opengl es2 -device linux-rasp-pi-g++ -qpa eglfs -no-libinput -no-linuxfb -no-xcb -no-kms -no-gbm -no-gtk -no-widgets -no-compile-examples -no-sql-tds -device-option CROSS_COMPILE=/home/mark/opt/rpi-ramdisk/sysroot/toolchain/bin/arm-linux-gnueabihf- -sysroot /home/mark/opt/rpi-ramdisk/sysroot/sysroot -opensource -confirm-license -make libs -strip -optimize-size -prefix /opt/qt -extprefix /home/mark/opt/rpi-ramdisk/packages/qt/stage//opt/qt -hostprefix /home/mark/opt/rpi-ramdisk/packages/qt/qt-host
    executing config test use_gold_linker
    + cd /home/mark/opt/rpi-ramdisk/packages/qt/qtbase/config.tests && /home/mark/opt/rpi-ramdisk/sysroot/toolchain/bin/arm-linux-gnueabihf-g++ -pipe -marm -mfpu=vfp -mtune=arm1176jzf-s -march=armv6zk -mabi=aapcs-linux -mfloat-abi=hard -fuse-ld=gold -o conftest-out conftest.cpp
    test config.qtbase.tests.use_gold_linker succeeded
    executing config test machineTuple
    + /home/mark/opt/rpi-ramdisk/sysroot/toolchain/bin/arm-linux-gnueabihf-g++ -dumpmachine
    > arm-linux-gnueabihf
    test config.qtbase.tests.machineTuple succeeded
    executing config test verifyspec
    + cd /home/mark/opt/rpi-ramdisk/packages/qt/qtbase/config.tests/verifyspec && /home/mark/opt/rpi-ramdisk/packages/qt/qtbase/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared use_gold_linker warn_off console single_arch" "QMAKE_CFLAGS += --sysroot=/home/mark/opt/rpi-ramdisk/sysroot/sysroot" "QMAKE_CXXFLAGS += --sysroot=/home/mark/opt/rpi-ramdisk/sysroot/sysroot" "QMAKE_LFLAGS += --sysroot=/home/mark/opt/rpi-ramdisk/sysroot/sysroot" -early "CONFIG += cross_compile" /home/mark/opt/rpi-ramdisk/packages/qt/qtbase/config.tests/verifyspec
    > Info: creating stash file /home/mark/opt/rpi-ramdisk/packages/qt/qtbase/config.tests/.qmake.stash
    + cd /home/mark/opt/rpi-ramdisk/packages/qt/qtbase/config.tests/verifyspec && MAKEFLAGS= /usr/bin/make
    > /home/mark/opt/rpi-ramdisk/sysroot/toolchain/bin/arm-linux-gnueabihf-g++ -c -pipe -marm -mfpu=vfp -mtune=arm1176jzf-s -march=armv6zk -mabi=aapcs-linux -mfloat-abi=hard --sysroot=/home/mark/opt/rpi-ramdisk/sysroot/sysroot -O2 -w -fPIC  -I. -I/home/mark/opt/rpi-ramdisk/packages/qt/qtbase/mkspecs/devices/linux-rasp-pi-g++ -o verifyspec.o verifyspec.cpp
    > /home/mark/opt/rpi-ramdisk/sysroot/toolchain/bin/arm-linux-gnueabihf-g++ -mfloat-abi=hard --sysroot=/home/mark/opt/rpi-ramdisk/sysroot/sysroot -Wl,-O1 -fuse-ld=gold -Wl,-rpath-link,/home/mark/opt/rpi-ramdisk/sysroot/sysroot/opt/vc/lib -Wl,-rpath-link,/home/mark/opt/rpi-ramdisk/sysroot/sysroot/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link,/home/mark/opt/rpi-ramdisk/sysroot/sysroot/lib/arm-linux-gnueabihf -o verifyspec verifyspec.o      
    > /home/mark/opt/rpi-ramdisk/sysroot/toolchain/bin/../lib/gcc/arm-linux-gnueabihf/6.4.1/../../../../arm-linux-gnueabihf/bin/ld.gold: error: cannot open crt1.o: File o directory non esistente
    > /home/mark/opt/rpi-ramdisk/sysroot/toolchain/bin/../lib/gcc/arm-linux-gnueabihf/6.4.1/../../../../arm-linux-gnueabihf/bin/ld.gold: error: cannot open crti.o: File o directory non esistente
    > /home/mark/opt/rpi-ramdisk/sysroot/toolchain/bin/../lib/gcc/arm-linux-gnueabihf/6.4.1/../../../../arm-linux-gnueabihf/bin/ld.gold: error: cannot open crtn.o: File o directory non esistente
    > /home/mark/opt/rpi-ramdisk/sysroot/toolchain/bin/../lib/gcc/arm-linux-gnueabihf/6.4.1/../../../../arm-linux-gnueabihf/bin/ld.gold: error: cannot find -lm
    > /home/mark/opt/rpi-ramdisk/sysroot/toolchain/bin/../lib/gcc/arm-linux-gnueabihf/6.4.1/../../../../arm-linux-gnueabihf/bin/ld.gold: error: cannot find -lc
    > collect2: error: ld returned 1 exit status
    > make: *** [Makefile:66: verifyspec] Error 1
    
    

    I have been trying to build ParaView to test the custom apps examples here on MacOS.

    I have followed the site instructions for the superbuild here.

    Then I executed:

    $ mkdir pv
    $ cd pv
    $ git clone https://gitlab.kitware.com/paraview/paraview-superbuild.git
    $ cd paraview-superbuild
    $ git fetch origin # ensure you have the latest state from the main repo
    $ git submodule update
    
    $ cd ..
    $ mkdir paraview_build
    $ cd paraview_build
    $ cmake ../paraview-superbuild
    $ ccmake -DCMAKE_OSX_SDK=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk ../paraview-superbuild
    

    I enabled the CMake variables:

    ENABLE_qt5
    ENABLE_python
    ENABLE_python2
    

    Then ran:

    $ make
    

    The error I got:

    [ 82%] No patch step for 'qt5'
    [ 83%] No update step for 'qt5'
    [ 85%] Performing configure step for 'qt5'
    + cd qtbase
    + /Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/src/qtbase/configure -top-level -opensource -confirm-license -release -prefix /Users/username/Desktop/dev/pv/paraview_build/install -I /Users/username/Desktop/dev/pv/paraview_build/install/include -L /Users/username/Desktop/dev/pv/paraview_build/install/lib -skip qtconnectivity -skip qtgamepad -skip qtlocation -skip qtmultimedia -skip qtsensors -skip qtserialport -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -nomake examples -nomake tests -no-dbus -qt-libjpeg -qt-pcre -system-zlib -no-openssl -skip qtsvg -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -qt-libpng
    Preparing build tree...
    Creating qmake...
    /Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/src/qtbase/qmake/generators/win32/msbuild_objectmodel.cpp:1190:10: warning: comparison of two values with different enumeration types in switch statement ('midlErrorCheckOption' and 'midlStructMemberAlignOption') [-Wenum-compare-switch]
        case midlAlignNotSet:
             ^~~~~~~~~~~~~~~
    1 warning generated.
    Done.
    Info: creating super cache file /Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/build/.qmake.super
    Info: creating stash file /Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/build/.qmake.stash
    
    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... no
    Checking for valid makespec... ERROR: Cannot compile a minimal program. The toolchain or QMakeSpec is broken.
    
    Check config.log for details.
    CMake Error at /Users/username/Desktop/dev/pv/paraview_build/superbuild/sb-qt5-configure.cmake:47 (message):
      Failed with exit code 3
    
    
    make[2]: *** [superbuild/qt5/stamp/qt5-configure] Error 1
    make[1]: *** [superbuild/CMakeFiles/qt5.dir/all] Error 2
    

    The config.log file:

    Command line: -opensource -confirm-license -release -prefix /Users/username/Desktop/dev/pv/paraview_build/install -I /Users/username/Desktop/dev/pv/paraview_build/install/include -L /Users/username/Desktop/dev/pv/paraview_build/install/lib -skip qtconnectivity -skip qtgamepad -skip qtlocation -skip qtmultimedia -skip qtsensors -skip qtserialport -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -nomake examples -nomake tests -no-dbus -qt-libjpeg -qt-pcre -system-zlib -no-openssl -skip qtsvg -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -qt-libpng
    executing config test verifyspec
    + cd /Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/build/config.tests/verifyspec && /Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/build/qtbase/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" 'QMAKE_LIBDIR += /Users/username/Desktop/dev/pv/paraview_build/install/lib' 'INCLUDEPATH += /Users/username/Desktop/dev/pv/paraview_build/install/include' /Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/src/qtbase/config.tests/verifyspec
    > Project ERROR: QMAKE_MAC_SDK can only contain short-form SDK names (eg. macosx, iphoneos)
    

    Any ideas on what should I do?

    Доброго времени суток!

    Установлено:

    Windows 10 x64

    Qt 5.13.0 установлен в с:Qt

    Сервер БД работает на ОС Linux.

    mysql Ver 15.1 Distrib 10.3.18-MariaDB, for Linux (x86_64) using readline 5.1


    Качем 64 битную версию MariaDB потому что Mingw 64-битный.


    mariadb-10.4.10-winx64.msi

    При установке отключаем компоненты сервера.

    Дабы потом не мучатся с путями в Program Files я ставлю в выбранную мной папку:

    D:MariaDB

    Заходим в Папку D:MariaDBlib и делаем копии файлов

    libmariadb.dll даем новое имя libmysql.dll

    libmariadb.lib даем новое имя libmysql.lib

    mariadbclient.lib даем новое имя mysqlclient.lib

    Добавляем в переменную среды PATH следующие пути:

    C:Qt5.13.0mingw73_64bin

    C:QtToolsmingw730_64bin

    D:MariaDBlib

    Переходим в папку C:Qt5.13.0Srcqtbasesrcpluginssqldrivers

    Выполняем следующее:

    qmake -- MYSQL_INCDIR=D:/MariaDB/include/mysql MYSQL_LIBDIR=D:/MariaDB/lib
    

    Получаем

    Qt Sql Drivers:
      DB2 (IBM) .............................. no
      InterBase .............................. no
      MySql .................................. yes
      OCI (Oracle) ........................... no
      ODBC ................................... yes
      PostgreSQL ............................. no
      SQLite2 ................................ no
      SQLite ................................. yes
      Using system provided SQLite ......... no
      TDS (Sybase) ........................... no
    

    Дальше

    mingw32-make.exe sub-mysql
    

    И потом

    mingw32-make.exe sub-mysql-install_subtargets
    

    Создаем консольный проект для теста:

    #include <QCoreApplication>
    #include <QSqlDatabase>
    #include <QDebug>
    
    int main(int argc, char *argv[])
    {
       QCoreApplication a(argc, argv);
    
       QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
    
       db.setHostName("10.28.8.78");
       db.setDatabaseName("hotline");
       db.setUserName("gluser");
       db.setPassword("SuP0rT");
    
       if(db.open()){
           qDebug() << "Database Open!";
       } else {
           qDebug() << "Database NOT Open!";
       }
    
       return a.exec();
    }
    

    Получаем:


    Database Open!

    Good day all

    Please note: newbie here, I am following this tutorial, attempting to make sense of it with my very limited knowledge.

    I am attempting to ,to my understanding, build a version of QT for my Raspberry Pi 3 by following this wiki tutorial

    I run into an error when configuring the qtbase with the command:

    ./configure -opengl es2 -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=~/opt/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf- -sysroot /mnt/rasp-pi-rootfs -opensource -confirm-license -optimized-qmake -reduce-exports -release -make libs -prefix /usr/local/qt5pi -hostprefix /usr/local/qt5pi
    

    Note that I am copying and pasting, if there is some mistake, it should be no fault of my own since I am trying to make sense of this as it is my first time doing this.

    The ouput follows:

    ~/opt/qt5/qtbase$ ./configure -opengl es2 -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=~/opt/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf- -sysroot /mnt/rasp-pi-rootfs -opensource -confirm-license -optimized-qmake -reduce-exports -release -make libs -prefix /usr/local/qt5pi -hostprefix /usr/local/qt5pi
    
    
    <srcbase> = /home/cx/opt/qt5/qtbase 
    <outbase> = /home/cx/opt/qt5/qtbase 
    Creating qmake...
    .Done.
    
    This is the Qt Open Source Edition.
    
    You have already accepted the terms of the Open Source license.
    
    Running configuration tests...
    Checking for valid makespec... 
    ERROR: Cannot compile a minimal program. The toolchain or QMakeSpec is broken.
    
    Check config.log for details.
    

    Config.log contents

    Additional Info

    I have followed the tutorial to the «T»

    System : Linux Gnome 16.04 AMD64

    uname -r
    4.8.3-040803-generic
    
    gcc --version
    gcc (Ubuntu 6.2.0-5ubuntu12) 6.2.0 20161005
    Copyright (C) 2016 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    

    Any advice or recommendations would be much appreciated!

    Hello all,

    I am currently trying to install Qt 5.12 on my Pi 3 (Jessie). I am following this tutorial: http://www.tal.org/tutorials/building-q … spberry-pi

    Upon configuring, I get the following error in the end:

    Code: Select all

    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 /home/pi/qt-build/config.tests && g++ -pipe -fuse-ld=gold -o conftest-out conftest.cpp
    test config.qtbase.tests.use_gold_linker succeeded
    Checking for machine tuple... 
    + g++ -dumpmachine
    > arm-linux-gnueabihf
    test config.qtbase.tests.machineTuple succeeded
    Checking for valid makespec... 
    + cd /home/pi/qt-build/config.tests/verifyspec && /home/pi/qt-build/qtbase/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared use_gold_linker warn_off console single_arch" 'DEFINES += EGLFS_DEVICE_INTEGRATION=eglfs_brcm' 'QMAKE_CFLAGS=-march=armv8-a -mtune=cortex-a53 -mfpu=crypto-neon-fp-armv8' 'QMAKE_CXXFLAGS=-march=armv8-a -mtune=cortex-a53 -mfpu=crypto-neon-fp-armv8' 'QMAKE_LIBS_EGL=-lEGL -lGLESv2' 'QMAKE_LIBS_OPENVG=-lEGL -lOpenVG -lGLESv2' QMAKE_LIBDIR_OPENGL_ES2=/opt/vc/lib 'QMAKE_INCDIR_OPENGL_ES2=/opt/vc/include /opt/vc/include/interface/vcos/pthreads /opt/vc/include/interface/vmcs_host/linux' QMAKE_LIBDIR_EGL=/opt/vc/lib 'QMAKE_INCDIR_EGL=/opt/vc/include /opt/vc/include/interface/vcos/pthreads /opt/vc/include/interface/vmcs_host/linux' QMAKE_LIBDIR_OPENVG=/opt/vc/lib 'QMAKE_INCDIR_OPENVG=/opt/vc/include /opt/vc/include/interface/vcos/pthreads /opt/vc/include/interface/vmcs_host/linux' /home/pi/qt-everywhere-src-5.12.0/qtbase/config.tests/verifyspec
    + cd /home/pi/qt-build/config.tests/verifyspec && MAKEFLAGS= /usr/bin/make
    > g++ -c -march=armv8-a -mtune=cortex-a53 -mfpu=crypto-neon-fp-armv8 -O2 -std=gnu++11 -w -fPIC -DEGLFS_DEVICE_INTEGRATION=eglfs_brcm -I/home/pi/qt-everywhere-src-5.12.0/qtbase/config.tests/verifyspec -I. -I/home/pi/qt-everywhere-src-5.12.0/qtbase/mkspecs/linux-g++ -o verifyspec.o /home/pi/qt-everywhere-src-5.12.0/qtbase/config.tests/verifyspec/verifyspec.cpp
    > g++ -Wl,-O1 -fuse-ld=gold -o verifyspec verifyspec.o 
    >[b] /usr/bin/ld.gold: error: verifyspec.o: unknown CPU architecture[/b]
    > collect2: error: ld returned 1 exit status
    > Makefile:66: recipe for target 'verifyspec' failed
    > make: *** [verifyspec] Error 1
    Note: Also available for Linux: linux-clang linux-icc
    
    ERROR: Cannot compile a minimal program. The toolchain or QMakeSpec is broken

    The configure command i run is:

    Code: Select all

    PKG_CONFIG_LIBDIR=/usr/lib/arm-linux-gnueabihf/pkgconfig:/usr/share/pkgconfig 
    ../qt-everywhere-src-5.12.0/configure 
    -v 
    -opengl es2 -eglfs 
    -no-gtk 
    -opensource -confirm-license -release 
    -reduce-exports 
    -force-pkg-config 
    -nomake examples -no-compile-examples 
    -skip qtwayland 
    -skip qtwebengine 
    -skip qtscript 
    -no-feature-geoservices_mapboxgl 
    -qt-pcre 
    -no-pch 
    -ssl 
    -evdev 
    -system-freetype 
    -fontconfig 
    -glib 
    -prefix /opt/Qt5.12 
    -qpa eglfs 
    QMAKE_CFLAGS="-march=armv8-a -mtune=cortex-a53 -mfpu=crypto-neon-fp-armv8" 
    QMAKE_CXXFLAGS="-march=armv8-a -mtune=cortex-a53 -mfpu=crypto-neon-fp-armv8" 
    QMAKE_LIBS_EGL="-lEGL -lGLESv2" QMAKE_LIBS_OPENVG="-lEGL -lOpenVG -lGLESv2" 
    QMAKE_LIBDIR_OPENGL_ES2=/opt/vc/lib QMAKE_INCDIR_OPENGL_ES2="/opt/vc/include /opt/vc/include/interface/vcos/pthreads /opt/vc/include/interface/vmcs_host/linux" 
    QMAKE_LIBDIR_EGL=/opt/vc/lib QMAKE_INCDIR_EGL="/opt/vc/include /opt/vc/include/interface/vcos/pthreads /opt/vc/include/interface/vmcs_host/linux" 
    QMAKE_LIBDIR_OPENVG=/opt/vc/lib QMAKE_INCDIR_OPENVG="/opt/vc/include /opt/vc/include/interface/vcos/pthreads /opt/vc/include/interface/vmcs_host/linux" 
    -DEGLFS_DEVICE_INTEGRATION=eglfs_brcm

    Since I am new to Pi, I am unsure about what I am doing wrong. I would be glad if someone could help me out with this.

    Hello,

    I have tried to cross compile the qt 5.14 for the Asus Tinkerboard 2S with Debian 10 v2.0.4.

    For do this I have followed the guide at this link: https://forum.qt.io/topic/83776/can-t-build-qt-for-tinkerboard/6.

    Following the guide on the TinkerBoard I have installed rsync and all the dependency packages of the guide (Part1, Command 9 form a to m) .

    After I have created the destination directory for Qt5.

    After I hade prepared a VM with Ubuntu 20.04 and following the guide I have installed the compile component, downloaded the Linaro Toolchain, create directory of the sysroot and do the rsync with the TinkerBoard.

    With the command  wget https://raw.githubusercontent.com/riscv/riscv-poky/master/scripts/sysroot-relativelinks.py I have downloaded the python script for make the symlink and after I have executed that.

    After I have downloaded the sorce code of Qt 5.14 and with this command I have configured the build directory: ../qt-everywhere-src-5.14.0/configure -release -opengl es2 -nomake examples -nomake tests -opensource -confirm-license -v -device tinkerboard -device-option CROSS_COMPILE=/opt/qt5tinker/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- -sysroot /opt/qt5tinker/sysroot -prefix /usr/local/qt5

    The problem is that this last command give me this error:

    This is the Qt Open Source Edition.

    You have already accepted the terms of the Open Source license.

    Running configuration tests…
    Checking for machine tuple… 
    + /opt/qt5tinker/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -dumpmachine
    > arm-linux-gnueabihf
    test config.qtbase.tests.machineTuple succeeded
    Checking for valid makespec… 
    + cd /opt/qt5tinker/qt5build/config.tests/verifyspec && /opt/qt5tinker/qt5build/qtbase/bin/qmake «CONFIG -= qt debug_and_release app_bundle lib_bundle» «CONFIG += shared warn_off console single_arch» «QMAKE_CFLAGS += —sysroot=/opt/qt5tinker/sysroot» «QMAKE_CXXFLAGS += —sysroot=/opt/qt5tinker/sysroot» «QMAKE_LFLAGS += —sysroot=/opt/qt5tinker/sysroot» -early «CONFIG += cross_compile» /opt/qt5tinker/qt-everywhere-src-5.14.0/qtbase/config.tests/verifyspec
    + cd /opt/qt5tinker/qt5build/config.tests/verifyspec && MAKEFLAGS= /usr/bin/make
    > /opt/qt5tinker/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -c -pipe -mtune=cortex-a17 -march=armv7-a -mfpu=neon-vfpv4 -mfloat-abi=hard —sysroot=/opt/qt5tinker/sysroot -O2 -w -fPIC  -I/opt/qt5tinker/qt-everywhere-src-5.14.0/qtbase/config.tests/verifyspec -I. -I/opt/qt5tinker/qt-everywhere-src-5.14.0/qtbase/mkspecs/devices/linux-tinkerboard-g++ -o verifyspec.o /opt/qt5tinker/qt-everywhere-src-5.14.0/qtbase/config.tests/verifyspec/verifyspec.cpp
    > /opt/qt5tinker/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -mfloat-abi=hard —sysroot=/opt/qt5tinker/sysroot -Wl,-O1 -Wl,-rpath-link,/opt/qt5tinker/sysroot/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link,/opt/qt5tinker/sysroot/lib/arm-linux-gnueabihf -o verifyspec verifyspec.o      
    > /opt/qt5tinker/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/7.5.0/../../../../arm-linux-gnueabihf/bin/ld: cannot find crt1.o: No such file or directory
    > /opt/qt5tinker/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/7.5.0/../../../../arm-linux-gnueabihf/bin/ld: cannot find crti.o: No such file or directory
    > /opt/qt5tinker/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/7.5.0/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lm
    > collect2: error: ld returned 1 exit status
    > make: *** [Makefile:68: verifyspec] Error 1
    Note: Also available for Linux: linux-clang linux-icc

    ERROR: Cannot compile a minimal program. The toolchain or QMakeSpec is broken.

    I have tried to change the toolchain but the problem remain.  Seems that it can’t find the file crt1.o and crti.o but the two file are present on my sysroot in this path: /opt/qt5tinker/sysroot/usr/lib/aarch64-linux-gnu are also present on the toolchain in this path: opt/qt5tinker/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/libc/usr/lib.

    Anybody can give me an help to resolve this problem?

    Thanks in advance.

    Evironment

    • Raspberry PI3
    • System image: 2017-11-29-raspbian-stretch.zip
    • Qt Version: Qt5.10.0
    • Host: Ubuntu 14.04
    • Cross Compiler: gcc-linaro-4.9-2015.02-3-x86_64_arm-linux-gnueabihf

    Mount image

    mount root file system to /mnt

    $ unzip 2017-11-29-raspbian-stretch.zip 
    Archive:  2017-11-29-raspbian-stretch.zip
      inflating: 2017-11-29-raspbian-stretch.img
    
    $ sudo fdisk -l 2017-11-29-raspbian-stretch.img 
    [sudo] password for wind: 
    
    Disk 2017-11-29-raspbian-stretch.img: 4919 MB, 4919918592 bytes
    255 heads, 63 sectors/track, 598 cylinders, total 9609216 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x49783f5b
    
                              Device Boot      Start         End      Blocks   Id  System
    2017-11-29-raspbian-stretch.img1            8192       93236       42522+   c  W95 FAT32 (LBA)
    2017-11-29-raspbian-stretch.img2           94208     9609215     4757504   83  Linux
    
    ### offset = 94208 * 512 = 48234496
    $ sudo mount -o loop,offset=48234496 2017-11-29-raspbian-stretch.img /mnt
    $ cd /mnt
    
    ROOTFS=/mnt
    TOOLCHAIN=/path/to/gcc-linaro-4.9-2015.02-3-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-
    

    Configure

    $ tar -xJvf qt-everywhere-src-5.10.0.tar.xz 
    $ cd qt-everywhere-src-5.10.0
    $ ./configure -opengl es2 -device linux-rasp-pi3-g++ -device-option CROSS_COMPILE=/home/wind/opt/raspi/tools/arm-bcm2708/gcc-linaro-4.9-2015.02-3-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- -sysroot /mnt -opensource -confirm-license -optimized-qmake -reduce-exports -release -make libs -prefix /usr/local/qt5
    ### add -make tools -make examples options if need
    

    ERROR like these

    ERROR: Cannot compile a minimal program. The toolchain or QMakeSpec is broken.
    ERROR: The OpenGL functionality tests 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 the mkspec for your platform.
    

    To fix these errors, modify device mkspec file linux-rasp-pi3-g++/qmake.conf like this

    VC_LIBRARY_PATH         = $$[QT_SYSROOT]/opt/vc/lib
    VC_INCLUDE_PATH         = $$[QT_SYSROOT]/opt/vc/include
    
    QMAKE_LIBDIR_OPENGL_ES2 = $${VC_LIBRARY_PATH}
    QMAKE_LIBDIR_EGL        = $$QMAKE_LIBDIR_OPENGL_ES2
    QMAKE_LIBDIR_OPENVG     = $$QMAKE_LIBDIR_OPENGL_ES2
    
    QMAKE_INCDIR_EGL        = 
                            $${VC_INCLUDE_PATH} 
                            $${VC_INCLUDE_PATH}/interface/vcos/pthreads 
                            $${VC_INCLUDE_PATH}/interface/vmcs_host/linux
    QMAKE_INCDIR_OPENGL_ES2 = $${QMAKE_INCDIR_EGL}
    QMAKE_INCDIR_OPENVG     = $${QMAKE_INCDIR_EGL}
    
    QMAKE_LIBS_OPENGL_ES2   = -lGLESv2
    QMAKE_LIBS_EGL          = -lEGL -lGLESv2
    QMAKE_LIBS_OPENVG       = -lEGL -lOpenVG -lGLESv2
    
    • Configure script
    • qmake.config

    When all error fixed, configure will create qmake, output like this means configure ok

    + cd qtbase
    ### ..............
    Creating qmake...
    ........................................
    .Done.
    
    This is the Qt Open Source Edition.
    
    You have already accepted the terms of the Open Source license.
    
    Running configuration tests...
    Done running configuration tests.
    
    Configure summary:
    
    Building on: linux-g++ (x86_64, CPU features: mmx sse sse2)
    Building for: devices/linux-rasp-pi3-g++ (arm, CPU features: neon)
    Configuration: cross_compile compile_examples enable_new_dtags largefile neon precompile_header shared rpath release c++11 c++14 concurrent dbus reduce_exports release_tools stl
    Build options:
      Mode ................................... release; optimized tools
      Optimize release build for size ........ no
      Building shared libraries .............. yes
      Using C++ standard ..................... C++14
      Using ccache ........................... no
      Using gold linker ...................... no
      Using new DTAGS ........................ yes
      Using precompiled headers .............. yes
      Using LTCG ............................. no
      Target compiler supports:
        NEON ................................. yes
      Build parts ............................ libs
    
    ### ..................
    
    Note: Also available for Linux: linux-clang linux-icc
    
    Note: -optimized-tools is not useful in -release mode.
    
    Note: No wayland-egl support detected. Cross-toolkit compatibility disabled.
    
    Qt is now configured for building. Just run 'make'.
    Once everything is built, you must run 'make install'.
    Qt will be installed into '/mnt/usr/local/qt5'.
    
    Prior to reconfiguration, make sure you remove any leftovers from
    the previous build.
    

    Make

    Compile ERROR fix

    error: cannot open /mnt/usr/lib/arm-linux-gnueabihf/libz.so: No such file or directory
    
    ### and libm.so, librt.so, libdl.so
    
    undefined reference to `__dlsym'
    
    make *** [sub-src-make_first] Error 2
    
    arm-linux-gnueabihf/bin/ld: cannot find -lm
    ### and -lc
    

    Reason:
    in root file system, some libs are symlinks, but they are absolute path, when run raspberry pi that is ok, but in host, symlinks cannot find correctly libraries, so we need fix this use related path relink symlinks

    $ cd /mnt/usr/lib/arm-linux-gnueabihf/
    $ sudo rm libdl.so 
    $ sudo ln -s ../../../lib/arm-linux-gnueabihf/libdl.so.2 libdl.so
    $ sudo rm libz.so 
    $ sudo ln -s ../../../lib/arm-linux-gnueabihf/libz.so.1 libz.so
    $ sudo rm libutil.so 
    $ sudo ln -s ../../../lib/arm-linux-gnueabihf/libutil.so.1 libutil.so
    $ sudo rm librt.so
    $ sudo ln -s ../../../lib/arm-linux-gnueabihf/librt.so.1 librt.so
    $ sudo rm libm.so 
    $ sudo ln -s ../../../lib/arm-linux-gnueabihf/libm.so.6 libm.so
    
    ### maybe we need same symlinks in /lib/arm-linux-gnueabihf/ too
    
    $ cd /mnt/lib/arm-linux-gnueabihf/
    $ sudo ln -s libz.so.1 libz.so
    $ sudo ln -s libdl.so.2 libdl.so
    $ sudo ln -s librt.so.1 librt.so
    $ sudo ln -s libm.so.6 libm.so
    
    ### and in some system image EGL, GLESv2, OpenVG libraries were renamed
    
    $ cd /mnt/opt/vc/lib
    $ sudo ln -s libbrcmEGL.so libEGL.so
    $ sudo ln -s libbrcmGLESv2.so libGLESv2.so
    $ sudo ln -s libbrcmOpenVG.so libOpenVG.so
    $ sudo ln -s libbrcmWFC.so libWFC.so
    

    Now we can compile Qt libs/tools/examples succesfully, and install

    $ sudo make install
    
    ### all files will be install to '/mnt/usr/local/qt5'
    

    Then, sudo umount /mnt and write new image file to SD card, boot raspberry pi3, run an example.

    Write image to SD card

    Plugin sdcard and umount partitions, write image file us dd command

    $ sudo umount /dev/sdd1
    $ sudo umount /dev/sdd2
    $ sudo dd bs=4M if=2017-11-29-raspbian-stretch.img of=/dev/sdd
    ### NOTE: there is no `sdd1` or `sdd2`
    

    Boot raspberry pi3, if want to use qmake on pi3, run

    $ sudo apt-get update
    $ sudo apt-get install qt5-qmake qt5-default
    

    References

    • RaspberryPi
    • Raspberry Pi Beginners Guide
    • Qt for Embedded Linux

    Build ( Cross Compile ) Qt5.14.2 For Raspberry pi4 (raspbian Buster lite OS)
    —————————————————-

    download toolchain :
    ———————————-
    https://app.box.com/s/f8uksyvam238boo8dnguyin547e9l1gl

    or
    http://thebugfreeblog.blogspot.com/2019/
    and download : Download Linux x64 cross toolchain GCC 8.3.0

    Start :
    —————

    # Target  Side ( raspbian os )
    ——————————-

    # nfs server
    sudo apt-get install nfs-kernel-server

    # confign nfs server
    # add this line to  /etc/exports
    /    *(rw,nohide,insecure,no_subtree_check,async,no_root_squash)
    service nfs-kernel-server restart

    # qtbase
    sudo apt-get install libboost1.58-all-dev libudev-dev libinput-dev libts-dev libmtdev-dev libjpeg-dev libfontconfig1-dev libssl-dev libdbus-1-dev libglib2.0-dev libxkbcommon-dev libegl1-mesa-dev libgbm-dev libgles2-mesa-dev mesa-common-dev xcb libxcb-xkb-dev x11-xkb-utils libx11-xcb-dev libxkbcommon-x11-dev libwayland-dev

    # qtmultimedia
    sudo apt-get install libasound2-dev libpulse-dev gstreamer1.0-omx libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev  gstreamer1.0-alsa

    # qtwebengine
    sudo apt-get install libvpx-dev libsrtp0-dev libsnappy-dev libnss3-dev

    # qtlocation
    sudo apt-get install libgeoclue-2-dev libdbus-glib-1-dev libgudev-1.0-dev libbluetooth-dev

    # Host Side (ubuntu 64 os)
    —————————

    mkdir /opt/rpi
    mkdir /opt/rpi/sysroot
    mkdir /lib/arm-linux-gnueabihf

    apt-get install nfs-common
    mount raspberrypi.local:/ /opt/rpi/sysroot
    mount raspberrypi.local:/lib/arm-linux-gnueabihf /lib/arm-linux-gnueabihdf

    # extract  ( qt source ) qt-everywhere-src-5.14.2.tar.gz    to    /opt/rpi/qt-everywhere-src-5.14.2
    # extract  ( compiler  ) rpi-gcc-8.3.0.tar.gz                to    /opt/rpi/rpi-gcc-8.3.0

    cd /opt/rpi/qt-everywhere-src-5.14.2

    ./configure -release -opengl es2 -device linux-rasp-pi4-v3d-g++ -device-option CROSS_COMPILE=/opt/rpi/rpi-gcc-8.3.0/bin/arm-linux-gnueabihf- -sysroot /opt/rpi/sysroot/ -opensource -confirm-license -make libs -prefix /usr/local/Qt-rasp4-5.14.2 -no-xcb -recheck

    make

    make install

    Понравилась статья? Поделить с друзьями:
  • Error cannot bind w authentication to computer null 000006d9 1753
  • Error cannot assign to a named constant at 1
  • Error cannot alter type of a column used by a view or rule
  • Error cannot allocate memory errno 12
  • Error cannot allocate kernel buffer