Strange paths when installing Angstrom SDK for Tegra K1

Hi all,

I made a custom build of Angstrom Linux for Tegra K1, target image and SDK.

I got all files from tag ‘Apalis-TK1_LXDE-Image_2.8b2.97-20180331’ from the repo ‘Index of /toradex-bsp-platform.git’ (that gave me the full BSP repo list manifest).

All my Angstrom files were setup in the folder : /angstrom/angstrom/oe-core/…

After bitbaked ‘angstrom-qt5-x11-image’, I got image files and SDK installer : the latter is ‘angstrom-glibc-x86_64-armv7at2hf-neon-v2017.12-toolchain.sh’

Surprisingly, after installing this SDK into a clean Ubuntu docker instance (install dir is ‘/opt/sdk’), I noticed some strange paths in qt5 ‘pri’ files :

/opt/sdk/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib/qt5/mkspecs/modules/qt_lib_gui_private.pri:QMAKE_LIBS_OPENGL = -L/angstrom/angstrom/oe-core/build/tmp-glibc/work/armv7at2hf-neon-angstrom-linux-gnueabi/qtbase/5.9.4+gitAUTOINC+0d9208cecb-r0/recipe-sysroot/usr/lib/arm-linux-gnueabihf/tegra -lGL

/opt/sdk/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib/qt5/mkspecs/modules/qt_lib_gui_private.pri:QMAKE_INCDIR_OPENGL = /angstrom/angstrom/oe-core/build/tmp-glibc/work/armv7at2hf-neon-angstrom-linux-gnueabi/qtbase/5.9.4+gitAUTOINC+0d9208cecb-r0/recipe-sysroot/usr/include/libdrm

/opt/sdk/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib/qt5/mkspecs/modules/qt_lib_gui_private.pri:QMAKE_LIBS_EGL = -L/angstrom/angstrom/oe-core/build/tmp-glibc/work/armv7at2hf-neon-angstrom-linux-gnueabi/qtbase/5.9.4+gitAUTOINC+0d9208cecb-r0/recipe-sysroot/usr/lib/arm-linux-gnueabihf/tegra-egl -lEGL

/opt/sdk/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib/qt5/mkspecs/modules/qt_lib_gui_private.pri:QMAKE_INCDIR_EGL = /angstrom/angstrom/oe-core/build/tmp-glibc/work/armv7at2hf-neon-angstrom-linux-gnueabi/qtbase/5.9.4+gitAUTOINC+0d9208cecb-r0/recipe-sysroot/usr/include/libdrm

/opt/sdk/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib/qt5/mkspecs/modules/qt_lib_gui_private.pri:QMAKE_INCDIR_FREETYPE = /angstrom/angstrom/oe-core/build/tmp-glibc/work/armv7at2hf-neon-angstrom-linux-gnueabi/qtbase/5.9.4+gitAUTOINC+0d9208cecb-r0/recipe-sysroot/usr/include/freetype2

/opt/sdk/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib/qt5/mkspecs/modules/qt_lib_gui_private.pri:QMAKE_INCDIR_FONTCONFIG = /angstrom/angstrom/oe-core/build/tmp-glibc/work/armv7at2hf-neon-angstrom-linux-gnueabi/qtbase/5.9.4+gitAUTOINC+0d9208cecb-r0/recipe-sysroot/usr/include/freetype2

/opt/sdk/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib/qt5/mkspecs/modules/qt_lib_gui_private.pri:QMAKE_INCDIR_LIBPNG = /angstrom/angstrom/oe-core/build/tmp-glibc/work/armv7at2hf-neon-angstrom-linux-gnueabi/qtbase/5.9.4+gitAUTOINC+0d9208cecb-r0/recipe-sysroot/usr/include/libpng16

/opt/sdk/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib/qt5/mkspecs/modules/qt_lib_core_private.pri:QMAKE_INCDIR_GLIB = /angstrom/angstrom/oe-core/build/tmp-glibc/work/armv7at2hf-neon-angstrom-linux-gnueabi/qtbase/5.9.4+gitAUTOINC+0d9208cecb-r0/recipe-sysroot/usr/include/glib-2.0
/angstrom/angstrom/oe-core/build/tmp-glibc/work/armv7at2hf-neon-angstrom-linux-gnueabi/qtbase/5.9.4+gitAUTOINC+0d9208cecb-r0/recipe-sysroot/usr/lib/glib-2.0/include
/opt/sdk/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib/qt5/mkspecs/modules
/qt_lib_multimedia_private.pri:QMAKE_INCDIR_PULSEAUDIO = /angstrom/angstrom/oe-core/build/tmp-glibc/work/armv7at2hf-neon-angstrom-linux-gnueabi/qtmultimedia/5.9.4+gitAUTOINC+d83467be15-r0/recipe-sysroot/usr/include/glib-2.0 /angstrom/angstrom/oe-core/build/tmp-glibc/work/armv7at2hf-neon-angstrom-linux-gnueabi/qtmultimedia/5.9.4+gitAUTOINC+d83467be15-r0/recipe-sysroot/usr/lib/glib-2.0/include

As you may see, some paths from my Angstrom target build environnement are transferred ‘as is’ into the SDK files, a place where they are of course totally invalid once installed into a clean dev Linux box …

Isn’t it strange?

Fred.

Hi Fred

I can reproduce this also on my side. Did you see any issue (compilation not working) or something other not working related to this?

Hi Jaski,
Thank you for your help!

Yes I encountered some WARNING & ERROR, I hoped that I could nevertheless use the image and the SDK :wink: These strange paths seem to be the only problem (AFAIK)

Here are the error lines in the bitbake output :

WARNING: No recipes available for:
  /angstrom/angstrom/oe-core/build/../layers/meta-freescale/dynamic-layers/browser-layer/recipes-browser/chromium/chromium-wayland_48.0.2548.0.bbappend
  /angstrom/angstrom/oe-core/build/../layers/meta-freescale/dynamic-layers/browser-layer/recipes-browser/chromium/chromium_52.0.2743.76.bbappend
  /angstrom/angstrom/oe-core/build/../layers/meta-jetson-tk1/recipes-graphics/mesa/mesa_11.1.1.bbappend
  /angstrom/angstrom/oe-core/build/../layers/meta-toradex-demos/recipes-connectivity/openssl/openssl_1.0.2l.bbappend
  /angstrom/angstrom/oe-core/build/../layers/meta-toradex-demos/recipes-support/icu/icu_57%.bbappend
  /angstrom/angstrom/oe-core/build/../layers/meta-toradex-demos/recipes-support/opencv/opencv_2.4.bbappend

ERROR: When reparsing /angstrom/angstrom/oe-core/build/../layers/meta-toradex-demos/recipes-images/images/angstrom-qt5-x11-image.bb.do_image, the basehash value changed from facac2408308d95cb070197df07ff4d4 to f685d034cf08f20c23147fe379b8ad65. The metadata is not deterministic and this needs to be fixed.
ERROR: When reparsing /angstrom/angstrom/oe-core/build/../layers/meta-toradex-demos/recipes-images/images/angstrom-qt5-x11-image.bb.do_image, the basehash value changed from facac2408308d95cb070197df07ff4d4 to f685d034cf08f20c23147fe379b8ad65. The metadata is not deterministic and this needs to be fixed.
ERROR: When reparsing /angstrom/angstrom/oe-core/build/../layers/meta-toradex-demos/recipes-images/images/angstrom-qt5-x11-image.bb.do_image, the basehash value changed from facac2408308d95cb070197df07ff4d4 to f685d034cf08f20c23147fe379b8ad65. The metadata is not deterministic and this needs to be fixed.
WARNING: angstrom-qt5-x11-image-2.8b2-r0 do_rootfs: The license listed FREESCALE_SEMICONDUCTOR_SOFTWARE_LICENSE_AGREEMENT was not in the licenses collected for recipe tdx-k20-fw
ERROR: When reparsing /angstrom/angstrom/oe-core/build/../layers/meta-toradex-demos/recipes-images/images/angstrom-qt5-x11-image.bb.do_image, the basehash value changed from facac2408308d95cb070197df07ff4d4 to f685d034cf08f20c23147fe379b8ad65. The metadata is not deterministic and this needs to be fixed.
ERROR: When reparsing /angstrom/angstrom/oe-core/build/../layers/meta-toradex-demos/recipes-images/images/angstrom-qt5-x11-image.bb.do_image, the basehash value changed from facac2408308d95cb070197df07ff4d4 to f685d034cf08f20c23147fe379b8ad65. The metadata is not deterministic and this needs to be fixed.
NOTE: Tasks Summary: Attempted 9865 tasks of which 9852 didn't need to be rerun and all succeeded.
NOTE: Writing buildhistory

Summary: There were 2 WARNING messages shown.
Summary: There were 5 ERROR messages shown, returning a non-zero exit code.

Here are the full bitbake log and the small script I use to launch the build

Regards,
Fred.

Thanks for the log and the script. The interesting thing if you see any errors when you were doing build and deployment of Qt-Application?

Yes, my colleague was unable to build the application using my SDK (he installed it in ‘/data/opt/toradex/apalis/angstrom-apalis-tk1-Qt5.9.4’), paths toward Qt related libraries are wrong :

arm-angstrom-linux-gnueabi-g++  -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard --sysroot=/data/opt/toradex/apalis/angstrom-apalis-tk1-Qt5.9.4/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed --sysroot=/data/opt/toradex/apalis/angstrom-apalis-tk1-Qt5.9.4/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi -Wl,-O1 -shared -o libxxx.so xxx.o moc_xxx.o -lQt5Gui -lQt5Core -L/angstrom/angstrom/oe-core/build/tmp-glibc/work/armv7at2hf-neon-angstrom-linux-gnueabi/qtbase/5.9.4+gitAUTOINC+0d9208cecb-r0/recipe-sysroot/usr/lib/arm-linux-gnueabihf/tegra -lGL -lpthread  
    /data/opt/toradex/apalis/angstrom-apalis-tk1-Qt5.9.4/sysroots/x86_64-angstromsdk-linux/usr/libexec/arm-angstrom-linux-gnueabi/gcc/arm-angstrom-linux-gnueabi/7.3.0/real-ld: error: cannot find -lGL

Fred.

‘/data/opt/toradex/apalis/angstrom-apalis-tk1-Qt5.9.4’ is OK

‘/angstrom/angstrom/oe-core/…’ is inexistent in this context

Hi Fred

I did not find a quick solution on how to change the path in those qmake project include files to the path valid on the host were you installed the SDK.

One workaround for your specific case would be to either add the additional linker path in your project file or to add it to the qmake cmdline:

xxx.pro:

...
LIBS += -L$$(OECORE_TARGET_SYSROOT)/usr/lib/arm-linux-gnueabihf/tegra/
...

cmdline:

qmake "LIBS += -L${OECORE_TARGET_SYSROOT}/usr/lib/arm-linux-gnueabihf/tegra/" .../xxx.pro

another would be to correct all the prepared qmake project include files:

sed -i 's%/angstrom/angstrom/.*recipe-sysroot%$$(OECORE_TARGET_SYSROOT)%' /usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib/qt5/mkspecs/modules/*pri

Additionally there seems to be a bug in the libGL.so symlink which points to a nonexisting file. You have to correct this in the extracted SDK as follows:

ln -fs libGL.so.1 ${OECORE_TARGET_SYSROOT}/usr/lib/arm-linux-gnueabihf/tegra/libGL.so

Max

Hello Max,

I’m glad to see you experienced the same things, it’s always a good point :slight_smile:
We followed your 2nd advice, we fixed .PRI files and the libGL.so symlink.

To successfully build our Qt Quick application we also fixed a fully wrong path in SDK ‘sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib/qt5/mkspecs/modules/qt_lib_gui_private.pri’

QMAKE_INCDIR_OPENGL = /angstrom/angstrom/oe-core/build/tmp-glibc/work/armv7at2hf-neon-angstrom-linux-gnueabi/qtbase/5.9.4+gitAUTOINC+0d9208cecb-r0/recipe-sysroot/usr/include/libdrm

changed to :

sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/src/debug/mesa/2_17.1.7-r0/mesa-17.1.7/include

This is a bit strange…
But now, the application build is successful.

Unfortunately, some tweaks are also needed : we use some Qt Quick components available in the SDK but not deployed into the target image :

SDK :

./sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib/qt5/qml/QtQuick.2
./sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib/qt5/qml/QtQml/Models.2
./sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib/qt5/qml/QtQuick/Controls.2
./sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib/qt5/qml/QtQuick/Particles.2
./sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib/qt5/qml/QtQuick/Window.2
./sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib/qt5/qml/QtQuick/Templates.2

Target :

rootfs/usr/lib/qt5/qml/QtQuick/Window.2
rootfs/usr/lib/qt5/qml/QtQuick/Particles.2
rootfs/usr/lib/qt5/qml/QtQml/Models.2
rootfs/usr/lib/qt5/qml/QtQuick.2

So we copied some missing folders and .so/symlinks files.

Regards,
Fred.

Hello Fred

Perfect, that it works. Thanks for the Information.
Which components exactly were missing or not deployed? Only the QtQuick Components or some other components too?

Hello Jaski,
At the moment we noticed that QtQuick/Templates.2 and QtQuick/Controls.2 were missing.

Fred.

Thanks for the Information, we will look into this.

Note that the angstrom-qt5-x11-image.bb recipe does include Qt5 packages through the dependencies of the demo ‘qtsmarthome’ plus some additional ones (e.g. fonts) needed.

If you need Qt5 packages beyond that you have to add them explicitly to the IMAGE_INSTALL variable.