From patchwork Mon Apr 25 16:04:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Brobecker X-Patchwork-Id: 1622040 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=c2cerD65; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Kn8yZ27kXz9s07 for ; Tue, 26 Apr 2022 02:06:28 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C27613858C53 for ; Mon, 25 Apr 2022 16:06:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C27613858C53 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1650902786; bh=cRxOHymf/pSvMgd0GWjRKVnvTDfFZR5lRsKkShSv7Ec=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=c2cerD65mh/o7ad5+QTdsnocNwyJJTEb18ttqajO+n2T3/HcWH4QBs6VTnoDfyyz9 +1DqQJmqgNwf8KDPDMqDYhOHitW8wc3U0kv3q9XfHLGjQnXE9JpmTtDBlv16iySCnm FGoII/59GjHBVEtlvLOzMbvog/7bu4hlUsoG3HAc= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by sourceware.org (Postfix) with ESMTPS id 0F043385801B for ; Mon, 25 Apr 2022 16:04:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0F043385801B Received: by mail-pl1-x630.google.com with SMTP id c23so27627860plo.0 for ; Mon, 25 Apr 2022 09:04:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=cRxOHymf/pSvMgd0GWjRKVnvTDfFZR5lRsKkShSv7Ec=; b=sn/Lj6phMN6wGcyu0etsoksRIPHBHiiYMdTQ8/WFKJ6eCQLMniq/8ikOAw3Fyzngve EqBV15QZdu83bExpa1MRZnZe201REKyF8CqZ0a2WZENRWBNxfM9cfwWhAprQAY3CVLbn DwN0BdGDDABgt4JnQjpUNg8DI+LmqNI+7Lm3gf76HXgKDlQUpDJwzZu4VPT4UEWhKYv4 vJUZ/Calmh+D7toPuUnn4oVjeQdrR8wGs94XpCnZnHXwqwj4Avv8KWQIPeuV1ZXwGmEu GOyy9Y6jgotJ1F7+yQXuvZ9+baxDfPRqxujq7hHRjyMdIAUopOcuhpGHXbd/VxlE7NTL GM5A== X-Gm-Message-State: AOAM531FOKu+5GxqD9biNhw4MLexR17Cgvmh93TJe8W6X8WvraHUTZ+y xpzHnSLxsZP6em/K1clWzXTR X-Google-Smtp-Source: ABdhPJxUTicHJulHT2G2815n0zlLxMZS0mJGF8IKf56KwQrYspoqJ7tuBvJ2fbozztVHP0xr1O/pPQ== X-Received: by 2002:a17:902:e791:b0:151:dbbd:aeae with SMTP id cp17-20020a170902e79100b00151dbbdaeaemr18522055plb.171.1650902696977; Mon, 25 Apr 2022 09:04:56 -0700 (PDT) Received: from takamaka.home ([184.69.131.86]) by smtp.gmail.com with ESMTPSA id o11-20020a62cd0b000000b0050d3365725csm5721840pfg.105.2022.04.25.09.04.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Apr 2022 09:04:56 -0700 (PDT) Received: by takamaka.home (Postfix, from userid 1000) id A93FBA1626; Mon, 25 Apr 2022 09:04:55 -0700 (PDT) To: gcc-patches@gcc.gnu.org Subject: [RFA] gcc.misc-tests/outputs.exp: Use link test to check for -gsplit-dwarf support Date: Mon, 25 Apr 2022 09:04:51 -0700 Message-Id: <20220425160451.85324-1-brobecker@adacore.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-Spam-Status: No, score=-10.4 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.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Joel Brobecker via Gcc-patches From: Joel Brobecker Reply-To: Joel Brobecker Cc: Joel Sherrill , Joel Brobecker Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Hello, We have noticed that, when running the GCC testsuite on AArch64 RTEMS 6, we have about 150 tests failing due to a link failure. When investigating, we found that all the tests were failing due to the use of -gsplit-dwarf. On this platform, using -gsplit-dwarf currently causes an error during the link: | /[...]/ld: a.out section `.unexpected_sections' will not fit | in region `UNEXPECTED_SECTIONS' | /[...]/ld: region `UNEXPECTED_SECTIONS' overflowed by 56 bytes The error is a bit cryptic, but the source of the issue is that the linker does not currently support the sections generated by -gsplit-dwarf (.debug_gnu_pubnames, .debug_gnu_pubtypes). This means that the -gsplit-dwarf feature itself really isn't supported on this platform, at least for the moment. This commit enhances the -gsplit-dwarf support check to be a compile-and-link check, rather than just a compile check. This allows it to properly detect that this feature isn't supported on platforms such as AArch64 RTEMS where the compilation works, but not the link. Tested on aarch64-rtems, where a little over 150 tests are now passing, instead of failing, as well as on x86_64-linux, where the results are identical, and where the .log file was also manually inspected to make sure that the use of the -gsplit-dwarf option was preserved. gcc/testsuite/ChangeLog: * gcc.misc-tests/outputs.exp: Make the -gsplit-dwarf test a compile-and-link test rather than a compile-only test. OK to push on master? Thank you, diff --git a/gcc/testsuite/gcc.misc-tests/outputs.exp b/gcc/testsuite/gcc.misc-tests/outputs.exp index bc1fbe4eb7f..afae735e92d 100644 --- a/gcc/testsuite/gcc.misc-tests/outputs.exp +++ b/gcc/testsuite/gcc.misc-tests/outputs.exp @@ -36,8 +36,8 @@ gcc_parallel_test_enable 0 # having to deal with .dSYM directories, as long as -gsplit-dwarf is # not supported on platforms that use .dSYM directories. set gsplit_dwarf "-g -gsplit-dwarf" -if ![check_no_compiler_messages gsplitdwarf object { - void foo (void) { } +if ![check_no_compiler_messages gsplitdwarf executable { + int main (void) { return 0; } } "$gsplit_dwarf"] { set gsplit_dwarf "" }