Message ID | 20231027151141.1879699-1-christophe.lyon@linaro.org |
---|---|
State | Accepted |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:d641:0:b0:403:3b70:6f57 with SMTP id cy1csp676733vqb; Fri, 27 Oct 2023 08:12:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IERcMTLcuyzoqob50hFpViZDXDnXzi2/DlvdYb6HfI5f/yv23lNF63ocXDl3yO/oSJEe2lm X-Received: by 2002:a05:620a:22a8:b0:77a:61a:605c with SMTP id p8-20020a05620a22a800b0077a061a605cmr2197490qkh.20.1698419530215; Fri, 27 Oct 2023 08:12:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698419530; cv=pass; d=google.com; s=arc-20160816; b=YuF0PiIl6xHdFXGtY2Hsr52ZVzXeban0d2Q+UI0kARHUA/D7LBHEcT7sieFHBELaif yquyG75jehKxfJXV8e0HDPLS4PfPXtR+pqF3bMHn9lepujsd+DJpj/J/KOHp1jsZ2bpT fsZ7tMecz0VL/Ux9KJ7+whMVgDnJ4knIc27tu3xlBvwSqe6pQeh75n+yHT2EsjVGdPZd lSGB7rsafpGAXtg/KGAGGSUK9arTs1QG4T2C4XprcwRlZk9RQ3BT6R/uJDdFHdDUXqkp ns06LFS9JVK+k3VQh3KCz5xgktHC8z8I/mu/9beyEpqVJFzmtmh0TZwMMZH9wtqtfQgJ Y5pw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=jybk6xBBaZ4Rrs+MLcWO4Mo+fwmDY1xIEWSXcABXjuc=; fh=DtMTNvQ7FF8mCqMwYFYOOYsfi2VPtG+iGDzKhyBGjHA=; b=zoXQvr2Sr7lhLngDxtXZm5N0Awb6nOFwl7q5DePwQZhvxHsm8Vw3dgotu00acw9Dd3 kqbaE4J4v/0CFSVJs7Df0sbXwqgc8B6HpVRpqG9kbZuT0esrdkPI+sM+HRfalellKFuV ivESi1vmPq0pzTYYOU9pR7vUcHtO/ULoVnsSoXBEqiCEkgIkhJQ0VUM4E7t8k+OGRM61 vZpejZTpnnejGTnWjK4myj1q+Bfhb4OhMIAAfiF6SaDyimZNGwE7eT5sIz1AoCPHw0Fj PrYEFMoLlrwdSHWv4te/evyQlKNuHhcV9cvnr5LTxEdd2JDAlTwgIxlykXaaZwRCYPGx 7Dgg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ypKlXLd5; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id b25-20020a05620a127900b00767c77c80b5si752103qkl.477.2023.10.27.08.12.10 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 08:12:10 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ypKlXLd5; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DDF033860778 for <ouuuleilei@gmail.com>; Fri, 27 Oct 2023 15:12:09 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-oi1-x236.google.com (mail-oi1-x236.google.com [IPv6:2607:f8b0:4864:20::236]) by sourceware.org (Postfix) with ESMTPS id 1FC233858298 for <gcc-patches@gcc.gnu.org>; Fri, 27 Oct 2023 15:11:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1FC233858298 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 1FC233858298 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::236 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698419507; cv=none; b=hEr/GzIAFO6ANg4hCIhsnEWqt4p+m3saPh0Jw6kkLdGDJbGwtqKg3FAiILbJQCuBr5NTczQ712NBEva+Wy0EMXXlO1XEu0HoYrq2ZW0o/ElLTaA9etS1dn3ALQbQ+BGhuvSL+lozBfzuvSL5cCRHQ7uNuMJ1Ro0pnRC3Y1EHZt4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698419507; c=relaxed/simple; bh=baqjUFRjF9sqkEXRUHPyyWSSNmu3T/BEFEh4qf+MP1E=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=Iit5mZjMo7WQxAU0BURnWPiJTIgtvlBjG5aT90zKyyJfVjxnSc+/N4OdAB0ZOfWBjihdU8ZTIUyNFTLOyXWPFRD06L5JqvKQAIcsgYSiNO5MVbGQI0gEnZMP/DPZv83d6rwmTF+K3gK81gd7MVJQEG9JW4N7zg3pJUAh5GH77AQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-oi1-x236.google.com with SMTP id 5614622812f47-3b2f507c03cso1243366b6e.2 for <gcc-patches@gcc.gnu.org>; Fri, 27 Oct 2023 08:11:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698419504; x=1699024304; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=jybk6xBBaZ4Rrs+MLcWO4Mo+fwmDY1xIEWSXcABXjuc=; b=ypKlXLd5eDzduZ/nH17hbRb6Ud07MkHqXktmAqOucH2vVY9V1K8X9Eo8c8SqZ8RXSQ hHf7hHejo/jln9SvMVtx9k2LyzZy//WxKdCwfvPwQ6iHd1skZyLlEPgUQt73ERAgyzaC S/Dv7EePy7YAYQDBNz1l2zs3Pgwk1CSTSGOxmEueG3Eb6I51HhjGzshQjoUKqwer+UDB 1ahWomz9WQjtD71YW3rvzvf3WlxMWjaszOH4ObaHttFi/BAZ6jdH2QY0olzcFDaAmeeL oPLEuB4DY0XXbPmw1vTQJsCR+sj1RLasSSIXLKFk5VNpyGF70rOETLqHwFV3CbyLYb4N 43Cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698419504; x=1699024304; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=jybk6xBBaZ4Rrs+MLcWO4Mo+fwmDY1xIEWSXcABXjuc=; b=Q2kXvLNoEFEpS2PmBBKIGXVg/Jy8TG14peB8xHVFqHiFBQLZYHuAFN32GC3JzSdQHm PgqEAjpmwzoTT9ASf3UzI3Rh5k3fPokgUQPWbBVS3+xoBW+EQJOrV9JaBVa6yQ/ERvrq ESjRZSgwgdkHjkwELCP7qhOlTWx2Hntjtcs6e2bnVBtzpway6mlp1oSed7weW9UGxWTE t434NwYZxE8GDbatB9TXHTGnk0Nm/y4MpxM+y+pLzVtOulLgOgYjuyP9wFbi/YNoPDtY ZRnaG2vgbV8AXd0Z86hls1+xeY50L2QroWbkHLorsDGdYbv3qx9DcMBsXY9tcMRH6yp+ IOXQ== X-Gm-Message-State: AOJu0Yw2opytScULbQs2YUBLjHduO2naCZF+MjRKomdA5uuZa3R7/kcd iNKu4NVqIbIsK03Y2NWIqOkPLqjhDK0mUW8hmvJfFw== X-Received: by 2002:a05:6808:14d0:b0:3ae:4774:c00c with SMTP id f16-20020a05680814d000b003ae4774c00cmr3326260oiw.53.1698419504574; Fri, 27 Oct 2023 08:11:44 -0700 (PDT) Received: from localhost.localdomain ([139.178.84.207]) by smtp.gmail.com with ESMTPSA id g38-20020a0568080de600b003ac9e775706sm316961oic.1.2023.10.27.08.11.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 08:11:44 -0700 (PDT) From: Christophe Lyon <christophe.lyon@linaro.org> To: gcc-patches@gcc.gnu.org, ro@CeBiTec.Uni-Bielefeld.DE, mikestump@comcast.net Cc: Christophe Lyon <christophe.lyon@linaro.org> Subject: [PATCH] testsuite: Force use of -c when precompiling headers Date: Fri, 27 Oct 2023 15:11:41 +0000 Message-Id: <20231027151141.1879699-1-christophe.lyon@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP 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 <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780921956886649592 X-GMAIL-MSGID: 1780921956886649592 |
Series |
testsuite: Force use of -c when precompiling headers
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
Christophe Lyon
Oct. 27, 2023, 3:11 p.m. UTC
In some configurations of our validation setup, we always call the compiler with -Wl,-rpath=XXX, which instructs the driver to invoke the linker if none of -c, -S or -E is used. This happens to be the case in the PCH tests, where dg-flags-pch sets dg-do-what-default to precompile. This works most of the time, in absence of any linker option, the compiler defaults to generating a precompiled header (otherwise the linker complains because it cannot find 'main'). This small patch forces the use of '-c' when generating the .gch file, which is sufficient not to invoke the linker. Arguably, this could be seen as a dejagnu bug: in gcc-dg-test-1 (in gcc-dg.exp), we set compile_type to "precompiled_header", which is not one of the supported values in dejagnu's default_target_compile (in target.exp). 2023-10-27 Christophe Lyon <christophe.lyon@linaro.org> gcc/testsuite/ * lib/dg-pch.exp (dg-flags-pch): Add -c when generating the precompiled header. --- gcc/testsuite/lib/dg-pch.exp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Oct 27, 2023, at 8:11 AM, Christophe Lyon <christophe.lyon@linaro.org> wrote: > > In some configurations of our validation setup, we always call the > compiler with -Wl,-rpath=XXX, which instructs the driver to invoke the > linker if none of -c, -S or -E is used. > > This happens to be the case in the PCH tests, where dg-flags-pch sets > dg-do-what-default to precompile. > > This works most of the time, in absence of any linker option, the > compiler defaults to generating a precompiled header (otherwise the > linker complains because it cannot find 'main'). > > This small patch forces the use of '-c' when generating the .gch file, > which is sufficient not to invoke the linker. > > Arguably, this could be seen as a dejagnu bug: in gcc-dg-test-1 (in > gcc-dg.exp), we set compile_type to "precompiled_header", which is not > one of the supported values in dejagnu's default_target_compile (in > target.exp). > > 2023-10-27 Christophe Lyon <christophe.lyon@linaro.org> > > gcc/testsuite/ > * lib/dg-pch.exp (dg-flags-pch): Add -c when generating the > precompiled header. Ok.
diff --git a/gcc/testsuite/lib/dg-pch.exp b/gcc/testsuite/lib/dg-pch.exp index b6fefaa0286..ae8ce3bf1e1 100644 --- a/gcc/testsuite/lib/dg-pch.exp +++ b/gcc/testsuite/lib/dg-pch.exp @@ -95,7 +95,7 @@ proc dg-flags-pch { subdir test otherflags options suffix } { set dg-do-what-default precompile catch { file_on_host delete "$bname$suffix" } gcc_copy_files "[file rootname $test]${suffix}s" "$bname$suffix" - dg-test -keep-output "./$bname$suffix" "$otherflags $flags" "" + dg-test -keep-output "./$bname$suffix" "$otherflags $flags -c" "" # For the rest, the default is to compile to .s. set dg-do-what-default compile