All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] qemu-native: set ld.bfd, fix cflags, and set some environment vars
@ 2016-06-08  0:00 Stephen Arnold
  2016-06-08 10:10 ` Burton, Ross
  0 siblings, 1 reply; 10+ messages in thread
From: Stephen Arnold @ 2016-06-08  0:00 UTC (permalink / raw)
  To: openembedded-core; +Cc: Stephen Arnold

The main thing is build failures with gold linker, but qemu is also a
little too aggressive at finding random tools on the build host, so we
also set the build env for qemu-native and make sure it doesn't reset
its own (hard-coded) cflags when we don't want it to.

Signed-off-by: Stephen Arnold <sarnold@vctlabs.com>
---
 meta/recipes-devtools/qemu/qemu.inc                     | 13 +++++++++++--
 meta/recipes-devtools/qemu/qemu/qemu-2.5.0-cflags.patch | 13 +++++++++++++
 meta/recipes-devtools/qemu/qemu_2.5.0.bb                |  1 +
 3 files changed, 25 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-devtools/qemu/qemu/qemu-2.5.0-cflags.patch

diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc
index 95fe66f..87c9f75 100644
--- a/meta/recipes-devtools/qemu/qemu.inc
+++ b/meta/recipes-devtools/qemu/qemu.inc
@@ -30,8 +30,12 @@ SRC_URI_append_class-native = "\
 
 EXTRA_OECONF += "--target-list=${@get_qemu_target_list(d)} --disable-werror  --disable-bluez --disable-libiscsi --with-system-pixman --extra-cflags='${CFLAGS}'"
 
-EXTRA_OECONF_class-nativesdk = "--target-list=${@get_qemu_target_list(d)} --disable-werror \
-				"
+EXTRA_OECONF_class-nativesdk = "--target-list=${@get_qemu_target_list(d)} --disable-werror"
+
+EXTRA_OEMAKE_append_class-native = " LD='${LD}' AR='${AR}' OBJCOPY='${OBJCOPY}' LDFLAGS='${LDFLAGS}'"
+
+LDFLAGS_append_class-native = " -fuse-ld=bfd"
+
 export LIBTOOL="${HOST_SYS}-libtool"
 
 do_configure_prepend_class-native() {
@@ -40,6 +44,11 @@ do_configure_prepend_class-native() {
 	if [ ! -z "$BHOST_PKGCONFIG_PATH" ]; then
 		export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$BHOST_PKGCONFIG_PATH
 	fi
+
+	# Alter target makefiles to accept CFLAGS set via env
+	sed -i -r \
+		-e 's/^(C|OP_C|HELPER_C)FLAGS=/\1FLAGS+=/' \
+		"${S}"/Makefile "${S}"/Makefile.target
 }
 
 KVMENABLE = "--enable-kvm"
diff --git a/meta/recipes-devtools/qemu/qemu/qemu-2.5.0-cflags.patch b/meta/recipes-devtools/qemu/qemu/qemu-2.5.0-cflags.patch
new file mode 100644
index 0000000..173394f
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/qemu-2.5.0-cflags.patch
@@ -0,0 +1,13 @@
+--- a/configure
++++ b/configure
+@@ -4468,10 +4468,6 @@ fi
+ if test "$gcov" = "yes" ; then
+   CFLAGS="-fprofile-arcs -ftest-coverage -g $CFLAGS"
+   LDFLAGS="-fprofile-arcs -ftest-coverage $LDFLAGS"
+-elif test "$fortify_source" = "yes" ; then
+-  CFLAGS="-O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $CFLAGS"
+-elif test "$debug" = "no"; then
+-  CFLAGS="-O2 $CFLAGS"
+ fi
+ 
+ ##########################################
diff --git a/meta/recipes-devtools/qemu/qemu_2.5.0.bb b/meta/recipes-devtools/qemu/qemu_2.5.0.bb
index 03a6cbe..97ad743 100644
--- a/meta/recipes-devtools/qemu/qemu_2.5.0.bb
+++ b/meta/recipes-devtools/qemu/qemu_2.5.0.bb
@@ -16,6 +16,7 @@ SRC_URI += "file://configure-fix-Darwin-target-detection.patch \
             file://rng_remove_the_unused_request_cancellation_code.patch \
             file://rng_move_request_queue_cleanup_from_RngEgd_to_RngBackend.patch \
             file://CVE-2016-2858.patch \
+            file://qemu-2.5.0-cflags.patch \
            "
 SRC_URI_prepend = "http://wiki.qemu-project.org/download/${BP}.tar.bz2"
 SRC_URI[md5sum] = "f469f2330bbe76e3e39db10e9ac4f8db"
-- 
2.8.1



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] qemu-native: set ld.bfd, fix cflags, and set some environment vars
  2016-06-08  0:00 [PATCH] qemu-native: set ld.bfd, fix cflags, and set some environment vars Stephen Arnold
@ 2016-06-08 10:10 ` Burton, Ross
  0 siblings, 0 replies; 10+ messages in thread
From: Burton, Ross @ 2016-06-08 10:10 UTC (permalink / raw)
  To: Stephen Arnold; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 390 bytes --]

On 8 June 2016 at 01:00, Stephen Arnold <sarnold@vctlabs.com> wrote:

>  meta/recipes-devtools/qemu/qemu.inc                     | 13 +++++++++++--
>  meta/recipes-devtools/qemu/qemu/qemu-2.5.0-cflags.patch | 13 +++++++++++++
>  meta/recipes-devtools/qemu/qemu_2.5.0.bb                |  1 +
>

qemu was upgraded to 2.6.0 in master a few weeks ago, can you rebase?

Cheers,
Ross

[-- Attachment #2: Type: text/html, Size: 915 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH] qemu-native: set ld.bfd, fix cflags, and set some environment vars
@ 2016-06-21  0:54 Stephen Arnold
  0 siblings, 0 replies; 10+ messages in thread
From: Stephen Arnold @ 2016-06-21  0:54 UTC (permalink / raw)
  To: openembedded-core; +Cc: Stephen Arnold, Stephen Arnold

The main thing is build failures with gold linker, but qemu is also a
little too aggressive at finding random tools on the build host, so we
also set the build env for qemu-native and make sure it doesn't reset
its own (hard-coded) cflags when we don't want it to.

Signed-off-by: Stephen Arnold <sarnold@vctlabs.com>

The cflags patch was imported from Gentoo Portage and has been
manitained over several versions; this version was rebased against
upstream qemu git.

Upstream-Status: Inappropriate
 - Patch addresses distribution maintenance and build environment
   sanity.

Signed-off-by: Stephen Arnold <nerdboy@gentoo.org>
---
 meta/recipes-devtools/qemu/qemu.inc                | 11 ++++++--
 .../qemu/qemu/qemu-2.6.0-cflags.patch              | 31 ++++++++++++++++++++++
 meta/recipes-devtools/qemu/qemu_2.6.0.bb           |  1 +
 3 files changed, 41 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-devtools/qemu/qemu/qemu-2.6.0-cflags.patch

diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc
index bf689bb..0a68f05 100644
--- a/meta/recipes-devtools/qemu/qemu.inc
+++ b/meta/recipes-devtools/qemu/qemu.inc
@@ -30,8 +30,10 @@ SRC_URI_append_class-native = "\
 
 EXTRA_OECONF += "--target-list=${@get_qemu_target_list(d)} --disable-werror  --disable-bluez --disable-libiscsi --with-system-pixman --extra-cflags='${CFLAGS}'"
 
-EXTRA_OECONF_class-nativesdk = "--target-list=${@get_qemu_target_list(d)} --disable-werror \
-				"
+EXTRA_OECONF_class-nativesdk = "--target-list=${@get_qemu_target_list(d)} --disable-werror"
+
+EXTRA_OEMAKE_append_class-native = " LD="${TARGET_PREFIX}ld.bfd" AR="${AR}" OBJCOPY="${OBJCOPY}" LDFLAGS="${LDFLAGS}""
+
 export LIBTOOL="${HOST_SYS}-libtool"
 
 do_configure_prepend_class-native() {
@@ -40,6 +42,11 @@ do_configure_prepend_class-native() {
 	if [ ! -z "$BHOST_PKGCONFIG_PATH" ]; then
 		export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$BHOST_PKGCONFIG_PATH
 	fi
+
+	# Alter target makefiles to accept CFLAGS set via env
+	sed -i -r \
+		-e 's/^(C|OP_C|HELPER_C)FLAGS=/\1FLAGS+=/' \
+		"${S}"/Makefile "${S}"/Makefile.target
 }
 
 KVMENABLE = "--enable-kvm"
diff --git a/meta/recipes-devtools/qemu/qemu/qemu-2.6.0-cflags.patch b/meta/recipes-devtools/qemu/qemu/qemu-2.6.0-cflags.patch
new file mode 100644
index 0000000..5b78edf
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/qemu-2.6.0-cflags.patch
@@ -0,0 +1,31 @@
+From 5d29baaf7a8c09f2f97231116e0f396b0402b23d Mon Sep 17 00:00:00 2001
+From: Steve Arnold <stephen.arnold42@gmail.com>
+Date: Sun, 19 Jun 2016 11:29:44 -0700
+Subject: [PATCH] configure: remove hard-coded flags and let build env handle
+ it
+
+Apply distribution patch for handling debug and fortify source options.
+
+Signed-off-by: Steve Arnold <nerdboy@gentoo.org>
+---
+ configure | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/configure b/configure
+index 10cb212..6f1b10c 100755
+--- a/configure
++++ b/configure
+@@ -4539,10 +4539,6 @@ fi
+ if test "$gcov" = "yes" ; then
+   CFLAGS="-fprofile-arcs -ftest-coverage -g $CFLAGS"
+   LDFLAGS="-fprofile-arcs -ftest-coverage $LDFLAGS"
+-elif test "$fortify_source" = "yes" ; then
+-  CFLAGS="-O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $CFLAGS"
+-elif test "$debug" = "no"; then
+-  CFLAGS="-O2 $CFLAGS"
+ fi
+ 
+ ##########################################
+-- 
+2.8.1
+
diff --git a/meta/recipes-devtools/qemu/qemu_2.6.0.bb b/meta/recipes-devtools/qemu/qemu_2.6.0.bb
index e391326..62c509b 100644
--- a/meta/recipes-devtools/qemu/qemu_2.6.0.bb
+++ b/meta/recipes-devtools/qemu/qemu_2.6.0.bb
@@ -8,6 +8,7 @@ SRC_URI += "file://configure-fix-Darwin-target-detection.patch \
             file://Qemu-Arm-versatilepb-Add-memory-size-checking.patch \
             file://no-valgrind.patch \
             file://pathlimit.patch \
+            file://qemu-2.5.0-cflags.patch \
            "
 SRC_URI_prepend = "http://wiki.qemu-project.org/download/${BP}.tar.bz2"
 SRC_URI[md5sum] = "ca3f70b43f093e33e9e014f144067f13"
-- 
2.8.1



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] qemu-native: set ld.bfd, fix cflags, and set some environment vars
  2016-06-19 19:40 Stephen Arnold
@ 2016-06-19 22:32 ` Stephen Arnold
  0 siblings, 0 replies; 10+ messages in thread
From: Stephen Arnold @ 2016-06-19 22:32 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

Following this:

http://www.openembedded.org/wiki/How_to_submit_a_patch_to_OpenEmbedded

and it still strips my " v3" from PATCH.  Is there another
document/prefix format I should be looking at?

Thanks, Steve

On Sun, Jun 19, 2016 at 12:40 PM, Stephen Arnold <sarnold@vctlabs.com> wrote:
> The main thing is build failures with gold linker, but qemu is also
> a little too aggressive at finding random tools on the build host, so
> we also set the build env for qemu-native and make sure it doesn't
> reset its own (hard-coded) cflags when we don't want it to.
>
> Signed-off-by: Stephen Arnold <sarnold@vctlabs.com>
>
> The cflags patch was imported from Gentoo Portage and has been
> manitained over several versions; this version was rebased against
> upstream qemu git.
>
> Upstream-Status: Inappropriate
>  - Patch addresses distribution maintenance and build environment
>    sanity.
>
> Signed-off-by: Stephen Arnold <nerdboy@gentoo.org>
> ---
>  meta/recipes-devtools/qemu/qemu.inc                | 13 +++++++--
>  .../qemu/qemu/qemu-2.6.0-cflags.patch              | 31 ++++++++++++++++++++++
>  meta/recipes-devtools/qemu/qemu_2.6.0.bb           |  1 +
>  3 files changed, 43 insertions(+), 2 deletions(-)
>  create mode 100644 meta/recipes-devtools/qemu/qemu/qemu-2.6.0-cflags.patch
>
> diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc
> index bf689bb..d5925fd 100644
> --- a/meta/recipes-devtools/qemu/qemu.inc
> +++ b/meta/recipes-devtools/qemu/qemu.inc
> @@ -30,8 +30,12 @@ SRC_URI_append_class-native = "\
>
>  EXTRA_OECONF += "--target-list=${@get_qemu_target_list(d)} --disable-werror  --disable-bluez --disable-libiscsi --with-system-pixman --extra-cflags='${CFLAGS}'"
>
> -EXTRA_OECONF_class-nativesdk = "--target-list=${@get_qemu_target_list(d)} --disable-werror \
> -                               "
> +EXTRA_OECONF_class-nativesdk = "--target-list=${@get_qemu_target_list(d)} --disable-werror"
> +
> +EXTRA_OEMAKE_append_class-native = " LD='${LD}' AR='${AR}' OBJCOPY='${OBJCOPY}' LDFLAGS='${LDFLAGS}'"
> +
> +LDFLAGS_append_class-native = " -fuse-ld=bfd"
> +
>  export LIBTOOL="${HOST_SYS}-libtool"
>
>  do_configure_prepend_class-native() {
> @@ -40,6 +44,11 @@ do_configure_prepend_class-native() {
>         if [ ! -z "$BHOST_PKGCONFIG_PATH" ]; then
>                 export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$BHOST_PKGCONFIG_PATH
>         fi
> +
> +       # Alter target makefiles to accept CFLAGS set via env
> +       sed -i -r \
> +               -e 's/^(C|OP_C|HELPER_C)FLAGS=/\1FLAGS+=/' \
> +               "${S}"/Makefile "${S}"/Makefile.target
>  }
>
>  KVMENABLE = "--enable-kvm"
> diff --git a/meta/recipes-devtools/qemu/qemu/qemu-2.6.0-cflags.patch b/meta/recipes-devtools/qemu/qemu/qemu-2.6.0-cflags.patch
> new file mode 100644
> index 0000000..5b78edf
> --- /dev/null
> +++ b/meta/recipes-devtools/qemu/qemu/qemu-2.6.0-cflags.patch
> @@ -0,0 +1,31 @@
> +From 5d29baaf7a8c09f2f97231116e0f396b0402b23d Mon Sep 17 00:00:00 2001
> +From: Steve Arnold <stephen.arnold42@gmail.com>
> +Date: Sun, 19 Jun 2016 11:29:44 -0700
> +Subject: [PATCH] configure: remove hard-coded flags and let build env handle
> + it
> +
> +Apply distribution patch for handling debug and fortify source options.
> +
> +Signed-off-by: Steve Arnold <nerdboy@gentoo.org>
> +---
> + configure | 4 ----
> + 1 file changed, 4 deletions(-)
> +
> +diff --git a/configure b/configure
> +index 10cb212..6f1b10c 100755
> +--- a/configure
> ++++ b/configure
> +@@ -4539,10 +4539,6 @@ fi
> + if test "$gcov" = "yes" ; then
> +   CFLAGS="-fprofile-arcs -ftest-coverage -g $CFLAGS"
> +   LDFLAGS="-fprofile-arcs -ftest-coverage $LDFLAGS"
> +-elif test "$fortify_source" = "yes" ; then
> +-  CFLAGS="-O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $CFLAGS"
> +-elif test "$debug" = "no"; then
> +-  CFLAGS="-O2 $CFLAGS"
> + fi
> +
> + ##########################################
> +--
> +2.8.1
> +
> diff --git a/meta/recipes-devtools/qemu/qemu_2.6.0.bb b/meta/recipes-devtools/qemu/qemu_2.6.0.bb
> index e391326..62c509b 100644
> --- a/meta/recipes-devtools/qemu/qemu_2.6.0.bb
> +++ b/meta/recipes-devtools/qemu/qemu_2.6.0.bb
> @@ -8,6 +8,7 @@ SRC_URI += "file://configure-fix-Darwin-target-detection.patch \
>              file://Qemu-Arm-versatilepb-Add-memory-size-checking.patch \
>              file://no-valgrind.patch \
>              file://pathlimit.patch \
> +            file://qemu-2.5.0-cflags.patch \
>             "
>  SRC_URI_prepend = "http://wiki.qemu-project.org/download/${BP}.tar.bz2"
>  SRC_URI[md5sum] = "ca3f70b43f093e33e9e014f144067f13"
> --
> 2.8.1
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH] qemu-native: set ld.bfd, fix cflags, and set some environment vars
@ 2016-06-19 19:40 Stephen Arnold
  2016-06-19 22:32 ` Stephen Arnold
  0 siblings, 1 reply; 10+ messages in thread
From: Stephen Arnold @ 2016-06-19 19:40 UTC (permalink / raw)
  To: openembedded-core; +Cc: Stephen Arnold, Stephen Arnold

The main thing is build failures with gold linker, but qemu is also
a little too aggressive at finding random tools on the build host, so
we also set the build env for qemu-native and make sure it doesn't
reset its own (hard-coded) cflags when we don't want it to.

Signed-off-by: Stephen Arnold <sarnold@vctlabs.com>

The cflags patch was imported from Gentoo Portage and has been
manitained over several versions; this version was rebased against
upstream qemu git.

Upstream-Status: Inappropriate
 - Patch addresses distribution maintenance and build environment
   sanity.

Signed-off-by: Stephen Arnold <nerdboy@gentoo.org>
---
 meta/recipes-devtools/qemu/qemu.inc                | 13 +++++++--
 .../qemu/qemu/qemu-2.6.0-cflags.patch              | 31 ++++++++++++++++++++++
 meta/recipes-devtools/qemu/qemu_2.6.0.bb           |  1 +
 3 files changed, 43 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-devtools/qemu/qemu/qemu-2.6.0-cflags.patch

diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc
index bf689bb..d5925fd 100644
--- a/meta/recipes-devtools/qemu/qemu.inc
+++ b/meta/recipes-devtools/qemu/qemu.inc
@@ -30,8 +30,12 @@ SRC_URI_append_class-native = "\
 
 EXTRA_OECONF += "--target-list=${@get_qemu_target_list(d)} --disable-werror  --disable-bluez --disable-libiscsi --with-system-pixman --extra-cflags='${CFLAGS}'"
 
-EXTRA_OECONF_class-nativesdk = "--target-list=${@get_qemu_target_list(d)} --disable-werror \
-				"
+EXTRA_OECONF_class-nativesdk = "--target-list=${@get_qemu_target_list(d)} --disable-werror"
+
+EXTRA_OEMAKE_append_class-native = " LD='${LD}' AR='${AR}' OBJCOPY='${OBJCOPY}' LDFLAGS='${LDFLAGS}'"
+
+LDFLAGS_append_class-native = " -fuse-ld=bfd"
+
 export LIBTOOL="${HOST_SYS}-libtool"
 
 do_configure_prepend_class-native() {
@@ -40,6 +44,11 @@ do_configure_prepend_class-native() {
 	if [ ! -z "$BHOST_PKGCONFIG_PATH" ]; then
 		export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$BHOST_PKGCONFIG_PATH
 	fi
+
+	# Alter target makefiles to accept CFLAGS set via env
+	sed -i -r \
+		-e 's/^(C|OP_C|HELPER_C)FLAGS=/\1FLAGS+=/' \
+		"${S}"/Makefile "${S}"/Makefile.target
 }
 
 KVMENABLE = "--enable-kvm"
diff --git a/meta/recipes-devtools/qemu/qemu/qemu-2.6.0-cflags.patch b/meta/recipes-devtools/qemu/qemu/qemu-2.6.0-cflags.patch
new file mode 100644
index 0000000..5b78edf
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/qemu-2.6.0-cflags.patch
@@ -0,0 +1,31 @@
+From 5d29baaf7a8c09f2f97231116e0f396b0402b23d Mon Sep 17 00:00:00 2001
+From: Steve Arnold <stephen.arnold42@gmail.com>
+Date: Sun, 19 Jun 2016 11:29:44 -0700
+Subject: [PATCH] configure: remove hard-coded flags and let build env handle
+ it
+
+Apply distribution patch for handling debug and fortify source options.
+
+Signed-off-by: Steve Arnold <nerdboy@gentoo.org>
+---
+ configure | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/configure b/configure
+index 10cb212..6f1b10c 100755
+--- a/configure
++++ b/configure
+@@ -4539,10 +4539,6 @@ fi
+ if test "$gcov" = "yes" ; then
+   CFLAGS="-fprofile-arcs -ftest-coverage -g $CFLAGS"
+   LDFLAGS="-fprofile-arcs -ftest-coverage $LDFLAGS"
+-elif test "$fortify_source" = "yes" ; then
+-  CFLAGS="-O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $CFLAGS"
+-elif test "$debug" = "no"; then
+-  CFLAGS="-O2 $CFLAGS"
+ fi
+ 
+ ##########################################
+-- 
+2.8.1
+
diff --git a/meta/recipes-devtools/qemu/qemu_2.6.0.bb b/meta/recipes-devtools/qemu/qemu_2.6.0.bb
index e391326..62c509b 100644
--- a/meta/recipes-devtools/qemu/qemu_2.6.0.bb
+++ b/meta/recipes-devtools/qemu/qemu_2.6.0.bb
@@ -8,6 +8,7 @@ SRC_URI += "file://configure-fix-Darwin-target-detection.patch \
             file://Qemu-Arm-versatilepb-Add-memory-size-checking.patch \
             file://no-valgrind.patch \
             file://pathlimit.patch \
+            file://qemu-2.5.0-cflags.patch \
            "
 SRC_URI_prepend = "http://wiki.qemu-project.org/download/${BP}.tar.bz2"
 SRC_URI[md5sum] = "ca3f70b43f093e33e9e014f144067f13"
-- 
2.8.1



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] qemu-native: set ld.bfd, fix cflags, and set some environment vars
  2016-06-15 21:03 ` Khem Raj
@ 2016-06-15 21:39   ` Stephen Arnold
  0 siblings, 0 replies; 10+ messages in thread
From: Stephen Arnold @ 2016-06-15 21:39 UTC (permalink / raw)
  To: Khem Raj; +Cc: Patches and discussions about the oe-core layer

Undefined references to itself, essentially.  Lemme regenerate a build
log with failure in it.  The host toolchain defaults to gcc 5.3.0 with
LTO plugin enabled and gold linker as default (with multilib-strict
profile).  This time I think it's getting confused about
toolchain/binutils multilib config and the qemu makefiles probably
need a bigger set of fixes to work with gold and/or multilib.

My $.02 would be use/set bfd linker as default for now.

Steve

This is without any changes to current poky/oe-core recipes:

| /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /usr/lib64/libstdc++.a(eh_personality.o): requires dynamic
R_X86_64_PC32 reloc against '__stack_chk_fail' which may overflow at
runtime; recompile with -fPIC
| /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /usr/lib64/libstdc++.a(eh_personality.o): requires unsupported
dynamic reloc 11; recompile with -fPIC
| /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /usr/lib64/libstdc++.a(eh_personality.o): requires dynamic
R_X86_64_PC32 reloc against 'abort' which may overflow at runtime;
recompile with -fPIC
| /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /usr/lib64/libstdc++.a(eh_personality.o): requires dynamic
R_X86_64_PC32 reloc against 'abort' which may overflow at runtime;
recompile with -fPIC
| /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /usr/lib64/libstdc++.a(eh_personality.o): requires dynamic
R_X86_64_PC32 reloc against '_Unwind_GetRegionStart' which may
overflow at runtime; recompile with -fPIC
| /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /usr/lib64/libstdc++.a(eh_personality.o): requires dynamic
R_X86_64_PC32 reloc against '_Unwind_SetGR' which may overflow at
runtime; recompile with -fPIC
| /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /usr/lib64/libstdc++.a(eh_personality.o): requires dynamic
R_X86_64_PC32 reloc against '_Unwind_Resume' which may overflow at
runtime; recompile with -fPIC
| /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /usr/lib64/libstdc++.a(eh_personality.o): requires dynamic
R_X86_64_32 reloc against '__gxx_personality_v0' which may overflow at
runtime; recompile with -fPIC
| /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /usr/lib64/libstdc++.a(eh_terminate.o): requires dynamic
R_X86_64_PC32 reloc against 'abort' which may overflow at runtime;
recompile with -fPIC
| /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /usr/lib64/libstdc++.a(eh_terminate.o): requires dynamic
R_X86_64_32 reloc which may overflow at runtime; recompile with -fPIC
| /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /usr/lib64/libstdc++.a(eh_exception.o): requires dynamic
R_X86_64_32 reloc which may overflow at runtime; recompile with -fPIC
| /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /usr/lib64/libstdc++.a(eh_exception.o): requires dynamic
R_X86_64_32 reloc which may overflow at runtime; recompile with -fPIC
| /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /usr/lib64/libstdc++.a(bad_alloc.o): requires dynamic
R_X86_64_32 reloc which may overflow at runtime; recompile with -fPIC
| /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /usr/lib64/libstdc++.a(bad_alloc.o): requires unsupported
dynamic reloc 11; recompile with -fPIC
| /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /usr/lib64/libstdc++.a(bad_alloc.o): requires unsupported
dynamic reloc 11; recompile with -fPIC
| /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /usr/lib64/libstdc++.a(tinfo.o): requires dynamic R_X86_64_PC32
reloc against 'strcmp' which may overflow at runtime; recompile with
-fPIC
| /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /usr/lib64/libstdc++.a(eh_catch.o): requires dynamic
R_X86_64_PC32 reloc against '_Unwind_DeleteException' which may
overflow at runtime; recompile with -fPIC
| /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /usr/lib64/libstdc++.a(eh_alloc.o): requires dynamic
R_X86_64_32 reloc which may overflow at runtime; recompile with -fPIC
| /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /usr/lib64/libstdc++.a(eh_alloc.o): requires dynamic
R_X86_64_32 reloc which may overflow at runtime; recompile with -fPIC
| /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /usr/lib64/libstdc++.a(eh_alloc.o): requires unsupported
dynamic reloc 11; recompile with -fPIC
| /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /usr/lib64/libstdc++.a(eh_alloc.o): requires unsupported
dynamic reloc 11; recompile with -fPIC
| /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /usr/lib64/libstdc++.a(eh_alloc.o): requires unsupported
dynamic reloc 11; recompile with -fPIC
| /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /usr/lib64/libstdc++.a(eh_alloc.o): requires unsupported
dynamic reloc 11; recompile with -fPIC
| /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /usr/lib64/libstdc++.a(eh_alloc.o): requires dynamic
R_X86_64_32 reloc against
'_ZN9__gnu_cxx24__concurrence_lock_errorD1Ev' which may overflow at
runtime; recompile with -fPIC
| /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /usr/lib64/libstdc++.a(eh_alloc.o): requires dynamic
R_X86_64_32 reloc against
'_ZN9__gnu_cxx26__concurrence_unlock_errorD1Ev' which may overflow at
runtime; recompile with -fPIC
| /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /usr/lib64/libstdc++.a(eh_alloc.o): requires dynamic
R_X86_64_PC32 reloc against 'malloc' which may overflow at runtime;
recompile with -fPIC
| /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /usr/lib64/libstdc++.a(eh_alloc.o): requires unsupported
dynamic reloc 11; recompile with -fPIC
| /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /usr/lib64/libstdc++.a(eh_alloc.o): requires dynamic
R_X86_64_PC32 reloc against 'malloc' which may overflow at runtime;
recompile with -fPIC
| /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /usr/lib64/libstdc++.a(eh_alloc.o): requires unsupported
dynamic reloc 11; recompile with -fPIC
| /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /usr/lib64/libstdc++.a(eh_alloc.o): requires dynamic
R_X86_64_32 reloc which may overflow at runtime; recompile with -fPIC
| /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /usr/lib64/libstdc++.a(vterminate.o): requires dynamic
R_X86_64_32 reloc which may overflow at runtime; recompile with -fPIC
| /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /usr/lib64/libstdc++.a(vterminate.o): requires dynamic
R_X86_64_32 reloc against '_ZTISt9exception' which may overflow at
runtime; recompile with -fPIC
| /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /usr/lib64/libstdc++.a(vterminate.o): requires dynamic
R_X86_64_32 reloc which may overflow at runtime; recompile with -fPIC
| /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /usr/lib64/libstdc++.a(pure.o): requires dynamic R_X86_64_32
reloc which may overflow at runtime; recompile with -fPIC
| /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /usr/lib64/libstdc++.a(pure.o): requires dynamic R_X86_64_32
reloc which may overflow at runtime; recompile with -fPIC
| /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /usr/lib64/libstdc++.a(cp-demangle.o): requires unsupported
dynamic reloc 11; recompile with -fPIC
| collect2: error: ld returned 1 exit status
| Makefile:193: recipe for target 'qemu-system-arm' failed
| make[1]: *** [qemu-system-arm] Error 1
| Makefile:184: recipe for target 'subdir-arm-softmmu' failed
| make: *** [subdir-arm-softmmu] Error 2
| ERROR: oe_runmake failed
| ERROR: Function failed: do_compile (log file is located at
/home/sarnold/beagleboard-bsp/poky/build-newkern/tmp/work/x86_64-linux/qemu-native/2.5.0-r1/temp/log.do_compile.29916)
ERROR: Task 4 (virtual:native:/home/sarnold/beagleboard-bsp/poky/meta/recipes-devtools/qemu/qemu_2.5.0.bb,
do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 187 tasks of which 185 didn't need to
be rerun and 1 failed.

Summary: 1 task failed:
  virtual:native:/home/sarnold/beagleboard-bsp/poky/meta/recipes-devtools/qemu/qemu_2.5.0.bb,
do_compile

On Wed, Jun 15, 2016 at 2:03 PM, Khem Raj <raj.khem@gmail.com> wrote:
> On Sun, Jun 12, 2016 at 6:09 PM, Stephen Arnold <sarnold@vctlabs.com> wrote:
>> The main thing is build failures with gold linker, but qemu is also a
>> little too aggressive at finding random tools on the build host, so we
>> also set the build env for qemu-native and make sure it doesn't reset
>> its own (hard-coded) cflags when we don't want it to.
>>
>> Signed-off-by: Stephen Arnold <sarnold@vctlabs.com>
>> ---
>>  meta/recipes-devtools/qemu/qemu.inc                     | 13 +++++++++++--
>>  meta/recipes-devtools/qemu/qemu/qemu-2.5.0-cflags.patch | 13 +++++++++++++
>>  meta/recipes-devtools/qemu/qemu_2.6.0.bb                |  4 +++-
>>  3 files changed, 27 insertions(+), 3 deletions(-)
>>  create mode 100644 meta/recipes-devtools/qemu/qemu/qemu-2.5.0-cflags.patch
>>
>> diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc
>> index bf689bb..d5925fd 100644
>> --- a/meta/recipes-devtools/qemu/qemu.inc
>> +++ b/meta/recipes-devtools/qemu/qemu.inc
>> @@ -30,8 +30,12 @@ SRC_URI_append_class-native = "\
>>
>>  EXTRA_OECONF += "--target-list=${@get_qemu_target_list(d)} --disable-werror  --disable-bluez --disable-libiscsi --with-system-pixman --extra-cflags='${CFLAGS}'"
>>
>> -EXTRA_OECONF_class-nativesdk = "--target-list=${@get_qemu_target_list(d)} --disable-werror \
>> -                               "
>> +EXTRA_OECONF_class-nativesdk = "--target-list=${@get_qemu_target_list(d)} --disable-werror"
>> +
>> +EXTRA_OEMAKE_append_class-native = " LD='${LD}' AR='${AR}' OBJCOPY='${OBJCOPY}' LDFLAGS='${LDFLAGS}'"
>> +
>> +LDFLAGS_append_class-native = " -fuse-ld=bfd"
>
> what errors do you see with gold ?
>
>> +
>>  export LIBTOOL="${HOST_SYS}-libtool"
>>
>>  do_configure_prepend_class-native() {
>> @@ -40,6 +44,11 @@ do_configure_prepend_class-native() {
>>         if [ ! -z "$BHOST_PKGCONFIG_PATH" ]; then
>>                 export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$BHOST_PKGCONFIG_PATH
>>         fi
>> +
>> +       # Alter target makefiles to accept CFLAGS set via env
>> +       sed -i -r \
>> +               -e 's/^(C|OP_C|HELPER_C)FLAGS=/\1FLAGS+=/' \
>> +               "${S}"/Makefile "${S}"/Makefile.target
>>  }
>>
>>  KVMENABLE = "--enable-kvm"
>> diff --git a/meta/recipes-devtools/qemu/qemu/qemu-2.5.0-cflags.patch b/meta/recipes-devtools/qemu/qemu/qemu-2.5.0-cflags.patch
>> new file mode 100644
>> index 0000000..173394f
>> --- /dev/null
>> +++ b/meta/recipes-devtools/qemu/qemu/qemu-2.5.0-cflags.patch
>> @@ -0,0 +1,13 @@
>> +--- a/configure
>> ++++ b/configure
>> +@@ -4468,10 +4468,6 @@ fi
>> + if test "$gcov" = "yes" ; then
>> +   CFLAGS="-fprofile-arcs -ftest-coverage -g $CFLAGS"
>> +   LDFLAGS="-fprofile-arcs -ftest-coverage $LDFLAGS"
>> +-elif test "$fortify_source" = "yes" ; then
>> +-  CFLAGS="-O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $CFLAGS"
>> +-elif test "$debug" = "no"; then
>> +-  CFLAGS="-O2 $CFLAGS"
>> + fi
>> +
>> + ##########################################
>> diff --git a/meta/recipes-devtools/qemu/qemu_2.6.0.bb b/meta/recipes-devtools/qemu/qemu_2.6.0.bb
>> index e391326..735d013 100644
>> --- a/meta/recipes-devtools/qemu/qemu_2.6.0.bb
>> +++ b/meta/recipes-devtools/qemu/qemu_2.6.0.bb
>> @@ -8,7 +8,9 @@ SRC_URI += "file://configure-fix-Darwin-target-detection.patch \
>>              file://Qemu-Arm-versatilepb-Add-memory-size-checking.patch \
>>              file://no-valgrind.patch \
>>              file://pathlimit.patch \
>> -           "
>> +            file://qemu-2.5.0-cflags.patch \
>> +"
>> +
>>  SRC_URI_prepend = "http://wiki.qemu-project.org/download/${BP}.tar.bz2"
>>  SRC_URI[md5sum] = "ca3f70b43f093e33e9e014f144067f13"
>>  SRC_URI[sha256sum] = "c9ac4a651b273233d21b8bec32e30507cb9cce7900841febc330956a1a8434ec"
>> --
>> 2.8.1
>>
>> --
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-core
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] qemu-native: set ld.bfd, fix cflags, and set some environment vars
  2016-06-13  1:09 Stephen Arnold
  2016-06-13  1:23 ` Stephen Arnold
  2016-06-13 12:16 ` Burton, Ross
@ 2016-06-15 21:03 ` Khem Raj
  2016-06-15 21:39   ` Stephen Arnold
  2 siblings, 1 reply; 10+ messages in thread
From: Khem Raj @ 2016-06-15 21:03 UTC (permalink / raw)
  To: Stephen Arnold; +Cc: Patches and discussions about the oe-core layer

On Sun, Jun 12, 2016 at 6:09 PM, Stephen Arnold <sarnold@vctlabs.com> wrote:
> The main thing is build failures with gold linker, but qemu is also a
> little too aggressive at finding random tools on the build host, so we
> also set the build env for qemu-native and make sure it doesn't reset
> its own (hard-coded) cflags when we don't want it to.
>
> Signed-off-by: Stephen Arnold <sarnold@vctlabs.com>
> ---
>  meta/recipes-devtools/qemu/qemu.inc                     | 13 +++++++++++--
>  meta/recipes-devtools/qemu/qemu/qemu-2.5.0-cflags.patch | 13 +++++++++++++
>  meta/recipes-devtools/qemu/qemu_2.6.0.bb                |  4 +++-
>  3 files changed, 27 insertions(+), 3 deletions(-)
>  create mode 100644 meta/recipes-devtools/qemu/qemu/qemu-2.5.0-cflags.patch
>
> diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc
> index bf689bb..d5925fd 100644
> --- a/meta/recipes-devtools/qemu/qemu.inc
> +++ b/meta/recipes-devtools/qemu/qemu.inc
> @@ -30,8 +30,12 @@ SRC_URI_append_class-native = "\
>
>  EXTRA_OECONF += "--target-list=${@get_qemu_target_list(d)} --disable-werror  --disable-bluez --disable-libiscsi --with-system-pixman --extra-cflags='${CFLAGS}'"
>
> -EXTRA_OECONF_class-nativesdk = "--target-list=${@get_qemu_target_list(d)} --disable-werror \
> -                               "
> +EXTRA_OECONF_class-nativesdk = "--target-list=${@get_qemu_target_list(d)} --disable-werror"
> +
> +EXTRA_OEMAKE_append_class-native = " LD='${LD}' AR='${AR}' OBJCOPY='${OBJCOPY}' LDFLAGS='${LDFLAGS}'"
> +
> +LDFLAGS_append_class-native = " -fuse-ld=bfd"

what errors do you see with gold ?

> +
>  export LIBTOOL="${HOST_SYS}-libtool"
>
>  do_configure_prepend_class-native() {
> @@ -40,6 +44,11 @@ do_configure_prepend_class-native() {
>         if [ ! -z "$BHOST_PKGCONFIG_PATH" ]; then
>                 export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$BHOST_PKGCONFIG_PATH
>         fi
> +
> +       # Alter target makefiles to accept CFLAGS set via env
> +       sed -i -r \
> +               -e 's/^(C|OP_C|HELPER_C)FLAGS=/\1FLAGS+=/' \
> +               "${S}"/Makefile "${S}"/Makefile.target
>  }
>
>  KVMENABLE = "--enable-kvm"
> diff --git a/meta/recipes-devtools/qemu/qemu/qemu-2.5.0-cflags.patch b/meta/recipes-devtools/qemu/qemu/qemu-2.5.0-cflags.patch
> new file mode 100644
> index 0000000..173394f
> --- /dev/null
> +++ b/meta/recipes-devtools/qemu/qemu/qemu-2.5.0-cflags.patch
> @@ -0,0 +1,13 @@
> +--- a/configure
> ++++ b/configure
> +@@ -4468,10 +4468,6 @@ fi
> + if test "$gcov" = "yes" ; then
> +   CFLAGS="-fprofile-arcs -ftest-coverage -g $CFLAGS"
> +   LDFLAGS="-fprofile-arcs -ftest-coverage $LDFLAGS"
> +-elif test "$fortify_source" = "yes" ; then
> +-  CFLAGS="-O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $CFLAGS"
> +-elif test "$debug" = "no"; then
> +-  CFLAGS="-O2 $CFLAGS"
> + fi
> +
> + ##########################################
> diff --git a/meta/recipes-devtools/qemu/qemu_2.6.0.bb b/meta/recipes-devtools/qemu/qemu_2.6.0.bb
> index e391326..735d013 100644
> --- a/meta/recipes-devtools/qemu/qemu_2.6.0.bb
> +++ b/meta/recipes-devtools/qemu/qemu_2.6.0.bb
> @@ -8,7 +8,9 @@ SRC_URI += "file://configure-fix-Darwin-target-detection.patch \
>              file://Qemu-Arm-versatilepb-Add-memory-size-checking.patch \
>              file://no-valgrind.patch \
>              file://pathlimit.patch \
> -           "
> +            file://qemu-2.5.0-cflags.patch \
> +"
> +
>  SRC_URI_prepend = "http://wiki.qemu-project.org/download/${BP}.tar.bz2"
>  SRC_URI[md5sum] = "ca3f70b43f093e33e9e014f144067f13"
>  SRC_URI[sha256sum] = "c9ac4a651b273233d21b8bec32e30507cb9cce7900841febc330956a1a8434ec"
> --
> 2.8.1
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] qemu-native: set ld.bfd, fix cflags, and set some environment vars
  2016-06-13  1:09 Stephen Arnold
  2016-06-13  1:23 ` Stephen Arnold
@ 2016-06-13 12:16 ` Burton, Ross
  2016-06-15 21:03 ` Khem Raj
  2 siblings, 0 replies; 10+ messages in thread
From: Burton, Ross @ 2016-06-13 12:16 UTC (permalink / raw)
  To: Stephen Arnold; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 669 bytes --]

On 13 June 2016 at 02:09, Stephen Arnold <sarnold@vctlabs.com> wrote:

> +++ b/meta/recipes-devtools/qemu/qemu/qemu-2.5.0-cflags.patch
> @@ -0,0 +1,13 @@
> +--- a/configure
> ++++ b/configure
> +@@ -4468,10 +4468,6 @@ fi
> + if test "$gcov" = "yes" ; then
> +   CFLAGS="-fprofile-arcs -ftest-coverage -g $CFLAGS"
> +   LDFLAGS="-fprofile-arcs -ftest-coverage $LDFLAGS"
> +-elif test "$fortify_source" = "yes" ; then
> +-  CFLAGS="-O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $CFLAGS"
> +-elif test "$debug" = "no"; then
> +-  CFLAGS="-O2 $CFLAGS"
> + fi
>

This patch needs an explanation in the header, an upstream status, and a
signed-off-by.

Ross

[-- Attachment #2: Type: text/html, Size: 1200 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] qemu-native: set ld.bfd, fix cflags, and set some environment vars
  2016-06-13  1:09 Stephen Arnold
@ 2016-06-13  1:23 ` Stephen Arnold
  2016-06-13 12:16 ` Burton, Ross
  2016-06-15 21:03 ` Khem Raj
  2 siblings, 0 replies; 10+ messages in thread
From: Stephen Arnold @ 2016-06-13  1:23 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

Okay, that wasn't supposed to cut off the v2 after PATCH...

Anyway, this is/was v2 for master branch (needs testing).

Steve

On Sun, Jun 12, 2016 at 6:09 PM, Stephen Arnold <sarnold@vctlabs.com> wrote:
> The main thing is build failures with gold linker, but qemu is also a
> little too aggressive at finding random tools on the build host, so we
> also set the build env for qemu-native and make sure it doesn't reset
> its own (hard-coded) cflags when we don't want it to.
>
> Signed-off-by: Stephen Arnold <sarnold@vctlabs.com>
> ---
>  meta/recipes-devtools/qemu/qemu.inc                     | 13 +++++++++++--
>  meta/recipes-devtools/qemu/qemu/qemu-2.5.0-cflags.patch | 13 +++++++++++++
>  meta/recipes-devtools/qemu/qemu_2.6.0.bb                |  4 +++-
>  3 files changed, 27 insertions(+), 3 deletions(-)
>  create mode 100644 meta/recipes-devtools/qemu/qemu/qemu-2.5.0-cflags.patch
>
> diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc
> index bf689bb..d5925fd 100644
> --- a/meta/recipes-devtools/qemu/qemu.inc
> +++ b/meta/recipes-devtools/qemu/qemu.inc
> @@ -30,8 +30,12 @@ SRC_URI_append_class-native = "\
>
>  EXTRA_OECONF += "--target-list=${@get_qemu_target_list(d)} --disable-werror  --disable-bluez --disable-libiscsi --with-system-pixman --extra-cflags='${CFLAGS}'"
>
> -EXTRA_OECONF_class-nativesdk = "--target-list=${@get_qemu_target_list(d)} --disable-werror \
> -                               "
> +EXTRA_OECONF_class-nativesdk = "--target-list=${@get_qemu_target_list(d)} --disable-werror"
> +
> +EXTRA_OEMAKE_append_class-native = " LD='${LD}' AR='${AR}' OBJCOPY='${OBJCOPY}' LDFLAGS='${LDFLAGS}'"
> +
> +LDFLAGS_append_class-native = " -fuse-ld=bfd"
> +
>  export LIBTOOL="${HOST_SYS}-libtool"
>
>  do_configure_prepend_class-native() {
> @@ -40,6 +44,11 @@ do_configure_prepend_class-native() {
>         if [ ! -z "$BHOST_PKGCONFIG_PATH" ]; then
>                 export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$BHOST_PKGCONFIG_PATH
>         fi
> +
> +       # Alter target makefiles to accept CFLAGS set via env
> +       sed -i -r \
> +               -e 's/^(C|OP_C|HELPER_C)FLAGS=/\1FLAGS+=/' \
> +               "${S}"/Makefile "${S}"/Makefile.target
>  }
>
>  KVMENABLE = "--enable-kvm"
> diff --git a/meta/recipes-devtools/qemu/qemu/qemu-2.5.0-cflags.patch b/meta/recipes-devtools/qemu/qemu/qemu-2.5.0-cflags.patch
> new file mode 100644
> index 0000000..173394f
> --- /dev/null
> +++ b/meta/recipes-devtools/qemu/qemu/qemu-2.5.0-cflags.patch
> @@ -0,0 +1,13 @@
> +--- a/configure
> ++++ b/configure
> +@@ -4468,10 +4468,6 @@ fi
> + if test "$gcov" = "yes" ; then
> +   CFLAGS="-fprofile-arcs -ftest-coverage -g $CFLAGS"
> +   LDFLAGS="-fprofile-arcs -ftest-coverage $LDFLAGS"
> +-elif test "$fortify_source" = "yes" ; then
> +-  CFLAGS="-O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $CFLAGS"
> +-elif test "$debug" = "no"; then
> +-  CFLAGS="-O2 $CFLAGS"
> + fi
> +
> + ##########################################
> diff --git a/meta/recipes-devtools/qemu/qemu_2.6.0.bb b/meta/recipes-devtools/qemu/qemu_2.6.0.bb
> index e391326..735d013 100644
> --- a/meta/recipes-devtools/qemu/qemu_2.6.0.bb
> +++ b/meta/recipes-devtools/qemu/qemu_2.6.0.bb
> @@ -8,7 +8,9 @@ SRC_URI += "file://configure-fix-Darwin-target-detection.patch \
>              file://Qemu-Arm-versatilepb-Add-memory-size-checking.patch \
>              file://no-valgrind.patch \
>              file://pathlimit.patch \
> -           "
> +            file://qemu-2.5.0-cflags.patch \
> +"
> +
>  SRC_URI_prepend = "http://wiki.qemu-project.org/download/${BP}.tar.bz2"
>  SRC_URI[md5sum] = "ca3f70b43f093e33e9e014f144067f13"
>  SRC_URI[sha256sum] = "c9ac4a651b273233d21b8bec32e30507cb9cce7900841febc330956a1a8434ec"
> --
> 2.8.1
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH] qemu-native: set ld.bfd, fix cflags, and set some environment vars
@ 2016-06-13  1:09 Stephen Arnold
  2016-06-13  1:23 ` Stephen Arnold
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Stephen Arnold @ 2016-06-13  1:09 UTC (permalink / raw)
  To: openembedded-core; +Cc: Stephen Arnold

The main thing is build failures with gold linker, but qemu is also a
little too aggressive at finding random tools on the build host, so we
also set the build env for qemu-native and make sure it doesn't reset
its own (hard-coded) cflags when we don't want it to.

Signed-off-by: Stephen Arnold <sarnold@vctlabs.com>
---
 meta/recipes-devtools/qemu/qemu.inc                     | 13 +++++++++++--
 meta/recipes-devtools/qemu/qemu/qemu-2.5.0-cflags.patch | 13 +++++++++++++
 meta/recipes-devtools/qemu/qemu_2.6.0.bb                |  4 +++-
 3 files changed, 27 insertions(+), 3 deletions(-)
 create mode 100644 meta/recipes-devtools/qemu/qemu/qemu-2.5.0-cflags.patch

diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc
index bf689bb..d5925fd 100644
--- a/meta/recipes-devtools/qemu/qemu.inc
+++ b/meta/recipes-devtools/qemu/qemu.inc
@@ -30,8 +30,12 @@ SRC_URI_append_class-native = "\
 
 EXTRA_OECONF += "--target-list=${@get_qemu_target_list(d)} --disable-werror  --disable-bluez --disable-libiscsi --with-system-pixman --extra-cflags='${CFLAGS}'"
 
-EXTRA_OECONF_class-nativesdk = "--target-list=${@get_qemu_target_list(d)} --disable-werror \
-				"
+EXTRA_OECONF_class-nativesdk = "--target-list=${@get_qemu_target_list(d)} --disable-werror"
+
+EXTRA_OEMAKE_append_class-native = " LD='${LD}' AR='${AR}' OBJCOPY='${OBJCOPY}' LDFLAGS='${LDFLAGS}'"
+
+LDFLAGS_append_class-native = " -fuse-ld=bfd"
+
 export LIBTOOL="${HOST_SYS}-libtool"
 
 do_configure_prepend_class-native() {
@@ -40,6 +44,11 @@ do_configure_prepend_class-native() {
 	if [ ! -z "$BHOST_PKGCONFIG_PATH" ]; then
 		export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$BHOST_PKGCONFIG_PATH
 	fi
+
+	# Alter target makefiles to accept CFLAGS set via env
+	sed -i -r \
+		-e 's/^(C|OP_C|HELPER_C)FLAGS=/\1FLAGS+=/' \
+		"${S}"/Makefile "${S}"/Makefile.target
 }
 
 KVMENABLE = "--enable-kvm"
diff --git a/meta/recipes-devtools/qemu/qemu/qemu-2.5.0-cflags.patch b/meta/recipes-devtools/qemu/qemu/qemu-2.5.0-cflags.patch
new file mode 100644
index 0000000..173394f
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/qemu-2.5.0-cflags.patch
@@ -0,0 +1,13 @@
+--- a/configure
++++ b/configure
+@@ -4468,10 +4468,6 @@ fi
+ if test "$gcov" = "yes" ; then
+   CFLAGS="-fprofile-arcs -ftest-coverage -g $CFLAGS"
+   LDFLAGS="-fprofile-arcs -ftest-coverage $LDFLAGS"
+-elif test "$fortify_source" = "yes" ; then
+-  CFLAGS="-O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $CFLAGS"
+-elif test "$debug" = "no"; then
+-  CFLAGS="-O2 $CFLAGS"
+ fi
+ 
+ ##########################################
diff --git a/meta/recipes-devtools/qemu/qemu_2.6.0.bb b/meta/recipes-devtools/qemu/qemu_2.6.0.bb
index e391326..735d013 100644
--- a/meta/recipes-devtools/qemu/qemu_2.6.0.bb
+++ b/meta/recipes-devtools/qemu/qemu_2.6.0.bb
@@ -8,7 +8,9 @@ SRC_URI += "file://configure-fix-Darwin-target-detection.patch \
             file://Qemu-Arm-versatilepb-Add-memory-size-checking.patch \
             file://no-valgrind.patch \
             file://pathlimit.patch \
-           "
+            file://qemu-2.5.0-cflags.patch \
+"
+
 SRC_URI_prepend = "http://wiki.qemu-project.org/download/${BP}.tar.bz2"
 SRC_URI[md5sum] = "ca3f70b43f093e33e9e014f144067f13"
 SRC_URI[sha256sum] = "c9ac4a651b273233d21b8bec32e30507cb9cce7900841febc330956a1a8434ec"
-- 
2.8.1



^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-06-21  1:03 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-08  0:00 [PATCH] qemu-native: set ld.bfd, fix cflags, and set some environment vars Stephen Arnold
2016-06-08 10:10 ` Burton, Ross
2016-06-13  1:09 Stephen Arnold
2016-06-13  1:23 ` Stephen Arnold
2016-06-13 12:16 ` Burton, Ross
2016-06-15 21:03 ` Khem Raj
2016-06-15 21:39   ` Stephen Arnold
2016-06-19 19:40 Stephen Arnold
2016-06-19 22:32 ` Stephen Arnold
2016-06-21  0:54 Stephen Arnold

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.