Cross compiling Qt for embedded Linux fails with "make[1]: strip-unneeded: Command not found" at make install

After adding the Qt5 Layer and building the SDK for Qt development I tried to build and install a Qt demo application.

qmake
make all
make install

The error is:

strip-unneeded /home/oe/oecore-x86_64/sysroots/armv7at2hf-vfp-neon-angstrom-linux-gnueabi/usr/lib/qt5/plugins/platforminputcontexts/libfreevirtualkeyboardplugin.so
make[1]: strip-unneeded: Command not found
Makefile.virtualkeyboard:1275: recipe for target 'install_target' failed
make[1]: [install_target] Error 127 (ignored)

If building for x86_64 Linux (on another machine) it works, the actual output is:

strip --strip-unneeded /home/user/Qt/5.7/gcc_64/plugins/platforminputcontexts/libfreevirtualkeyboardplugin.so

In the Qt SDK environment “strip-unneeded” is called instead of “strip --strip-unneeded”. Any idea how this can happen?

which qmake
/home/oe/oecore-x86_64/sysroots/x86_64-angstromsdk-linux/usr/bin/qt5/qmake

I compared the Makefiles of my x86_64 environment with the one of my cross-compiling environment.

I came across these lines:

STRIP         = strip                                 | STRIP         = $(OE_QMAKE_STRIP)
-$(STRIP) --strip-unneeded $(INSTALL_ROOT)/home/lars. | -$(STRIP) --strip-unneeded $(INSTALL_ROOT)/home/oe/oe

So in the cross-compiling environment the build tools are defined by environment variables.

This works for most of the tools, e.g.:

echo $OE_QMAKE_CC
arm-angstrom-linux-gnueabi-gcc -march=armv7-a -mthumb -mthumb-interwork -mfloat-abi=hard -mfpu=neon --sysroot=/home/oe/oecore-x86_64/sysroots/armv7at2hf-vfp-neon-angstrom-linux-gnueabi

But echo $OE_QMAKE_STRIP is empty.

I looked for the occurrence of OE_QMAKE_STRIP

$grep OE_QMAKE_STRIP -r /home/oe/oecore-x86_64/
/home/oe/oecore-x86_64/sysroots/armv7at2hf-vfp-neon-angstrom-linux-gnueabi/usr/lib/qt5/mkspecs/qmodule.pri:OE_QMAKE_STRIP = echo
/home/oe/oecore-x86_64/sysroots/armv7at2hf-vfp-neon-angstrom-linux-gnueabi/usr/lib/qt5/mkspecs/linux-oe-g++/qmake.conf:QMAKE_STRIP           = $(OE_QMAKE_STRIP)

and compared this with the occurrence of OE_QMAKE_CC

$ grep OE_QMAKE_CC -r /home/oe/oecore-x86_64/
/home/oe/oecore-x86_64/sysroots/armv7at2hf-vfp-neon-angstrom-linux-gnueabi/usr/lib/qt5/mkspecs/qmodule.pri:OE_QMAKE_CC = arm-angstrom-linux-gnueabi-gcc  -march=armv7-a -mthumb  -mthumb-interwork -mfloat-abi=hard -mfpu=neon --sysroot=/home/oe/oe-core/build/out-glibc/sysroots/colibri-t30
/home/oe/oecore-x86_64/sysroots/armv7at2hf-vfp-neon-angstrom-linux-gnueabi/usr/lib/qt5/mkspecs/linux-oe-g++/qmake.conf:QMAKE_CC       = $(OE_QMAKE_CC)
/home/oe/oecore-x86_64/sysroots/x86_64-angstromsdk-linux/environment-setup.d/qt5.sh:export OE_QMAKE_CC=$CC

So OE_QMAKE_CC=$CC but the qt5.sh is missing the corresponding line.

STRIP is defined:

$ echo $STRIP
arm-angstrom-linux-gnueabi-strip

So I added an export for OE_QMAKE_STRIP:

--- /home/oe/oecore-x86_64/sysroots/x86_64-angstromsdk-linux/environment-setup.d/qt5.sh.orig    2016-09-28 14:44:34.316335999 +0200
+++ /home/oe/oecore-x86_64/sysroots/x86_64-angstromsdk-linux/environment-setup.d/qt5.sh 2016-09-30 10:04:32.900442211 +0200
@@ -6,6 +6,7 @@
 export OE_QMAKE_CXX=$CXX
 export OE_QMAKE_LINK=$CXX
 export OE_QMAKE_AR=$AR
+export OE_QMAKE_STRIP=$STRIP
 export QT_CONF_PATH=$OECORE_NATIVE_SYSROOT/usr/bin/qt5/qt.conf
 export OE_QMAKE_LIBDIR_QT=`qmake -query QT_INSTALL_LIBS`
 export OE_QMAKE_INCDIR_QT=`qmake -query QT_INSTALL_HEADERS`

and sourced the cross-toolchain’s environment setup script again:

. /home/oe/oecore-x86_64/environment-setup-armv7at2hf-vfp-neon-angstrom-linux-gnueabi

so that OE_QMAKE_STRIP is defined:

$ echo $OE_QMAKE_STRIP
arm-angstrom-linux-gnueabi-strip

and now make install runs without error.

@Toradex Support

Is this a bug in qt5.sh? Will it be fixed?