All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: peter.maydell@linaro.org, richard.henderson@linaro.org
Cc: qemu-devel@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Thomas Huth" <thuth@redhat.com>,
	"Christian Borntraeger" <borntraeger@linux.ibm.com>,
	"Cornelia Huck" <cohuck@redhat.com>,
	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	[thread overview]
Message-ID: <20220601180537.2329566-25-alex.bennee@linaro.org> (raw)
In-Reply-To: <20220601180537.2329566-1-alex.bennee@linaro.org>

From: Paolo Bonzini <pbonzini@redhat.com>

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 <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20220517092616.1272238-14-pbonzini@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Acked-by: Thomas Huth <thuth@redhat.com>
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."
-- 
2.30.2



  parent reply	other threads:[~2022-06-01 18:30 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-01 18:05 [PULL 00/33] testing updates (gitlab, junit, lcitool, x-compile) Alex Bennée
2022-06-01 18:05 ` [PULL 01/33] .gitlab-ci.d/container-cross: Fix RISC-V container dependencies / stages Alex Bennée
2022-06-01 18:05 ` [PULL 02/33] .gitlab-ci.d/crossbuilds: Fix the dependency of the cross-i386-tci job Alex Bennée
2022-06-01 18:05 ` [PULL 03/33] gitlab-ci: add meson JUnit test result into report Alex Bennée
2022-06-01 18:05 ` [PULL 04/33] meson.build: fix summary display of test compilers Alex Bennée
2022-06-01 18:05 ` [PULL 05/33] tests/lcitool: fix up indentation to correct style Alex Bennée
2022-06-01 18:05 ` [PULL 06/33] tests/docker: update debian-armhf-cross with lcitool Alex Bennée
2022-06-01 18:05 ` [PULL 07/33] tests/docker: update debian-armel-cross " Alex Bennée
2022-06-01 18:05 ` [PULL 08/33] tests/docker: update debian-mipsel-cross " Alex Bennée
2022-06-01 18:05 ` [PULL 09/33] tests/docker: update debian-mips64el-cross " Alex Bennée
2022-06-01 18:05 ` [PULL 10/33] tests/docker: update debian-ppc64el-cross " Alex Bennée
2022-06-01 18:05 ` [PULL 11/33] tests/docker: update debian-amd64 " Alex Bennée
2022-06-01 18:05 ` [PULL 12/33] configure: do not define or use the CPP variable Alex Bennée
2022-06-01 18:05 ` [PULL 13/33] build: clean up ninja invocation Alex Bennée
2022-06-01 18:05 ` [PULL 14/33] build: add a more generic way to specify make->ninja dependencies Alex Bennée
2022-06-01 18:05 ` [PULL 15/33] build: do a full build before running TCG tests Alex Bennée
2022-06-01 18:05 ` [PULL 16/33] configure, meson: move symlinking of ROMs to meson Alex Bennée
2022-06-01 18:05 ` [PULL 17/33] tests/tcg: correct target CPU for sparc32 Alex Bennée
2022-06-01 18:05 ` [PULL 18/33] tests/tcg: merge configure.sh back into main configure script Alex Bennée
2022-06-01 18:05 ` [PULL 19/33] configure: add missing cross compiler fallbacks Alex Bennée
2022-06-01 18:05 ` [PULL 20/33] configure: handle host compiler in probe_target_compiler Alex Bennée
2022-06-15 11:57   ` Matheus Kowalczuk Ferst
2022-06-16  1:20     ` Alex Bennée
2022-06-17 10:12     ` Paolo Bonzini
2022-06-20 16:41       ` Matheus Kowalczuk Ferst
2022-06-21  1:38         ` Richard Henderson
2022-06-21 16:58         ` Paolo Bonzini
2022-06-21 18:30           ` Richard Henderson
2022-06-22  8:39             ` Paolo Bonzini
2022-06-01 18:05 ` [PULL 21/33] configure: introduce --cross-prefix-*= Alex Bennée
2022-06-01 18:05 ` [PULL 22/33] configure: include more binutils in tests/tcg makefile Alex Bennée
2022-06-01 18:05 ` [PULL 23/33] configure: move symlink configuration earlier Alex Bennée
2022-06-01 18:05 ` Alex Bennée [this message]
2022-06-01 18:05 ` [PULL 25/33] configure: enable cross-compilation of optionrom Alex Bennée
2022-06-01 18:05 ` [PULL 26/33] configure: enable cross compilation of vof Alex Bennée
2022-06-01 18:05 ` [PULL 27/33] configure: remove unused variables from config-host.mak Alex Bennée
2022-06-01 18:05 ` [PULL 28/33] gitlab: introduce a common base job template Alex Bennée
2022-06-01 18:05 ` [PULL 29/33] gitlab: convert Cirrus jobs to .base_job_template Alex Bennée
2022-06-01 18:05 ` [PULL 30/33] gitlab: convert static checks " Alex Bennée
2022-06-01 18:05 ` [PULL 31/33] gitlab: convert build/container jobs " Alex Bennée
2022-06-01 18:05 ` [PULL 32/33] gitlab: don't run CI jobs in forks by default Alex Bennée
2022-06-02 10:50   ` Philippe Mathieu-Daudé via
2022-06-06 11:01     ` Daniel P. Berrangé
2022-06-01 18:05 ` [PULL 33/33] docs/devel: clean-up the CI links in the docs Alex Bennée
2022-06-01 21:21 ` [PULL 00/33] testing updates (gitlab, junit, lcitool, x-compile) Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220601180537.2329566-25-alex.bennee@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=borntraeger@linux.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.