Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/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/myproject.pro:QMAKE_LFLAGS += "--sysroot=$${TUL_PATH}/TOOLS/$${BOARD}"
    src/myproject.pro:    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
    QtCreator.ini:FindCompletions\1\Text=sysroot
    QtCreator.ini:FindCompletions\2\Text=--sysroot
    Binary file qtcreator/helpcollection.qhc matches
    qtcreator/qbs/1.13.1/qbs.conf:qt-project\qbs\profiles\qtc_Beaglebo_bd13586c\qbs\sysroot=/home/myname/HOMEBOARDS/FLOATING/ROOTFS
    qtcreator/qbs/1.13.1/qbs.conf:qt-project\qbs\profiles\qtc_Qt_5_9_5_2b2aa98d\qbs\sysroot=/home/myname/CPP/rembix/src/TOOLS/raspberrypi
    qtcreator/qbs/1.13.1/qbs.conf:qt-project\qbs\profiles\qtc_bbblinux_973d4103\qbs\sysroot=/home/myname/HOMEBOARDS/FLOATING/ROOTFS
    qtcreator/qbs/1.13.1/qbs.conf:qt-project\qbs\profiles\qtc_bbblinux_bd13586c\qbs\sysroot=/home/TOOLS/TOOLS/beaglebone
    qtcreator/qbs/1.13.1/qbs.conf:qt-project\qbs\profiles\qtc_raspberr_a5f9fc27\qbs\sysroot=/home/TOOLS/TOOLS/raspberrypi
    qtcreator/qbs/1.12.2/qbs.conf:qt-project\qbs\profiles\qtc_ST_MICRO_5d9e316f\qbs\sysroot=/usr/bin
    qtcreator/qbs/1.12.2/qbs.conf:qt-project\qbs\profiles\qtc_stmicro_5d9e316f\qbs\sysroot=/usr/bin
    
    

    Thank you.


  • Moderators

    @comarius
    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 ROOT_FS=$BBB_SDK/ROOTFS
    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:

    BOARD=raspberrypi
    #...
    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