From nobody Tue Feb 10 06:58:02 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=1654108267; cv=none; d=zohomail.com; s=zohoarc; b=ckL+DvWaiplJDRsIEFYl7FOlxJccO6SxyJNkctpdzgcFZ8JXOLIDY4QUzc3Zq+bt+4TmSYWQW8WZ5rbucse8OUNkcXt6AIHWQI0ln2vzVKFDDNj4B7Ob3USlgkjpwCfe/HzRGFpAAlkzo6bbkRjDZJLKxgjwLa7zUtK3smQAnyo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1654108267; 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=1r2rKk9p3Z4WuyVHz9vKxY76XN/AUS8op6qSsWyyueQ=; b=akFV+L7Z3vJcV2PaR3yJt89Ez5/9FNtXQ7J3cOXkV+hF6PiE9Zn57fy0UQITB4+6rjkrV/ADg8L3FC5VhV4PDujgI85OnoN4mSFT0UuInyKfNbq/AyPZnaDVWivsK9i09WhstlV42p2GpWFYeh1RBsR3NOvVgHFgCfBtdUyFua4= 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 165410826709529.7482248059722; Wed, 1 Jun 2022 11:31:07 -0700 (PDT) Received: from localhost ([::1]:36894 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nwT7a-0003QJ-2Z for importer@patchew.org; Wed, 01 Jun 2022 14:31:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52738) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nwSr7-0001jf-5k for qemu-devel@nongnu.org; Wed, 01 Jun 2022 14:14:05 -0400 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]:42584) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nwSr4-0006Z8-Ti for qemu-devel@nongnu.org; Wed, 01 Jun 2022 14:14:04 -0400 Received: by mail-ej1-x62e.google.com with SMTP id q1so5395663ejz.9 for ; Wed, 01 Jun 2022 11:14:02 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id m11-20020a056402050b00b0042dd7e13391sm1367056edv.45.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 D091C1FFCF; Wed, 1 Jun 2022 19:05:39 +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=1r2rKk9p3Z4WuyVHz9vKxY76XN/AUS8op6qSsWyyueQ=; b=D5Hr4Fs5RLuWq/vyoBRX2Dsjtxxs80rnS/u4Mmt2UXc77lgoDoy6foPgD34PDe2njt A+QrJ9zsiGowVIkbYqCx9Ld7v5Gg/Zv5l+t/LiiXnQKaVVJemIb+lxW2l3g5tuiQPEqB lXf2H2eCjLirAQQLVUpMSY/tfOan1NXkzmZyfk+QG51crpzpAyhnjePPzWyVRmB0OKnN 3PJpktSg8sYt6QUN6So8jbAcKTN4UlBJ3DUhuKpwrgaWd2M5Fam2iWuzCJoQZgRkqLqD +WUeJmbAGx8POlj2hN89KGnep99nWDlFvlF48+GKqI6IskSdgzLqkScKBPsa/0umZTMZ du2A== 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=1r2rKk9p3Z4WuyVHz9vKxY76XN/AUS8op6qSsWyyueQ=; b=hiEygkD2EeRUz6lqdwpJRja1Qlwc0eez66NU5uk4X3qjG/U/D1M+1P8purwGP0SOW6 qMI+fZNtS66iB4gN0hthjXDFaklJJNYfQ+FK8DFwrIGdIPdQ/tpJBdx6FtCgK3Z9DPXv R/FHUy9O01FwpCNx6BAiQx0KWuvJPqAVf4t5HIASIajz7kQMxBWFRbbGBhwFLLALqGLn II7nM5PHGmNYfTuFCSA8YXRfsv0WaUaJdCYIBaz/bNSCv/1dWxuBEJdjR4BAo8JLT5Q/ 40zgh9XxlOJjzH0OXGFq9dgDWYQbeO2L9wmoMq3T8+OwtDLFbBPbQGZHpXJz+kPDF5vt /0kg== X-Gm-Message-State: AOAM530qKZK1npHueaNEBiPnKJ45oRujNqRwRGQh91SGFFoMyt/NTKBO kx1iaPlO1AoBA7o215ozh7/0Fg== X-Google-Smtp-Source: ABdhPJwmp2jJLaKjK7XiccfuvLfv4pKcdJgTXu/MKVuKHsUxBboaZYEw0erU9AEcAw5dBwA9niJ3uQ== X-Received: by 2002:a17:907:6ea5:b0:6fa:967d:6d57 with SMTP id sh37-20020a1709076ea500b006fa967d6d57mr748802ejc.276.1654107241559; Wed, 01 Jun 2022 11:14:01 -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?= , Thomas Huth , Christian Borntraeger , Cornelia Huck , qemu-s390x@nongnu.org (open list:S390-ccw boot) Subject: [PULL 24/33] configure: enable cross-compilation of s390-ccw Date: Wed, 1 Jun 2022 19:05:28 +0100 Message-Id: <20220601180537.2329566-25-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: 1654108268692100001 From: Paolo Bonzini 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. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini Message-Id: <20220517092616.1272238-14-pbonzini@redhat.com> Signed-off-by: Alex Benn=C3=A9e Acked-by: Thomas Huth Message-Id: <20220527153603.887929-25-alex.bennee@linaro.org> diff --git a/configure b/configure index aa17b0fa55..f509bce304 100755 --- a/configure +++ b/configure @@ -2231,24 +2231,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 if the compiler has -march=3Dz900 or -march=3Dz= 10 +# (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/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 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." --=20 2.30.2