Important: Please read the Qt Code of Conduct -

--sysroot get's overwritten with weir old sysroot

  • I have a cross-compiler set up.
    I have 2 kits set up, one for beagle - bone one for R-PI
    I configured BBB first @ Tools->Kits sysroot pointing to /path/TOOLS/beaglebone/rootfs
    then R-PI @ Tools->Kits sysroot at /path/TOOLS/raspberrypi/rootfs

    I had a very old kit which was deleted with a sysroot at /path/OLD_LOCATION/rootfs

    I cleaned all in the working folder and all build* folders
    I also added in the pro file:

    BOARD = beaglebone

    BOARD = raspberrypi

    QMAKE_LFLAGS += "--sysroot=$${TUL_PATH}/TOOLS/$${BOARD}"
    LIBS += --sysroot=$${TUL_PATH}/TOOLS/$${BOARD}/

    Checking all project setting in all folders and subfolders

    $ grep -rF "sysroot"
    src/ += "--sysroot=$${TUL_PATH}/TOOLS/$${BOARD}"
    src/    LIBS += --sysroot=$${TUL_PATH}/TOOLS/$${BOARD}/

    qmake . && make works fine, BUT QTCREATOR IDE -Main Menu->Buld->run qmake generates a Make file with an ancient --syspath '--sysroot=/home/OLD_PATH/debfs'

    grep -rF "sysroot" |grep deb
    build-Debug/Makefile:CFLAGS        = -march=armv8-a -mtune=cortex-a53 -mfpu=crypto-neon-fp-armv8 -mfloat-abi=hard --sysroot=/home/OLD_PATH/debfs -g -Wall -W -D_REENTRANT -fPIC $(DEFINES)

    Where the heck is this coming from ? Is nowhere in any settings tools kits compiler.

    I also checked /home/.config/Qtproject

    $ grep -rF sysroot
    Binary file qtcreator/helpcollection.qhc matches

    Thank you.

  • Moderators

    you can try to delete the .pro.user* file and reconfigure the project in QtCreator.
    also you can check (with qmake in your .pro file) what the contents of the QT_SYSROOT variable is

  • I found it.

    When I build the qt5 for arm, Iong ago I used in ./configure

    git clean -dfx
    export PATH=${BBB_SDK}/TC741/bin/:$PATH:$ROOT_FS/lib/arm-linux-gnueabihf
    export LD_LIBRARY_PATH=$ROOT_FS/usr/lib/arm-linux-gnueabihf:$ROOT_FS/lib/arm-linux-gnueabihf:$LD_LIBRARY_PATH:
    export LDFLAGS='-L$ROOT_FS/usr/lib/arm-linux-gnueabihf -L$ROOT_FS/lib/arm-linux-gnueabihf'
    export CFLAGS='-L$ROOT_FS/usr/lib/arm-linux-gnueabihf -L$ROOT_FS/lib/arm-linux-gnueabihf'
    export BBB_TC=arm-linux-gnueabihf-
    echo $PATH
    #./configure -platform linux-g++ -opengl es2 -device linux-beagleboard-g++ -device-option CROSS_COMPILE=$BBB_TC -sysroot $ROOT_FS -opensource -confirm-license -make libs -prefix $ROOT_FS -extprefix $ROOT_FS -hostprefix $ROOT_FS -v -no-gbm --enable-static --enable-shared
    ./configure -platform linux-g++ --enable-shared --enable-static -opengl es2 -device linux-beagleboard-g++ -device-option CROSS_COMPILE=$BBB_TC -sysroot $ROOT_FS -opensource -confirm-license -make libs -prefix $ROOT_FS -extprefix $ROOT_FS -hostprefix $ROOT_FS -v -no-gbm -skip qtserialbus -skip qtscxml -skip qtscript -skip qtcharts -skip qt3d -skip qtdatavis3d -skip qtcanvas3d -skip qtgamepad -skip qtvirtualkeyboard -skip qtwayland -skip qtwebengine -skip qtwebchannel -skip qtwebglplugin -recheck-all -no-qml-debug -nomake examples -nomake tests -no-pulseaudio -no-alsa

    so all the make files in buld folder had imprint for --sysroot=$ROOT_FS
    somehow mkspecs is picking from there the sys root.

    The workaround was to recreate that path, and in pro file
    ill make a symbolic link to right sysroot as:

    system('rm /home/myname/OLD_SYSROOT/debfs')
    system('ln -s /NEW_SYSROOT/$${BOARD} /home/myname/OLD_SYSROOT/debfs ')

  • @comarius glad you found a solution, and thanks for sharing it.
    Please don't forget to mark your post as solved!

Log in to reply