From nobody Tue Nov 18 02:53:52 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=canonical.com ARC-Seal: i=1; a=rsa-sha256; t=1607972313; cv=none; d=zohomail.com; s=zohoarc; b=nUq9GD1qX9m3xzIHmdj9PbmPXaVXCXC/J3b4GE/UOqBta5SYuZoigD9XYup21K5p+kaF0A+b0lp6f//KWy4nPy15pkod0UwLxQlzvaf+O09RJ0nwNhMMiSNqfMWptOlIwUmwo16/lLnZBiCjfo9Vk0liuwm4N0xyfDs/81wiNH4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607972313; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=mGJ7qMiKuDkxloRkYLXFoZKeLxLK0fQ0I/ATkx3zw/M=; b=ibCYNbGOLFOOVYRd9MkRcFbFtcXbzc4R9mngtuc9KBYWMAqz9dVbvG3sEG/jBDI/giBxCS76yTOHXU4DuyetwLvXlpu+5WuC6sOgM9Zc1cbrjxkpKIyw39bNKpljE1GofqsYOv/tEvkmrhIFIk80tyj/b4jcpOoz8okJHKZ/tjc= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1607972313602599.7484170226678; Mon, 14 Dec 2020 10:58:33 -0800 (PST) Received: from localhost ([::1]:40758 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kopUv-0004zc-ND for importer@patchew.org; Mon, 14 Dec 2020 10:10:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51332) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kopTx-0003yZ-Ds for qemu-devel@nongnu.org; Mon, 14 Dec 2020 10:09:49 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:40898) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.90_1) (envelope-from ) id 1kopTv-0003VL-I9 for qemu-devel@nongnu.org; Mon, 14 Dec 2020 10:09:49 -0500 Received: from 2.general.paelzer.uk.vpn ([10.172.196.173] helo=Keschdeichel.fritz.box) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kopTs-0006WB-D8; Mon, 14 Dec 2020 15:09:44 +0000 From: Christian Ehrhardt To: qemu-devel Subject: [PATCH] build: -no-pie is no functional linker flag Date: Mon, 14 Dec 2020 16:09:38 +0100 Message-Id: <20201214150938.1297512-1-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=91.189.89.112; envelope-from=christian.ehrhardt@canonical.com; helo=youngberry.canonical.com X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Christian Ehrhardt Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" 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_NOP= IE in .mak, therefore we can also remove it from being added there. [1]: https://sourceware.org/git/?p=3Dbinutils-gdb.git;a=3Dcommit;h=3D983d92= 5d [2]: https://sourceware.org/bugzilla/show_bug.cgi?id=3D27050#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=3D"-fno-pie" - LDFLAGS_NOPIE=3D"-no-pie" fi =20 if test "$static" =3D "yes"; then @@ -2149,7 +2148,6 @@ if test "$static" =3D "yes"; then fi elif test "$pie" =3D "no"; then CONFIGURE_CFLAGS=3D"$CFLAGS_NOPIE $CONFIGURE_CFLAGS" - CONFIGURE_LDFLAGS=3D"$LDFLAGS_NOPIE $CONFIGURE_LDFLAGS" elif compile_prog "-Werror -fPIE -DPIE" "-pie"; then CONFIGURE_CFLAGS=3D"-fPIE -DPIE $CONFIGURE_CFLAGS" CONFIGURE_LDFLAGS=3D"-pie $CONFIGURE_LDFLAGS" @@ -6768,7 +6766,6 @@ echo "QEMU_CXXFLAGS=3D$QEMU_CXXFLAGS" >> $config_host= _mak echo "GLIB_CFLAGS=3D$glib_cflags" >> $config_host_mak echo "GLIB_LIBS=3D$glib_libs" >> $config_host_mak echo "QEMU_LDFLAGS=3D$QEMU_LDFLAGS" >> $config_host_mak -echo "LDFLAGS_NOPIE=3D$LDFLAGS_NOPIE" >> $config_host_mak echo "LD_I386_EMULATION=3D$ld_i386_emulation" >> $config_host_mak echo "EXESUF=3D$EXESUF" >> $config_host_mak echo "HOST_DSOSUF=3D$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 +=3D $(call cc-option, $(Wa)-32) =20 LD_I386_EMULATION ?=3D elf_i386 override LDFLAGS =3D -m $(LD_I386_EMULATION) -T $(SRC_DIR)/flat.lds -override LDFLAGS +=3D $(LDFLAGS_NOPIE) =20 all: multiboot.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin pvh.bin =20 --=20 2.29.2