From nobody Tue Feb 10 19:23:09 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=1693659664; cv=none; d=zohomail.com; s=zohoarc; b=RtkQLg4hpw25zj4PKd0IgROPSLQMYdefkiNFh9asvrEF8YxMY2rZrFKU9c4Zp3YCCXMXYLQrSAVDK1n9rxmo7fgOh0zQzmbHxfapZSLrMwCQSEs9Wpp3KFMIUgz3AmSmd9FZ9NmGI6m2EWvbjCOfCE41nbVOjLmDNTCH4ogZgzA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693659664; 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=eTC08l5E2LHxzBEzXg14rY8tH1ESV2HYzTzj23bXChc=; b=Iv9uG3KMIlSWxm79h9+QM/1cX0ygYKoU+3oDpGlsryF8KP496iZ8/nkp0npe3iUKcY7A/4RlIuoTs3B37wXWS0YTJOMwT0z01JPqAHredXZT/fOjbmfqelPA+AE0u3mYYZwkerIHHp9HDYGqqDPNijPwIavo4OK4OtjXEojdH1I= 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 1693659664734477.4589160912884; Sat, 2 Sep 2023 06:01:04 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qcQEB-0000zb-Ug; Sat, 02 Sep 2023 08:59:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qcQEA-0000wu-L4 for qemu-devel@nongnu.org; Sat, 02 Sep 2023 08:59:50 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qcQE8-0001gR-A2 for qemu-devel@nongnu.org; Sat, 02 Sep 2023 08:59:50 -0400 Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-44-y3euDBcIOGSj9xfxFlzSYg-1; Sat, 02 Sep 2023 08:59:46 -0400 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-31c7727aa5cso1467937f8f.0 for ; Sat, 02 Sep 2023 05:59:45 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:63a7:c72e:ea0e:6045]) by smtp.gmail.com with ESMTPSA id bs11-20020a056000070b00b0031f3780ce60sm1695182wrb.7.2023.09.02.05.59.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Sep 2023 05:59:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1693659587; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eTC08l5E2LHxzBEzXg14rY8tH1ESV2HYzTzj23bXChc=; b=XAFCKAwFuDpQNfQWhUpJCVHDBxY0lOk1p852mQniK9AGDjPBiT+ohjVnkhlMYZ1zO0A5ew aSq25VFBUvrgvjnAgz70woOS4hhUoSqBRy5RAa/jHviHMwbBB9GuSzSLZCqIyNDm1TkuiV feLIhcj/Un+qI5xAFRSpja7Ul6v78L4= X-MC-Unique: y3euDBcIOGSj9xfxFlzSYg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693659584; x=1694264384; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eTC08l5E2LHxzBEzXg14rY8tH1ESV2HYzTzj23bXChc=; b=Oipv9PWtGS/XvIpErpSUVG/b33sipqAGN5MrUDgFG+g6K6MMbiu60ro9PO5eavsb88 uNqgA/0TWYW2BnhJBcBDEpJztLRiwjJhV7szYn3hQvOBXFGgrsK6x3uu1GfKP2xpPwew 4e9rsG7AuwoooYYN07kAU/UJ/+E2bErxp+qhDrK/X297Omji+5so9tgrY6QHMvhEpuqq rlBmthElN6HZCaHO9OUOcW65cYPEpE5IeF44In52UD6iPyXfFrO/1mpSgKyvLIJzUHVT Jjm4Ho7B4EQiWOLaLsykph0/9vDc7Uotw2+RKh6iX4atbj5+g0I9nxe6XUaGdAmU+exa 12Dw== X-Gm-Message-State: AOJu0YxOGO3JYy0kCdguw+iUkvnFOR+ytfV5mGlVxzftBt+mhP02j/nm 2jLuWv326MVdLEmiL0gAWd0bJzgTWHuqGSnpdvRgFP+kE8LjFBAQN/wti50VTtMIjTj6jW7Pz3G jXhopEW8czlFp0iGjMpJ5sOKTu9zrGBDPSED+Pv8IgN88a7seHwm4w0/iMM2GyGnJOPwRwcCLRP A= X-Received: by 2002:adf:e382:0:b0:319:8430:f80f with SMTP id e2-20020adfe382000000b003198430f80fmr4307031wrm.49.1693659584188; Sat, 02 Sep 2023 05:59:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGaArmF3GMN73lRajHBfWjw0CPtAh74iUSl7zgvJ3YypN0m6VHK9TVjrydWM/S4Fd5/UuP0HQ== X-Received: by 2002:adf:e382:0:b0:319:8430:f80f with SMTP id e2-20020adfe382000000b003198430f80fmr4307024wrm.49.1693659583949; Sat, 02 Sep 2023 05:59:43 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Richard Henderson , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= Subject: [PATCH 04/15] configure: create native file with contents of $host_cc Date: Sat, 2 Sep 2023 14:59:23 +0200 Message-ID: <20230902125934.113017-5-pbonzini@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230902125934.113017-1-pbonzini@redhat.com> References: <20230902125934.113017-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, 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_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1693659665693100007 The argument of --host-cc is not obeyed when cross compiling. To avoid this issue, place it in a configuration file and pass it to meson with --native-file. While at it, clarify that --host-cc is not obeyed anyway when _not_ cross compiling, because cc=3D"$host_cc" is placed before --host-cc is processed. Reviewed-by: Richard Henderson Reviewed-by: Daniel P. Berrang=C3=A9 Signed-off-by: Paolo Bonzini --- configure | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/configure b/configure index 7743c18f2fe..378a0de9fb6 100755 --- a/configure +++ b/configure @@ -288,7 +288,7 @@ static=3D"no" # ${cross_prefix}gcc (if cross-prefix specified) # system compiler if test -z "${CC}${cross_prefix}"; then - cc=3D"$host_cc" + cc=3D"cc" else cc=3D"${CC-${cross_prefix}gcc}" fi @@ -927,8 +927,8 @@ Advanced options (experts only): -Dmesonoptname=3Dval passthrough option to meson unmodified --cross-prefix=3DPREFIX use PREFIX for compile tools, PREFIX can be b= lank [$cross_prefix] --cc=3DCC use C compiler CC [$cc] - --host-cc=3DCC use C compiler CC [$host_cc] for code run at - build time + --host-cc=3DCC when cross compiling, use C compiler CC for c= ode run + at build time [$host_cc] --cxx=3DCXX use C++ compiler CXX [$cxx] --objcc=3DOBJCC use Objective-C compiler OBJCC [$objcc] --extra-cflags=3DCFLAGS append extra C compiler flags CFLAGS @@ -1892,7 +1892,6 @@ if test "$skip_meson" =3D no; then echo "windres =3D [$(meson_quote $windres)]" >> $cross echo "windmc =3D [$(meson_quote $windmc)]" >> $cross if test "$cross_compile" =3D "yes"; then - cross_arg=3D"--cross-file config-meson.cross" echo "[host_machine]" >> $cross echo "system =3D '$targetos'" >> $cross case "$cpu" in @@ -1909,6 +1908,14 @@ if test "$skip_meson" =3D no; then else echo "endian =3D 'little'" >> $cross fi + cross_arg=3D"--cross-file config-meson.cross" + + native=3D"config-meson.native.new" + echo "# Automatically generated by configure - do not modify" > $native + echo "[binaries]" >> $native + echo "c =3D [$(meson_quote $host_cc)]" >> $native + mv $native config-meson.native + cross_arg=3D"$cross_arg --native-file config-meson.native" else cross_arg=3D"--native-file config-meson.cross" fi --=20 2.41.0