From patchwork Wed Jun 1 18:05:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 577824 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:8f0c:0:0:0:0 with SMTP id mq12csp857660mab; Wed, 1 Jun 2022 11:29:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwrHQlEUOsakhpRV595rcK+QaeXzliaq7dQARG4fbERBziR2lhhem66ZFKTpDFeqHmBHZhJ X-Received: by 2002:a05:622a:14c:b0:2fc:5024:c8bc with SMTP id v12-20020a05622a014c00b002fc5024c8bcmr895097qtw.426.1654108172073; Wed, 01 Jun 2022 11:29:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654108172; cv=none; d=google.com; s=arc-20160816; b=dsHj9ajLnfwIbXS69qqsCawVlmW2b/zusXBs5wkUlJw+GNif2SOVr1jai6Dhox6Yvs GMAkqzdjqjETfLjdTqr1QrEDrPGhImKezkyiURwU4+g3X9+YbGCDymn7n5azOTSMnrlf B0ZkI0sw3BYaFyUShiT+rZIDpzQol481V88WgorlHpIXtz/CPln2Xq5tYSgG16p2whIs pQBYo+Pqcr9L/8nltyVYzug/OuGM9z66UhIKXwfHtl52NRhtO9Um7K80ETGGAouHPB/L YezKQPhr6VGrJDQwxv4mKKYHWze628EGMG4MRTI4GNz2iT0M/YCzUeYd2TeMxC0fp7K1 UtIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=1r2rKk9p3Z4WuyVHz9vKxY76XN/AUS8op6qSsWyyueQ=; b=O/wYT8YIElvvFH9uchI5d65rSDQBeyz4RWZCqZhbx2ietC7QvYO3hFTsj4lxkBHvxq 35uK/WDxRiXIaPmoWwPYy36C3imPODxWW+XXUrQPLIHhfagedDoLbz5HdV0H4Cx3/C+W gaL8R7WtNVD2pIXXdcdAQ43JWFnQw85nCFGBDCZw9KZ3hkZZhv0/vohJL35awiXgASO5 3hRQoJD7toGiyS/2aLgInDhfnkRs1gVzaFPAXd4EMkrUuFO5eyZn4zrqUz5HJ81rnVMR UnvVcWTct77viwui1UnT/eXxOynycsk4fpd+nrq0AqYq978kR7Xjy5aYbEtSioxZooNH dBmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=D5Hr4Fs5; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id fo9-20020ad45f09000000b00453b38bd86dsi1093873qvb.301.2022.06.01.11.29.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Jun 2022 11:29:32 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=D5Hr4Fs5; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:32984 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nwT63-0000lj-LO for patch@linaro.org; Wed, 01 Jun 2022 14:29:31 -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) 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-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) 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) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, richard.henderson@linaro.org Cc: qemu-devel@nongnu.org, Paolo Bonzini , =?utf-8?q?Al?= =?utf-8?q?ex_Benn=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 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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ée 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" = "i386" || test "$cpu" = "x86_64"; } && \ done fi -# Only build s390-ccw bios if we're on s390x and the compiler has -march=z900 -# or -march=z10 (which is the lowest architecture level that Clang supports) -if test "$cpu" = "s390x" ; then +# Only build s390-ccw bios if the compiler has -march=z900 or -march=z10 +# (which is the lowest architecture level that Clang supports) +probe_target_compiler s390x +if test -n "$target_cc" && test "$softmmu" = yes; then write_c_skeleton - compile_prog "-march=z900" "" + do_compiler "$target_cc" $target_cc_cflags -march=z900 -o $TMPO -c $TMPC has_z900=$? - if [ $has_z900 = 0 ] || compile_object "-march=z10 -msoft-float -Werror"; then + if [ $has_z900 = 0 ] || do_compiler "$target_cc" $target_cc_cflags -march=z10 -msoft-float -Werror -o $TMPO -c $TMPC; then if [ $has_z900 != 0 ]; then echo "WARNING: Your compiler does not support the z900!" echo " The s390-ccw bios will only work with guest CPUs >= z10." fi roms="$roms s390-ccw" + config_mak=pc-bios/s390-ccw/config-host.mak + echo "# Automatically generated by configure - do not modify" > $config_mak + echo "SRC_PATH=$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="${git_submodules} roms/SLOF" fi fi +####################################### +# 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 @@ -SLOF_DIR := $(SRC_PATH)/roms/SLOF +SLOF_DIR := $(SRC_PATH)/../../roms/SLOF NETOBJS := start.o sclp.o cio.o virtio.o virtio-net.o jump2ipl.o netmain.o 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 -include ../../config-host.mak +include config-host.mak CFLAGS = -O2 -g +MAKEFLAGS += -rR quiet-command = $(if $(V),$1,$(if $(2),@printf " %-7s %s\n" $2 $3 && $1, @$1)) cc-option = $(if $(shell $(CC) $1 $2 -S -o /dev/null -xc /dev/null \ @@ -11,7 +12,7 @@ cc-option = $(if $(shell $(CC) $1 $2 -S -o /dev/null -xc /dev/null \ VPATH_SUFFIXES = %.c %.h %.S %.m %.mak %.sh %.rc Kconfig% %.json.in set-vpath = $(if $1,$(foreach PATTERN,$(VPATH_SUFFIXES),$(eval vpath $(PATTERN) $1))) -$(call set-vpath, $(SRC_PATH)/pc-bios/s390-ccw) +$(call set-vpath, $(SRC_PATH)) # Flags for dependency generation QEMU_DGFLAGS = -MMD -MP -MT $@ -MF $(@D)/$(*F).d @@ -49,8 +50,8 @@ s390-ccw.img: s390-ccw.elf $(OBJECTS): Makefile -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."