From nobody Tue Feb 10 07:23:59 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1654108308; cv=none; d=zohomail.com; s=zohoarc; b=BBpqYz+P7m8jUPna+irxb/XlnVMXlAfuA+2QZ5VEIm9pMJqNl7NBNY2YJCLRAqYWaA7iq+RcSjrBhd6Z7j9Ah+aBLH2chcRaNE4i1epvjxy8Q5L8nw9F1A8x05ZQJ1iRi0+CvP7chD3J4R7rVg5Vnb62OFMyx9aAc1j2k1rUWyU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1654108308; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=3D8/UyD+ztVeocgeehcA/xb0KzGAE86uC41XX1vBnSs=; b=HQAL01rVLw68a+g5C602zWcg50fErzupH3a+/NihJnO+8BC5Vcb7jP/BhmGB6lcEM6uW661ux76l6L5QyfE8wmbbcUrlvUKj/k9PJNti5qx/uoR/6f3Tvz+irxKqUjcc+C6xbA9Jaz/7TyyL755Ro+2yDopEN1QuKbvkmoZSgQc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1654108308469334.0614991951318; Wed, 1 Jun 2022 11:31:48 -0700 (PDT) Received: from localhost ([::1]:39270 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nwT8F-000580-DC for importer@patchew.org; Wed, 01 Jun 2022 14:31:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52698) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nwSr5-0001dx-DO for qemu-devel@nongnu.org; Wed, 01 Jun 2022 14:14:03 -0400 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]:45961) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nwSr3-0006Xa-Hy for qemu-devel@nongnu.org; Wed, 01 Jun 2022 14:14:03 -0400 Received: by mail-ej1-x62e.google.com with SMTP id jx22so5361624ejb.12 for ; Wed, 01 Jun 2022 11:14:00 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id m3-20020aa7c483000000b0042de29d8fc0sm1329097edq.94.2022.06.01.11.13.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 11:13:57 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 15D481FFD0; Wed, 1 Jun 2022 19:05:40 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3D8/UyD+ztVeocgeehcA/xb0KzGAE86uC41XX1vBnSs=; b=wEHO5EN1aGj4BbNXnK77aPshmjP+Ksk+4YpNovNp6ZZW5AkTwrI4S2j1ckcIsFzUrO u3aDFSYb3U8kmZRzfMrRu3522JnfigsrbA1wfB8BP031QbSzd0zR1KVJp/yfAC5w/uOu RngoonLfaz1efkh6qsF6owusdN2Y4ebG2mPToopZiq4lN860oPDHMtkgNTH8ylhKtngg 5DKA9GUWaw2Ryiz1n9MaxO2aM8T7J0w/NsVvDLMXEDYt7CiO0FAK9iyFszFilx/mUgxy s4HjJeGB1xc25D943jVVuYUCb9SQzqufAwYxOEDdZNXHYMVhyc6fvxDMJk77GP5Q7fyP N5ZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3D8/UyD+ztVeocgeehcA/xb0KzGAE86uC41XX1vBnSs=; b=57VaqCf/i+LkJButQr2o252cxxvwhM2cEFZkOE2NDAxH1bSRSGRERb3/OuINwHY0H3 hiBM3uELU/2OlqkmAn7UAHlmneF+HqaZ9iTY2waENNw9IOkejM5frMidw5khdwU58fMW Y/+uK3Zfdll9DuYjlYwvJnnNcRJGBPsMEFd1QKhNKqlz/spEC+onfkTglR5lzSQdGtkE yf/ptcJ44LeVaCsHu28uPrYH5ZRP8MUPBGu6mOsB9JwkOE4gE+BplZmHbpxtI1J6dU0f PTIAGMxrgKtpMuycwQzHtP+z9I4ETmn8vcVeiNrOivgT+vdL94XspWiyJOewh05hgjNT M1rg== X-Gm-Message-State: AOAM532FzXHOz0IaPhnBz9Gahs5T2DIfGjJrskOs473aXL49VDRBnQuh LC18YzGWyHKgg3YrSR6WMxxeKg== X-Google-Smtp-Source: ABdhPJygpemRDc+iXtpuVJBBJGmI4e/0gts0XggJV4N9gJD3zC3L+jwujoIAOtHoLElEOUy5zD3GNw== X-Received: by 2002:a17:906:6a29:b0:705:dc2b:727b with SMTP id qw41-20020a1709066a2900b00705dc2b727bmr737227ejc.80.1654107239012; Wed, 01 Jun 2022 11:13:59 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: peter.maydell@linaro.org, richard.henderson@linaro.org Cc: qemu-devel@nongnu.org, Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PULL 25/33] configure: enable cross-compilation of optionrom Date: Wed, 1 Jun 2022 19:05:29 +0100 Message-Id: <20220601180537.2329566-26-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220601180537.2329566-1-alex.bennee@linaro.org> References: <20220601180537.2329566-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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: pass client-ip=2a00:1450:4864:20::62e; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1654108308800100001 From: Paolo Bonzini While container-based cross compilers are not supported, this already makes it possible to build x86 optionroms on any machine that has an installation of GCC and binutils for 32- or 64-bit x86. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini Message-Id: <20220517092616.1272238-15-pbonzini@redhat.com> Signed-off-by: Alex Benn=C3=A9e Message-Id: <20220527153603.887929-26-alex.bennee@linaro.org> diff --git a/configure b/configure index f509bce304..1ae5c950f0 100755 --- a/configure +++ b/configure @@ -2082,6 +2082,13 @@ probe_target_compiler() { fi } =20 +probe_target_compilers() { + for i; do + probe_target_compiler $i + test -n "$target_cc" && return 0 + done +} + write_target_makefile() { if test -n "$target_cc"; then echo "CC=3D$target_cc" @@ -2190,6 +2197,10 @@ if test "$QEMU_GA_VERSION" =3D ""; then QEMU_GA_VERSION=3D$(cat $source_path/VERSION) fi =20 + +####################################### +# cross-compiled firmware targets + # Set up build tree symlinks that point back into the source tree # (these can be both files and directories). # Caution: avoid adding files or directories here using wildcards. This @@ -2216,19 +2227,27 @@ done =20 # Mac OS X ships with a broken assembler roms=3D -if { test "$cpu" =3D "i386" || test "$cpu" =3D "x86_64"; } && \ +probe_target_compilers i386 x86_64 +if test -n "$target_cc" && test "$targetos" !=3D "darwin" && test "$targetos" !=3D "sunos" &&= \ test "$targetos" !=3D "haiku" && test "$softmmu" =3D yes ; then # Different host OS linkers have different ideas about the name of the= ELF # emulation. Linux and OpenBSD/amd64 use 'elf_i386'; FreeBSD uses the = _fbsd # variant; OpenBSD/i386 uses the _obsd variant; and Windows uses i386p= e. for emu in elf_i386 elf_i386_fbsd elf_i386_obsd i386pe; do - if "$ld" -verbose 2>&1 | grep -q "^[[:space:]]*$emu[[:space:]]*$";= then + if "$target_ld" -verbose 2>&1 | grep -q "^[[:space:]]*$emu[[:space= :]]*$"; then ld_i386_emulation=3D"$emu" - roms=3D"optionrom" break fi done + if test -n "$ld_i386_emulation"; then + roms=3D"optionrom" + config_mak=3Dpc-bios/optionrom/config.mak + echo "# Automatically generated by configure - do not modify" > $c= onfig_mak + echo "TOPSRC_DIR=3D$source_path" >> $config_mak + echo "LD_I386_EMULATION=3D$ld_i386_emulation" >> $config_mak + write_target_makefile >> $config_mak + fi fi =20 # Only build s390-ccw bios if the compiler has -march=3Dz900 or -march=3Dz= 10 @@ -2381,7 +2400,6 @@ echo "GLIB_LIBS=3D$glib_libs" >> $config_host_mak echo "GLIB_BINDIR=3D$glib_bindir" >> $config_host_mak echo "GLIB_VERSION=3D$(pkg-config --modversion glib-2.0)" >> $config_host_= mak echo "QEMU_LDFLAGS=3D$QEMU_LDFLAGS" >> $config_host_mak -echo "LD_I386_EMULATION=3D$ld_i386_emulation" >> $config_host_mak echo "STRIP=3D$strip" >> $config_host_mak echo "EXESUF=3D$EXESUF" >> $config_host_mak =20 @@ -2571,10 +2589,6 @@ for target in $target_list; do done echo "TCG_TESTS_TARGETS=3D$tcg_tests_targets" >> $makefile) =20 -config_mak=3Dpc-bios/optionrom/config.mak -echo "# Automatically generated by configure - do not modify" > $config_mak -echo "TOPSRC_DIR=3D$source_path" >> $config_mak - if test "$skip_meson" =3D no; then cross=3D"config-meson.cross.new" meson_quote() { diff --git a/pc-bios/optionrom/Makefile b/pc-bios/optionrom/Makefile index 17ccc76241..f639915b4f 100644 --- a/pc-bios/optionrom/Makefile +++ b/pc-bios/optionrom/Makefile @@ -6,7 +6,6 @@ all: multiboot.bin multiboot_dma.bin linuxboot.bin linuxboo= t_dma.bin kvmvapic.bi # Dummy command so that make thinks it has done something @true =20 -include ../../config-host.mak CFLAGS =3D -O2 -g =20 quiet-command =3D $(if $(V),$1,$(if $(2),@printf " %-7s %s\n" $2 $3 && $1= , @$1)) @@ -44,7 +43,6 @@ Wa =3D -Wa, override ASFLAGS +=3D -32 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 =20 pvh.img: pvh.o pvh_main.o --=20 2.30.2