Skip to contentSkip to conversation

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

PATCH In review Dengke Du 2 participants 5 messages Feb 28, 2019 – Mar 1, 2019

lore
Share & tools
lore

Dengke Du

author
#0 lore raw

PATCH v2 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 | 1 +
 1 file changed, 1 insertion(+)
recipes-containers/criu/criu_git.bb +1 -0
index 45195ea..123f6a3 100644
@@ -54,6 +54,7 @@ export C_INCLUDE_PATH="${STAGING_INCDIR}/libnl3"
 
 export BUILD_SYS
 export HOST_SYS
+export HOSTCFLAGS = "${BUILD_CFLAGS}"
 
 inherit setuptools
 
Signature · 1 line
2.7.4
#1 lore raw
Quoted 10 lines · Dengke Du

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.

What's the difference from v1 ?

Bruce

Quoted 26 lines
---
 recipes-containers/criu/criu_git.bb | 1 +
 1 file changed, 1 insertion(+)
recipes-containers/criu/criu_git.bb +1 -1
index 45195ea..123f6a3 100644
@@ -54,6 +54,7 @@ export C_INCLUDE_PATH="${STAGING_INCDIR}/libnl3"
 
 export BUILD_SYS
 export HOST_SYS
+export HOSTCFLAGS = "${BUILD_CFLAGS}"
 
 inherit setuptools
 
--

2.7.4

--
_______________________________________________
meta-virtualization mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-virtualization

Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
author
#2 lore raw
Quoted 5 lines · Bruce Ashfield
Quoted 4 lines · Dengke Du

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".

Quoted 8 lines
Quoted 5 lines

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.

What's the difference from v1 ?

Bruce

Hi bruce

V1 have two lines.

Quoted 28 lines
Quoted 26 lines
---
  recipes-containers/criu/criu_git.bb | 1 +
  1 file changed, 1 insertion(+)
recipes-containers/criu/criu_git.bb +1 -1
index 45195ea..123f6a3 100644
@@ -54,6 +54,7 @@ export C_INCLUDE_PATH="${STAGING_INCDIR}/libnl3"
 
  export BUILD_SYS
  export HOST_SYS
+export HOSTCFLAGS = "${BUILD_CFLAGS}"
 
  inherit setuptools
 
--

2.7.4

--
_______________________________________________
meta-virtualization mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-virtualization

author
#3 lore raw

Sorry for my little words for V2, I will add more next time.

Dengke

Quoted 48 lines · ddu
Quoted 5 lines · Bruce Ashfield
Quoted 4 lines · Dengke Du

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".

Quoted 8 lines
Quoted 5 lines

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.

What's the difference from v1 ?

Bruce

Hi bruce

V1 have two lines.

Quoted 28 lines
Quoted 26 lines

---
  recipes-containers/criu/criu_git.bb | 1 +

  1 file changed, 1 insertion(+)
recipes-containers/criu/criu_git.bb +0 -0
index 45195ea..123f6a3 100644
@@ -54,6 +54,7 @@ export C_INCLUDE_PATH="${STAGING_INCDIR}/libnl3"
 

  export BUILD_SYS
  export HOST_SYS
+export HOSTCFLAGS = "${BUILD_CFLAGS}"

  inherit setuptools

Signature · 7 lines
2.7.4

-- 
_______________________________________________
meta-virtualization mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-virtualization
#4 lore raw
In reply to Dengke Du

merged

Bruce

Quoted 36 lines · Dengke Du

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 | 1 +
 1 file changed, 1 insertion(+)
recipes-containers/criu/criu_git.bb +1 -1
index 45195ea..123f6a3 100644
@@ -54,6 +54,7 @@ export C_INCLUDE_PATH="${STAGING_INCDIR}/libnl3"
 
 export BUILD_SYS
 export HOST_SYS
+export HOSTCFLAGS = "${BUILD_CFLAGS}"
 
 inherit setuptools
 
--

2.7.4

--
_______________________________________________
meta-virtualization mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-virtualization

Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II