From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1285) id 2B57A3854830; Fri, 9 Jul 2021 10:14:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2B57A3854830 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Eric Botcazou To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-2189] Fix build failure on Windows with older binutils X-Act-Checkin: gcc X-Git-Author: Eric Botcazou X-Git-Refname: refs/heads/master X-Git-Oldrev: 10722fb36de944c2385a275bb2b270727f7c93a4 X-Git-Newrev: e37e175e7dc3376244eb7705269ada6755616831 Message-Id: <20210709101415.2B57A3854830@sourceware.org> Date: Fri, 9 Jul 2021 10:14:15 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jul 2021 10:14:15 -0000 https://gcc.gnu.org/g:e37e175e7dc3376244eb7705269ada6755616831 commit r12-2189-ge37e175e7dc3376244eb7705269ada6755616831 Author: Eric Botcazou Date: Fri Jul 9 12:08:52 2021 +0200 Fix build failure on Windows with older binutils 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. gcc/ PR target/101377 * gcc.c (ASM_DEBUG_DWARF_OPTION): Set again to --gdwarf2 in the case where HAVE_AS_WORKING_DWARF_N_FLAG is not defined and HAVE_LD_BROKEN_PE_DWARF5 is defined. Diff: --- gcc/gcc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/gcc.c b/gcc/gcc.c index 36a88fc99b0..f086dd47b91 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -916,7 +916,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;" \