From patchwork Fri Jul 9 07:40:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 1502955 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=adacore-com.20150623.gappssmtp.com header.i=@adacore-com.20150623.gappssmtp.com header.a=rsa-sha256 header.s=20150623 header.b=rTwbWzV1; dkim-atps=neutral Received: from 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 RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GLlTD4T18z9sRR for ; Fri, 9 Jul 2021 17:41:02 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1DE1A3853837 for ; Fri, 9 Jul 2021 07:40:59 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by sourceware.org (Postfix) with ESMTPS id 4837A3858D39 for ; Fri, 9 Jul 2021 07:40:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4837A3858D39 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-wm1-x32e.google.com with SMTP id j34so5695359wms.5 for ; Fri, 09 Jul 2021 00:40:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=Xrw/7Q0rh6Iz+SKJ2PgmWrIkkOzF6vzUE/lbpHLYE9U=; b=rTwbWzV1ZKcFBYatmg+LeOlKE2Zdbp1WnuwF79+2ZdTAQwyNK7wAOfTl4qXFlm1zL7 6C2bX14pgvS8Fnyh8GQ3xdhE1XpSRaGhI/o/mq7DnYTBU0D5VT0oxz+lP4MR2XSLu2jg SNfR04gwAyLh0GtG+vkLH0eJsJLqmYBv5L/vj5/6JzP4sAJejPXYp56POXEyHjSZ8cvw pfCRucRu7ESiWSVfkkVyFVBzuCioez1rFr5YOn1doXO4aUpPoEbcTjqFl2AppnqtMQ9r F1RcxDO/p+LtKrTsaIBhZcpe0bxyHmqdSxZqk5fCIMaJSO5By5KmYSl5ecoNRHNtKkuh jUAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=Xrw/7Q0rh6Iz+SKJ2PgmWrIkkOzF6vzUE/lbpHLYE9U=; b=roasD7txKDNMWZjlWjTXwdsKni3SBtOw2uW6U0FiUsWQarxbhiGkWZS+ETywhcybRP 66pc5pJSjv/INhhhdJwCmyobpPtpAeYTrUKrcJ3B6LyDgLXDfJMFdOixAuaWgbZQkfaR sC043nciiD5n8pgpDRoy4BIu5fyO02TjAyt0KPSkYjYG5R/wQJFzp76Z5AXMMzgWcyIk +QvlwaT3MUSJdG1XVqt6oUsvchXThfLt/sTxFOCJ2RAS9Vl1CnkH9dVEkv8SkN9a/bNd e8ZaREFvTGOGqk8CEc8SAkKQrPn9+gzw/u6iicjXwQtIOBoS8m3daTgsmG4X3OjLDkAa P/NQ== X-Gm-Message-State: AOAM533V1l23t2QDeDKo8M1bTX0meNC8kx7c/hEJO80L3+lwWuigoV/6 M9Jpxr9oD1qjaNY7Jum9O1zUxWI8zVnJt9Yy X-Google-Smtp-Source: ABdhPJyznH2aPInBOnN/sl15rfwJ9uYIdei/mP5S8sjUiq8QKAuquCo13Jg2AxZmibpqhjn8/yYbIg== X-Received: by 2002:a05:600c:2187:: with SMTP id e7mr10062566wme.161.1625816446016; Fri, 09 Jul 2021 00:40:46 -0700 (PDT) Received: from fomalhaut.localnet ([2a01:e0a:41b:84f0:cf71:f5e0:b050:bede]) by smtp.gmail.com with ESMTPSA id n41sm10757618wms.26.2021.07.09.00.40.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Jul 2021 00:40:45 -0700 (PDT) From: Eric Botcazou X-Google-Original-From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: Fix PR target/101377 Date: Fri, 09 Jul 2021 09:40:29 +0200 Message-ID: <11784456.O9o76ZdvQC@fomalhaut> MIME-Version: 1.0 X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, KAM_NUMSUBJECT, 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: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Hi, this is the build failure on Windows with binutils for which GNU as accepts the --gdwarf-5 switch but GNU ld generates broken binaries with DWARF 5. We already have the HAVE_LD_BROKEN_PE_DWARF5 kludge to disable DWARF 5 in this case but it only tames the DWARF version in the compiler, so the driver still passes --gdwarf-5 when invoked on an assembly file with -g. The attached patch is a minimal fix to plug the hole, and I don't think that anything more sophisticated is worth the hassle since 2.37 supports DWARF 5, i.e. HAVE_AS_GDWARF_5_DEBUG_FLAG and HAVE_AS_WORKING_DWARF_N_FLAG are defined and HAVE_LD_BROKEN_PE_DWARF5 is not with it. Tested on x86-64/Linux and x86[-64]/Windows, OK for mainline and 11 branch? 2021-07-07 Eric Botcazou PR target/101377 * gcc.c.c (ASM_DEBUG_DWARF_OPTION): Set again to --gdwarf2 if HAVE_AS_WORKING_DWARF_N_FLAG is not defined and HAVE_LD_BROKEN_PE_DWARF5 is defined. diff --git a/gcc/gcc.c b/gcc/gcc.c index 7837553958b..7c75d1314fa 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -910,7 +910,7 @@ proper position among the other output files. */ than in ASM_DEBUG_SPEC, so that it applies to both .s and .c etc. compilations. */ # define ASM_DEBUG_DWARF_OPTION "" -# elif defined(HAVE_AS_GDWARF_5_DEBUG_FLAG) +# elif defined(HAVE_AS_GDWARF_5_DEBUG_FLAG) && !defined(HAVE_LD_BROKEN_PE_DWARF5) # define ASM_DEBUG_DWARF_OPTION "%{%:dwarf-version-gt(4):--gdwarf-5;" \ "%:dwarf-version-gt(3):--gdwarf-4;" \ "%:dwarf-version-gt(2):--gdwarf-3;" \