* [PATCH 1/4] grub2.inc: dont export TARGET_CFLAGS etc to grub2 configure
2016-02-27 5:53 [PATCH 0/4] poison TARGET_CFLAGS etc for native builds Andre McCurdy
@ 2016-02-27 5:53 ` Andre McCurdy
2016-02-27 5:53 ` [PATCH 2/4] grub2.inc: avoid passing -isystem to native builds Andre McCurdy
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Andre McCurdy @ 2016-02-27 5:53 UTC (permalink / raw)
To: openembedded-core
The grub2 configure script uses variables such as TARGET_CFLAGS etc
for its own purposes. Remove the OE versions from the configure
environment to avoid conflicts.
Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
---
meta/recipes-bsp/grub/grub2.inc | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/meta/recipes-bsp/grub/grub2.inc b/meta/recipes-bsp/grub/grub2.inc
index 84a4727..5a12563 100644
--- a/meta/recipes-bsp/grub/grub2.inc
+++ b/meta/recipes-bsp/grub/grub2.inc
@@ -44,10 +44,16 @@ PACKAGECONFIG ??= ""
PACKAGECONFIG[grub-mount] = "--enable-grub-mount,--disable-grub-mount,fuse"
PACKAGECONFIG[device-mapper] = "--enable-device-mapper,--disable-device-mapper,lvm2"
+do_configure_prepend() {
+ # The grub2 configure script uses variables such as TARGET_CFLAGS etc
+ # for its own purposes. Remove the OE versions from the environment to
+ # avoid conflicts.
+ unset TARGET_CPPFLAGS TARGET_CFLAGS TARGET_CXXFLAGS TARGET_LDFLAGS
+}
+
# grub and grub-efi's sysroot/${datadir}/grub/grub-mkconfig_lib are
# conflicted, remove it since no one uses it.
SYSROOT_PREPROCESS_FUNCS_class-target += "remove_sysroot_mkconfig_lib"
remove_sysroot_mkconfig_lib() {
rm -r "${SYSROOT_DESTDIR}${datadir}/grub/grub-mkconfig_lib"
}
-
--
1.9.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH 2/4] grub2.inc: avoid passing -isystem to native builds
2016-02-27 5:53 [PATCH 0/4] poison TARGET_CFLAGS etc for native builds Andre McCurdy
2016-02-27 5:53 ` [PATCH 1/4] grub2.inc: dont export TARGET_CFLAGS etc to grub2 configure Andre McCurdy
@ 2016-02-27 5:53 ` Andre McCurdy
2016-02-27 5:53 ` [PATCH 3/4] grub2.inc: drop bogus dependency on xz Andre McCurdy
2016-02-27 5:53 ` [PATCH 4/4] native.bbclass: poison TARGET_CFLAGS etc for native builds Andre McCurdy
3 siblings, 0 replies; 7+ messages in thread
From: Andre McCurdy @ 2016-02-27 5:53 UTC (permalink / raw)
To: openembedded-core
grub2 creates its own set of -nostdinc / -isystem / -ffreestanding
CFLAGS and OE's default BUILD_CFLAGS (assigned to CFLAGS for native
builds) etc, conflict with that.
Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
---
meta/recipes-bsp/grub/grub2.inc | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/meta/recipes-bsp/grub/grub2.inc b/meta/recipes-bsp/grub/grub2.inc
index 5a12563..0fdafd5 100644
--- a/meta/recipes-bsp/grub/grub2.inc
+++ b/meta/recipes-bsp/grub/grub2.inc
@@ -44,6 +44,15 @@ PACKAGECONFIG ??= ""
PACKAGECONFIG[grub-mount] = "--enable-grub-mount,--disable-grub-mount,fuse"
PACKAGECONFIG[device-mapper] = "--enable-device-mapper,--disable-device-mapper,lvm2"
+# grub2 creates its own set of -nostdinc / -isystem / -ffreestanding CFLAGS and
+# OE's default BUILD_CFLAGS (assigned to CFLAGS for native builds) etc, conflict
+# with that. Note that since BUILD_CFLAGS etc are not used by grub2 target
+# builds, it's safe to clear them unconditionally for both target and native.
+BUILD_CPPFLAGS = ""
+BUILD_CFLAGS = ""
+BUILD_CXXFLAGS = ""
+BUILD_LDFLAGS = ""
+
do_configure_prepend() {
# The grub2 configure script uses variables such as TARGET_CFLAGS etc
# for its own purposes. Remove the OE versions from the environment to
--
1.9.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH 3/4] grub2.inc: drop bogus dependency on xz
2016-02-27 5:53 [PATCH 0/4] poison TARGET_CFLAGS etc for native builds Andre McCurdy
2016-02-27 5:53 ` [PATCH 1/4] grub2.inc: dont export TARGET_CFLAGS etc to grub2 configure Andre McCurdy
2016-02-27 5:53 ` [PATCH 2/4] grub2.inc: avoid passing -isystem to native builds Andre McCurdy
@ 2016-02-27 5:53 ` Andre McCurdy
2016-02-27 5:53 ` [PATCH 4/4] native.bbclass: poison TARGET_CFLAGS etc for native builds Andre McCurdy
3 siblings, 0 replies; 7+ messages in thread
From: Andre McCurdy @ 2016-02-27 5:53 UTC (permalink / raw)
To: openembedded-core
grub contains it's own internal lzma library. Attempting to build grub against
the system liblzma shared library or header files is not likely to end well.
This change does not cause a floating dependency since all grub2.inc based
recipes pass "--enable-liblzma=no" to configure.
Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
---
meta/recipes-bsp/grub/grub2.inc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/recipes-bsp/grub/grub2.inc b/meta/recipes-bsp/grub/grub2.inc
index 0fdafd5..12cff4f 100644
--- a/meta/recipes-bsp/grub/grub2.inc
+++ b/meta/recipes-bsp/grub/grub2.inc
@@ -31,7 +31,7 @@ SRC_URI = "ftp://ftp.gnu.org/gnu/grub/grub-${PV}.tar.gz \
file://0001-Remove-direct-_llseek-code-and-require-long-filesyst.patch \
"
-DEPENDS = "flex-native bison-native xz"
+DEPENDS = "flex-native bison-native"
SRC_URI[md5sum] = "e927540b6eda8b024fb0391eeaa4091c"
SRC_URI[sha256sum] = "65b39a0558f8c802209c574f4d02ca263a804e8a564bc6caf1cd0fd3b3cc11e3"
--
1.9.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH 4/4] native.bbclass: poison TARGET_CFLAGS etc for native builds
2016-02-27 5:53 [PATCH 0/4] poison TARGET_CFLAGS etc for native builds Andre McCurdy
` (2 preceding siblings ...)
2016-02-27 5:53 ` [PATCH 3/4] grub2.inc: drop bogus dependency on xz Andre McCurdy
@ 2016-02-27 5:53 ` Andre McCurdy
2016-02-27 8:20 ` Richard Purdie
3 siblings, 1 reply; 7+ messages in thread
From: Andre McCurdy @ 2016-02-27 5:53 UTC (permalink / raw)
To: openembedded-core
TARGET_* FLAGS are never passed to the native toolchain. However,
they are exported so their values affect the checksum of every task.
Replace with fixed values to both avoid any unnecessary rebuilding
of native packages when target flags are changed (as before) and now
also to poison any accidental use of target flags with the native
toolchain.
Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
---
meta/classes/native.bbclass | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/meta/classes/native.bbclass b/meta/classes/native.bbclass
index f67ef00..34c08b2 100644
--- a/meta/classes/native.bbclass
+++ b/meta/classes/native.bbclass
@@ -26,10 +26,18 @@ TARGET_PREFIX = "${BUILD_PREFIX}"
TARGET_CC_ARCH = "${BUILD_CC_ARCH}"
TARGET_LD_ARCH = "${BUILD_LD_ARCH}"
TARGET_AS_ARCH = "${BUILD_AS_ARCH}"
-TARGET_CPPFLAGS = "${BUILD_CPPFLAGS}"
-TARGET_CFLAGS = "${BUILD_CFLAGS}"
-TARGET_CXXFLAGS = "${BUILD_CXXFLAGS}"
-TARGET_LDFLAGS = "${BUILD_LDFLAGS}"
+
+# TARGET_* FLAGS are never passed to the native toolchain. However, they are
+# exported so their values affect the checksum of every task. Replace with fixed
+# values to both avoid any unnecessary rebuilding of native packages when target
+# flags are changed and to poison any accidental use of target flags with the
+# native toolchain.
+TARGET_CPPFLAGS = "--target-cppflag-never-passed-to-the-native-toolchain"
+TARGET_CFLAGS = "--target-cflag-never-passed-to-the-native-toolchain"
+TARGET_CXXFLAGS = "--target-cxxflag-never-passed-to-the-native-toolchain"
+TARGET_LDFLAGS = "--target-ldflag-never-passed-to-the-native-toolchain"
+
+# Hardcoding is OK since native always implies x86 or x86-64.
TARGET_FPU = ""
HOST_ARCH = "${BUILD_ARCH}"
--
1.9.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH 4/4] native.bbclass: poison TARGET_CFLAGS etc for native builds
2016-02-27 5:53 ` [PATCH 4/4] native.bbclass: poison TARGET_CFLAGS etc for native builds Andre McCurdy
@ 2016-02-27 8:20 ` Richard Purdie
2016-02-27 20:49 ` Burton, Ross
0 siblings, 1 reply; 7+ messages in thread
From: Richard Purdie @ 2016-02-27 8:20 UTC (permalink / raw)
To: Andre McCurdy, openembedded-core
On Fri, 2016-02-26 at 21:53 -0800, Andre McCurdy wrote:
> TARGET_* FLAGS are never passed to the native toolchain. However,
> they are exported so their values affect the checksum of every task.
>
> Replace with fixed values to both avoid any unnecessary rebuilding
> of native packages when target flags are changed (as before) and now
> also to poison any accidental use of target flags with the native
> toolchain.
>
> Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
> ---
> meta/classes/native.bbclass | 16 ++++++++++++----
> 1 file changed, 12 insertions(+), 4 deletions(-)
>
> diff --git a/meta/classes/native.bbclass
> b/meta/classes/native.bbclass
> index f67ef00..34c08b2 100644
> --- a/meta/classes/native.bbclass
> +++ b/meta/classes/native.bbclass
> @@ -26,10 +26,18 @@ TARGET_PREFIX = "${BUILD_PREFIX}"
> TARGET_CC_ARCH = "${BUILD_CC_ARCH}"
> TARGET_LD_ARCH = "${BUILD_LD_ARCH}"
> TARGET_AS_ARCH = "${BUILD_AS_ARCH}"
> -TARGET_CPPFLAGS = "${BUILD_CPPFLAGS}"
> -TARGET_CFLAGS = "${BUILD_CFLAGS}"
> -TARGET_CXXFLAGS = "${BUILD_CXXFLAGS}"
> -TARGET_LDFLAGS = "${BUILD_LDFLAGS}"
> +
> +# TARGET_* FLAGS are never passed to the native toolchain. However,
> they are
> +# exported so their values affect the checksum of every task.
> Replace with fixed
> +# values to both avoid any unnecessary rebuilding of native packages
> when target
> +# flags are changed and to poison any accidental use of target flags
> with the
> +# native toolchain.
> +TARGET_CPPFLAGS = "--target-cppflag-never-passed-to-the-native
> -toolchain"
> +TARGET_CFLAGS = "--target-cflag-never-passed-to-the-native
> -toolchain"
> +TARGET_CXXFLAGS = "--target-cxxflag-never-passed-to-the-native
> -toolchain"
> +TARGET_LDFLAGS = "--target-ldflag-never-passed-to-the-native
> -toolchain"
Wouldn't it perhaps be nicer just to unexport these?
I think
TARGET_CPPFLAGS[unexport] = "1"
might do it or we could do:
delvarFlag("TARGET_CPPFLAGS", "export")
?
Regardless of approach, this is likely going to need some extensive
testing.
Cheers,
Richard
^ permalink raw reply [flat|nested] 7+ messages in thread