From nobody Fri Nov 14 05:16:45 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1585230271; cv=none; d=zohomail.com; s=zohoarc; b=TvLZnw6zDiSnh7Nk0xXo3ZlQCHXVe3llWPLGfUpoH2ickvql9nX0j1TDKJGzqkb96NO2wB2aBqPTQBJYt6OgNviOyckfbnfLPS/c5/Tj/Be28BjDOgOnC61yvloCLVz8B8KxL6JucQ0+BdDJRFUmsdxLG9mTLFbnjsRtIvZbwE0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585230271; h=Content-Type: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=ytptqUP4Ed5IcNztGNg5s7fneF0UWCazjCtU1oGNex8=; b=RroR988SMvdcHfW7kJ/lCobotqnXnL11zQI0cDEDu+AHxMyKd1HwEnr2qUUzjYBh9wwqBDJA9w0B8ZROmTIn68XsgsmaIGj7ARkY6Nsmg7AfV2Z7FnWD14osev7oiXYFfcO3zs2mD1LaNQMjTWr2RQ4mhayDMLZcRpU5vxRpaZU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 1585230271352386.9756778748666; Thu, 26 Mar 2020 06:44:31 -0700 (PDT) Received: from localhost ([::1]:52046 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHSo8-00077l-5Q for importer@patchew.org; Thu, 26 Mar 2020 09:44:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58295) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHSnK-0006Ep-9L for qemu-devel@nongnu.org; Thu, 26 Mar 2020 09:43:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHSnJ-0002fj-1f for qemu-devel@nongnu.org; Thu, 26 Mar 2020 09:43:38 -0400 Received: from esa2.hc3370-68.iphmx.com ([216.71.145.153]:44959) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jHSnI-0002ee-NW for qemu-devel@nongnu.org; Thu, 26 Mar 2020 09:43:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1585230217; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=dLmyqyhGeopiywpiXKWNNgDa9zmcQBLA4yhnWSTaxCY=; b=IjG+/9PiBMbdrRi2vBFDfMRmswVSXnr2Q+mHglBCM2cHUNiBQvwzZa+T yyQxwXT3BFAG18939UEFh06EzAaOP7nEp/3jLnRDed5KE5yVbi6L4mAwv vWfpuW0mciK3CFKahpVkSLjGY66NpSGSLkZsiPbjjWYrC0D0IhzogQ1Kb w=; Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=roger.pau@citrix.com; spf=Pass smtp.mailfrom=roger.pau@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com 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 (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of roger.pau@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="roger.pau@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa2.hc3370-68.iphmx.com: domain of roger.pau@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="roger.pau@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ip4:168.245.78.127 ~all" Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: bRVLWcKMW78I3KXDW5GDWpI+oOgJx89dUf2WEmRQ6KC5+vyCIqbHEzNJpg4LshFRDOnomy8U78 dD2go9bU5omzasWAD/Bkd2HjMryOGYaBWrHFHRiJRuy5Qd4PvnbnA5evEs8/gA89l4MfiSYMlP Ht2olHspNvgu5jRnInGytVemTCKI88eKI6xYdUPsWjhLzCI3/HiziZH+f1GULyaCYNa9rCB0h4 MIz/nciYmen4itmKcLKejIkrf75wCz2Ih/MQiR06z2dj8BSrNg/6iDOOciTsX95ZCA9OQtOcSb qPw= X-SBRS: 2.7 X-MesageID: 14692363 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.72,308,1580792400"; d="scan'208";a="14692363" From: Roger Pau Monne To: Subject: [PATCH] qemu-user: fix build with LLVM lld 10 Date: Thu, 26 Mar 2020 14:43:16 +0100 Message-ID: <20200326134316.36059-1-roger.pau@citrix.com> X-Mailer: git-send-email 2.26.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 216.71.145.153 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: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Dimitry Andric , Richard Henderson , Laurent Vivier , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Roger Pau Monne Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) lld 10.0.0 introduced a new linker option --image-base equivalent to the GNU -Ttext-segment one, hence use it when available. This fixes the build of QEMU on systems using lld 10 or greater. Signed-off-by: Dimitry Andric Signed-off-by: Roger Pau Monn=C3=A9 --- Cc: Laurent Vivier Cc: Richard Henderson Cc: "Philippe Mathieu-Daud=C3=A9" Cc: Paolo Bonzini Cc: "Daniel P. Berrang=C3=A9" --- configure | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/configure b/configure index da09c35895..92d57d84fa 100755 --- a/configure +++ b/configure @@ -6514,27 +6514,31 @@ if ( [ "$linux_user" =3D yes ] || [ "$bsd_user" =3D= yes ] ) && [ "$pie" =3D no ]; then cat > $TMPC </dev/null 2>&1; then - error_exit \ - "We need to link the QEMU user mode binaries at a" \ - "specific text address. Unfortunately your linker" \ - "doesn't support either the -Ttext-segment option or" \ - "printing the default linker script with --verbose." \ - "If you don't want the user mode binaries, pass the" \ - "--disable-user option to configure." - fi + textseg_ldflags=3D"-Wl,-Ttext-segment=3D$textseg_addr" + if ! compile_prog "" "$textseg_ldflags"; then + # In case ld does not support -Ttext-segment, edit the default lin= ker + # script via sed to set the .text start addr. This is needed on F= reeBSD + # at least. + if ! $ld --verbose >/dev/null 2>&1; then + error_exit \ + "We need to link the QEMU user mode binaries at a" \ + "specific text address. Unfortunately your linker" \ + "doesn't support either the --image-base or -Ttext-segment" \ + "options or printing the default linker script with" \ + "--verbose. If you don't want the user mode binaries," \ + "pass the --disable-user option to configure." + fi =20 - $ld --verbose | sed \ - -e '1,/=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D/d' \ - -e '/=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D/,$d' \ - -e "s/[.] =3D [0-9a-fx]* [+] SIZEOF_HEADERS/. =3D $textseg_addr + = SIZEOF_HEADERS/" \ - -e "s/__executable_start =3D [0-9a-fx]*/__executable_start =3D $te= xtseg_addr/" > config-host.ld - textseg_ldflags=3D"-Wl,-T../config-host.ld" + $ld --verbose | sed \ + -e '1,/=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D/d' \ + -e '/=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D/,$d' \ + -e "s/[.] =3D [0-9a-fx]* [+] SIZEOF_HEADERS/. =3D $textseg_addr = + SIZEOF_HEADERS/" \ + -e "s/__executable_start =3D [0-9a-fx]*/__executable_start =3D $= textseg_addr/" > config-host.ld + textseg_ldflags=3D"-Wl,-T../config-host.ld" + fi fi fi fi --=20 2.26.0