From patchwork Sat Jan 2 20:01:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 1421777 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@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sandoe.co.uk Received: from sourceware.org (unknown [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 4D7XpJ3lFtz9sVq for ; Sun, 3 Jan 2021 07:01:26 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8098F386F450; Sat, 2 Jan 2021 20:01:22 +0000 (GMT) X-Original-To: GCC-patches@gcc.gnu.org Delivered-To: GCC-patches@gcc.gnu.org Received: from smtp1.wavenetuk.net (smtp.wavenetuk.net [195.26.36.10]) by sourceware.org (Postfix) with ESMTP id 88E89386F446 for ; Sat, 2 Jan 2021 20:01:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 88E89386F446 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=sandoe.co.uk Authentication-Results: sourceware.org; spf=none smtp.mailfrom=iain@sandoe.co.uk Received: from [192.168.1.212] (host81-138-1-83.in-addr.btopenworld.com [81.138.1.83]) by smtp1.wavenetuk.net (Postfix) with ESMTPA id 2EFAE12008A7; Sat, 2 Jan 2021 20:01:18 +0000 (GMT) From: Iain Sandoe Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Date: Sat, 2 Jan 2021 20:01:05 +0000 Subject: [pushed] Darwin : Adjust defaults for current bootstrap constraints. Message-Id: To: GCC Patches X-Mailer: Apple Mail (2.3273) X-Spam-Status: No, score=-15.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_COUK, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, KAM_SHORT, KHOP_HELO_FCRDNS, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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@gcc.gnu.org Sender: "Gcc-patches" Hi, Part of fixing up headers to handle Darwin20. The toolchain now requires a C++11 compiler to bootstrap and none of the older Darwin toolchains which were based on stabs debugging are suitable. We can simplify the debug setup now. tested on darwin8, 9, 16, 18, 20 x86_64-linux-gnu pushed to master thanks Iain gcc/ChangeLog: * config/darwin.h (DSYMUTIL_SPEC): Default to DWARF (ASM_DEBUG_SPEC):Only define if the assembler supports stabs. (PREFERRED_DEBUGGING_TYPE): Default to DWARF. (DARWIN_PREFER_DWARF): Define. * config/darwin9.h (PREFERRED_DEBUGGING_TYPE): Remove. (DARWIN_PREFER_DWARF): Likewise (DSYMUTIL_SPEC): Likewise. (COLLECT_RUN_DSYMUTIL): Likewise. (ASM_DEBUG_SPEC): Likewise. (ASM_DEBUG_OPTION_SPEC): Likewise. --- gcc/config/darwin.h | 37 ++++++++++++++++++++++++++----------- gcc/config/darwin9.h | 26 -------------------------- 2 files changed, 26 insertions(+), 37 deletions(-) diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h index da40a08443e..93e7796e850 100644 --- a/gcc/config/darwin.h +++ b/gcc/config/darwin.h @@ -241,12 +241,18 @@ extern GTY(()) int darwin_ms_struct; #define DSYMUTIL "\ndsymutil" +/* Spec that controls whether the debug linker is run automatically for + a link step. This needs to be done if there is a source file on the + command line which will result in a temporary object (and debug is + enabled). */ + #define DSYMUTIL_SPEC \ "%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\ %{v} \ - %{gdwarf-2:%{!gstabs*:%{%:debug-level-gt(0): -idsym}}}\ - %{.c|.cc|.C|.cpp|.cp|.c++|.cxx|.CPP|.m|.mm: \ - %{gdwarf-2:%{!gstabs*:%{%:debug-level-gt(0): -dsym}}}}}}}}}}}" + %{g*:%{!gstabs*:%{%:debug-level-gt(0): -idsym}}}\ + %{.c|.cc|.C|.cpp|.cp|.c++|.cxx|.CPP|.m|.mm|.s|.f|.f90|\ + .f95|.f03|.f77|.for|.F|.F90|.F95|.F03: \ + %{g*:%{!gstabs*:%{%:debug-level-gt(0): -dsym}}}}}}}}}}}" #define LINK_COMMAND_SPEC LINK_COMMAND_SPEC_A DSYMUTIL_SPEC @@ -472,22 +478,31 @@ extern GTY(()) int darwin_ms_struct; %{Zforce_cpusubtype_ALL:-force_cpusubtype_ALL} \ %{static}" ASM_MMACOSX_VERSION_MIN_SPEC -/* Default ASM_DEBUG_SPEC. Darwin's as cannot currently produce dwarf - debugging data. */ - +#ifdef HAVE_AS_STABS_DIRECTIVE +/* We only pass a debug option to the assembler if that supports stabs, since + dwarf is not uniformly supported in the assemblers. */ #define ASM_DEBUG_SPEC "%{g*:%{%:debug-level-gt(0):%{!gdwarf*:--gstabs}}}" -#define ASM_DEBUG_OPTION_SPEC "" +#else +#define ASM_DEBUG_SPEC "" +#endif + +#undef ASM_DEBUG_OPTION_SPEC +#define ASM_DEBUG_OPTION_SPEC "" + #define ASM_FINAL_SPEC \ "%{gsplit-dwarf:%ngsplit-dwarf is not supported on this platform} %. */ -/* Prefer DWARF2. */ -#undef PREFERRED_DEBUGGING_TYPE -#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG -#define DARWIN_PREFER_DWARF - -/* Since DWARF2 is default, conditions for running dsymutil are different. */ -#undef DSYMUTIL_SPEC -#define DSYMUTIL_SPEC \ - "%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\ - %{v} \ - %{g*:%{!gstabs*:%{%:debug-level-gt(0): -idsym}}}\ - %{.c|.cc|.C|.cpp|.cp|.c++|.cxx|.CPP|.m|.mm|.s|.f|.f90|.f95|.f03|.f77|.for|.F|.F90|.F95|.F03: \ - %{g*:%{!gstabs*:%{%:debug-level-gt(0): -dsym}}}}}}}}}}}" - -/* Tell collect2 to run dsymutil for us as necessary. */ -#define COLLECT_RUN_DSYMUTIL 1 - -/* Only ask as for debug data if the debug style is stabs (since as doesn't - yet generate dwarf.) */ - -#undef ASM_DEBUG_SPEC -#define ASM_DEBUG_SPEC "%{g*:%{%:debug-level-gt(0):%{gstabs:--gstabs}}}" - -#undef ASM_DEBUG_OPTION_SPEC -#define ASM_DEBUG_OPTION_SPEC "" - #undef ASM_OUTPUT_ALIGNED_COMMON #define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \ do { \