Swupdate recipe adds CONFIG_EXTRA_CFLAGS and CONFIG_EXTRA_LDFLAGS to the
beginning of the .config. Most generated defconfig already contains
(empty) CFLAGS, which overwrite those added by the recipe (last
definition wins). This behaviour is not mentioned in documentation and
causes unexpected problems. In this commit, we remove preddefined CFLAGS
from defconfig, which are invalid because they don't contain correct
build paths, and we add the CFLAGS from bitbake to the end of the .config file.
Signed-off-by: Andrej Kozemcak <
andrej....@siemens.com>
---
recipes-support/swupdate/swupdate.inc | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/recipes-support/swupdate/swupdate.inc b/recipes-support/swupdate/swupdate.inc
index 188c25c..8a740ad 100644
--- a/recipes-support/swupdate/swupdate.inc
+++ b/recipes-support/swupdate/swupdate.inc
@@ -245,11 +245,13 @@ python () {
}
do_configure () {
- cat > ${WORKDIR}/.config <<HEREDOC
-CONFIG_EXTRA_CFLAGS="${CFLAGS}"
-CONFIG_EXTRA_LDFLAGS="${LDFLAGS}"
-HEREDOC
- cat ${WORKDIR}/defconfig >> ${WORKDIR}/.config
+ cp ${WORKDIR}/defconfig ${WORKDIR}/.config
+
+ sed -i "s/^CONFIG_EXTRA_CFLAGS.*$//" ${WORKDIR}/.config
+ echo "CONFIG_EXTRA_CFLAGS=\"${CFLAGS}\"" >> ${WORKDIR}/.config
+
+ sed -i "s/^CONFIG_EXTRA_LDFLAGS.*$//" ${WORKDIR}/.config
+ echo "CONFIG_EXTRA_LDFLAGS=\"${LDFLAGS}\"" >> ${WORKDIR}/.config
merge_config.sh -O ${B} -m ${WORKDIR}/.config ${@" ".join(find_cfgs(d))}
(cd ${S} && cml1_do_configure)
--
2.39.2