]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR target/67973 (All the tests for -gstabs* fail on x86_64-apple-darwin1...
authorIain Sandoe <iain@codesourcery.com>
Sun, 22 May 2016 08:53:32 +0000 (08:53 +0000)
committerDominique d'Humieres <dominiq@gcc.gnu.org>
Sun, 22 May 2016 08:53:32 +0000 (10:53 +0200)
2016-05-22  Iain Sandoe  <iain@codesourcery.com>
    Dominique d'Humieres  <dominiq@lps.ens.fr>

Backport from mainline
2015-12-17  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

gcc:
PR target/67973
* configure.ac (gcc_cv_as_stabs_directive): New test.
* configure: Regenerate.
* config.in: Regenerate.
* config/darwin.h (DBX_DEBUGGING_INFO): Wrap in
HAVE_AS_STABS_DIRECTIVE.
(PREFERRED_DEBUGGING_TYPE): Likewise.
* config/i386/darwin.h (PREFERRED_DEBUGGING_TYPE): Only include
DBX_DEBUG if HAVE_AS_STABS_DIRECTIVE.

* doc/sourcebuild.texi (Effective-Target Keywords, Environment
attributes): Document stabs.

gcc/testsuite:
PR target/67973

* lib/target-supports.exp (check_effective_target_stabs): New proc.
* g++.dg/cpp0x/alias-decl-debug-0.C: Restrict to stabs targets.
* g++.dg/other/PR23205.C: Likewise.
* g++.dg/other/pr23205-2.C: Likewise.
* gcc.dg/20040813-1.c: Likewise.
* gcc.dg/darwin-20040809-2.c: Likewise.
* objc.dg/stabs-1.m: Likewise.

Co-Authored-By: Dominique d'Humieres <dominiq@lps.ens.fr>
From-SVN: r236565

15 files changed:
gcc/ChangeLog
gcc/config.in
gcc/config/darwin.h
gcc/config/i386/darwin.h
gcc/configure
gcc/configure.ac
gcc/doc/sourcebuild.texi
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/alias-decl-debug-0.C
gcc/testsuite/g++.dg/other/PR23205.C
gcc/testsuite/g++.dg/other/pr23205-2.C
gcc/testsuite/gcc.dg/20040813-1.c
gcc/testsuite/gcc.dg/darwin-20040809-2.c
gcc/testsuite/lib/target-supports.exp
gcc/testsuite/objc.dg/stabs-1.m

index fe3d796eefd29ec3ec3adf0eaf99918242246954..389c7d4076043587549f94367ea7474c98d0957c 100644 (file)
@@ -1,3 +1,22 @@
+2016-05-22  Iain Sandoe  <iain@codesourcery.com>
+           Dominique d'Humieres  <dominiq@lps.ens.fr>
+
+       Backport from mainline
+       2015-12-17  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       PR target/67973
+       * configure.ac (gcc_cv_as_stabs_directive): New test.
+       * configure: Regenerate.
+       * config.in: Regenerate.
+       * config/darwin.h (DBX_DEBUGGING_INFO): Wrap in
+       HAVE_AS_STABS_DIRECTIVE.
+       (PREFERRED_DEBUGGING_TYPE): Likewise.
+       * config/i386/darwin.h (PREFERRED_DEBUGGING_TYPE): Only include
+       DBX_DEBUG if HAVE_AS_STABS_DIRECTIVE.
+
+       * doc/sourcebuild.texi (Effective-Target Keywords, Environment
+       attributes): Document stabs.
+
 2016-05-20  Eric Botcazou  <ebotcazou@adacore.com>
 
        * config/arm/arm.c (arm_expand_prologue): Set the stack usage to 0
index 6e120e70f39a81d1b14ba1fc23f0d70c9c7165ec..f86133120bc6232546ebab0360f75c3b6b5fa824 100644 (file)
 #endif
 
 
+/* Define if your assembler supports .stabs. */
+#ifndef USED_FOR_TARGET
+#undef HAVE_AS_STABS_DIRECTIVE
+#endif
+
+
 /* Define if your assembler and linker support thread-local storage. */
 #ifndef USED_FOR_TARGET
 #undef HAVE_AS_TLS
index 12636409979b81b8a01c1d6624c36cd838cc8fe3..f8fd2fef3b4ae549449bdc9040eafb057848ef02 100644 (file)
@@ -1,5 +1,5 @@
 /* Target definitions for Darwin (Mac OS X) systems.
-   Copyright (C) 1989-2014 Free Software Foundation, Inc.
+   Copyright (C) 1989-2016 Free Software Foundation, Inc.
    Contributed by Apple Computer Inc.
 
 This file is part of GCC.
@@ -392,12 +392,13 @@ extern GTY(()) int darwin_ms_struct;
 
 #define ASM_DEBUG_SPEC  "%{g*:%{!g0:%{!gdwarf*:--gstabs}}}"
 
-/* We still allow output of STABS.  */
-
+/* We still allow output of STABS if the assembler supports it.  */
+#ifdef HAVE_AS_STABS_DIRECTIVE
 #define DBX_DEBUGGING_INFO 1
+#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
+#endif
 
 #define DWARF2_DEBUGGING_INFO 1
-#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
 
 #define DEBUG_FRAME_SECTION    "__DWARF,__debug_frame,regular,debug"
 #define DEBUG_INFO_SECTION     "__DWARF,__debug_info,regular,debug"
index a85aa42d5fc5a28299c2fd5f2857f034d5d0a31e..185bf31c2fe487accc028053ff5725b21ebddec7 100644 (file)
@@ -1,5 +1,5 @@
 /* Target definitions for x86 running Darwin.
-   Copyright (C) 2001-2014 Free Software Foundation, Inc.
+   Copyright (C) 2001-2016 Free Software Foundation, Inc.
    Contributed by Apple Computer Inc.
 
 This file is part of GCC.
@@ -242,7 +242,11 @@ do {                                                                       \
    compiles default to stabs+.  darwin9+ defaults to dwarf-2.  */
 #ifndef DARWIN_PREFER_DWARF
 #undef PREFERRED_DEBUGGING_TYPE
+#ifdef HAVE_AS_STABS_DIRECTIVE
 #define PREFERRED_DEBUGGING_TYPE (TARGET_64BIT ? DWARF2_DEBUG : DBX_DEBUG)
+#else
+#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
+#endif
 #endif
 
 /* Darwin uses the standard DWARF register numbers but the default
index 1674e3063c2954c8a69875cf1d7a79d5a2932175..282878fbd8386308e04f78580eb64c781b234df5 100755 (executable)
@@ -15917,7 +15917,7 @@ _LT_EOF
        if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
          export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
        else
-         export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+         export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
        fi
        aix_use_runtimelinking=no
 
@@ -20403,7 +20403,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
     if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
       export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
     else
-      export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+      export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
     fi
     ;;
   pw32*)
@@ -22987,6 +22987,37 @@ cat >>confdefs.h <<_ACEOF
 _ACEOF
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for stabs directive" >&5
+$as_echo_n "checking assembler for stabs directive... " >&6; }
+if test "${gcc_cv_as_stabs_directive+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  gcc_cv_as_stabs_directive=no
+  if test x$gcc_cv_as != x; then
+    $as_echo '.stabs "gcc2_compiled.",60,0,0,0' > conftest.s
+    if { ac_try='$gcc_cv_as $gcc_cv_as_flags  -o conftest.o conftest.s >&5'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }
+    then
+       gcc_cv_as_stabs_directive=yes
+    else
+      echo "configure: failed program was" >&5
+      cat conftest.s >&5
+    fi
+    rm -f conftest.o conftest.s
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_stabs_directive" >&5
+$as_echo "$gcc_cv_as_stabs_directive" >&6; }
+if test $gcc_cv_as_stabs_directive = yes; then
+
+$as_echo "#define HAVE_AS_STABS_DIRECTIVE 1" >>confdefs.h
+
+fi
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for COMDAT group support (GNU as)" >&5
 $as_echo_n "checking assembler for COMDAT group support (GNU as)... " >&6; }
 if test "${gcc_cv_as_comdat_group+set}" = set; then :
index 1a009c87b0c49f59ec0c1e7537747a87d98ad14f..a57c0a2fb30a4ced9f07c2e6e20499501b55a380 100644 (file)
@@ -2746,6 +2746,11 @@ AC_DEFINE_UNQUOTED(HAVE_GAS_SHF_MERGE,
   [`if test $gcc_cv_as_shf_merge = yes; then echo 1; else echo 0; fi`],
 [Define 0/1 if your assembler supports marking sections with SHF_MERGE flag.])
 
+gcc_GAS_CHECK_FEATURE([stabs directive], gcc_cv_as_stabs_directive, ,,
+[.stabs "gcc2_compiled.",60,0,0,0],,
+[AC_DEFINE(HAVE_AS_STABS_DIRECTIVE, 1,
+  [Define if your assembler supports .stabs.])])
+
 gcc_GAS_CHECK_FEATURE([COMDAT group support (GNU as)],
  gcc_cv_as_comdat_group,
  [elf,2,16,0], [--fatal-warnings],
index 39152df272a08a6c805511ca65b06ac87957b44e..371ddf663bbc7d87dc6a54152a0d72f8b9824c6a 100644 (file)
@@ -1782,6 +1782,9 @@ time) should be run on this target.  This can be enabled by setting the
 Test system runs executables on a simulator (i.e. slowly) rather than
 hardware (i.e. fast).
 
+@item stabs
+Target supports the stabs debugging format.
+
 @item stdint_types
 Target has the basic signed and unsigned C types in @code{stdint.h}.
 This will be obsolete when GCC ensures a working @code{stdint.h} for
index 30c17894a8f350075d3c3ae3c4696b0a60e8b654..bc1044a415d4fca46554807c22a420906c1e601d 100644 (file)
@@ -1,3 +1,19 @@
+2016-05-22  Iain Sandoe  <iain@codesourcery.com>
+           Dominique d'Humieres  <dominiq@lps.ens.fr>
+
+       Backport from mainline
+       2015-12-17  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       PR target/67973
+
+       * lib/target-supports.exp (check_effective_target_stabs): New proc.
+       * g++.dg/cpp0x/alias-decl-debug-0.C: Restrict to stabs targets.
+       * g++.dg/other/PR23205.C: Likewise.
+       * g++.dg/other/pr23205-2.C: Likewise.
+       * gcc.dg/20040813-1.c: Likewise.
+       * gcc.dg/darwin-20040809-2.c: Likewise.
+       * objc.dg/stabs-1.m: Likewise.
+
 2016-05-20  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
 
        Backport from mainline
index 524216ad5c07b0bcde6f87fed63c841fbcf9cb08..8464aa35a1a011c0b5f5d954d31066e28e84766a 100644 (file)
@@ -1,6 +1,5 @@
 // Origin: PR c++/51032
-// { dg-do compile { target c++11 } }
-// { dg-skip-if "No stabs" { aarch64*-*-* mmix-*-* *-*-aix* alpha*-*-* hppa*64*-*-* ia64-*-* *-*-vxworks* nios2-*-* } { "*" } { "" } }
+// { dg-do compile { target { c++11 && stabs } } }
 // { dg-options "-gstabs+" }
 
 template <class C>
index b05087b5420dbd87e1862866612e35944c68eba6..65ba1f6f30603503502dbbace63d78f593f81676 100644 (file)
@@ -1,5 +1,4 @@
-/* { dg-do compile } */
-/* { dg-skip-if "No stabs" { aarch64*-*-* mmix-*-* *-*-aix* alpha*-*-* hppa*64*-*-* ia64-*-* nios2-*-* tile*-*-* *-*-vxworks } { "*" } { "" } } */
+/* { dg-do compile { target stabs } } */
 /* { dg-options "-gstabs+ -fno-eliminate-unused-debug-types" } */
 
 const int foobar = 4;
index c7eefaa58c920e57dd10a2d800fc5ce830de30b8..7b25c071a67a90f03686a2a82af6c16995c89869 100644 (file)
@@ -1,5 +1,4 @@
-/* { dg-do compile } */
-/* { dg-skip-if "No stabs" { aarch64*-*-* mmix-*-* *-*-aix* alpha*-*-* hppa*64*-*-* ia64-*-* tile*-*-* nios2-*-* } { "*" } { "" } } */
+/* { dg-do compile { target stabs } } */
 /* { dg-options "-gstabs+ -fno-eliminate-unused-debug-types -ftoplevel-reorder" } */
 
 const int foobar = 4;
index 8be831d96b6a8dcc78ca833e29e8c5c6ef1d208b..9cf664dd769a89064daa9b85dca31e8e107d2ec7 100644 (file)
@@ -1,8 +1,7 @@
 /* Test lang in N_SO stab.  */
 /* Contributed by Devang Patel  <dpatel@apple.com>  */
 
-/* { dg-do compile } */
-/* { dg-skip-if "No stabs" { aarch64*-*-* mmix-*-* *-*-aix* alpha*-*-* hppa*64*-*-* ia64-*-* tile*-*-* nios2-*-* *-*-vxworks* } { "*" } { "" } } */
+/* { dg-do compile { target stabs } } */
 /* { dg-options "-gstabs" } */
 
 int
index a38f75f26b7de3562a02b5855410b4929054852f..98d571276d0a5c120a767527b7e3b74f3a4c8163 100644 (file)
@@ -1,7 +1,7 @@
 /* Test dead code strip support.  */
 /* Contributed by Devang Patel  <dpatel@apple.com>  */
 
-/* { dg-do compile { target *-*-darwin* } } */
+/* { dg-do compile { target { *-*-darwin* && stabs } } } */
 /* { dg-options "-gstabs+ -fno-eliminate-unused-debug-symbols" } */
 
 int
index 19c512f4eb900a02bd5d3c4dfd0378cccf79edc2..04ef21ca7eabd7ee8a88a2634c1d80fd28e925f1 100644 (file)
@@ -804,6 +804,15 @@ proc check_effective_target_pthread {} {
     } "-pthread"]
 }
 
+# Return 1 if compilation with -gstabs is error-free for trivial
+# code, 0 otherwise.
+
+proc check_effective_target_stabs {} {
+    return [check_no_compiler_messages stabs object {
+       void foo (void) { }
+    } "-gstabs"]
+}
+
 # Return 1 if compilation with -mpe-aligned-commons is error-free
 # for trivial code, 0 otherwise.
 
index e43f7d84aa410067cf3f6113222ed970887d0c66..452993ed9165172d89972a5496163524ebd2e21e 100644 (file)
@@ -1,8 +1,7 @@
 /* Check if the final SO STABS record goes into the .text section.  */
 /* Contributed by Ziemowit Laski <zlaski@apple.com> */
 
-/* { dg-do compile } */
-/* { dg-skip-if "No stabs" { mmix-*-* *-*-aix* alpha*-*-* hppa*64*-*-* ia64-*-* } { "*" } { "" } } */
+/* { dg-do compile { target stabs } } */
 /* { dg-options "-gstabs" } */
 
 @interface MyClass