From patchwork Mon Feb 5 13:50:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 1895275 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=SiJg1CdN; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TT77D4JTjz23gM for ; Tue, 6 Feb 2024 00:50:32 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 83A2F385842D for ; Mon, 5 Feb 2024 13:50:30 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 0A74E3858CDB for ; Mon, 5 Feb 2024 13:50:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0A74E3858CDB Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 0A74E3858CDB Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707141012; cv=none; b=b41QtNtGYCfy0QYBoDnqHoz3mooXUxS5YjMZFET1CUeI5uWmuj2LTzrBFVCnaFNpNjNubVk0JQ7O08gIbJaQEmt4DLtiQ4AS8AM3sv6UYUgJdb3wc2c0HcyhWf/TvH3hjFQgC+IApAEENfP9KZTAwwjZcfwECgqOYvIolyN8Cms= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707141012; c=relaxed/simple; bh=uRvWBOnwEa/Cjrl1dfCmDYB9OgLrsptFNTPHlnt4sgM=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=Od+qCrNqvrT+Tg2Un4U1w2HRgVnelcXh+F5eYKfQjTWeuOjrHpwhJyLNawCTrYWAySLz46yRY/8p06I9qkR5lbiK3ug3w4fUH6cME4ObaRp/AbCmjCihUkMvn2xsy+Yy4B4lVl11I2c7WnYLSTKhyA5QKupsovrP6RKepoAUH9g= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707141009; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type; bh=TCJ+05C778WBekCP00beDO36QDrMKYk/8sS5eFDe4BA=; b=SiJg1CdNehWnz4GVp5GNHnOvzcr4rPEruih6s9qZcQuuTJmTBvNJAmuBYoBViBbIs+cJ9E 4lbkVhi3ZUZdmueIwqrotDi55XUKU5OITeCVVaRrC06BnOHfZ/71zjGcpH7nmOCF3CGu3x VO/QW4yT6GEV3fIW76799xPZW4Okjn8= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-400-BiGlQWTCNNSSh03MuQVbLA-1; Mon, 05 Feb 2024 08:50:08 -0500 X-MC-Unique: BiGlQWTCNNSSh03MuQVbLA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D773B85A58C; Mon, 5 Feb 2024 13:50:07 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.70]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 97FA01C060B3; Mon, 5 Feb 2024 13:50:07 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 415Do4si328591 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 5 Feb 2024 14:50:04 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 415Do2tk328590; Mon, 5 Feb 2024 14:50:02 +0100 Date: Mon, 5 Feb 2024 14:50:02 +0100 From: Jakub Jelinek To: Alexandre Oliva , Rainer Orth , Mike Stump Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] contrib: Fill in HOST{CC,CFLAGS,CXX,CXXFLAGS} in test_installed Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Jakub Jelinek Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Hi! gcc/Makefile.in since my r0-60234 change fills in HOSTCC and HOSTCFLAGS in site.exp and since r8-671 also HOSTCXX and HOSTCXXFLAGS. If those variables aren't set, we get errors like: /usr/src/gcc/contrib/test_installed --without-g++ --without-gfortran --without-objc struct-layout-1.exp ... ERROR: tcl error sourcing /usr/src/gcc/gcc/testsuite/gcc.dg/compat/struct-layout-1.exp. ERROR: tcl error code TCL LOOKUP VARNAME HOSTCC ERROR: can't read "HOSTCC": no such variable while executing "remote_exec build "$HOSTCC $HOSTCFLAGS $generator_cmd"" (file "/usr/src/gcc/gcc/testsuite/gcc.dg/compat/struct-layout-1.exp" line 96) invoked from within "source /usr/src/gcc/gcc/testsuite/gcc.dg/compat/struct-layout-1.exp" ("uplevel" body line 1) invoked from within "uplevel #0 source /usr/src/gcc/gcc/testsuite/gcc.dg/compat/struct-layout-1.exp" invoked from within "catch "uplevel #0 source $test_file_name" msg" (similarly in g++ or gfortran) struct-layout-1.exp. One doesn't need to test specially for just struct-layout-1.exp alone, just not using any arg will trigger it as well, just later. The following patch fills it in as cc and c++ with empty flags to compile those, I believe that is what e.g. make uses by default, so it should be a reasonable default. We IMHO shouldn't default to GCC_UNDER_TEST because that might be a cross-compiler etc. Ok for trunk? 2024-02-05 Jakub Jelinek * test_installed: Fill in HOSTCC, HOSTCXX, HOSTCFLAGS and HOSTCXXFLAGS. Jakub --- contrib/test_installed.jj 2024-01-03 11:51:20.865879222 +0100 +++ contrib/test_installed 2024-02-05 14:36:03.625047250 +0100 @@ -114,6 +114,10 @@ set GCC_UNDER_TEST "${GCC_UNDER_TEST-${p set GXX_UNDER_TEST "${GXX_UNDER_TEST-${prefix}${prefix+/bin/}g++}" set GFORTRAN_UNDER_TEST "${GFORTRAN_UNDER_TEST-${prefix}${prefix+/bin/}gfortran}" set OBJC_UNDER_TEST "${OBJC_UNDER_TEST-${prefix}${prefix+/bin/}gcc}" +set HOSTCC "${HOSTCC-cc}" +set HOSTCXX "${HOSTCXX-c++}" +set HOSTCFLAGS "" +set HOSTCXXFLAGS "" EOF if test x${target} != x; then echo "set target_triplet $target" >> site.exp