From patchwork Wed Apr 21 21:26:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adolf Belka X-Patchwork-Id: 4197 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4FQYXJ56Ykz44R5 for ; Wed, 21 Apr 2021 21:26:40 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4FQYXJ27PDz2ZP; Wed, 21 Apr 2021 21:26:40 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4FQYXJ1Hf3z2ybC; Wed, 21 Apr 2021 21:26:40 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4FQYXH0W1rz2xmd for ; Wed, 21 Apr 2021 21:26:39 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4FQYXG4np4zZN; Wed, 21 Apr 2021 21:26:38 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1619040398; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9992Pca7zLW5huwYWz+A1CVvAfpsOY60LuI5ge7yWkw=; b=hClPVgbUQULnjDZ8qmOkYAbnWp4YvY5zF/zNJFnrj96t5kmjTyFVZz0YIPUgxFSyuZKyaJ m6oE//cSiNug7kBg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1619040398; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9992Pca7zLW5huwYWz+A1CVvAfpsOY60LuI5ge7yWkw=; b=TAlFfQkrqumgclHAasEW4iwsV+hyLUoUN6ZrilN5ZGwpxbtJuxvhlacfE2gKI7juHqvSw+ ax+aRgcWM68PRicCojcQ4usZ6tedRNELmb0+B2Vms6M05hzic8ScQq8Kn5nGbJABfJP9A/ 7I/w1r3IYTyZNmid996Vh2vzy7QRyuvKczRilZvHSSXmpYmovMeeJLVGo7ATfMrWU4wOgi 32qjm3ZOd0W9E/CYVByQB4paqkyy3l7x+N1BtzBVwceLIzJI0N/NKfD+qLV4h5nFqGYxMg U/767bK0fzBDjRpHanpT81mIXJy0MiNEiFfkoclDGRPu9eIgAyXmMbOgcEpyRg== From: Adolf Belka To: development@lists.ipfire.org Subject: [PATCH 3/4] qemu: Patch required to build with updated binutils-2.36.1 Date: Wed, 21 Apr 2021 23:26:25 +0200 Message-Id: <20210421212626.2729436-3-adolf.belka@ipfire.org> In-Reply-To: <20210421212626.2729436-1-adolf.belka@ipfire.org> References: <20210421212626.2729436-1-adolf.belka@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" - Updated binutils caused failure in build of qemu Patch solved the problem This removes the -no-pie flag - Thanks to Michael Tremer and Marcel Lorenz for guidance on the patch Signed-off-by: Adolf Belka --- lfs/qemu | 4 +- src/patches/qemu-5.2.0-no-pie.patch | 67 +++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 src/patches/qemu-5.2.0-no-pie.patch diff --git a/lfs/qemu b/lfs/qemu index aa09fa0ca..77bd00287 100644 --- a/lfs/qemu +++ b/lfs/qemu @@ -33,7 +33,7 @@ DIR_APP = $(DIR_SRC)/$(THISAPP) TARGET = $(DIR_INFO)/$(THISAPP) SUP_ARCH = i586 x86_64 PROG = qemu -PAK_VER = 30 +PAK_VER = 31 DEPS = libusbredir spice libseccomp @@ -88,6 +88,8 @@ $(subst %,%_MD5,$(objects)) : $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) @$(PREBUILD) @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE) + + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/qemu-5.2.0-no-pie.patch cd $(DIR_APP) && ./configure \ --prefix=/usr \ --sysconfdir=/etc \ diff --git a/src/patches/qemu-5.2.0-no-pie.patch b/src/patches/qemu-5.2.0-no-pie.patch new file mode 100644 index 000000000..8f3f4d590 --- /dev/null +++ b/src/patches/qemu-5.2.0-no-pie.patch @@ -0,0 +1,67 @@ +Recent binutils changes dropping unsupported options [1] caused a build +issue in regard to the optionroms. + + ld -m elf_i386 -T /<>/pc-bios/optionrom//flat.lds -no-pie \ + -s -o multiboot.img multiboot.o + ld.bfd: Error: unable to disambiguate: -no-pie (did you mean --no-pie ?) + +This isn't really a regression in ld.bfd, filing the bug upstream +revealed that this never worked as a ld flag [2] - in fact it seems we +were by accident setting --nmagic). + +Since it never had the wanted effect this usage of LDFLAGS_NOPIE, should be +droppable without any effect. This also is the only use-case of LDFLAGS_NOPIE +in .mak, therefore we can also remove it from being added there. + +[1]: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=983d925d +[2]: https://sourceware.org/bugzilla/show_bug.cgi?id=27050#c5 + +Signed-off-by: Christian Ehrhardt +--- + configure | 3 --- + pc-bios/optionrom/Makefile | 1 - + 2 files changed, 4 deletions(-) + +diff --git a/configure b/configure +index 3f823ed163..61c17c2dde 100755 +--- a/configure ++++ b/configure +@@ -2133,7 +2133,6 @@ EOF + # Check we support --no-pie first; we will need this for building ROMs. + if compile_prog "-Werror -fno-pie" "-no-pie"; then + CFLAGS_NOPIE="-fno-pie" +- LDFLAGS_NOPIE="-no-pie" + fi + + if test "$static" = "yes"; then +@@ -2149,7 +2148,6 @@ if test "$static" = "yes"; then + fi + elif test "$pie" = "no"; then + CONFIGURE_CFLAGS="$CFLAGS_NOPIE $CONFIGURE_CFLAGS" +- CONFIGURE_LDFLAGS="$LDFLAGS_NOPIE $CONFIGURE_LDFLAGS" + elif compile_prog "-Werror -fPIE -DPIE" "-pie"; then + CONFIGURE_CFLAGS="-fPIE -DPIE $CONFIGURE_CFLAGS" + CONFIGURE_LDFLAGS="-pie $CONFIGURE_LDFLAGS" +@@ -6768,7 +6766,6 @@ echo "QEMU_CXXFLAGS=$QEMU_CXXFLAGS" >> $config_host_mak + echo "GLIB_CFLAGS=$glib_cflags" >> $config_host_mak + echo "GLIB_LIBS=$glib_libs" >> $config_host_mak + echo "QEMU_LDFLAGS=$QEMU_LDFLAGS" >> $config_host_mak +-echo "LDFLAGS_NOPIE=$LDFLAGS_NOPIE" >> $config_host_mak + echo "LD_I386_EMULATION=$ld_i386_emulation" >> $config_host_mak + echo "EXESUF=$EXESUF" >> $config_host_mak + echo "HOST_DSOSUF=$HOST_DSOSUF" >> $config_host_mak +diff --git a/pc-bios/optionrom/Makefile b/pc-bios/optionrom/Makefile +index 084fc10f05..30771f8d17 100644 +--- a/pc-bios/optionrom/Makefile ++++ b/pc-bios/optionrom/Makefile +@@ -41,7 +41,6 @@ override CFLAGS += $(call cc-option, $(Wa)-32) + + LD_I386_EMULATION ?= elf_i386 + override LDFLAGS = -m $(LD_I386_EMULATION) -T $(SRC_DIR)/flat.lds +-override LDFLAGS += $(LDFLAGS_NOPIE) + + all: multiboot.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin pvh.bin + +-- +2.29.2 +