Skip to contentSkip to conversation

criu: fix host gcc can't recognized option -fmacro-prefix-map

PATCH Superseded Dengke Du 1 participant 1 message Feb 26, 2019

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Dengke Du

author
#0 lore raw

PATCH 1/1 criu: fix host gcc can't recognized option -fmacro-prefix-map

Generally, our host gcc version below 8.0, but cross toolchain in yocto above 8.0, now 8.3, the option "macro-prefix-map" coming from 8.0, so if the host gcc below 8.0, it can't unrecognized the option "macro-prefix-map".

In criu source code, the HOSTCFLAGS coming from CFLAGS:
https://github.com/checkpoint-restore/criu/blob/criu-dev/Makefile#L17
In yocto project, the CFLAGS coming from the cross toolchain, containing the "-fmacro-prefix-map" default, so we should use the BUILD_CFLAGS, it contains the flags that used for host building.

---
 recipes-containers/criu/criu_git.bb | 3 +++
 1 file changed, 3 insertions(+)
recipes-containers/criu/criu_git.bb +3 -0
index 45195ea..01c3b94 100644
@@ -55,6 +55,9 @@ export C_INCLUDE_PATH="${STAGING_INCDIR}/libnl3"
 export BUILD_SYS
 export HOST_SYS
 
+HOSTCFLAGS = "${BUILD_CFLAGS}"
+export HOSTCFLAGS
+
 inherit setuptools
 
 PACKAGECONFIG ??= ""
Signature · 1 line
2.7.4