From nobody Tue Feb 10 06:27:30 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1661467733; cv=none; d=zohomail.com; s=zohoarc; b=kurF6fK2vXMJv0+3MP/xYrVWhTbsYCLc1K6m0SgP07+RjXRIuV9UeNi4hLK9amtAlXur/obM5c2qhfbJ95UPY1xiVKCKtrT6TijeiunUVK9iMGtqcwxtoJYlIhDDrzP+F+ImrOSjZh8sXI24Bf6fNs1wIcAE/qgLW/SCCsMMr6o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661467733; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=6W78XcIEwjBygjDtKPv0nEQYE1uLOnUnaxuQgUKSOpI=; b=cjPJicC/U9Pq9qpPCCeI1TQr0LSm/tzNzzHhUgy1CG8YDHRRyPHHvMIyYr1HZ82Xays9XGkN+F9edVIUNVn+jQQ7PXHOG8HAK+7ZQC1+NFuKapvfKNSXZIKBkwsy/GjhZe+ZyRtkWBIjBqBJsw5s+oaiKBqpCSfKN68ukXXQCZk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661467733231685.8280275985687; Thu, 25 Aug 2022 15:48:53 -0700 (PDT) Received: from localhost ([::1]:40544 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oRLed-0000LG-0T for importer@patchew.org; Thu, 25 Aug 2022 18:48:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37014) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oRLKh-0002nr-Tu for qemu-devel@nongnu.org; Thu, 25 Aug 2022 18:28:15 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:34168) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oRLKg-0004fj-1g for qemu-devel@nongnu.org; Thu, 25 Aug 2022 18:28:15 -0400 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-279-ajkT9WrSOw-JiCZNloVRCw-1; Thu, 25 Aug 2022 18:28:12 -0400 Received: by mail-wm1-f72.google.com with SMTP id 203-20020a1c02d4000000b003a5f5bce876so3064705wmc.2 for ; Thu, 25 Aug 2022 15:28:11 -0700 (PDT) Received: from goa-sendmail ([2001:b07:6468:f312:9af8:e5f5:7516:fa89]) by smtp.gmail.com with ESMTPSA id bh19-20020a05600c3d1300b003a54d610e5fsm7030053wmb.26.2022.08.25.15.28.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Aug 2022 15:28:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661466493; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6W78XcIEwjBygjDtKPv0nEQYE1uLOnUnaxuQgUKSOpI=; b=hWH/JjiZG0sY+rQOSCsOM/Vgj83JiEYMtZqaWhZuVaUwYRKN20meQC8lYl8tJ4TRWbN/sC H/un2FVQTzLaQFtpVprqD7Yf+oRSUk//CGV6/ZBhoSrrjBoOdj9r9E9x7gOyLFFMprs1ih wlSiT+WZq8ppR4+NEYMzqPHcwV5SQUk= X-MC-Unique: ajkT9WrSOw-JiCZNloVRCw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=6W78XcIEwjBygjDtKPv0nEQYE1uLOnUnaxuQgUKSOpI=; b=OubUoGMYHg9t9vLytak4tD4nEtiT/ZoJXEn0Qg4dVbtmADk9CkizAGpvAm5Qqm6B9e uKsYgObORE0wf9Ke2Od31+p6W21LDQOFl5T+9EXSAT1/26rIjyBOJwv9uZiINQab5LMQ qjPsBH/iUTp2f6w2G3gqCebuDgINyEzx9/zR5TzYku8k4RvCpSBl+Y75hItzgvreNse5 iDq7c4HlpPs3Iuo9lnjnbpncfIomdLGYtf1TJs74EVN9KIFz6Zdg7Pqv1UHCanpLt6Wo JKoGBg62hHYhipAw10uLajFVa+bxlWVHRqDbMQ5WLkMuKVYBTLo2n/XJbNO9nUYoSGSt FtxQ== X-Gm-Message-State: ACgBeo23sJADfofFhiOxEbokSl95Jhsw1QhNeC8PVelNeR9pZQU7G9zp 1D6Zha4ET3hi3ErWqPVDF1xTYJ0qIq+ZDQxYJIHYBwWPtF1UVXRFRgCnI8Aih0JkQFBcbm7mQoJ HnAK/WOkN6apt4VP9y5JphF6M5e/wmYs1j7WxSPSehGVn/Q1HAhy6IPiMYF5Oa/STFAk= X-Received: by 2002:a7b:ce89:0:b0:3a5:cefe:80f6 with SMTP id q9-20020a7bce89000000b003a5cefe80f6mr10005690wmj.113.1661466490370; Thu, 25 Aug 2022 15:28:10 -0700 (PDT) X-Google-Smtp-Source: AA6agR4dAEfVt7GTMUq/DJFibx2SwTEwWVrGbqdTSJCaDrBdU7BX98Lu2QOWoNjWYtp5NLjteg+ozg== X-Received: by 2002:a7b:ce89:0:b0:3a5:cefe:80f6 with SMTP id q9-20020a7bce89000000b003a5cefe80f6mr10005684wmj.113.1661466490075; Thu, 25 Aug 2022 15:28:10 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: alex.bennee@linaro.org Subject: [PATCH 15/20] configure: unify creation of cross-compilation Makefiles Date: Fri, 26 Aug 2022 00:27:40 +0200 Message-Id: <20220825222745.38779-16-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220825222745.38779-1-pbonzini@redhat.com> References: <20220825222745.38779-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1661467735374100001 Content-Type: text/plain; charset="utf-8" Let write_target_makefile handle both host and container cross compilers. Signed-off-by: Paolo Bonzini --- configure | 94 +++++++++++++++++++++++++------------------------------ 1 file changed, 43 insertions(+), 51 deletions(-) diff --git a/configure b/configure index 6dc6a5a48b..37ddd90bb1 100755 --- a/configure +++ b/configure @@ -2191,51 +2191,49 @@ probe_target_compiler() { =20 write_target_makefile() { echo "EXTRA_CFLAGS=3D$target_cflags" - 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" - fi - 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" + if test -z "$target_cc" && test -z "$target_as"; then + test -z "$container_image" && error_exit "Internal error: could not fi= nd cross compiler for $1?" + echo "$1: docker-image-$container_image" >> Makefile.prereqs + if test -n "$container_cross_cc"; then + echo "CC=3D$docker_py cc --cc $container_cross_cc -i qemu/$container= _image -s $source_path --" + echo "CCAS=3D$docker_py cc --cc $container_cross_cc -i qemu/$contain= er_image -s $source_path --" + fi + echo "AR=3D$docker_py cc --cc $container_cross_ar -i qemu/$container_i= mage -s $source_path --" + echo "AS=3D$docker_py cc --cc $container_cross_as -i qemu/$container_i= mage -s $source_path --" + echo "LD=3D$docker_py cc --cc $container_cross_ld -i qemu/$container_i= mage -s $source_path --" + echo "NM=3D$docker_py cc --cc $container_cross_nm -i qemu/$container_i= mage -s $source_path --" + echo "OBJCOPY=3D$docker_py cc --cc $container_cross_objcopy -i qemu/$c= ontainer_image -s $source_path --" + echo "RANLIB=3D$docker_py cc --cc $container_cross_ranlib -i qemu/$con= tainer_image -s $source_path --" + echo "STRIP=3D$docker_py cc --cc $container_cross_strip -i qemu/$conta= iner_image -s $source_path --" + else + 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" + fi + 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 fi } =20 -write_container_target_makefile() { - echo "$1: docker-image-$container_image" >> Makefile.prereqs - echo "EXTRA_CFLAGS=3D$target_cflags" - if test -n "$container_cross_cc"; then - echo "CC=3D$docker_py cc --cc $container_cross_cc -i qemu/$container_i= mage -s $source_path --" - echo "CCAS=3D$docker_py cc --cc $container_cross_cc -i qemu/$container= _image -s $source_path --" - fi - echo "AR=3D$docker_py cc --cc $container_cross_ar -i qemu/$container_ima= ge -s $source_path --" - echo "AS=3D$docker_py cc --cc $container_cross_as -i qemu/$container_ima= ge -s $source_path --" - echo "LD=3D$docker_py cc --cc $container_cross_ld -i qemu/$container_ima= ge -s $source_path --" - echo "NM=3D$docker_py cc --cc $container_cross_nm -i qemu/$container_ima= ge -s $source_path --" - echo "OBJCOPY=3D$docker_py cc --cc $container_cross_objcopy -i qemu/$con= tainer_image -s $source_path --" - echo "RANLIB=3D$docker_py cc --cc $container_cross_ranlib -i qemu/$conta= iner_image -s $source_path --" - echo "STRIP=3D$docker_py cc --cc $container_cross_strip -i qemu/$contain= er_image -s $source_path --" -} - - - ########################################## # check for vfio_user_server =20 @@ -2587,15 +2585,9 @@ for target in $target_list; do ;; esac =20 - probe_target_compiler $target - if test $got_cross_cc =3D yes; then - write_target_makefile >> $config_target_mak - elif test -n "$container_image"; then - build_static=3Dy - write_container_target_makefile build-tcg-tests-$target >> $config_t= arget_mak - got_cross_cc=3Dyes - fi - if test $got_cross_cc =3D yes; then + if probe_target_compiler $target || test -n "$container_image"; then + test -n "$container_image" && build_static=3Dy + write_target_makefile build-tcg-tests-$target >> $config_target_mak mkdir -p tests/tcg/$target ln -sf $source_path/tests/tcg/Makefile.target tests/tcg/$target/Make= file ln -sf ../config-$target.mak tests/tcg/$target/config-target.mak --=20 2.37.1