aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-qt/qt5
diff options
context:
space:
mode:
authorMingde (Matthew) Zeng <matthew.zeng@windriver.com>2020-07-06 00:12:10 -0400
committerMartin Jansa <Martin.Jansa@gmail.com>2020-07-08 11:15:54 +0200
commitb61ea2c1a2c338487aee3c5e47d7394c0a5cbc27 (patch)
tree7cb0344dc6c73d3e44be286890b26c209e6c4cce /recipes-qt/qt5
parentc9553a5d2b5fd113dd5c165f2bd47618908528a9 (diff)
qtbase: remove path of the build host from qmake.conf
OE_QMAKE_CFLAGS and OE_QMAKE_CXXFLAGS contain path of the build host, which is not useful for the target, and can be a potential security risk. It looks like the following in the target qmake.conf (actual build host path replaced with $PATH_OF_BUILD_HOST): isEmpty(QMAKE_CFLAGS): QMAKE_CFLAGS = -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=$PATH_OF_BUILD_HOST/qtbase/5.15.0+gitAUTOINC+f6fe4bbab7-r0=/usr/src/debug/qtbase/5.15.0+gitAUTOINC+f6fe4bbab7-r0 -fdebug-prefix-map=$PATH_OF_BUILD_HOST/qtbase/5.15.0+gitAUTOINC+f6fe4bbab7-r0=/usr/src/debug/qtbase/5.15.0+gitAUTOINC+f6fe4bbab7-r0 -fdebug-prefix-map=$PATH_OF_BUILD_HOST/qtbase/5.15.0+gitAUTOINC+f6fe4bbab7-r0/recipe-sysroot= -fdebug-prefix-map=$PATH_OF_BUILD_HOST/qtbase/5.15.0+gitAUTOINC+f6fe4bbab7-r0/recipe-sysroot-native= -fmacro-prefix-map and -fdebug-prefix-map are therefore removed from qmake.conf on the target, as these are default options only that can be overridden any time. Signed-off-by: Mingde (Matthew) Zeng <matthew.zeng@windriver.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'recipes-qt/qt5')
-rw-r--r--recipes-qt/qt5/qtbase_git.bb5
1 files changed, 3 insertions, 2 deletions
diff --git a/recipes-qt/qt5/qtbase_git.bb b/recipes-qt/qt5/qtbase_git.bb
index 6212ee38..7f6fd956 100644
--- a/recipes-qt/qt5/qtbase_git.bb
+++ b/recipes-qt/qt5/qtbase_git.bb
@@ -253,9 +253,10 @@ do_install_append() {
echo "# default compiler options which can be overwritten from the environment" >> $conf
echo "isEmpty(QMAKE_AR): QMAKE_AR = ${OE_QMAKE_AR} cqs" >> $conf
echo "isEmpty(QMAKE_CC): QMAKE_CC = $OE_QMAKE_CC_NO_SYSROOT" >> $conf
- echo "isEmpty(QMAKE_CFLAGS): QMAKE_CFLAGS = ${OE_QMAKE_CFLAGS}" >> $conf
echo "isEmpty(QMAKE_CXX): QMAKE_CXX = $OE_QMAKE_CXX_NO_SYSROOT" >> $conf
- echo "isEmpty(QMAKE_CXXFLAGS): QMAKE_CXXFLAGS = ${OE_QMAKE_CXXFLAGS}" >> $conf
+ # OE_QMAKE_CFLAGS and OE_QMAKE_CXXFLAGS contain path of the build host, which is not useful for the target.
+ echo "isEmpty(QMAKE_CFLAGS): QMAKE_CFLAGS = ${OE_QMAKE_CFLAGS}" | sed -e 's/-fdebug-prefix-map=[^ ]*//g' | sed -e 's/-fmacro-prefix-map=[^ ]*//g' >> $conf
+ echo "isEmpty(QMAKE_CXXFLAGS): QMAKE_CXXFLAGS = ${OE_QMAKE_CXXFLAGS}" | sed -e 's/-fdebug-prefix-map=[^ ]*//g' | sed -e 's/-fmacro-prefix-map=[^ ]*//g' >> $conf
echo "isEmpty(QMAKE_LINK): QMAKE_LINK = $OE_QMAKE_LINK_NO_SYSROOT" >> $conf
echo "isEmpty(QMAKE_LINK_SHLIB): QMAKE_LINK_SHLIB = $OE_QMAKE_LINK_NO_SYSROOT" >> $conf
echo "isEmpty(QMAKE_LINK_C): QMAKE_LINK_C = $OE_QMAKE_LINK_NO_SYSROOT" >> $conf