From nobody Mon Feb 9 20:32:48 2026 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651242412863975.3231449235055; Fri, 29 Apr 2022 07:26:52 -0700 (PDT) Received: from localhost ([::1]:46302 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nkRa7-0005OC-Rc for importer@patchew.org; Fri, 29 Apr 2022 10:26:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58064) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nkRRx-0005kc-HV for qemu-devel@nongnu.org; Fri, 29 Apr 2022 10:18:26 -0400 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]:45985) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nkRRv-0004Zb-Qq for qemu-devel@nongnu.org; Fri, 29 Apr 2022 10:18:25 -0400 Received: by mail-ej1-x633.google.com with SMTP id y3so15684929ejo.12 for ; Fri, 29 Apr 2022 07:18:23 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id jz1-20020a17090775e100b006f3ef214e27sm692298ejc.141.2022.04.29.07.18.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Apr 2022 07:18:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=R/i+EfOfUAftxgvGpFuIKRv6QIV6ur0Tq52pMurNusU=; b=OBEgJzULWHfPQqT7zq2jEC9Ft0kII+0m60YAUcxwM3NqrunnuuQQuht8q3ig3bOfZh YJySsser33hbQS8VQiHP3cgoR+jU7gsZaMJQswfWniHgf5JEB/p2a4hnApFMfte5wONr E0RVheFq+yMdSL+59xf3KEA9bnganf61K/p6FHRzIesFLzNdwmHQVSHhob/IAfdu9sOx FP+r1h8gIt0HTkYi9P8tWvc493rlX9lZ/+cKAJiSCO7tMcW5Ok4T4MD4eAk/8HGdP6Cs Z6R2t9FO8v9YmPNdaw1l9IAVh0vZBoSvcriqP/1UDsb/+LB6GEvc+QyMmEtD7aUNg8DB vpvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=R/i+EfOfUAftxgvGpFuIKRv6QIV6ur0Tq52pMurNusU=; b=UEF7pPhQEgJbVCsGU5I+Cd2HHwnSJX5KRBYpbIMM1B0fP77X5grKuXdPfVkv9c2DhR OluHZfpJgRxcEQI9WMF4loYmDUIn+IFbBWHlkVslxlm4Wbqh79Rgr+lcM5hTpthQyHQJ ddBM2lRh19gMRCrByRm5bRb3jelwzYit4kHEm6fNceTRcYQIkQA/jxidyGLf1ffcNybI /Wb8tyzn2/aftQ4w0hw99jn9jldP/kUrIEo6xSkNaIl7CRKlkCTN2YBegTDiYA+BZ1EZ 6+ej5S2RYt6+rpSWPKYKhMHLOzhDU4mjLOFEiYgZDm/zsShjwit+8sZA69CXJbw2bvSm KE9A== X-Gm-Message-State: AOAM530zvZNPYAj5aKuFAjXFDrvRrKK0V07abF3kHh8sgIqzkesx6doW C+aAEdU0ITXQeSAirh0L6nFhZjSo/6ZTlg== X-Google-Smtp-Source: ABdhPJwKHszpH8+5Ci65hjyL9ZMtYZl1FuW8lNjaIQ9PtfnUXEjGZ4eyS3ORIsTb54CdMou88QNygQ== X-Received: by 2002:a17:906:7751:b0:6ce:e3c:81a6 with SMTP id o17-20020a170906775100b006ce0e3c81a6mr34806503ejn.278.1651241902482; Fri, 29 Apr 2022 07:18:22 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [RFC PATCH 08/12] configure: enable cross-compilation of s390-ccw Date: Fri, 29 Apr 2022 16:18:09 +0200 Message-Id: <20220429141813.328975-9-pbonzini@redhat.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220429141813.328975-1-pbonzini@redhat.com> References: <20220429141813.328975-1-pbonzini@redhat.com> 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: pass client-ip=2a00:1450:4864:20::633; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x633.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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: , Cc: alex.bennee@linaro.org, richard.henderson@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1651242414901100001 Content-Type: text/plain; charset="utf-8" While container-based cross compilers are not supported, this already makes it possible to build s390-ccw on any machine that has s390x GCC and binutils installed. Signed-off-by: Paolo Bonzini Reviewed-by: Richard Henderson --- configure | 18 +++++++++++++----- pc-bios/s390-ccw/Makefile | 9 +++++---- pc-bios/s390-ccw/netboot.mak | 2 +- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/configure b/configure index de2bc799cd..5c34d8ffc2 100755 --- a/configure +++ b/configure @@ -2251,24 +2251,32 @@ if { test "$cpu" =3D "i386" || test "$cpu" =3D "x86= _64"; } && \ done fi =20 -# Only build s390-ccw bios if we're on s390x and the compiler has -march= =3Dz900 -# or -march=3Dz10 (which is the lowest architecture level that Clang suppo= rts) -if test "$cpu" =3D "s390x" ; then +# Only build s390-ccw bios the compiler has -march=3Dz900 or -march=3Dz10 = (which is +# the lowest architecture level that Clang supports) +probe_target_compiler s390x +if test -n "$target_cc" && test "$softmmu" =3D yes; then write_c_skeleton - compile_prog "-march=3Dz900" "" + do_compiler "$target_cc" $target_cc_cflags -march=3Dz900 -o $TMPO -c $TM= PC has_z900=3D$? - if [ $has_z900 =3D 0 ] || compile_object "-march=3Dz10 -msoft-float -Wer= ror"; then + if [ $has_z900 =3D 0 ] || do_compiler "$target_cc" $target_cc_cflags -ma= rch=3Dz10 -msoft-float -Werror -o $TMPO -c $TMPC; then if [ $has_z900 !=3D 0 ]; then echo "WARNING: Your compiler does not support the z900!" echo " The s390-ccw bios will only work with guest CPUs >=3D= z10." fi roms=3D"$roms s390-ccw" + config_mak=3Dpc-bios/s390-ccw/config-host.mak + echo "# Automatically generated by configure - do not modify" > $confi= g_mak + echo "SRC_PATH=3D$source_path/pc-bios/s390-ccw" >> $config_mak + write_target_makefile >> $config_mak # SLOF is required for building the s390-ccw firmware on s390x, # since it is using the libnet code from SLOF for network booting. git_submodules=3D"${git_submodules} roms/SLOF" fi fi =20 +####################################### +# generate config-host.mak + # Check that the C++ compiler exists and works with the C compiler. # All the QEMU_CXXFLAGS are based on QEMU_CFLAGS. Keep this at the end to = don't miss any other that could be added. if has $cxx; then diff --git a/pc-bios/s390-ccw/Makefile b/pc-bios/s390-ccw/Makefile index 0eb68efc7b..6eb713bf37 100644 --- a/pc-bios/s390-ccw/Makefile +++ b/pc-bios/s390-ccw/Makefile @@ -2,8 +2,9 @@ all: build-all # Dummy command so that make thinks it has done something @true =20 -include ../../config-host.mak +include config-host.mak CFLAGS =3D -O2 -g +MAKEFLAGS +=3D -rR =20 quiet-command =3D $(if $(V),$1,$(if $(2),@printf " %-7s %s\n" $2 $3 && $1= , @$1)) cc-option =3D $(if $(shell $(CC) $1 $2 -S -o /dev/null -xc /dev/null \ @@ -11,7 +12,7 @@ cc-option =3D $(if $(shell $(CC) $1 $2 -S -o /dev/null -x= c /dev/null \ =20 VPATH_SUFFIXES =3D %.c %.h %.S %.m %.mak %.sh %.rc Kconfig% %.json.in set-vpath =3D $(if $1,$(foreach PATTERN,$(VPATH_SUFFIXES),$(eval vpath $(P= ATTERN) $1))) -$(call set-vpath, $(SRC_PATH)/pc-bios/s390-ccw) +$(call set-vpath, $(SRC_PATH)) =20 # Flags for dependency generation QEMU_DGFLAGS =3D -MMD -MP -MT $@ -MF $(@D)/$(*F).d @@ -49,8 +50,8 @@ s390-ccw.img: s390-ccw.elf =20 $(OBJECTS): Makefile =20 -ifneq ($(wildcard $(SRC_PATH)/roms/SLOF/lib/libnet),) -include $(SRC_PATH)/pc-bios/s390-ccw/netboot.mak +ifneq ($(wildcard $(SRC_PATH)/../../roms/SLOF/lib/libnet),) +include $(SRC_PATH)/netboot.mak else s390-netboot.img: @echo "s390-netboot.img not built since roms/SLOF/ is not available." diff --git a/pc-bios/s390-ccw/netboot.mak b/pc-bios/s390-ccw/netboot.mak index 68b4d7edcb..1a06befa4b 100644 --- a/pc-bios/s390-ccw/netboot.mak +++ b/pc-bios/s390-ccw/netboot.mak @@ -1,5 +1,5 @@ =20 -SLOF_DIR :=3D $(SRC_PATH)/roms/SLOF +SLOF_DIR :=3D $(SRC_PATH)/../../roms/SLOF =20 NETOBJS :=3D start.o sclp.o cio.o virtio.o virtio-net.o jump2ipl.o netmain= .o =20 --=20 2.35.1