From nobody Sun May 5 07:47:08 2024 Delivered-To: importer2@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+importer2=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 165124219758419.458290091497815; Fri, 29 Apr 2022 07:23:17 -0700 (PDT) Received: from localhost ([::1]:34964 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nkRWc-0005wt-IY for importer2@patchew.org; Fri, 29 Apr 2022 10:23:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57974) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nkRRs-0005fu-MI for qemu-devel@nongnu.org; Fri, 29 Apr 2022 10:18:20 -0400 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]:42737) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nkRRp-0004YL-Ga for qemu-devel@nongnu.org; Fri, 29 Apr 2022 10:18:20 -0400 Received: by mail-ed1-x52e.google.com with SMTP id z19so9228672edx.9 for ; Fri, 29 Apr 2022 07:18:17 -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.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Apr 2022 07:18:15 -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=318/kUuPaazLiyf6nNi4TZdS6a9iFGes1ZD8zTFxGz0=; b=e8EOfETBZormWhNK0fMKQjP39Iw1SMJX+GAe8glr5ADqLQSKI9Y3j9CzcZqbGWlWAt WJqqRcwR+h3lfBZy9sWl/rVFavj1XINQQ98lY3S9zO6ygb1Y6O4O+uxTiYbHGzHsVSoW ovchMJw+em+VQWMcexfAn+uf1bVuCwg9uSWJZANrGfRKqT6RA0mCbdRAr8UzqzI7Wvx3 OgvIitGlBmkEwVbtpOE7vh/euBo5PGqIr1MbL9y7mnlNp/nHuwwW004PaM7umk6TlfVs jVzqGDWYqZWIMFw/96JZzvdkaha/2vR51y1ZJ7CbuhxYUX5JFRmI9NCIiZJwsuiu5nJn mvfA== 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=318/kUuPaazLiyf6nNi4TZdS6a9iFGes1ZD8zTFxGz0=; b=FFWQee6E3OJW0J+LtgiODWpuEZQyuciC0hpdYJNhHyAB+nOGHDSsegj2p/TvQT1ucG PmL5r/CUHR60RKj3G73P7Ql98wu0+Tt5KdCVqa/dvdYfu/zatIO3y3GNM8rh0Wo7pJOY EF6Zlp6H1ivYOxgm9FvhJgOCxFUfrFkjW6KtjGAfQ6rTNRj81YX0PRQopL9cSLcSW/vE G/IboKXXBW8RpVZDhgSfCBtVHiA1SJ+3B4rxrcXHt3xjjZkmP95f0H8IiwD6nNj1cXLH qUxZJEsIrwF+X2Hilr8FpWXNwlpOYqpcGTj1I2B9piRfEZRKeZ0R9v7ipbwUvMqsmih4 KbxQ== X-Gm-Message-State: AOAM5316gMsrQDrgl2KZQ0A42lx7hJzyZkwNnbrH5+mb0EhwC7bb5U6N 5yLcluJSjGJk7WRXPBHHHg0lCAo46DiT1A== X-Google-Smtp-Source: ABdhPJxQeXe5yEj/OvoAFfEBcTq9hJGqYh8VhcBnd+9hvhyjj6H7PpBwWpxM9VQHtlkFssNsjOelXQ== X-Received: by 2002:a05:6402:e99:b0:41d:11f2:85e0 with SMTP id h25-20020a0564020e9900b0041d11f285e0mr40790872eda.339.1651241895879; Fri, 29 Apr 2022 07:18:15 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [RFC PATCH 01/12] tests/tcg: merge configure.sh back into main configure script Date: Fri, 29 Apr 2022 16:18:02 +0200 Message-Id: <20220429141813.328975-2-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::52e; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x52e.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+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1651242198877100001 Content-Type: text/plain; charset="utf-8" tests/tcg/configure.sh has a complicated story. In the beginning its code ran as part of the creation of config-target.mak files, and that is where it placed the information on the target compiler. However, probing for the buildability of TCG tests required multiple inclusions of config-target.mak in the _main_ Makefile (not in Makefile.target, which took care of building the QEMU executables in the pre-Meson era), which polluted the namespace. Thus, it was moved to a separate directory. It created small config-*.mak files in $(BUILD_DIR)/tests/tcg. Those were also included multiple times, but at least they were small and manageable; this was also an important step in disentangling the TCG tests from Makefile.target. Since then, Meson has allowed the configure script to go on a diet. A few compilation tests survive (mostly for sanitizers) but these days it mostly takes care of command line parsing, looking for tools, and setting up the environment for Meson to do its stuff. It's time to extend configure with the capability to build for more than just one target: not just tests, but also firmware. As a first step, integrate all the logic to find cross compilers in the configure script, and move tests/tcg/configure.sh back there (though as a separate loop, not integrated in the one that generates target configurations for Meson). tests/tcg is actually very close to being buildable as a standalone project, so I actually expect the compiler tests to move back to tests/tcg, as a "configure" script of sorts which would run at Make time after the docker images are built. The GCC tree has a similar idea of doing only bare-bones tree-wide configuration and leaving the rest for Make time. Signed-off-by: Paolo Bonzini --- configure | 398 +++++++++++++++++++++++++++++++++++++++-- tests/Makefile.include | 1 - tests/tcg/configure.sh | 376 -------------------------------------- 3 files changed, 388 insertions(+), 387 deletions(-) delete mode 100755 tests/tcg/configure.sh diff --git a/configure b/configure index e77b29b093..5d136492f8 100755 --- a/configure +++ b/configure @@ -109,6 +109,20 @@ error_exit() { } =20 do_compiler() { + # Run the compiler, capturing its output to the log. First argument + # is compiler binary to execute. + local compiler=3D"$1" + shift + if test -n "$BASH_VERSION"; then eval ' + echo >>config.log " +funcs: ${FUNCNAME[*]} +lines: ${BASH_LINENO[*]}" + '; fi + echo $compiler "$@" >> config.log + $compiler "$@" >> config.log 2>&1 || return $? +} + +do_compiler_werror() { # Run the compiler, capturing its output to the log. First argument # is compiler binary to execute. compiler=3D"$1" @@ -142,15 +156,15 @@ lines: ${BASH_LINENO[*]}" } =20 do_cc() { - do_compiler "$cc" $CPU_CFLAGS "$@" + do_compiler_werror "$cc" $CPU_CFLAGS "$@" } =20 do_cxx() { - do_compiler "$cxx" $CPU_CFLAGS "$@" + do_compiler_werror "$cxx" $CPU_CFLAGS "$@" } =20 do_objc() { - do_compiler "$objcc" $CPU_CFLAGS "$@" + do_compiler_werror "$objcc" $CPU_CFLAGS "$@" } =20 # Append $2 to the variable named $1, with space separation @@ -347,11 +361,9 @@ for opt do ;; --cross-cc-cflags-*) cc_arch=3D${opt#--cross-cc-cflags-}; cc_arch=3D${cc= _arch%%=3D*} eval "cross_cc_cflags_${cc_arch}=3D\$optarg" - cross_cc_vars=3D"$cross_cc_vars cross_cc_cflags_${cc= _arch}" ;; --cross-cc-*) cc_arch=3D${opt#--cross-cc-}; cc_arch=3D${cc_arch%%=3D*} eval "cross_cc_${cc_arch}=3D\$optarg" - cross_cc_vars=3D"$cross_cc_vars cross_cc_${cc_arch}" ;; esac done @@ -955,7 +967,6 @@ esac =20 if eval test -z "\${cross_cc_$cpu}"; then eval "cross_cc_${cpu}=3D\$cc" - cross_cc_vars=3D"$cross_cc_vars cross_cc_${cpu}" fi =20 default_target_list=3D"" @@ -1818,6 +1829,248 @@ case "$slirp" in ;; esac =20 +########################################## +# functions to probe cross compilers + +container=3D"no" +if test $use_containers =3D "yes"; then + if has "docker" || has "podman"; then + container=3D$($python $source_path/tests/docker/docker.py probe) + fi +fi + +# cross compilers defaults, can be overridden with --cross-cc-ARCH +: ${cross_cc_aarch64=3D"aarch64-linux-gnu-gcc"} +: ${cross_cc_aarch64_be=3D"$cross_cc_aarch64"} +: ${cross_cc_cflags_aarch64_be=3D"-mbig-endian"} +: ${cross_cc_alpha=3D"alpha-linux-gnu-gcc"} +: ${cross_cc_arm=3D"arm-linux-gnueabihf-gcc"} +: ${cross_cc_cflags_armeb=3D"-mbig-endian"} +: ${cross_cc_hexagon=3D"hexagon-unknown-linux-musl-clang"} +: ${cross_cc_cflags_hexagon=3D"-mv67 -O2 -static"} +: ${cross_cc_hppa=3D"hppa-linux-gnu-gcc"} +: ${cross_cc_i386=3D"i686-linux-gnu-gcc"} +: ${cross_cc_cflags_i386=3D"-m32"} +: ${cross_cc_m68k=3D"m68k-linux-gnu-gcc"} +: ${cross_cc_microblaze=3D"microblaze-linux-musl-gcc"} +: ${cross_cc_mips64el=3D"mips64el-linux-gnuabi64-gcc"} +: ${cross_cc_mips64=3D"mips64-linux-gnuabi64-gcc"} +: ${cross_cc_mipsel=3D"mipsel-linux-gnu-gcc"} +: ${cross_cc_mips=3D"mips-linux-gnu-gcc"} +: ${cross_cc_nios2=3D"nios2-linux-gnu-gcc"} +: ${cross_cc_ppc=3D"powerpc-linux-gnu-gcc"} +: ${cross_cc_cflags_ppc=3D"-m32"} +: ${cross_cc_ppc64=3D"powerpc64-linux-gnu-gcc"} +: ${cross_cc_cflags_ppc64=3D"-m64 -mbig-endian"} +: ${cross_cc_ppc64le=3D"$cross_cc_ppc64"} +: ${cross_cc_cflags_ppc64le=3D"-m64 -mlittle-endian"} +: ${cross_cc_riscv64=3D"riscv64-linux-gnu-gcc"} +: ${cross_cc_s390x=3D"s390x-linux-gnu-gcc"} +: ${cross_cc_sh4=3D"sh4-linux-gnu-gcc"} +: ${cross_cc_cflags_sparc=3D"-m32 -mv8plus -mcpu=3Dultrasparc"} +: ${cross_cc_sparc64=3D"sparc64-linux-gnu-gcc"} +: ${cross_cc_cflags_sparc64=3D"-m64 -mcpu=3Dultrasparc"} +: ${cross_cc_x86_64=3D"x86_64-linux-gnu-gcc"} +: ${cross_cc_cflags_x86_64=3D"-m64"} + +# tricore is special as it doesn't have a compiler +: ${cross_as_tricore=3D"tricore-as"} +: ${cross_ld_tricore=3D"tricore-ld"} + +probe_target_compiler() { + # reset all output variables + container_image=3D + container_hosts=3D + container_cross_cc=3D + container_cross_as=3D + container_cross_ld=3D + target_cc=3D + target_as=3D + target_ld=3D + + case $1 in + aarch64) container_hosts=3D"x86_64 aarch64" ;; + alpha) container_hosts=3Dx86_64 ;; + arm) container_hosts=3D"x86_64 aarch64" ;; + cris) container_hosts=3Dx86_64 ;; + hexagon) container_hosts=3Dx86_64 ;; + hppa) container_hosts=3Dx86_64 ;; + i386) container_hosts=3Dx86_64 ;; + m68k) container_hosts=3Dx86_64 ;; + microblaze) container_hosts=3Dx86_64 ;; + mips64el) container_hosts=3Dx86_64 ;; + mips64) container_hosts=3Dx86_64 ;; + mipsel) container_hosts=3Dx86_64 ;; + mips) container_hosts=3Dx86_64 ;; + nios2) container_hosts=3Dx86_64 ;; + ppc) container_hosts=3Dx86_64 ;; + ppc64|ppc64le) container_hosts=3Dx86_64 ;; + riscv64) container_hosts=3Dx86_64 ;; + s390x) container_hosts=3Dx86_64 ;; + sh4) container_hosts=3Dx86_64 ;; + sparc64) container_hosts=3Dx86_64 ;; + tricore) container_hosts=3Dx86_64 ;; + x86_64) container_hosts=3D"aarch64 ppc64el x86_64" ;; + xtensa*) container_hosts=3Dx86_64 ;; + esac + + for host in $container_hosts; do + test "$container" !=3D no || continue + test "$host" =3D "$cpu" || continue + case $1 in + aarch64) + # We don't have any bigendian build tools so we only use this for = AArch64 + container_image=3Ddebian-arm64-cross + container_cross_cc=3Daarch64-linux-gnu-gcc-10 + ;; + alpha) + container_image=3Ddebian-alpha-cross + container_cross_cc=3Dalpha-linux-gnu-gcc + ;; + arm) + # We don't have any bigendian build tools so we only use this for = ARM + container_image=3Ddebian-armhf-cross + container_cross_cc=3Darm-linux-gnueabihf-gcc + ;; + cris) + container_image=3Dfedora-cris-cross + container_cross_cc=3Dcris-linux-gnu-gcc + ;; + hexagon) + container_image=3Ddebian-hexagon-cross + container_cross_cc=3Dhexagon-unknown-linux-musl-clang + ;; + hppa) + container_image=3Ddebian-hppa-cross + container_cross_cc=3Dhppa-linux-gnu-gcc + ;; + i386) + container_image=3Dfedora-i386-cross + container_cross_cc=3Dgcc + ;; + m68k) + container_image=3Ddebian-m68k-cross + container_cross_cc=3Dm68k-linux-gnu-gcc + ;; + microblaze) + container_image=3Ddebian-microblaze-cross + container_cross_cc=3Dmicroblaze-linux-musl-gcc + ;; + mips64el) + container_image=3Ddebian-mips64el-cross + container_cross_cc=3Dmips64el-linux-gnuabi64-gcc + ;; + mips64) + container_image=3Ddebian-mips64-cross + container_cross_cc=3Dmips64-linux-gnuabi64-gcc + ;; + mipsel) + container_image=3Ddebian-mipsel-cross + container_cross_cc=3Dmipsel-linux-gnu-gcc + ;; + mips) + container_image=3Ddebian-mips-cross + container_cross_cc=3Dmips-linux-gnu-gcc + ;; + nios2) + container_image=3Ddebian-nios2-cross + container_cross_cc=3Dnios2-linux-gnu-gcc + ;; + ppc) + container_image=3Ddebian-powerpc-test-cross + container_cross_cc=3Dpowerpc-linux-gnu-gcc-10 + ;; + ppc64|ppc64le) + container_image=3Ddebian-powerpc-test-cross + container_cross_cc=3Dpowerpc${1#ppc}-linux-gnu-gcc-10 + ;; + riscv64) + container_image=3Ddebian-riscv64-test-cross + container_cross_cc=3Driscv64-linux-gnu-gcc + ;; + s390x) + container_image=3Ddebian-s390x-cross + container_cross_cc=3Ds390x-linux-gnu-gcc + ;; + sh4) + container_image=3Ddebian-sh4-cross + container_cross_cc=3Dsh4-linux-gnu-gcc + ;; + sparc64) + container_image=3Ddebian-sparc64-cross + container_cross_cc=3Dsparc64-linux-gnu-gcc + ;; + tricore) + container_image=3Ddebian-tricore-cross + container_cross_as=3Dtricore-as + container_cross_ld=3Dtricore-ld + ;; + x86_64) + container_image=3Ddebian-amd64-cross + container_cross_cc=3Dx86_64-linux-gnu-gcc + ;; + xtensa*) + # FIXME: xtensa-linux-user? + container_hosts=3Dx86_64 + container_image=3Ddebian-xtensa-cross + + # default to the dc232b cpu + container_cross_cc=3D/opt/2020.07/xtensa-dc232b-elf/bin/xtensa-dc2= 32b-elf-gcc + ;; + esac + done + + eval "target_cflags=3D\${cross_cc_cflags_$1}" + if eval test -n "\"\${cross_cc_$1}\""; then + if eval has "\"\${cross_cc_$1}\""; then + eval "target_cc=3D\"\${cross_cc_$1}\"" + case $1 in + i386|x86_64) + if $target_cc --version | grep -qi "clang"; then + unset target_cc + fi + ;; + esac + fi + fi + if eval test -n "\"\${cross_as_$1}\""; then + if eval has "\"\${cross_as_$1}\""; then + eval "target_as=3D\"\${cross_as_$1}\"" + fi + fi + if eval test -n "\"\${cross_ld_$1}\""; then + if eval has "\"\${cross_ld_$1}\""; then + eval "target_ld=3D\"\${cross_ld_$1}\"" + fi + fi +} + +write_target_makefile() { + if test -n "$target_cc"; then + echo "CC=3D$target_cc" + fi + if test -n "$target_as"; then + echo "AS=3D$target_as" + fi + if test -n "$target_ld"; then + echo "LD=3D$target_ld" + fi +} + +write_container_target_makefile() { + if test -n "$container_cross_cc"; then + echo "CC=3D\$(DOCKER_SCRIPT) cc --cc $container_cross_cc -i qemu/$cont= ainer_image -s $source_path --" + fi + if test -n "$container_cross_as"; then + echo "AS=3D\$(DOCKER_SCRIPT) cc --cc $container_cross_as -i qemu/$cont= ainer_image -s $source_path --" + fi + if test -n "$container_cross_ld"; then + echo "LD=3D\$(DOCKER_SCRIPT) cc --cc $container_cross_ld -i qemu/$cont= ainer_image -s $source_path --" + fi +} + + + ########################################## # End of CC checks # After here, no more $cc or $ld runs @@ -2145,11 +2398,136 @@ for f in $LINKS ; do fi done =20 -(for i in $cross_cc_vars; do - export $i +# tests/tcg configuration +(makefile=3Dtests/tcg/Makefile.prereqs +echo "# Automatically generated by configure - do not modify" > $makefile + +config_host_mak=3Dtests/tcg/config-host.mak +echo "# Automatically generated by configure - do not modify" > $config_ho= st_mak +echo "SRC_PATH=3D$source_path" >> $config_host_mak +echo "HOST_CC=3D$host_cc" >> $config_host_mak + +tcg_tests_targets=3D +for target in $target_list; do + arch=3D${target%%-*} + + probe_target_compiler ${arch} + config_target_mak=3Dtests/tcg/config-$target.mak + + echo "# Automatically generated by configure - do not modify" > $config_= target_mak + echo "TARGET_NAME=3D$arch" >> $config_target_mak + case $target in + *-softmmu) + test -f $source_path/tests/tcg/$arch/Makefile.softmmu-target || cont= inue + qemu=3D"qemu-system-$arch" + ;; + *-linux-user|*-bsd-user) + qemu=3D"qemu-$arch" + ;; + esac + + got_cross_cc=3Dno + unset build_static + + if test -n "$target_cc"; then + write_c_skeleton + if ! do_compiler "$target_cc" $target_cflags \ + -o $TMPE $TMPC -static ; then + # For host systems we might get away with building without -stat= ic + if do_compiler "$target_cc" $target_cflags \ + -o $TMPE $TMPC ; then + got_cross_cc=3Dyes + fi + else + got_cross_cc=3Dyes + build_static=3Dy + fi + elif test -n "$target_as" && test -n "$target_ld"; then + # Special handling for assembler only tests + case $target in + tricore-softmmu) got_cross_cc=3Dyes ;; + esac + fi + + if test $got_cross_cc =3D yes; then + # Test for compiler features for optional tests. We only do this + # for cross compilers because ensuring the docker containers based + # compilers is a requirememt for adding a new test that needs a + # compiler feature. + + echo "BUILD_STATIC=3D$build_static" >> $config_target_mak + write_target_makefile >> $config_target_mak + case $target in + aarch64-*) + if do_compiler "$target_cc" $target_cflags \ + -march=3Darmv8.1-a+sve -o $TMPE $TMPC; then + echo "CROSS_CC_HAS_SVE=3Dy" >> $config_target_mak + fi + if do_compiler "$target_cc" $target_cflags \ + -march=3Darmv8.1-a+sve2 -o $TMPE $TMPC; then + echo "CROSS_CC_HAS_SVE2=3Dy" >> $config_target_mak + fi + if do_compiler "$target_cc" $target_cflags \ + -march=3Darmv8.3-a -o $TMPE $TMPC; then + echo "CROSS_CC_HAS_ARMV8_3=3Dy" >> $config_target_mak + fi + if do_compiler "$target_cc" $target_cflags \ + -mbranch-protection=3Dstandard -o $TMPE $TMPC= ; then + echo "CROSS_CC_HAS_ARMV8_BTI=3Dy" >> $config_target_mak + fi + if do_compiler "$target_cc" $target_cflags \ + -march=3Darmv8.5-a+memtag -o $TMPE $TMPC; then + echo "CROSS_CC_HAS_ARMV8_MTE=3Dy" >> $config_target_mak + fi + ;; + ppc*) + if do_compiler "$target_cc" $target_cflags \ + -mpower8-vector -o $TMPE $TMPC; then + echo "CROSS_CC_HAS_POWER8_VECTOR=3Dy" >> $config_target_= mak + fi + if do_compiler "$target_cc" $target_cflags \ + -mpower10 -o $TMPE $TMPC; then + echo "CROSS_CC_HAS_POWER10=3Dy" >> $config_target_mak + fi + ;; + i386-linux-user) + if do_compiler "$target_cc" $target_cflags \ + -Werror -fno-pie -o $TMPE $TMPC; then + echo "CROSS_CC_HAS_I386_NOPIE=3Dy" >> $config_target_mak + fi + ;; + esac + elif test -n "$container_image"; then + echo "build-tcg-tests-$target: docker-image-$container_image" >> $ma= kefile + echo "BUILD_STATIC=3Dy" >> $config_target_mak + write_container_target_makefile >> $config_target_mak + case $target in + aarch64-*) + echo "CROSS_CC_HAS_SVE=3Dy" >> $config_target_mak + echo "CROSS_CC_HAS_SVE2=3Dy" >> $config_target_mak + echo "CROSS_CC_HAS_ARMV8_3=3Dy" >> $config_target_mak + echo "CROSS_CC_HAS_ARMV8_BTI=3Dy" >> $config_target_mak + echo "CROSS_CC_HAS_ARMV8_MTE=3Dy" >> $config_target_mak + ;; + ppc*) + echo "CROSS_CC_HAS_POWER8_VECTOR=3Dy" >> $config_target_mak + echo "CROSS_CC_HAS_POWER10=3Dy" >> $config_target_mak + ;; + i386-linux-user) + echo "CROSS_CC_HAS_I386_NOPIE=3Dy" >> $config_target_mak + ;; + esac + got_cross_cc=3Dyes + fi + if test $got_cross_cc =3D yes; then + mkdir -p tests/tcg/$target + echo "QEMU=3D$PWD/$qemu" >> $config_target_mak + echo "EXTRA_CFLAGS=3D$target_cflags" >> $config_target_mak + echo "run-tcg-tests-$target: $qemu\$(EXESUF)" >> $makefile + tcg_tests_targets=3D"$tcg_tests_targets $target" + fi done -export target_list source_path use_containers cpu host_cc -$source_path/tests/tcg/configure.sh) +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 diff --git a/tests/Makefile.include b/tests/Makefile.include index ec84b2ebc0..bef96a775c 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -37,7 +37,6 @@ export SRC_PATH SPEED =3D quick =20 -include tests/tcg/Makefile.prereqs -config-host.mak: $(SRC_PATH)/tests/tcg/configure.sh tests/tcg/Makefile.prereqs: config-host.mak =20 # Per guest TCG tests diff --git a/tests/tcg/configure.sh b/tests/tcg/configure.sh deleted file mode 100755 index 691d90abac..0000000000 --- a/tests/tcg/configure.sh +++ /dev/null @@ -1,376 +0,0 @@ -#! /bin/sh - -if test -z "$source_path"; then - echo Do not invoke this script directly. It is called - echo automatically by configure. - exit 1 -fi - -write_c_skeleton() { - cat > $TMPC </dev/null 2>&1 -} - -do_compiler() { - # Run the compiler, capturing its output to the log. First argument - # is compiler binary to execute. - local compiler=3D"$1" - shift - if test -n "$BASH_VERSION"; then eval ' - echo >>config.log " -funcs: ${FUNCNAME[*]} -lines: ${BASH_LINENO[*]}" - '; fi - echo $compiler "$@" >> config.log - $compiler "$@" >> config.log 2>&1 || return $? -} - - -TMPDIR1=3D"config-temp" -TMPC=3D"${TMPDIR1}/qemu-conf.c" -TMPE=3D"${TMPDIR1}/qemu-conf.exe" - -container=3D"no" -if test $use_containers =3D "yes"; then - if has "docker" || has "podman"; then - container=3D$($python $source_path/tests/docker/docker.py probe) - fi -fi - -# cross compilers defaults, can be overridden with --cross-cc-ARCH -: ${cross_cc_aarch64=3D"aarch64-linux-gnu-gcc"} -: ${cross_cc_aarch64_be=3D"$cross_cc_aarch64"} -: ${cross_cc_cflags_aarch64_be=3D"-mbig-endian"} -: ${cross_cc_alpha=3D"alpha-linux-gnu-gcc"} -: ${cross_cc_arm=3D"arm-linux-gnueabihf-gcc"} -: ${cross_cc_cflags_armeb=3D"-mbig-endian"} -: ${cross_cc_hexagon=3D"hexagon-unknown-linux-musl-clang"} -: ${cross_cc_cflags_hexagon=3D"-mv67 -O2 -static"} -: ${cross_cc_hppa=3D"hppa-linux-gnu-gcc"} -: ${cross_cc_i386=3D"i686-linux-gnu-gcc"} -: ${cross_cc_cflags_i386=3D"-m32"} -: ${cross_cc_m68k=3D"m68k-linux-gnu-gcc"} -: ${cross_cc_microblaze=3D"microblaze-linux-musl-gcc"} -: ${cross_cc_mips64el=3D"mips64el-linux-gnuabi64-gcc"} -: ${cross_cc_mips64=3D"mips64-linux-gnuabi64-gcc"} -: ${cross_cc_mipsel=3D"mipsel-linux-gnu-gcc"} -: ${cross_cc_mips=3D"mips-linux-gnu-gcc"} -: ${cross_cc_nios2=3D"nios2-linux-gnu-gcc"} -: ${cross_cc_ppc=3D"powerpc-linux-gnu-gcc"} -: ${cross_cc_cflags_ppc=3D"-m32"} -: ${cross_cc_ppc64=3D"powerpc64-linux-gnu-gcc"} -: ${cross_cc_cflags_ppc64=3D"-m64 -mbig-endian"} -: ${cross_cc_ppc64le=3D"$cross_cc_ppc64"} -: ${cross_cc_cflags_ppc64le=3D"-m64 -mlittle-endian"} -: ${cross_cc_riscv64=3D"riscv64-linux-gnu-gcc"} -: ${cross_cc_s390x=3D"s390x-linux-gnu-gcc"} -: ${cross_cc_sh4=3D"sh4-linux-gnu-gcc"} -: ${cross_cc_cflags_sparc=3D"-m32 -mv8plus -mcpu=3Dultrasparc"} -: ${cross_cc_sparc64=3D"sparc64-linux-gnu-gcc"} -: ${cross_cc_cflags_sparc64=3D"-m64 -mcpu=3Dultrasparc"} -: ${cross_cc_x86_64=3D"x86_64-linux-gnu-gcc"} -: ${cross_cc_cflags_x86_64=3D"-m64"} - -# tricore is special as it doesn't have a compiler -: ${cross_as_tricore=3D"tricore-as"} -: ${cross_ld_tricore=3D"tricore-ld"} - -makefile=3Dtests/tcg/Makefile.prereqs -echo "# Automatically generated by configure - do not modify" > $makefile - -config_host_mak=3Dtests/tcg/config-host.mak -echo "# Automatically generated by configure - do not modify" > $config_ho= st_mak -echo "SRC_PATH=3D$source_path" >> $config_host_mak -echo "HOST_CC=3D$host_cc" >> $config_host_mak - -tcg_tests_targets=3D -for target in $target_list; do - arch=3D${target%%-*} - - # reset all container fields - container_image=3D - container_hosts=3D - container_cross_cc=3D - container_cross_as=3D - container_cross_ld=3D - - # suppress clang - supress_clang=3D - - case $target in - aarch64-*) - # We don't have any bigendian build tools so we only use this for AA= rch64 - container_hosts=3D"x86_64 aarch64" - container_image=3Ddebian-arm64-cross - container_cross_cc=3Daarch64-linux-gnu-gcc-10 - ;; - alpha-*) - container_hosts=3Dx86_64 - container_image=3Ddebian-alpha-cross - container_cross_cc=3Dalpha-linux-gnu-gcc - ;; - arm-*) - # We don't have any bigendian build tools so we only use this for ARM - container_hosts=3D"x86_64 aarch64" - container_image=3Ddebian-armhf-cross - container_cross_cc=3Darm-linux-gnueabihf-gcc - ;; - cris-*) - container_hosts=3Dx86_64 - container_image=3Dfedora-cris-cross - container_cross_cc=3Dcris-linux-gnu-gcc - ;; - hexagon-*) - container_hosts=3Dx86_64 - container_image=3Ddebian-hexagon-cross - container_cross_cc=3Dhexagon-unknown-linux-musl-clang - ;; - hppa-*) - container_hosts=3Dx86_64 - container_image=3Ddebian-hppa-cross - container_cross_cc=3Dhppa-linux-gnu-gcc - ;; - i386-*) - container_hosts=3Dx86_64 - container_image=3Dfedora-i386-cross - container_cross_cc=3Dgcc - supress_clang=3Dyes - ;; - m68k-*) - container_hosts=3Dx86_64 - container_image=3Ddebian-m68k-cross - container_cross_cc=3Dm68k-linux-gnu-gcc - ;; - microblaze-*) - container_hosts=3Dx86_64 - container_image=3Ddebian-microblaze-cross - container_cross_cc=3Dmicroblaze-linux-musl-gcc - ;; - mips64el-*) - container_hosts=3Dx86_64 - container_image=3Ddebian-mips64el-cross - container_cross_cc=3Dmips64el-linux-gnuabi64-gcc - ;; - mips64-*) - container_hosts=3Dx86_64 - container_image=3Ddebian-mips64-cross - container_cross_cc=3Dmips64-linux-gnuabi64-gcc - ;; - mipsel-*) - container_hosts=3Dx86_64 - container_image=3Ddebian-mipsel-cross - container_cross_cc=3Dmipsel-linux-gnu-gcc - ;; - mips-*) - container_hosts=3Dx86_64 - container_image=3Ddebian-mips-cross - container_cross_cc=3Dmips-linux-gnu-gcc - ;; - nios2-*) - container_hosts=3Dx86_64 - container_image=3Ddebian-nios2-cross - container_cross_cc=3Dnios2-linux-gnu-gcc - ;; - ppc-*) - container_hosts=3Dx86_64 - container_image=3Ddebian-powerpc-test-cross - container_cross_cc=3Dpowerpc-linux-gnu-gcc-10 - ;; - ppc64-*|ppc64le-*) - container_hosts=3Dx86_64 - container_image=3Ddebian-powerpc-test-cross - container_cross_cc=3D${target%%-*}-linux-gnu-gcc-10 - container_cross_cc=3Dpowerpc${container_cross_cc#ppc} - ;; - riscv64-*) - container_hosts=3Dx86_64 - container_image=3Ddebian-riscv64-test-cross - container_cross_cc=3Driscv64-linux-gnu-gcc - ;; - s390x-*) - container_hosts=3Dx86_64 - container_image=3Ddebian-s390x-cross - container_cross_cc=3Ds390x-linux-gnu-gcc - ;; - sh4-*) - container_hosts=3Dx86_64 - container_image=3Ddebian-sh4-cross - container_cross_cc=3Dsh4-linux-gnu-gcc - ;; - sparc64-*) - container_hosts=3Dx86_64 - container_image=3Ddebian-sparc64-cross - container_cross_cc=3Dsparc64-linux-gnu-gcc - ;; - tricore-softmmu) - container_hosts=3Dx86_64 - container_image=3Ddebian-tricore-cross - container_cross_as=3Dtricore-as - container_cross_ld=3Dtricore-ld - ;; - x86_64-*) - container_hosts=3D"aarch64 ppc64el x86_64" - container_image=3Ddebian-amd64-cross - container_cross_cc=3Dx86_64-linux-gnu-gcc - supress_clang=3Dyes - ;; - xtensa*-softmmu) - container_hosts=3Dx86_64 - container_image=3Ddebian-xtensa-cross - - # default to the dc232b cpu - container_cross_cc=3D/opt/2020.07/xtensa-dc232b-elf/bin/xtensa-dc232= b-elf-gcc - ;; - esac - - config_target_mak=3Dtests/tcg/config-$target.mak - - echo "# Automatically generated by configure - do not modify" > $config_= target_mak - echo "TARGET_NAME=3D$arch" >> $config_target_mak - case $target in - *-softmmu) - test -f $source_path/tests/tcg/$arch/Makefile.softmmu-target || cont= inue - qemu=3D"qemu-system-$arch" - ;; - *-linux-user|*-bsd-user) - qemu=3D"qemu-$arch" - ;; - esac - - eval "target_compiler_cflags=3D\${cross_cc_cflags_$arch}" - - got_cross_cc=3Dno - - if eval test "x\"\${cross_cc_$arch}\"" !=3D xyes; then - eval "target_compiler=3D\"\${cross_cc_$arch}\"" - - if has $target_compiler; then - if test "$supress_clang" =3D yes && - $target_compiler --version | grep -qi "clang"; then - got_cross_cc=3Dno - else - write_c_skeleton - if ! do_compiler "$target_compiler" $target_compiler_cflags \ - -o $TMPE $TMPC -static ; then - # For host systems we might get away with building witho= ut -static - if do_compiler "$target_compiler" $target_compiler_cflag= s \ - -o $TMPE $TMPC ; then - got_cross_cc=3Dyes - echo "CC=3D$target_compiler" >> $config_target_mak - fi - else - got_cross_cc=3Dyes - echo "BUILD_STATIC=3Dy" >> $config_target_mak - echo "CC=3D$target_compiler" >> $config_target_mak - fi - fi - fi - - # Special handling for assembler only tests - eval "target_as=3D\"\${cross_as_$arch}\"" - eval "target_ld=3D\"\${cross_ld_$arch}\"" - if has $target_as && has $target_ld; then - case $target in - tricore-softmmu) - echo "AS=3D$target_as" >> $config_target_mak - echo "LD=3D$target_ld" >> $config_target_mak - got_cross_cc=3Dyes - ;; - esac - fi - fi - - if test $got_cross_cc =3D yes; then - # Test for compiler features for optional tests. We only do this - # for cross compilers because ensuring the docker containers based - # compilers is a requirememt for adding a new test that needs a - # compiler feature. - - case $target in - aarch64-*) - if do_compiler "$target_compiler" $target_compiler_cflags \ - -march=3Darmv8.1-a+sve -o $TMPE $TMPC; then - echo "CROSS_CC_HAS_SVE=3Dy" >> $config_target_mak - fi - if do_compiler "$target_compiler" $target_compiler_cflags \ - -march=3Darmv8.1-a+sve2 -o $TMPE $TMPC; then - echo "CROSS_CC_HAS_SVE2=3Dy" >> $config_target_mak - fi - if do_compiler "$target_compiler" $target_compiler_cflags \ - -march=3Darmv8.3-a -o $TMPE $TMPC; then - echo "CROSS_CC_HAS_ARMV8_3=3Dy" >> $config_target_mak - fi - if do_compiler "$target_compiler" $target_compiler_cflags \ - -mbranch-protection=3Dstandard -o $TMPE $TMPC= ; then - echo "CROSS_CC_HAS_ARMV8_BTI=3Dy" >> $config_target_mak - fi - if do_compiler "$target_compiler" $target_compiler_cflags \ - -march=3Darmv8.5-a+memtag -o $TMPE $TMPC; then - echo "CROSS_CC_HAS_ARMV8_MTE=3Dy" >> $config_target_mak - fi - ;; - ppc*) - if do_compiler "$target_compiler" $target_compiler_cflags \ - -mpower8-vector -o $TMPE $TMPC; then - echo "CROSS_CC_HAS_POWER8_VECTOR=3Dy" >> $config_target_= mak - fi - if do_compiler "$target_compiler" $target_compiler_cflags \ - -mpower10 -o $TMPE $TMPC; then - echo "CROSS_CC_HAS_POWER10=3Dy" >> $config_target_mak - fi - ;; - i386-linux-user) - if do_compiler "$target_compiler" $target_compiler_cflags \ - -Werror -fno-pie -o $TMPE $TMPC; then - echo "CROSS_CC_HAS_I386_NOPIE=3Dy" >> $config_target_mak - fi - ;; - esac - elif test $got_cross_cc =3D no && test "$container" !=3D no && \ - test -n "$container_image"; then - for host in $container_hosts; do - if test "$host" =3D "$cpu"; then - echo "build-tcg-tests-$target: docker-image-$container_image= " >> $makefile - echo "BUILD_STATIC=3Dy" >> $config_target_mak - echo "CC=3D\$(DOCKER_SCRIPT) cc --cc $container_cross_cc -i = qemu/$container_image -s $source_path --" >> $config_target_mak - if test -n "$container_cross_as"; then - echo "AS=3D\$(DOCKER_SCRIPT) cc --cc $container_cross_as= -i qemu/$container_image -s $source_path --" >> $config_target_mak - fi - if test -n "$container_cross_ld"; then - echo "LD=3D\$(DOCKER_SCRIPT) cc --cc $container_cross_ld= -i qemu/$container_image -s $source_path --" >> $config_target_mak - fi - case $target in - aarch64-*) - echo "CROSS_CC_HAS_SVE=3Dy" >> $config_target_mak - echo "CROSS_CC_HAS_SVE2=3Dy" >> $config_target_mak - echo "CROSS_CC_HAS_ARMV8_3=3Dy" >> $config_target_mak - echo "CROSS_CC_HAS_ARMV8_BTI=3Dy" >> $config_target_= mak - echo "CROSS_CC_HAS_ARMV8_MTE=3Dy" >> $config_target_= mak - ;; - ppc*) - echo "CROSS_CC_HAS_POWER8_VECTOR=3Dy" >> $config_tar= get_mak - echo "CROSS_CC_HAS_POWER10=3Dy" >> $config_target_mak - ;; - i386-linux-user) - echo "CROSS_CC_HAS_I386_NOPIE=3Dy" >> $config_target= _mak - ;; - esac - got_cross_cc=3Dyes - break - fi - done - fi - if test $got_cross_cc =3D yes; then - mkdir -p tests/tcg/$target - echo "QEMU=3D$PWD/$qemu" >> $config_target_mak - echo "EXTRA_CFLAGS=3D$target_compiler_cflags" >> $config_target_mak - echo "run-tcg-tests-$target: $qemu\$(EXESUF)" >> $makefile - tcg_tests_targets=3D"$tcg_tests_targets $target" - fi -done -echo "TCG_TESTS_TARGETS=3D$tcg_tests_targets" >> $makefile --=20 2.35.1 From nobody Sun May 5 07:47:08 2024 Delivered-To: importer2@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+importer2=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 1651242003755678.5467831023044; Fri, 29 Apr 2022 07:20:03 -0700 (PDT) Received: from localhost ([::1]:54738 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nkRTW-0008VD-Li for importer2@patchew.org; Fri, 29 Apr 2022 10:20:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57972) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nkRRs-0005fs-78 for qemu-devel@nongnu.org; Fri, 29 Apr 2022 10:18:20 -0400 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]:42740) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nkRRq-0004YQ-Hs for qemu-devel@nongnu.org; Fri, 29 Apr 2022 10:18:19 -0400 Received: by mail-ed1-x531.google.com with SMTP id z19so9228722edx.9 for ; Fri, 29 Apr 2022 07:18:18 -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.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Apr 2022 07:18:16 -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=v0YZFWXZvJXgxjhtdyBY6KrGRYnC6+BD1SAFyqVxXeY=; b=Bm0xpaj1gFwFzUJM1wJD8w74WT/I2zi8SuKXsZ27X1j3heupTf0lRblo1QYl95C3NO 1bargTUp0NWvcp2b71oPiGbr7iYimFVrcIn5urkNVCIBvRC9ExoH97jAWFd11Bnb6QCC gX39qVCC4Wr0xWt5W7Ir75gQtwFfsjorexcZxuu1zPoKxT6elqLlnr4daDeEq/i6Dfl3 RK4IcuWDxHsjt70dhlZrK+9lpuo2htzQ5epnAnqeCdyvRAyTGmk0K6w0lVEcXYM9n11W UAYtAOVQpppfRnacOLqwa3NvOtuwIhogWy6NkH1cnAoQ5o+GGNXF7f+M/CJp2OR48s7g Xoww== 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=v0YZFWXZvJXgxjhtdyBY6KrGRYnC6+BD1SAFyqVxXeY=; b=YweSldHzW5Z9J7DmN5A+E+DRP/Fb1gOUnEtJostZSrywIB/NxRSatx54hihAfYNMB/ pUBOYwVZkTOOvoqg0HTovhaOljHOYNpCmjRS4dLRdAF9lynwOl53QA1MV6f6+Uy1AJDh Dt6a4Qg7gYCWZcDa5u7RuEhh8VB83EbIAWs82SXmYCzuxSMnmTS/dxk4u9j4ArMH9jaz jXxVkiHKjR0Oe/jdjHN1IWRBueeuNWLDWOwGzIiTU8T+nYB8Zj4dyda5ficYsRrBZpkJ 8y71EkEGQoThaXo/antJEIaU2yWp957CeLKu1y9B7b+ddPx7InjgAs7NfMpvCJNneNtX sf3Q== X-Gm-Message-State: AOAM532i+sTMgV1FUlU2yWn9XWFvxvPcsneN3r/ux4pT+Y67DhLXenO1 7FE8Bf/3NdpS1cO80eOPNO3vf8oPTqGbOQ== X-Google-Smtp-Source: ABdhPJw+HJo+UxpcajDVO//rLlmULlCN/kWYASOz2U2N78p7kWogSYnwxf28ynF33HE5/LkP6PDSQw== X-Received: by 2002:a05:6402:358c:b0:426:19c0:2ee7 with SMTP id y12-20020a056402358c00b0042619c02ee7mr13083370edc.137.1651241896813; Fri, 29 Apr 2022 07:18:16 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [RFC PATCH 02/12] configure: add missing cross compiler fallbacks Date: Fri, 29 Apr 2022 16:18:03 +0200 Message-Id: <20220429141813.328975-3-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::531; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x531.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+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1651242005829100001 Content-Type: text/plain; charset="utf-8" The arm compiler can be used for armeb, and the sparc64 compiler can be used for sparc. Signed-off-by: Paolo Bonzini Reviewed-by: Richard Henderson --- configure | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 5d136492f8..a208459ff1 100755 --- a/configure +++ b/configure @@ -1845,6 +1845,7 @@ fi : ${cross_cc_cflags_aarch64_be=3D"-mbig-endian"} : ${cross_cc_alpha=3D"alpha-linux-gnu-gcc"} : ${cross_cc_arm=3D"arm-linux-gnueabihf-gcc"} +: ${cross_cc_armeb=3D"$cross_cc_arm"} : ${cross_cc_cflags_armeb=3D"-mbig-endian"} : ${cross_cc_hexagon=3D"hexagon-unknown-linux-musl-clang"} : ${cross_cc_cflags_hexagon=3D"-mv67 -O2 -static"} @@ -1867,9 +1868,10 @@ fi : ${cross_cc_riscv64=3D"riscv64-linux-gnu-gcc"} : ${cross_cc_s390x=3D"s390x-linux-gnu-gcc"} : ${cross_cc_sh4=3D"sh4-linux-gnu-gcc"} -: ${cross_cc_cflags_sparc=3D"-m32 -mv8plus -mcpu=3Dultrasparc"} : ${cross_cc_sparc64=3D"sparc64-linux-gnu-gcc"} : ${cross_cc_cflags_sparc64=3D"-m64 -mcpu=3Dultrasparc"} +: ${cross_cc_sparc=3D"$cross_cc_sparc64"} +: ${cross_cc_cflags_sparc=3D"-m32 -mv8plus -mcpu=3Dultrasparc"} : ${cross_cc_x86_64=3D"x86_64-linux-gnu-gcc"} : ${cross_cc_cflags_x86_64=3D"-m64"} =20 --=20 2.35.1 From nobody Sun May 5 07:47:08 2024 Delivered-To: importer2@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+importer2=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 1651242304318871.0591785618076; Fri, 29 Apr 2022 07:25:04 -0700 (PDT) Received: from localhost ([::1]:38032 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nkRYN-00081j-5G for importer2@patchew.org; Fri, 29 Apr 2022 10:25:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57976) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nkRRs-0005fv-MG for qemu-devel@nongnu.org; Fri, 29 Apr 2022 10:18:20 -0400 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]:45981) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nkRRr-0004Yb-31 for qemu-devel@nongnu.org; Fri, 29 Apr 2022 10:18:20 -0400 Received: by mail-ej1-x630.google.com with SMTP id y3so15684510ejo.12 for ; Fri, 29 Apr 2022 07:18:18 -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.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Apr 2022 07:18:17 -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=CKwxXqLYNV6OHtD6LrxQjyXmwSW3qhAClw+CCy5pf/g=; b=XVoZcaQxok5enJp4h9oiRzNh9sipSVIQoYbO0BTIqNKpJ+XgHQ+49tjlA0B7IHuNPJ RNdcYOePHoIw3Ivf7TSqXPzI/L++QciZDpnN5qLhR0u6JlolCiJtXiN0W7fALOm8dcOu RZom+pmaLLg0Psn6QIP4DU13ssUcuY1zbXSLOz6jZOQeLCJrEvBAP+foDNTo1a/L3i23 ZcBgz8XCMUae97DPz2E+NN0A8Bg5M4etFDhiqp8ofAWU9dJVgAj29Hw3kjiqcuVn6g2B 3GNuD6CoL3h5wBsfU4/YH27uF2L5j6PhXUGkxLcYuI1L38xNl41mPM12Pvr3cG8kT+s1 ObcQ== 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=CKwxXqLYNV6OHtD6LrxQjyXmwSW3qhAClw+CCy5pf/g=; b=1VyRk+xnTDKh4QUXetM+NUuK8P13jGoI3+/3NrM4TwmN7HngM2lIlXDPcvSFW1rGwL UlnRra503Uc1e7B47pwMM9je/27dKhc+8MHi2Za/ca+hTZcyPTnHyLaweDptGITWX7HX WMdJSSfCEIAG/WX+FbzEL1CKonBkKAFNhrxoxR+jY47JMQfeCfzpboVAM4VHdk7hxpK0 jctS9aplN+fxKnByH6iWIYnF2TNPCwcS48NnRR5pIWG4qLtObp25nMl4MIrNX07LR3Hv Hjm8yQ5L54hMcZfgaj+DlF2WB2265pgq1BIu264iPR4sk/VSgVOyASTb5FHWWo0UKlmy sm3w== X-Gm-Message-State: AOAM531BhixRhFOD1MWVK7HSeQvqQ2ZQZz53t2tJXnYwm85NwA2QP6Ng Y9xXX33LznGkOOne6Jx1fTg3NoYh60ii2Q== X-Google-Smtp-Source: ABdhPJyl/f8R+pwQ+IA8yT5zJ24p6iWpq9xmkU174oA43gAAGYKjyLXgJWUfdDHB8fC8Lf0mNOhdFw== X-Received: by 2002:a17:907:7254:b0:6db:ad8f:27b4 with SMTP id ds20-20020a170907725400b006dbad8f27b4mr36819858ejc.599.1651241897660; Fri, 29 Apr 2022 07:18:17 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [RFC PATCH 03/12] configure: handle host compiler in probe_target_compiler Date: Fri, 29 Apr 2022 16:18:04 +0200 Message-Id: <20220429141813.328975-4-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x630.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+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1651242306172100001 Content-Type: text/plain; charset="utf-8" In preparation for handling more binaries than just cc, handle the case of "probe_target_compiler $cpu" directly in the function, setting the target_* variables based on the ones that are used to build QEMU. The clang check also needs to be moved after this fallback. Signed-off-by: Paolo Bonzini --- configure | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/configure b/configure index a208459ff1..5277ac9092 100755 --- a/configure +++ b/configure @@ -965,10 +965,6 @@ case $git_submodules_action in ;; esac =20 -if eval test -z "\${cross_cc_$cpu}"; then - eval "cross_cc_${cpu}=3D\$cc" -fi - default_target_list=3D"" mak_wilds=3D"" =20 @@ -2026,13 +2022,6 @@ probe_target_compiler() { if eval test -n "\"\${cross_cc_$1}\""; then if eval has "\"\${cross_cc_$1}\""; then eval "target_cc=3D\"\${cross_cc_$1}\"" - case $1 in - i386|x86_64) - if $target_cc --version | grep -qi "clang"; then - unset target_cc - fi - ;; - esac fi fi if eval test -n "\"\${cross_as_$1}\""; then @@ -2045,6 +2034,20 @@ probe_target_compiler() { eval "target_ld=3D\"\${cross_ld_$1}\"" fi fi + if test "$1" =3D $cpu; then + : ${target_cc:=3D$cc} + : ${target_as:=3D$as} + : ${target_ld:=3D$ld} + fi + if test -n "$target_cc"; then + case $1 in + i386|x86_64) + if $target_cc --version | grep -qi "clang"; then + unset target_cc + fi + ;; + esac + fi } =20 write_target_makefile() { --=20 2.35.1 From nobody Sun May 5 07:47:08 2024 Delivered-To: importer2@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+importer2=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 1651242391535340.47978308623453; Fri, 29 Apr 2022 07:26:31 -0700 (PDT) Received: from localhost ([::1]:43490 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nkRZm-0003QJ-1D for importer2@patchew.org; Fri, 29 Apr 2022 10:26:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58004) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nkRRv-0005gw-09 for qemu-devel@nongnu.org; Fri, 29 Apr 2022 10:18:23 -0400 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]:36760) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nkRRr-0004Yq-Vl for qemu-devel@nongnu.org; Fri, 29 Apr 2022 10:18:21 -0400 Received: by mail-ed1-x52f.google.com with SMTP id a1so9265028edt.3 for ; Fri, 29 Apr 2022 07:18:19 -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.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Apr 2022 07:18:18 -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=xLtzTvp+FE6KwXO4pgqn4X4tFBND/jCa/NstrMYwYbk=; b=kBUDRZhylYrsPICMhfjIUyQefP9hguhJt73PlTBvsjjwUAsWfFORpTNWmx3VnF1PDb vndBBCc6GVITuLZI02Kz2fZ17PGeuat8PVIonSNxR5YPHTEevNMPAsuV1PbE4iqDwX6H ryMuFar/+Z4xTYqHBdEtKxj/f6vLgG5bS/OJYD6lVBBNAVJvemEth7WRI/zhNvhOX4NX 4oRWtgtyC8tSWe//+Es3bRTJz1TJEpwqxymcraVOudrjtltSsic5DQ/METNG+IwAR4f2 BBW/4vQ2hrxZiTjqbncvB+SvBxhYgIOiBZOZg6Qc5uRve5PFvPiYqNNu91qmvFfEBNHj kaaA== 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=xLtzTvp+FE6KwXO4pgqn4X4tFBND/jCa/NstrMYwYbk=; b=WeAswrqil8n/67FVaR3YZKi02FQhv2bOi70B5RLe4KiUOV39l41tphRAuOUIzkOAlj dj6pIYtxkSO3jHSM9LSzXGrJjJFhrxhLbTjZ/5ap/mYU3uw3i0dCAExS/YPTudVhsPyx cHSePgg9T7NrbS3vx98M714VfhndqXxxmEqR+rHBBd9k8fkyyXEwodmoUl5RTQuJkiKf HZ6HwEnD7IKnLO+kZ0BLVFi45xWj5/lUh+oyNiChSmMtbROxuMp6dNUyr7Yqm608qVwJ fq93v6VvN0uCxmVbFpbd1yKmdWdrC0YKqKIDx02l8akpmPaLB42i4/hbMDWuZAviHjZC fUgQ== X-Gm-Message-State: AOAM533LJz0/OpL+8eUXcEfHcuDT02bXAh9AoF3Ooa2ZrIsr/eX/eTl9 tDi4bA0UaFmAh6PXozZN6/9ta57XVt1oRA== X-Google-Smtp-Source: ABdhPJyWRVT8wMXpPzWRIdW57MQlA2buZUOOo/agBK5afQurXcrK9g/hCEQiQex67slhVIY/AGDRmQ== X-Received: by 2002:a50:8dca:0:b0:425:e8a3:a79f with SMTP id s10-20020a508dca000000b00425e8a3a79fmr27087685edh.155.1651241898512; Fri, 29 Apr 2022 07:18:18 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [RFC PATCH 04/12] configure: introduce --cross-prefix-*= Date: Fri, 29 Apr 2022 16:18:05 +0200 Message-Id: <20220429141813.328975-5-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::52f; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x52f.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+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1651242392383100001 Content-Type: text/plain; charset="utf-8" Also in preparation for handling more binaries from the cross binutils, support an option --cross-prefix-ARCH. All cross_cc_* defaults are replaced with cross_prefix_*; the cross_cc_* fallbacks are extended to the cross-compilation prefix, but the compiler fallbacks remain as well. This way, for example, --cross-cc-arm=3Darm-linux-gnueabihf-clang also applies to armeb binaries. Signed-off-by: Paolo Bonzini Reviewed-by: Richard Henderson --- configure | 137 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 77 insertions(+), 60 deletions(-) diff --git a/configure b/configure index 5277ac9092..c05eeb6a74 100755 --- a/configure +++ b/configure @@ -365,6 +365,11 @@ for opt do --cross-cc-*) cc_arch=3D${opt#--cross-cc-}; cc_arch=3D${cc_arch%%=3D*} eval "cross_cc_${cc_arch}=3D\$optarg" ;; + --cross-prefix-*[!a-zA-Z0-9_-]*=3D*) error_exit "Passed bad --cross-pref= ix-FOO option" + ;; + --cross-prefix-*) cc_arch=3D${opt#--cross-prefix-}; cc_arch=3D${cc_arch%= %=3D*} + eval "cross_prefix_${cc_arch}=3D\$optarg" + ;; esac done # OS specific @@ -731,6 +736,8 @@ for opt do ;; --cross-cc-*) ;; + --cross-prefix-*) + ;; --enable-debug-info) meson_option_add -Ddebug=3Dtrue ;; --disable-debug-info) meson_option_add -Ddebug=3Dfalse @@ -1027,6 +1034,7 @@ Advanced options (experts only): --extra-ldflags=3DLDFLAGS append extra linker flags LDFLAGS --cross-cc-ARCH=3DCC use compiler when building ARCH guest test ca= ses --cross-cc-cflags-ARCH=3D use compiler flags when building ARCH guest t= ests + --cross-prefix-ARCH=3DPREFIX cross compiler prefix when building ARCH gu= est test cases --make=3DMAKE use specified make [$make] --python=3DPYTHON use specified python [$python] --meson=3DMESON use specified meson [$meson] @@ -1836,44 +1844,54 @@ if test $use_containers =3D "yes"; then fi =20 # cross compilers defaults, can be overridden with --cross-cc-ARCH -: ${cross_cc_aarch64=3D"aarch64-linux-gnu-gcc"} +: ${cross_prefix_aarch64=3D"aarch64-linux-gnu-"} +: ${cross_prefix_aarch64_be=3D"$cross_prefix_aarch64"} +: ${cross_prefix_alpha=3D"alpha-linux-gnu-"} +: ${cross_prefix_arm=3D"arm-linux-gnueabihf-"} +: ${cross_prefix_armeb=3D"$cross_prefix_arm"} +: ${cross_prefix_hexagon=3D"hexagon-unknown-linux-musl-"} +: ${cross_prefix_hppa=3D"hppa-linux-gnu-"} +: ${cross_prefix_i386=3D"i686-linux-gnu-"} +: ${cross_prefix_m68k=3D"m68k-linux-gnu-"} +: ${cross_prefix_microblaze=3D"microblaze-linux-musl-"} +: ${cross_prefix_mips64el=3D"mips64el-linux-gnuabi64-"} +: ${cross_prefix_mips64=3D"mips64-linux-gnuabi64-"} +: ${cross_prefix_mipsel=3D"mipsel-linux-gnu-"} +: ${cross_prefix_mips=3D"mips-linux-gnu-"} +: ${cross_prefix_nios2=3D"nios2-linux-gnu-"} +: ${cross_prefix_ppc=3D"powerpc-linux-gnu-"} +: ${cross_prefix_ppc64=3D"powerpc64-linux-gnu-"} +: ${cross_prefix_ppc64le=3D"$cross_prefix_ppc64-"} +: ${cross_prefix_riscv64=3D"riscv64-linux-gnu-"} +: ${cross_prefix_s390x=3D"s390x-linux-gnu-"} +: ${cross_prefix_sh4=3D"sh4-linux-gnu-"} +: ${cross_prefix_sparc64=3D"sparc64-linux-gnu-"} +: ${cross_prefix_sparc64=3D"sparc64-linux-gnu-"} +: ${cross_prefix_x86_64=3D"x86_64-linux-gnu-"} + : ${cross_cc_aarch64_be=3D"$cross_cc_aarch64"} : ${cross_cc_cflags_aarch64_be=3D"-mbig-endian"} -: ${cross_cc_alpha=3D"alpha-linux-gnu-gcc"} -: ${cross_cc_arm=3D"arm-linux-gnueabihf-gcc"} : ${cross_cc_armeb=3D"$cross_cc_arm"} : ${cross_cc_cflags_armeb=3D"-mbig-endian"} : ${cross_cc_hexagon=3D"hexagon-unknown-linux-musl-clang"} : ${cross_cc_cflags_hexagon=3D"-mv67 -O2 -static"} -: ${cross_cc_hppa=3D"hppa-linux-gnu-gcc"} -: ${cross_cc_i386=3D"i686-linux-gnu-gcc"} : ${cross_cc_cflags_i386=3D"-m32"} -: ${cross_cc_m68k=3D"m68k-linux-gnu-gcc"} -: ${cross_cc_microblaze=3D"microblaze-linux-musl-gcc"} -: ${cross_cc_mips64el=3D"mips64el-linux-gnuabi64-gcc"} -: ${cross_cc_mips64=3D"mips64-linux-gnuabi64-gcc"} -: ${cross_cc_mipsel=3D"mipsel-linux-gnu-gcc"} -: ${cross_cc_mips=3D"mips-linux-gnu-gcc"} -: ${cross_cc_nios2=3D"nios2-linux-gnu-gcc"} -: ${cross_cc_ppc=3D"powerpc-linux-gnu-gcc"} : ${cross_cc_cflags_ppc=3D"-m32"} -: ${cross_cc_ppc64=3D"powerpc64-linux-gnu-gcc"} : ${cross_cc_cflags_ppc64=3D"-m64 -mbig-endian"} : ${cross_cc_ppc64le=3D"$cross_cc_ppc64"} : ${cross_cc_cflags_ppc64le=3D"-m64 -mlittle-endian"} -: ${cross_cc_riscv64=3D"riscv64-linux-gnu-gcc"} -: ${cross_cc_s390x=3D"s390x-linux-gnu-gcc"} -: ${cross_cc_sh4=3D"sh4-linux-gnu-gcc"} -: ${cross_cc_sparc64=3D"sparc64-linux-gnu-gcc"} : ${cross_cc_cflags_sparc64=3D"-m64 -mcpu=3Dultrasparc"} : ${cross_cc_sparc=3D"$cross_cc_sparc64"} : ${cross_cc_cflags_sparc=3D"-m32 -mv8plus -mcpu=3Dultrasparc"} -: ${cross_cc_x86_64=3D"x86_64-linux-gnu-gcc"} : ${cross_cc_cflags_x86_64=3D"-m64"} =20 -# tricore is special as it doesn't have a compiler -: ${cross_as_tricore=3D"tricore-as"} -: ${cross_ld_tricore=3D"tricore-ld"} +compute_target_variable() { + if eval test -n "\"\${cross_prefix_$1}\""; then + if eval has "\"\${cross_prefix_$1}\$3\""; then + eval "$2=3D\"\${cross_prefix_$1}\$3\"" + fi + fi +} =20 probe_target_compiler() { # reset all output variables @@ -1919,93 +1937,99 @@ probe_target_compiler() { aarch64) # We don't have any bigendian build tools so we only use this for = AArch64 container_image=3Ddebian-arm64-cross - container_cross_cc=3Daarch64-linux-gnu-gcc-10 + container_cross_prefix=3Daarch64-linux-gnu- + container_cross_cc=3D${container_cross_prefix}gcc-10 ;; alpha) container_image=3Ddebian-alpha-cross - container_cross_cc=3Dalpha-linux-gnu-gcc + container_cross_prefix=3Dalpha-linux-gnu- ;; arm) # We don't have any bigendian build tools so we only use this for = ARM container_image=3Ddebian-armhf-cross - container_cross_cc=3Darm-linux-gnueabihf-gcc + container_cross_prefix=3Darm-linux-gnueabihf- ;; cris) container_image=3Dfedora-cris-cross - container_cross_cc=3Dcris-linux-gnu-gcc + container_cross_prefix=3Dcris-linux-gnu- ;; hexagon) container_image=3Ddebian-hexagon-cross - container_cross_cc=3Dhexagon-unknown-linux-musl-clang + container_cross_prefix=3Dhexagon-unknown-linux-musl- + container_cross_cc=3D${container_cross_prefix}clang ;; hppa) container_image=3Ddebian-hppa-cross - container_cross_cc=3Dhppa-linux-gnu-gcc + container_cross_prefix=3Dhppa-linux-gnu- ;; i386) container_image=3Dfedora-i386-cross - container_cross_cc=3Dgcc + container_cross_prefix=3D ;; m68k) container_image=3Ddebian-m68k-cross - container_cross_cc=3Dm68k-linux-gnu-gcc + container_cross_prefix=3Dm68k-linux-gnu- ;; microblaze) container_image=3Ddebian-microblaze-cross - container_cross_cc=3Dmicroblaze-linux-musl-gcc + container_cross_prefix=3Dmicroblaze-linux-musl- ;; mips64el) container_image=3Ddebian-mips64el-cross - container_cross_cc=3Dmips64el-linux-gnuabi64-gcc + container_cross_prefix=3Dmips64el-linux-gnuabi64- ;; mips64) container_image=3Ddebian-mips64-cross - container_cross_cc=3Dmips64-linux-gnuabi64-gcc + container_cross_prefix=3Dmips64-linux-gnuabi64- ;; mipsel) container_image=3Ddebian-mipsel-cross - container_cross_cc=3Dmipsel-linux-gnu-gcc + container_cross_prefix=3Dmipsel-linux-gnu- ;; mips) container_image=3Ddebian-mips-cross - container_cross_cc=3Dmips-linux-gnu-gcc + container_cross_prefix=3Dmips-linux-gnu- ;; nios2) container_image=3Ddebian-nios2-cross - container_cross_cc=3Dnios2-linux-gnu-gcc + container_cross_prefix=3Dnios2-linux-gnu- ;; ppc) container_image=3Ddebian-powerpc-test-cross - container_cross_cc=3Dpowerpc-linux-gnu-gcc-10 + container_cross_prefix=3Dpowerpc-linux-gnu- + container_cross_cc=3D${container_cross_prefix}gcc-10 ;; ppc64|ppc64le) container_image=3Ddebian-powerpc-test-cross - container_cross_cc=3Dpowerpc${1#ppc}-linux-gnu-gcc-10 + container_cross_prefix=3Dpowerpc${1#ppc}-linux-gnu- + container_cross_cc=3D${container_cross_prefix}gcc-10 ;; riscv64) container_image=3Ddebian-riscv64-test-cross - container_cross_cc=3Driscv64-linux-gnu-gcc + container_cross_prefix=3Driscv64-linux-gnu- ;; s390x) container_image=3Ddebian-s390x-cross - container_cross_cc=3Ds390x-linux-gnu-gcc + container_cross_prefix=3Ds390x-linux-gnu- ;; sh4) container_image=3Ddebian-sh4-cross - container_cross_cc=3Dsh4-linux-gnu-gcc + container_cross_prefix=3Dsh4-linux-gnu- ;; sparc64) container_image=3Ddebian-sparc64-cross - container_cross_cc=3Dsparc64-linux-gnu-gcc + container_cross_prefix=3Dsparc64-linux-gnu- ;; tricore) container_image=3Ddebian-tricore-cross + container_cross_prefix=3Dtricore- container_cross_as=3Dtricore-as container_cross_ld=3Dtricore-ld + break ;; x86_64) container_image=3Ddebian-amd64-cross - container_cross_cc=3Dx86_64-linux-gnu-gcc + container_cross_prefix=3Dx86_64-linux-gnu- ;; xtensa*) # FIXME: xtensa-linux-user? @@ -2013,9 +2037,12 @@ probe_target_compiler() { container_image=3Ddebian-xtensa-cross =20 # default to the dc232b cpu - container_cross_cc=3D/opt/2020.07/xtensa-dc232b-elf/bin/xtensa-dc2= 32b-elf-gcc + container_cross_prefix=3D/opt/2020.07/xtensa-dc232b-elf/bin/xtensa= -dc232b-elf- ;; esac + : ${container_cross_cc:=3D${container_cross_prefix}gcc} + : ${container_cross_as:=3D${container_cross_prefix}as} + : ${container_cross_ld:=3D${container_cross_prefix}ld} done =20 eval "target_cflags=3D\${cross_cc_cflags_$1}" @@ -2023,17 +2050,11 @@ probe_target_compiler() { if eval has "\"\${cross_cc_$1}\""; then eval "target_cc=3D\"\${cross_cc_$1}\"" fi + else + compute_target_variable $1 target_cc gcc fi - if eval test -n "\"\${cross_as_$1}\""; then - if eval has "\"\${cross_as_$1}\""; then - eval "target_as=3D\"\${cross_as_$1}\"" - fi - fi - if eval test -n "\"\${cross_ld_$1}\""; then - if eval has "\"\${cross_ld_$1}\""; then - eval "target_ld=3D\"\${cross_ld_$1}\"" - fi - fi + compute_target_variable $1 target_as as + compute_target_variable $1 target_ld ld if test "$1" =3D $cpu; then : ${target_cc:=3D$cc} : ${target_as:=3D$as} @@ -2066,12 +2087,8 @@ write_container_target_makefile() { if test -n "$container_cross_cc"; then echo "CC=3D\$(DOCKER_SCRIPT) cc --cc $container_cross_cc -i qemu/$cont= ainer_image -s $source_path --" fi - if test -n "$container_cross_as"; then - echo "AS=3D\$(DOCKER_SCRIPT) cc --cc $container_cross_as -i qemu/$cont= ainer_image -s $source_path --" - fi - if test -n "$container_cross_ld"; then - echo "LD=3D\$(DOCKER_SCRIPT) cc --cc $container_cross_ld -i qemu/$cont= ainer_image -s $source_path --" - fi + echo "AS=3D\$(DOCKER_SCRIPT) cc --cc $container_cross_as -i qemu/$contai= ner_image -s $source_path --" + echo "LD=3D\$(DOCKER_SCRIPT) cc --cc $container_cross_ld -i qemu/$contai= ner_image -s $source_path --" } =20 =20 --=20 2.35.1 From nobody Sun May 5 07:47:08 2024 Delivered-To: importer2@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+importer2=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 1651242024220771.6047684197407; Fri, 29 Apr 2022 07:20:24 -0700 (PDT) Received: from localhost ([::1]:54880 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nkRTq-00009r-RX for importer2@patchew.org; Fri, 29 Apr 2022 10:20:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58040) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nkRRw-0005iY-BK for qemu-devel@nongnu.org; Fri, 29 Apr 2022 10:18:24 -0400 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]:33380) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nkRRu-0004Z6-NQ for qemu-devel@nongnu.org; Fri, 29 Apr 2022 10:18:24 -0400 Received: by mail-ed1-x532.google.com with SMTP id p4so9320514edx.0 for ; Fri, 29 Apr 2022 07:18:20 -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.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Apr 2022 07:18:18 -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=GMCY4YCH8i/SiEFJws5UTh2zIpQl/Kl6qbHZlEXIHXY=; b=oRBfAvvklsRCjEeQ6D1TCPo9hTEd/3NMrVCn3StPp+ZIrFtBkOI2Il3VC6/LTXqUi/ AN+Xct3C/47Ussx2Lq++sFr/48jrFqWXqW7XTqmJJqGcfA3ui3dFc9Uf0/879s37QgU9 Q6th4PoF68o6r04+lMCJc0VftpcaWb8DiWUYdHlZ2jL2uszb3Wg73c/kFq1FQknzYc+M QlYXoB9T1AE/K+bLHlFezZW9bDJixGs7lzF6h5/TG7VtbpNjj9lq55TjDz7/eM4iXrFV oSAToegUO7VRaX8rcZTZNw7gYjvb4HHMw1tOMe8l8EdIzEk0fMEIovP3n+3MNslTv49k smOg== 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=GMCY4YCH8i/SiEFJws5UTh2zIpQl/Kl6qbHZlEXIHXY=; b=FLgNwk1+ynOQe9hQY84PKpYjuWTYeqdRzHu/Y7x63hqliMzOWROQeTL4L3Bfw9jhcw Tjd9DOvgUR5rr8eSz3npdnjXh02qPssNgqq0H2GEMOzs0b0LG77U6HSl8rllEXuk/Jpg 09Fa7q70Thx1WnD5VLA2E6FNPiMiKyS/7hxinAIGObF/XDWxX6pb3k22EHbCx9CevLLh 040PfQgrbAqIIleC0tAsfyWGmMWzt6rby90IN4W2DzpByoAKlbA0FSUSqYHgA5u3oehQ gDDrADzkYWW1YWMfWBBzWKaQQjyXnSGqIG+DvcF6nA526Qe6utJFbtqouF8jTF0Mq5RZ 0KqQ== X-Gm-Message-State: AOAM531Qm7KJHUc3zfDzznn5aimzlHQ7i3tYB7Op6cX+A7Dk3M5dAOnz St5RmYKyspCg0suYSXrwmqiubU0T2sMLEg== X-Google-Smtp-Source: ABdhPJwxv/AUg5NubtYuLGzAXFxAxI6JYEPoG1qrBYE9gOiavaItlfAQCW70R65qBGMlJpngCjJ7rw== X-Received: by 2002:a05:6402:3508:b0:426:1b4:a2e2 with SMTP id b8-20020a056402350800b0042601b4a2e2mr17024375edd.387.1651241899619; Fri, 29 Apr 2022 07:18:19 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [RFC PATCH 05/12] configure: include more binutils in tests/tcg makefile Date: Fri, 29 Apr 2022 16:18:06 +0200 Message-Id: <20220429141813.328975-6-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::532; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x532.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+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1651242024723100002 Content-Type: text/plain; charset="utf-8" Firmware builds require paths to all the binutils; it is not enough to use only cc, or even as/ld as in the case of tests/tcg/tricore. Adjust the cross-compiler configurator to detect also ar, nm, objcopy, ranlib and strip. Signed-off-by: Paolo Bonzini Reviewed-by: Richard Henderson --- configure | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/configure b/configure index c05eeb6a74..8626989239 100755 --- a/configure +++ b/configure @@ -1898,11 +1898,21 @@ probe_target_compiler() { container_image=3D container_hosts=3D container_cross_cc=3D + container_cross_ar=3D container_cross_as=3D container_cross_ld=3D + container_cross_nm=3D + container_cross_objcopy=3D + container_cross_ranlib=3D + container_cross_strip=3D target_cc=3D + target_ar=3D target_as=3D target_ld=3D + target_nm=3D + target_objcopy=3D + target_ranlib=3D + target_strip=3D =20 case $1 in aarch64) container_hosts=3D"x86_64 aarch64" ;; @@ -2041,8 +2051,13 @@ probe_target_compiler() { ;; esac : ${container_cross_cc:=3D${container_cross_prefix}gcc} + : ${container_cross_ar:=3D${container_cross_prefix}ar} : ${container_cross_as:=3D${container_cross_prefix}as} : ${container_cross_ld:=3D${container_cross_prefix}ld} + : ${container_cross_nm:=3D${container_cross_prefix}nm} + : ${container_cross_objcopy:=3D${container_cross_prefix}objcopy} + : ${container_cross_ranlib:=3D${container_cross_prefix}ranlib} + : ${container_cross_strip:=3D${container_cross_prefix}strip} done =20 eval "target_cflags=3D\${cross_cc_cflags_$1}" @@ -2053,12 +2068,26 @@ probe_target_compiler() { else compute_target_variable $1 target_cc gcc fi + target_ccas=3D$target_cc + compute_target_variable $1 target_ar ar compute_target_variable $1 target_as as compute_target_variable $1 target_ld ld + compute_target_variable $1 target_nm nm + compute_target_variable $1 target_objcopy objcopy + compute_target_variable $1 target_ranlib ranlib + compute_target_variable $1 target_strip strip if test "$1" =3D $cpu; then : ${target_cc:=3D$cc} + : ${target_ccas:=3D$ccas} : ${target_as:=3D$as} : ${target_ld:=3D$ld} + : ${target_ar:=3D$ar} + : ${target_as:=3D$as} + : ${target_ld:=3D$ld} + : ${target_nm:=3D$nm} + : ${target_objcopy:=3D$objcopy} + : ${target_ranlib:=3D$ranlib} + : ${target_strip:=3D$strip} fi if test -n "$target_cc"; then case $1 in @@ -2074,6 +2103,10 @@ probe_target_compiler() { write_target_makefile() { if test -n "$target_cc"; then echo "CC=3D$target_cc" + echo "CCAS=3D$target_ccas" + fi + if test -n "$target_ar"; then + echo "AR=3D$target_ar" fi if test -n "$target_as"; then echo "AS=3D$target_as" @@ -2081,14 +2114,32 @@ write_target_makefile() { if test -n "$target_ld"; then echo "LD=3D$target_ld" fi + if test -n "$target_nm"; then + echo "NM=3D$target_nm" + fi + if test -n "$target_objcopy"; then + echo "OBJCOPY=3D$target_objcopy" + fi + if test -n "$target_ranlib"; then + echo "RANLIB=3D$target_ranlib" + fi + if test -n "$target_strip"; then + echo "STRIP=3D$target_strip" + fi } =20 write_container_target_makefile() { if test -n "$container_cross_cc"; then echo "CC=3D\$(DOCKER_SCRIPT) cc --cc $container_cross_cc -i qemu/$cont= ainer_image -s $source_path --" + echo "CCAS=3D\$(DOCKER_SCRIPT) cc --cc $container_cross_cc -i qemu/$co= ntainer_image -s $source_path --" fi + echo "AR=3D\$(DOCKER_SCRIPT) cc --cc $container_cross_ar -i qemu/$contai= ner_image -s $source_path --" echo "AS=3D\$(DOCKER_SCRIPT) cc --cc $container_cross_as -i qemu/$contai= ner_image -s $source_path --" echo "LD=3D\$(DOCKER_SCRIPT) cc --cc $container_cross_ld -i qemu/$contai= ner_image -s $source_path --" + echo "NM=3D\$(DOCKER_SCRIPT) cc --cc $container_cross_nm -i qemu/$contai= ner_image -s $source_path --" + echo "OBJCOPY=3D\$(DOCKER_SCRIPT) cc --cc $container_cross_objcopy -i qe= mu/$container_image -s $source_path --" + echo "RANLIB=3D\$(DOCKER_SCRIPT) cc --cc $container_cross_ranlib -i qemu= /$container_image -s $source_path --" + echo "STRIP=3D\$(DOCKER_SCRIPT) cc --cc $container_cross_strip -i qemu/$= container_image -s $source_path --" } =20 =20 --=20 2.35.1 From nobody Sun May 5 07:47:08 2024 Delivered-To: importer2@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+importer2=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 1651242192413772.181711599108; Fri, 29 Apr 2022 07:23:12 -0700 (PDT) Received: from localhost ([::1]:34998 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nkRWZ-0005yL-Di for importer2@patchew.org; Fri, 29 Apr 2022 10:23:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58036) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nkRRw-0005iW-97 for qemu-devel@nongnu.org; Fri, 29 Apr 2022 10:18:24 -0400 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]:42741) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nkRRu-0004ZK-Ng for qemu-devel@nongnu.org; Fri, 29 Apr 2022 10:18:24 -0400 Received: by mail-ed1-x531.google.com with SMTP id z19so9228958edx.9 for ; Fri, 29 Apr 2022 07:18:21 -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.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Apr 2022 07:18:20 -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=D/6OytvJbsLh0C+nIPVe7VJ1Gh5+e5oo89SAz9CqAEM=; b=IrKA8kAVXWTWjnZM2GSLaGVrLFA7ZUXg/SgAk//fLbJ2W6b6+414G0bi23hxmcSVPK YqvXgtu3PHC0ePEuu6PJoF5LJn2MhX7lO+58RX9sdTZ4pc+rAVOfOteeJ6s5Tb7hrXD6 uBpHlu7WKq5oE719UDib3jeOxdAtzBkNPiUdX6qol/w9MMukA/X4gS+kgtopEnz+qkfC ySm/7hkzsJGPp1D8yNUrijGceXuVOYNhckkNv9qRsfwjTnFo3G5ur2P/SxwIbLvkHpTK oBWlEmKoGZiXfKMGLTKDU6NXhbLQraL6FVKBxLwPkm0YvCALFdnNszX9M/quiXqnz8Rr /RNg== 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=D/6OytvJbsLh0C+nIPVe7VJ1Gh5+e5oo89SAz9CqAEM=; b=wYw4mhcozgB9WqmnHlQbLhqmztNoCmNe/ZjrdSTkkm2pZkkBIG/KJ0dninDPajZw+a pqqRIBMfY87FUq0A2/XWhX8RfjTwayH4JiFMg7FEWWfZbOlTZAF+BZC9OHfHKAMVVPN0 tKt1z6WodlTC9n5GdYl7ChYfRkOo37l6IideA4LaoqW92MppOMKy87Y55uiDnGyX1n4g AdxIdJeTPkJ1vNJDTapdCTfresQw6fbdMKDPM5UWwQS9XHIaP6chP5bjmiUYKL0IUxOd oIHEBRl/wJ7bSwQ7Gw4uEyjha1eVOYlqQ1EGwiHNKi4W6jawA3ZaFkQPo4NkY61H2m4E OYZg== X-Gm-Message-State: AOAM532B97EcrEXCCwqnUwHlFkxVYgFLFeicr7XOVTYx63VjjOZk8Qrh OmGZc9HPAMBdi+hPP3dueq4qZfeFt2VZOQ== X-Google-Smtp-Source: ABdhPJxgM0aOApzFH/L3TVA/ezFuWAcyQIEwheFkGcFK4eXpLsl8u5ORffEdC00IRs7xCcmtKv/bnA== X-Received: by 2002:a50:ee11:0:b0:425:b5b3:a48d with SMTP id g17-20020a50ee11000000b00425b5b3a48dmr41550691eds.246.1651241900556; Fri, 29 Apr 2022 07:18:20 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [RFC PATCH 06/12] configure, meson: move symlinking of ROMs to meson Date: Fri, 29 Apr 2022 16:18:07 +0200 Message-Id: <20220429141813.328975-7-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::531; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x531.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+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1651242192778100001 Content-Type: text/plain; charset="utf-8" This is useful because pc-bios/meson.build already has a list of all ROM files, and thus does not need to use wildcards. The problems with wildcards are mentioned above the definition of the LINKS variable, but then the recommendation is disattended. Signed-off-by: Paolo Bonzini Reviewed-by: Richard Henderson --- configure | 15 --------------- pc-bios/meson.build | 18 +++++++++++++----- tests/Makefile.include | 2 +- 3 files changed, 14 insertions(+), 21 deletions(-) diff --git a/configure b/configure index 8626989239..bdb0cc35a8 100755 --- a/configure +++ b/configure @@ -2449,21 +2449,6 @@ LINKS=3D"$LINKS tests/avocado tests/data" LINKS=3D"$LINKS tests/qemu-iotests/check" LINKS=3D"$LINKS python" LINKS=3D"$LINKS contrib/plugins/Makefile " -for bios_file in \ - $source_path/pc-bios/*.bin \ - $source_path/pc-bios/*.elf \ - $source_path/pc-bios/*.lid \ - $source_path/pc-bios/*.rom \ - $source_path/pc-bios/*.dtb \ - $source_path/pc-bios/*.img \ - $source_path/pc-bios/openbios-* \ - $source_path/pc-bios/u-boot.* \ - $source_path/pc-bios/palcode-* \ - $source_path/pc-bios/qemu_vga.ndrv - -do - LINKS=3D"$LINKS pc-bios/$(basename $bios_file)" -done for f in $LINKS ; do if [ -e "$source_path/$f" ]; then mkdir -p `dirname ./$f` diff --git a/pc-bios/meson.build b/pc-bios/meson.build index c86dedf7df..8ba81f5518 100644 --- a/pc-bios/meson.build +++ b/pc-bios/meson.build @@ -23,7 +23,7 @@ if unpack_edk2_blobs endforeach endif =20 -blobs =3D files( +blobs =3D [ 'bios.bin', 'bios-256k.bin', 'bios-microvm.bin', @@ -83,11 +83,19 @@ blobs =3D files( 'npcm7xx_bootrom.bin', 'vof.bin', 'vof-nvram.bin', -) +] =20 -if get_option('install_blobs') - install_data(blobs, install_dir: qemu_datadir) -endif +ln_s =3D [find_program('ln', required: true), '-sf'] +foreach f : blobs + roms +=3D custom_target(f, + build_by_default: have_system, + output: f, + input: files('meson.build'), # dummy input + install: get_option('install_blobs'), + install_dir: qemu_datadir, + command: [ ln_s, meson.project_source_root() / 'pc-bios' /= f, '@OUTPUT@' ]) +endforeach +alias_target('emulator-firmware', roms) =20 subdir('descriptors') subdir('keymaps') diff --git a/tests/Makefile.include b/tests/Makefile.include index bef96a775c..1fe7c8cd09 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -56,7 +56,7 @@ $(TCG_TESTS_TARGETS:%=3Dbuild-tcg-tests-%): build-tcg-tes= ts-%: $(BUILD_DIR)/tests/ "BUILD","$* guest-tests") =20 .PHONY: $(TCG_TESTS_TARGETS:%=3Drun-tcg-tests-%) -$(TCG_TESTS_TARGETS:%=3Drun-tcg-tests-%): run-tcg-tests-%: build-tcg-tests= -% $(if $(CONFIG_PLUGIN),test-plugins) +$(TCG_TESTS_TARGETS:%=3Drun-tcg-tests-%): run-tcg-tests-%: build-tcg-tests= -% $(if $(CONFIG_PLUGIN),test-plugins) emulator-firmware $(call quiet-command, \ $(MAKE) -C tests/tcg/$* -f ../Makefile.target $(SUBDIR_MAKEFLAG= S) \ TARGET=3D"$*" SRC_PATH=3D"$(SRC_PATH)" SPEED=3D$(S= PEED) run, \ --=20 2.35.1 From nobody Sun May 5 07:47:08 2024 Delivered-To: importer2@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+importer2=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 1651242024241207.91818581914788; Fri, 29 Apr 2022 07:20:24 -0700 (PDT) Received: from localhost ([::1]:54944 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nkRTq-0000Cs-RW for importer2@patchew.org; Fri, 29 Apr 2022 10:20:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58052) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nkRRw-0005j8-Ui for qemu-devel@nongnu.org; Fri, 29 Apr 2022 10:18:24 -0400 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]:43977) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nkRRv-0004ZS-1n for qemu-devel@nongnu.org; Fri, 29 Apr 2022 10:18:24 -0400 Received: by mail-ej1-x635.google.com with SMTP id m20so15700785ejj.10 for ; Fri, 29 Apr 2022 07:18:22 -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.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Apr 2022 07:18:21 -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=PddrXv+5hIHFaBzhxiEaPLVSrYwbMHaHDvw3rtbFC3s=; b=B5SFEoqZt1jVqOC8eooJnyPt/c+QIhu1cJs6F9oHvjKcG6xy4GU0E5mLUOweoKtYAn Y+FRmvOKOQRplDyEO0gySv3LKG/tgcqaXiCiYpJaiK1XaDZ1Z9c1yUSXtss7lgue+/K1 IxjbFtdW/QSedfE/6whA6v+kQptQjPl6zjGxNru3wCnOo5eUjG4Jp0zhLjXJo4G8SCSo TtYMZpcnUjRwY276b7l3+eBNKtVJxnGMjdrSi78XQbsHE0kCJ1Gi5mnQXPW5sfbCHSqF YSPXfKa52w74yr2hIqbbWY+mlmY1yIX3RAskULQe/9Ct1yC/ancbBXy8Sns+S7PANRs0 X6tA== 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=PddrXv+5hIHFaBzhxiEaPLVSrYwbMHaHDvw3rtbFC3s=; b=zdhtWs2OXH2Bjd4+m3zl/OxjnpfbZHpwnfcRgdSsYXkJLMjWrhOfG+74mHk/gWrgdt uP/ocBQ1u/x5XQuPElh2278fehW9Yv8LjkiVaAMX332yAI4vfLcpVjWMRsqHIU1YAPUo CqXuLeLcosXC8AumlHWaugRxPgg8v3U4EvFg743DNSxyJBBYKn0qsgnGaSfYIcLdqf62 l63tEg09LVZOP+KR3ls+RWF4qArnFySWLxY7cDrnuv8TzTvbJTJVWicZBwkf9Xz2Mb/U LyUUM5fqHYRO1JZoM6VJ6MBsgLhsv42FmvM83H2e0vMX9M34+q2lW5FSCaBqrdZv7mHx 2HMA== X-Gm-Message-State: AOAM532K7WNvHdQz9hWBC30/MbxCtliqxKp2ewTRq/ZCchE9nodZKcIs QFv4yyHfmGE/mkPI4gfRJzXLl6QI1BUtfQ== X-Google-Smtp-Source: ABdhPJwp591uQBikpIaUUC+ujzlKGrdioQoIqnvw5wi2lJWxbje03vOMBUdYKRl2GO68AAAZmnJj+A== X-Received: by 2002:a17:907:9493:b0:6f3:9be8:237 with SMTP id dm19-20020a170907949300b006f39be80237mr23020085ejc.598.1651241901601; Fri, 29 Apr 2022 07:18:21 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [RFC PATCH 07/12] configure: move symlink configuration earlier Date: Fri, 29 Apr 2022 16:18:08 +0200 Message-Id: <20220429141813.328975-8-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::635; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x635.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+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1651242024715100001 Content-Type: text/plain; charset="utf-8" Ensure that the pc-bios/optionrom and pc-bios/s390-ccw directory exist at the time when we'll write out the compiler configuration for them. Signed-off-by: Paolo Bonzini Reviewed-by: Richard Henderson --- configure | 49 ++++++++++++++++++++++++------------------------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/configure b/configure index bdb0cc35a8..de2bc799cd 100755 --- a/configure +++ b/configure @@ -2210,6 +2210,30 @@ fi =20 QEMU_GA_MSI_MINGW_BIN_PATH=3D"$($pkg_config --variable=3Dprefix glib-2.0)/= bin" =20 +# 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 +# will result in problems later if a new file matching the wildcard is +# added to the source tree -- nothing will cause configure to be rerun +# so the build tree will be missing the link back to the new file, and +# tests might fail. Prefer to keep the relevant files in their own +# directory and symlink the directory instead. +LINKS=3D"Makefile" +LINKS=3D"$LINKS tests/tcg/Makefile.target" +LINKS=3D"$LINKS pc-bios/optionrom/Makefile" +LINKS=3D"$LINKS pc-bios/s390-ccw/Makefile" +LINKS=3D"$LINKS .gdbinit scripts" # scripts needed by relative path in .gd= binit +LINKS=3D"$LINKS tests/avocado tests/data" +LINKS=3D"$LINKS tests/qemu-iotests/check" +LINKS=3D"$LINKS python" +LINKS=3D"$LINKS contrib/plugins/Makefile " +for f in $LINKS ; do + if [ -e "$source_path/$f" ]; then + mkdir -p `dirname ./$f` + symlink "$source_path/$f" "$f" + fi +done + # Mac OS X ships with a broken assembler roms=3D if { test "$cpu" =3D "i386" || test "$cpu" =3D "x86_64"; } && \ @@ -2431,31 +2455,6 @@ if test "$safe_stack" =3D "yes"; then echo "CONFIG_SAFESTACK=3Dy" >> $config_host_mak fi =20 -# If we're using a separate build tree, set it up now. -# LINKS are things to symlink back into the source tree -# (these can be both files and directories). -# Caution: do not add files or directories here using wildcards. This -# will result in problems later if a new file matching the wildcard is -# added to the source tree -- nothing will cause configure to be rerun -# so the build tree will be missing the link back to the new file, and -# tests might fail. Prefer to keep the relevant files in their own -# directory and symlink the directory instead. -LINKS=3D"Makefile" -LINKS=3D"$LINKS tests/tcg/Makefile.target" -LINKS=3D"$LINKS pc-bios/optionrom/Makefile" -LINKS=3D"$LINKS pc-bios/s390-ccw/Makefile" -LINKS=3D"$LINKS .gdbinit scripts" # scripts needed by relative path in .gd= binit -LINKS=3D"$LINKS tests/avocado tests/data" -LINKS=3D"$LINKS tests/qemu-iotests/check" -LINKS=3D"$LINKS python" -LINKS=3D"$LINKS contrib/plugins/Makefile " -for f in $LINKS ; do - if [ -e "$source_path/$f" ]; then - mkdir -p `dirname ./$f` - symlink "$source_path/$f" "$f" - fi -done - # tests/tcg configuration (makefile=3Dtests/tcg/Makefile.prereqs echo "# Automatically generated by configure - do not modify" > $makefile --=20 2.35.1 From nobody Sun May 5 07:47:08 2024 Delivered-To: importer2@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+importer2=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 1651242446325780.9985841590171; Fri, 29 Apr 2022 07:27:26 -0700 (PDT) Received: from localhost ([::1]:46302 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nkRaf-0005OC-Bt for importer2@patchew.org; Fri, 29 Apr 2022 10:27:25 -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+importer2=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+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1651242446726100001 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 From nobody Sun May 5 07:47:08 2024 Delivered-To: importer2@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+importer2=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 165124219376434.10238329536446; Fri, 29 Apr 2022 07:23:13 -0700 (PDT) Received: from localhost ([::1]:35018 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nkRWZ-0005z6-WB for importer2@patchew.org; Fri, 29 Apr 2022 10:23:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58070) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nkRRx-0005ke-Uq for qemu-devel@nongnu.org; Fri, 29 Apr 2022 10:18:26 -0400 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]:33376) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nkRRw-0004Zh-IO for qemu-devel@nongnu.org; Fri, 29 Apr 2022 10:18:25 -0400 Received: by mail-ed1-x52d.google.com with SMTP id p4so9320705edx.0 for ; Fri, 29 Apr 2022 07:18:24 -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.22 (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=nHPW7yfli727FMhApbuFCfFM7ic91z4RB4PVmidJ+ZM=; b=ASQENc31kom1dH3Vaz1Yp0IpvhoLEyUYSieYFq2GcVc4g662Vn1EsPPKILMRJbmknF esG/d22jwBBvyX3ps1ehv9efP1PK9MfT0+eYHW8bQEIaSgSSeYHRKoIShCFzAeHFKZHL ieioknJeYtp4ObTKy/OO+EuCoyZ30zHgR0lcf4NO3E+dxTuc2riZVrSzgxVBAsUJG9qG pOc5HW28RVd7R8m6pMmndRYDFhMfg23VkWd0WSiKDTL4szY9+cnRcgcYSydEI9u+mY9/ 07a0UdOJMLmo1MoRpGyPa1gn9wSxPuU7IzX1yknr5r23tLzU8dmfWIc60RNzfUc2EF1E WB5g== 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=nHPW7yfli727FMhApbuFCfFM7ic91z4RB4PVmidJ+ZM=; b=Phs2apRfoU2GafLFvMqurKMROXLOMLdP7zrIVu8CXqhvS9EiHCmUE7x8a/V8uVkgOS lPswBRbbDFxLKyQqTuB1wnH//PrAJnT/la2pCvmDOlmE9y0W3LPtHR9Lr3aEUf69eeW6 8XuQXuj6i0LM/wccmvSvVoVk/aN5LMQit41/VVgfE0xwuIw1ezxsUesVY7CGM6RUTbpm Y79XJOsYp+8CqKo4N0M7MulhyPLirBQb9uGtj3f/n4YjETlOBsoK4xC7m4ryukrXe/ba 1kHl6Lxgiuun/7vU7F9wDy6nRZSmeYUjEe7c9DRb2hlsKw0YKVsuwOio54gdyG07+tIw NMBw== X-Gm-Message-State: AOAM532xKWsDiyhhWd6AupEaXlCmUGHh30sgwNif4lirELFrVrWi2iAi xgUfLX0yC7tsuWaH2D+p1oOGHP15IWlShw== X-Google-Smtp-Source: ABdhPJwrpBugsfXoPmkT0Ih2b0kDKTJR8zj3G4d4fnyaXuWbcTKyRBfVMpx6tps9lQ3zViA1cwoGUw== X-Received: by 2002:a05:6402:3553:b0:426:2b19:a4b0 with SMTP id f19-20020a056402355300b004262b19a4b0mr8438453edd.66.1651241903261; Fri, 29 Apr 2022 07:18:23 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [RFC PATCH 09/12] pc-bios/optionrom: detect -fno-pie Date: Fri, 29 Apr 2022 16:18:10 +0200 Message-Id: <20220429141813.328975-10-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::52d; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x52d.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+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1651242194767100003 Content-Type: text/plain; charset="utf-8" Do not rely on the detection that was done in the configure script, since in the future we may want to cross-compile this file. Signed-off-by: Paolo Bonzini Reviewed-by: Richard Henderson --- configure | 1 - pc-bios/optionrom/Makefile | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 5c34d8ffc2..07ee586ef5 100755 --- a/configure +++ b/configure @@ -2396,7 +2396,6 @@ echo "CCAS=3D$ccas" >> $config_host_mak echo "CPP=3D$cpp" >> $config_host_mak echo "OBJCOPY=3D$objcopy" >> $config_host_mak echo "LD=3D$ld" >> $config_host_mak -echo "CFLAGS_NOPIE=3D$CFLAGS_NOPIE" >> $config_host_mak echo "QEMU_CFLAGS=3D$QEMU_CFLAGS" >> $config_host_mak echo "QEMU_CXXFLAGS=3D$QEMU_CXXFLAGS" >> $config_host_mak echo "QEMU_OBJCFLAGS=3D$QEMU_OBJCFLAGS" >> $config_host_mak diff --git a/pc-bios/optionrom/Makefile b/pc-bios/optionrom/Makefile index f1ef898073..8de5a9461c 100644 --- a/pc-bios/optionrom/Makefile +++ b/pc-bios/optionrom/Makefile @@ -22,7 +22,8 @@ override CFLAGS +=3D $(call cc-option, -fcf-protection=3D= none) override CPPFLAGS +=3D -MMD -MP -MT $@ -MF $(@D)/$(*F).d =20 override CFLAGS +=3D $(filter -W%, $(QEMU_CFLAGS)) -override CFLAGS +=3D $(CFLAGS_NOPIE) -ffreestanding -I$(TOPSRC_DIR)/include +override CFLAGS +=3D $(call cc-option, -fno-pie) +override CFLAGS +=3D -ffreestanding -I$(TOPSRC_DIR)/include override CFLAGS +=3D $(call cc-option, -fno-stack-protector) override CFLAGS +=3D $(call cc-option, -m16) =20 --=20 2.35.1 From nobody Sun May 5 07:47:08 2024 Delivered-To: importer2@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+importer2=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 1651242387900816.4438170298619; Fri, 29 Apr 2022 07:26:27 -0700 (PDT) Received: from localhost ([::1]:43230 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nkRZi-0003FT-Op for importer2@patchew.org; Fri, 29 Apr 2022 10:26:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58114) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nkRS0-0005l5-0b for qemu-devel@nongnu.org; Fri, 29 Apr 2022 10:18:30 -0400 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]:44808) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nkRRx-0004Zx-Jl for qemu-devel@nongnu.org; Fri, 29 Apr 2022 10:18:26 -0400 Received: by mail-ed1-x530.google.com with SMTP id e23so9226900eda.11 for ; Fri, 29 Apr 2022 07:18:25 -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.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Apr 2022 07:18:23 -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=PlV/EK5UsYBfqg6xjcxWdCbe+/9xSJ7+ICIhFQH4VjY=; b=IFpRS5aIUkqeHGYK/R/8+MKQ2GMw3iVWetzPCpEUjxireXsVTiKakYl7YwFzvhfNKq P0LY0MnvifqKPT9e3gSL+dPZ7TFMaMVDe0xWjxeVN+cedr02nAbLAbP4rKurDuQyzqzP vbH47F7kKTiwA2l8V9gSinLRzjOKuxmek1hMgqOoFdGbt8H7Uf6Ql40r/O9s7IuVlR+/ m45Vqy+v1gH8M3q8KVfn42gLHDRW+gPXceoew8UkIHo93S846E0TMm0qt1XhEMWOJKuH zM/oLy/ueb6BzQbzNlNpBsThWK6A7lRG8DVieLNjouJussXo+DDpnQOCjgz02m0i+GjJ f7wA== 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=PlV/EK5UsYBfqg6xjcxWdCbe+/9xSJ7+ICIhFQH4VjY=; b=2aemTXLlN4yyZyixI27bzvvhDw5mD7911c2dlbi23kIKtfRpByOqHNJwuwEKdsc8XU BZ57m/BW1T2IhrY/5J3pKUSqRVs3HlLr6LujLg5QZmLLFfItdL7uypA3JyEqID2sWOTR N4dGS9ITI8SLhT1oUehVPcDsfd1WzWmp0so/7H3+055ed2Sb1eY10bEIgRYpBDIBQdtR XvUc6i+hfHtF9WwPCj4C5DuNjllmzYROjzBjLqv3nhore2IXjDMB6NqRaLFM+sKooreO nBVjKfT5AaK+jod9KcpoJw3dgc4DexCySloG5OlcgEv9YEDE3nTXsffgMIrvXJ0fYRk9 EH8g== X-Gm-Message-State: AOAM530NupRI9TqoZTzW8MH72TQDfOhue6zoed52Q9vGXz7INKpQX9W4 OUPKRX5cpM8D9Ro2bYLNF9OzQm5qhimfHg== X-Google-Smtp-Source: ABdhPJxsKHaxo5pnuBduWL99H/4HpgIIouSuB1BsrHskkknNKvo8ClnupyFptZGYzexSMjTyw8FlNg== X-Received: by 2002:a05:6402:f07:b0:426:12ba:9b7c with SMTP id i7-20020a0564020f0700b0042612ba9b7cmr15615608eda.0.1651241904258; Fri, 29 Apr 2022 07:18:24 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [RFC PATCH 10/12] pc-bios/optionrom: compile with -Wno-array-bounds Date: Fri, 29 Apr 2022 16:18:11 +0200 Message-Id: <20220429141813.328975-11-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-Type: text/plain; charset="utf-8" Content-Type: text/plain 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::530; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x530.google.com X-Spam_score_int: -4 X-Spam_score: -0.5 X-Spam_bar: / X-Spam_report: (-0.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, PP_MIME_FAKE_ASCII_TEXT=0.999, 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+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1651242388373100001 Avoids the following bogus warning: pvh_main.c: In function =E2=80=98pvh_load_kernel=E2=80=99: pvh_main.c:101:42: warning: array subscript 0 is outside array bounds of = =E2=80=98uint16_t[0]=E2=80=99 {aka =E2=80=98short unsigned int[]=E2=80=99} = [-Warray-bounds] 101 | uint32_t ebda_paddr =3D ((uint32_t)*((uint16_t *)EBDA_BASE_= ADDR)) << 4; | ^~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~ Signed-off-by: Paolo Bonzini Reviewed-by: Richard Henderson --- pc-bios/optionrom/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/pc-bios/optionrom/Makefile b/pc-bios/optionrom/Makefile index 8de5a9461c..2494ad9c25 100644 --- a/pc-bios/optionrom/Makefile +++ b/pc-bios/optionrom/Makefile @@ -26,6 +26,7 @@ override CFLAGS +=3D $(call cc-option, -fno-pie) override CFLAGS +=3D -ffreestanding -I$(TOPSRC_DIR)/include override CFLAGS +=3D $(call cc-option, -fno-stack-protector) override CFLAGS +=3D $(call cc-option, -m16) +override CFLAGS +=3D $(call cc-option, -Wno-array-bounds) =20 ifeq ($(filter -m16, $(CFLAGS)),) # Attempt to work around compilers that lack -m16 (GCC <=3D 4.8, clang <= =3D ??) --=20 2.35.1 From nobody Sun May 5 07:47:08 2024 Delivered-To: importer2@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+importer2=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 1651242529967117.834790473417; Fri, 29 Apr 2022 07:28:49 -0700 (PDT) Received: from localhost ([::1]:50728 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nkRc0-0008RA-Ta for importer2@patchew.org; Fri, 29 Apr 2022 10:28:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58120) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nkRS0-0005l6-0Y for qemu-devel@nongnu.org; Fri, 29 Apr 2022 10:18:30 -0400 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]:33476) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nkRRy-0004a9-Ab for qemu-devel@nongnu.org; Fri, 29 Apr 2022 10:18:27 -0400 Received: by mail-ej1-x629.google.com with SMTP id gh6so15826313ejb.0 for ; Fri, 29 Apr 2022 07:18:25 -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.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Apr 2022 07:18:24 -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=mOjpMWbtSWYMaSIQQN91Mhp5Lq9EP7onS/rq0Krzws0=; b=mGtgHrTCkZPzZeNwrVkUVOR0wCXhNFHYKn0SewqaqyRD/8dB4mGcpv3MfkTRsVrhWF EgR8zf84n/SrXNc/nBLvcsL9/PQU51PC6SqQf3E1bU3R6nxXbN0SU6ihEeswDMT5gqPi Bb5iWacTuZMrtF1VrD9UqGl6dovls0FQHcGPoBgx6H98VSsaxiCQzdeD9WgGTjokwm8p qYlZgYIaCOpRW0+sXqVjz9bBicvtCOuFm/5WAJJA4pX7y6KOCGXlNDwCc1iXii13cltQ dt0q5HLvcu8FaVqkPaB5MsIGpPehvmlNlk8Y4dpKGB5LrJSfNADkYhT1Wmn4K2SSJNbE k87g== 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=mOjpMWbtSWYMaSIQQN91Mhp5Lq9EP7onS/rq0Krzws0=; b=X0r8qfLOjW8c4OFBaQcn0wvBz/htr2agnqMSpyuxyI6Yt75Nt8Y8hpjd8bI2pDLkIq Qju5Rcjb62MgijVf+IW+w1BgCq7L9cSdce9xWrf9dDRSllzfbOEl+GcYOt4d8C/JOdth 1YcMtHVPJLRTQl0RUX3F+2WeUPT75Sm2Swh5LICwaqTApN3rTLmZLQa6ZFKcSft7sFtJ oI/QUaxkWzwgdyRaalplX0FAaTGDzF4Iq8Zvp3hcjnGVsM+z3StLyJyEj8nvgLSsAgwJ aQDfX9wW7KCG1ifv169nL1h51wtnGccbybI1n5YDPQR9fvcr0mtqMKjgE3xPXCp9NOrr l9YQ== X-Gm-Message-State: AOAM531vxVsA3sLb7POZGYGjpj8KoB5QW3Ca3CAkU7os5WZlFZk6bCov jTpqRY87ACeUJ1+a9GMsK0RyG+iMZmYCVA== X-Google-Smtp-Source: ABdhPJzqOIjiVY8eOK5vQwRnr3LEnrc0dNnsF67xHuNkfKsP6TMtvsJkVnLs9BWn3GXqIBvjpFTe+g== X-Received: by 2002:a17:906:5006:b0:6ce:3762:c72e with SMTP id s6-20020a170906500600b006ce3762c72emr35602275ejj.30.1651241904991; Fri, 29 Apr 2022 07:18:24 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [RFC PATCH 11/12] configure: enable cross-compilation of optionrom Date: Fri, 29 Apr 2022 16:18:12 +0200 Message-Id: <20220429141813.328975-12-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::629; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x629.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+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1651242531734100001 Content-Type: text/plain; charset="utf-8" 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. Signed-off-by: Paolo Bonzini Reviewed-by: Richard Henderson --- configure | 29 +++++++++++++++++++++-------- pc-bios/optionrom/Makefile | 4 +--- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/configure b/configure index 07ee586ef5..6b8e2e2fdb 100755 --- a/configure +++ b/configure @@ -2100,6 +2100,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" @@ -2210,6 +2217,9 @@ fi =20 QEMU_GA_MSI_MINGW_BIN_PATH=3D"$($pkg_config --variable=3Dprefix glib-2.0)/= bin" =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 @@ -2236,19 +2246,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 the compiler has -march=3Dz900 or -march=3Dz10 = (which is @@ -2403,7 +2421,6 @@ echo "GLIB_CFLAGS=3D$glib_cflags" >> $config_host_mak echo "GLIB_LIBS=3D$glib_libs" >> $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 @@ -2593,10 +2610,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 2494ad9c25..6696ce010a 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,13 +43,12 @@ 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 %.o: %.S - $(call quiet-command,$(CPP) $(CPPFLAGS) -c -o - $< | $(AS) $(ASFLAGS) -o = $@,"AS","$@") + $(call quiet-command,$(CC) -E $(CPPFLAGS) -c -o - $< | $(AS) $(ASFLAGS) -= o $@,"AS","$@") =20 %.o: %.c $(call quiet-command,$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@,"CC","$@") --=20 2.35.1 From nobody Sun May 5 07:47:08 2024 Delivered-To: importer2@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+importer2=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 1651242640942567.2370328306699; Fri, 29 Apr 2022 07:30:40 -0700 (PDT) Received: from localhost ([::1]:55228 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nkRdn-0003Hh-Sx for importer2@patchew.org; Fri, 29 Apr 2022 10:30:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58144) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nkRS1-0005lB-97 for qemu-devel@nongnu.org; Fri, 29 Apr 2022 10:18:30 -0400 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]:38509) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nkRRz-0004aP-OP for qemu-devel@nongnu.org; Fri, 29 Apr 2022 10:18:29 -0400 Received: by mail-ed1-x52d.google.com with SMTP id z99so9252060ede.5 for ; Fri, 29 Apr 2022 07:18:26 -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.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Apr 2022 07:18:25 -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=EjTvkAW7QyXc5iAFTituHf5ht0mFR+ObaQDlumtGE10=; b=CoIfWVFSp2rv/IF6gG8pZbHLunWNWAzcNVs4/TWwPrdrMa+Z/tVSgRSs7gO1a/qtuY TSJxSEcnLNudhEg0zz2DZ0rUyKK8mTdmVstKq4Febw4mJ+5VcRqn0odU44q5Wnk1dTda i1Epv1nKOjCSp0FYlKCrw06qy/vsZrmRHaY+DH2i36O86AYU0DBXRYUd3JWFGP5yDIHK uKXGXPVzALnOfTgVEKUutoe6JGro8UtNptzEvs8DzwDcjxg3RUsbOY39gkzcsMxywu11 gf0AQkyFHSwHZpTS/AALRrnKFr6B4xLur+XH/stZdjhKNuCUP3dAAycULrBBv/HT8fAn eeuA== 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=EjTvkAW7QyXc5iAFTituHf5ht0mFR+ObaQDlumtGE10=; b=uFqrR8EWPAGK7PfNiHbCG7cwDM+/gsrlhWn9zsbEeWtIneM26clhA+RrMwkiLmneWh tSc5Wc/w5XxnWikgddmRy8fK+srRx/N12jCMyonMmtpNtvWUnqaNGy+mifULEaKjnUG9 TNmnYFb+qP6fxoCjuAX3Cq3jiGO8iB1u+bYn1IIUXhJPlTy1fELjyVkKxgKpqE7r+vL5 dKJWajuGt3ERSBdSn/Oz2LWMRvIVFv6Vyk4WFqXNVyMyxSAIb+FliQRc7pF5Gcy4TZJi IhrK2YK420bUr5MCx0RW/9ge17IhTadJXaGNvchoYQD+bUS+Uei7QX41QKM1nQm5lqBE CxOw== X-Gm-Message-State: AOAM531ZfZ2RgNeYfXMO7bVE0h8qhgSXXhevvpvqFtrd/0PrJ5khAAQx 3aCgi0kwP2l0E7yQ1A08g29U2ysJjKsEXg== X-Google-Smtp-Source: ABdhPJw+2T5nGttpccR5HpA5OcAzE42aSx1KCu2TjqTzuNRKp/i/Vg6RtL1AsdNf0hMdkxt9ipxhcw== X-Received: by 2002:a05:6402:d05:b0:425:b7ab:776e with SMTP id eb5-20020a0564020d0500b00425b7ab776emr40805499edb.142.1651241905735; Fri, 29 Apr 2022 07:18:25 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [RFC PATCH 12/12] configure: enable cross compilation of vof Date: Fri, 29 Apr 2022 16:18:13 +0200 Message-Id: <20220429141813.328975-13-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::52d; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x52d.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+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1651242642463100001 Content-Type: text/plain; charset="utf-8" While container-based cross compilers are not supported, this already makes it possible to build vof on any machine that has an installation of GCC and binutils for 32- or 64-bit PowerPC. Signed-off-by: Paolo Bonzini Reviewed-by: Richard Henderson --- configure | 10 ++++++++++ pc-bios/vof/Makefile | 17 +++++++++-------- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/configure b/configure index 6b8e2e2fdb..1db1eef7b1 100755 --- a/configure +++ b/configure @@ -2232,6 +2232,7 @@ LINKS=3D"Makefile" LINKS=3D"$LINKS tests/tcg/Makefile.target" LINKS=3D"$LINKS pc-bios/optionrom/Makefile" LINKS=3D"$LINKS pc-bios/s390-ccw/Makefile" +LINKS=3D"$LINKS pc-bios/vof/Makefile" LINKS=3D"$LINKS .gdbinit scripts" # scripts needed by relative path in .gd= binit LINKS=3D"$LINKS tests/avocado tests/data" LINKS=3D"$LINKS tests/qemu-iotests/check" @@ -2269,6 +2270,15 @@ if test -n "$target_cc" && fi fi =20 +probe_target_compilers ppc ppc64 +if test -n "$target_cc" && test "$softmmu" =3D yes; then + roms=3D"$roms vof" + config_mak=3Dpc-bios/vof/config.mak + echo "# Automatically generated by configure - do not modify" > $confi= g_mak + echo "SRC_DIR=3D$source_path/pc-bios/vof" >> $config_mak + write_target_makefile >> $config_mak +fi + # 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 diff --git a/pc-bios/vof/Makefile b/pc-bios/vof/Makefile index aa1678c4d8..391ac0d600 100644 --- a/pc-bios/vof/Makefile +++ b/pc-bios/vof/Makefile @@ -1,11 +1,10 @@ -all: build-all +include config.mak +VPATH=3D$(SRC_DIR) +all: vof.bin =20 -build-all: vof.bin - -CROSS ?=3D -CC =3D $(CROSS)gcc -LD =3D $(CROSS)ld -OBJCOPY =3D $(CROSS)objcopy +CC ?=3D $(CROSS)gcc +LD ?=3D $(CROSS)ld +OBJCOPY ?=3D $(CROSS)objcopy =20 %.o: %.S $(CC) -m32 -mbig-endian -mcpu=3Dpower4 -c -o $@ $< @@ -14,10 +13,12 @@ OBJCOPY =3D $(CROSS)objcopy $(CC) -m32 -mbig-endian -mcpu=3Dpower4 -c -fno-stack-protector -o $@ $< =20 vof.elf: entry.o main.o ci.o bootmem.o libc.o - $(LD) -nostdlib -e_start -Tvof.lds -EB -o $@ $^ + $(LD) -nostdlib -e_start -T$(SRC_DIR)/vof.lds -EB -o $@ $^ =20 %.bin: %.elf $(OBJCOPY) -O binary -j .text -j .data -j .toc -j .got2 $^ $@ =20 clean: rm -f *.o vof.bin vof.elf *~ + +.PHONY: all clean --=20 2.35.1