Darwin does not support gsplit-dwarf.
authorIain Sandoe <iain@sandoe.co.uk>
Sat, 18 Aug 2018 09:15:05 +0000 (09:15 +0000)
committerIain Sandoe <iains@gcc.gnu.org>
Sat, 18 Aug 2018 09:15:05 +0000 (09:15 +0000)
2018-08-18  Iain Sandoe  <iain@sandoe.co.uk>

gcc/

* config/darwin.c (darwin_override_options): If -gsplit-dwarf is set,
emit a diagnostic that it is not supported and reset the option.
* config/darwin.h (DRIVER_SELF_SPECS): Note that gsplit-dwarf is not
supported and consume the option.  (ASM_FINAL_SPEC): New.

gcc/testsuite

* g++.dg/debug/dwarf2/pr85302.C: Skip unsupported split DWARF
test on Darwin.
* g++.dg/debug/dwarf2/pr85302.C: Likewise.
* gcc.dg/lto/pr83719_0.c: Likewise.

From-SVN: r263645

gcc/ChangeLog
gcc/config/darwin.c
gcc/config/darwin.h
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/debug/dwarf2/pr85302.C
gcc/testsuite/gcc.dg/lto/pr83719_0.c
gcc/testsuite/gcc.dg/pr86064.c

index 7babd0d494c300170b176947715daf1653740ebd..ccc76e48bb041ed26e51ac6a14643e139692351b 100644 (file)
@@ -1,3 +1,10 @@
+2018-08-18  Iain Sandoe  <iain@sandoe.co.uk>
+
+       * config/darwin.c (darwin_override_options): If -gsplit-dwarf is set,
+       emit a diagnostic that it is not supported and reset the option.
+       * config/darwin.h (DRIVER_SELF_SPECS): Note that gsplit-dwarf is not
+       supported and consume the option.  (ASM_FINAL_SPEC): New.
+
 2018-08-17  Segher Boessenkool  <segher@kernel.crashing.org>
 
        * doc/md.texi (Patterns): Use @ref instead of @xref in the middle of
index a31cb08b60500094de8b74c4deab95f3b3dd9c5d..233076a3b77a202c2f46ae77e647faa2fa9f6c53 100644 (file)
@@ -3176,6 +3176,14 @@ darwin_override_options (void)
   if (!global_options_set.x_dwarf_version)
     dwarf_version = 2;
 
+  if (global_options_set.x_dwarf_split_debug_info)
+    {
+      inform (input_location,
+             "-gsplit-dwarf is not supported on this platform, ignored");
+      dwarf_split_debug_info = 0;
+      global_options_set.x_dwarf_split_debug_info = 0;
+    }
+
   /* Do not allow unwind tables to be generated by default for m32.  
      fnon-call-exceptions will override this, regardless of what we do.  */
   if (generating_for_darwin_version < 10
index 166c3c7718ca094d2003849d58f4d60272025c3f..05c8cf71a1f949f211bd347ea82593fda7d13258 100644 (file)
@@ -122,7 +122,9 @@ extern GTY(()) int darwin_ms_struct;
   "%{gfull:-g -fno-eliminate-unused-debug-symbols} %<gfull",   \
   "%{gused:-g -feliminate-unused-debug-symbols} %<gused",      \
   "%{fapple-kext|mkernel:-static}",                            \
-  "%{shared:-Zdynamiclib} %<shared"
+  "%{shared:-Zdynamiclib} %<shared",                            \
+  "%{gsplit-dwarf:%ngsplit-dwarf is not supported on this platform } \
+     %<gsplit-dwarf"
 
 #define DARWIN_CC1_SPEC                                                        \
   "%{findirect-virtual-calls: -fapple-kext} %<findirect-virtual-calls " \
@@ -421,6 +423,8 @@ extern GTY(()) int darwin_ms_struct;
    debugging data.  */
 
 #define ASM_DEBUG_SPEC  "%{g*:%{%:debug-level-gt(0):%{!gdwarf*:--gstabs}}}"
+#define ASM_FINAL_SPEC \
+  "%{gsplit-dwarf:%ngsplit-dwarf is not supported on this platform } %<gsplit-dwarf"
 
 /* We still allow output of STABS if the assembler supports it.  */
 #ifdef HAVE_AS_STABS_DIRECTIVE
index 3478f11b17bdda852bb924037ab202327a9a95d6..5a1aedfd899bc4319423264c00cd196b9f270c57 100644 (file)
@@ -1,3 +1,10 @@
+2018-08-18  Iain Sandoe  <iain@sandoe.co.uk>
+
+       * g++.dg/debug/dwarf2/pr85302.C: Skip unsupported split DWARF
+       test on Darwin.
+       * g++.dg/debug/dwarf2/pr85302.C: Likewise.
+       * gcc.dg/lto/pr83719_0.c: Likewise.
+
 2018-08-17  Martin Sebor  <msebor@redhat.com>
 
        PR testsuite/86996
index 97ac302a92179990bef90a3d1a0fb301232c4202..457508dd586745e4d71ac2304ae513465c66783f 100644 (file)
@@ -1,5 +1,6 @@
 // PR debug/85302
 // { dg-do compile }
+// { dg-skip-if "split DWARF unsupported" { *-*-darwin* } }
 // { dg-options "-std=c++11 -gsplit-dwarf -O1" }
 // { dg-additional-options "-fPIE" { target pie } }
 
index 6d5c16da7dad10afce3bfae7ae56df804eef180e..cd4cab369a5d397e1a2403afb9e8f823954a67fe 100644 (file)
@@ -1,4 +1,5 @@
 /* { dg-lto-do assemble } */
+/* { dg-skip-if "split DWARF unsupported" { *-*-darwin* } } */
 /* { dg-lto-options { { -flto -g -gsplit-dwarf } } } */
 
 /* Empty.  */
index 5be820c78f8476402d60108fea7ae8a2aeba892f..3397427256922deaccd29d6994e480a6bb77ebf3 100644 (file)
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-skip-if "split DWARF unsupported" { *-*-darwin* } } */
 /* { dg-options "-g -O2 -fno-var-tracking-assignments -gsplit-dwarf" } */
 
 /* This used to fail with location views (implicitly) enabled, because