qemu-native: set ld.bfd, fix cflags, and set some environment vars
PATCH 1/1 qemu-native: set ld.bfd, fix cflags, and set some environment vars
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 <[email protected]>
--- 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
meta/recipes-devtools/qemu/qemu.inc +11 -2
@@ -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"
meta/recipes-devtools/qemu/qemu/qemu-2.5.0-cflags.patch new file +13 -0
@@ -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 + + ##########################################
meta/recipes-devtools/qemu/qemu_2.5.0.bb +1 -0
@@ -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"
Signature · 1 line
2.8.1
Quoted 4 lines · Stephen Arnold
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