Commit 01704e5a by Rainer Orth Committed by Rainer Orth

Only support -gstabs on Mac OS X if assember supports it (PR target/67973)

	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.

From-SVN: r231747
parent 761f6ae9
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.
2015-12-16 Martin Sebor <msebor@redhat.com> 2015-12-16 Martin Sebor <msebor@redhat.com>
PR c/68868 PR c/68868
...@@ -636,6 +636,12 @@ ...@@ -636,6 +636,12 @@
#endif #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. */ /* Define if your assembler and linker support thread-local storage. */
#ifndef USED_FOR_TARGET #ifndef USED_FOR_TARGET
#undef HAVE_AS_TLS #undef HAVE_AS_TLS
......
...@@ -400,12 +400,13 @@ extern GTY(()) int darwin_ms_struct; ...@@ -400,12 +400,13 @@ extern GTY(()) int darwin_ms_struct;
#define ASM_DEBUG_SPEC "%{g*:%{!g0:%{!gdwarf*:--gstabs}}}" #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 DBX_DEBUGGING_INFO 1
#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
#endif
#define DWARF2_DEBUGGING_INFO 1 #define DWARF2_DEBUGGING_INFO 1
#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
#define DEBUG_FRAME_SECTION "__DWARF,__debug_frame,regular,debug" #define DEBUG_FRAME_SECTION "__DWARF,__debug_frame,regular,debug"
#define DEBUG_INFO_SECTION "__DWARF,__debug_info,regular,debug" #define DEBUG_INFO_SECTION "__DWARF,__debug_info,regular,debug"
......
...@@ -226,7 +226,11 @@ do { \ ...@@ -226,7 +226,11 @@ do { \
compiles default to stabs+. darwin9+ defaults to dwarf-2. */ compiles default to stabs+. darwin9+ defaults to dwarf-2. */
#ifndef DARWIN_PREFER_DWARF #ifndef DARWIN_PREFER_DWARF
#undef PREFERRED_DEBUGGING_TYPE #undef PREFERRED_DEBUGGING_TYPE
#ifdef HAVE_AS_STABS_DIRECTIVE
#define PREFERRED_DEBUGGING_TYPE (TARGET_64BIT ? DWARF2_DEBUG : DBX_DEBUG) #define PREFERRED_DEBUGGING_TYPE (TARGET_64BIT ? DWARF2_DEBUG : DBX_DEBUG)
#else
#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
#endif
#endif #endif
/* Darwin uses the standard DWARF register numbers but the default /* Darwin uses the standard DWARF register numbers but the default
......
...@@ -23519,6 +23519,37 @@ cat >>confdefs.h <<_ACEOF ...@@ -23519,6 +23519,37 @@ cat >>confdefs.h <<_ACEOF
_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 "$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; } $as_echo_n "checking assembler for COMDAT group support (GNU as)... " >&6; }
if test "${gcc_cv_as_comdat_group+set}" = set; then : if test "${gcc_cv_as_comdat_group+set}" = set; then :
......
...@@ -2909,6 +2909,11 @@ AC_DEFINE_UNQUOTED(HAVE_GAS_SHF_MERGE, ...@@ -2909,6 +2909,11 @@ AC_DEFINE_UNQUOTED(HAVE_GAS_SHF_MERGE,
[`if test $gcc_cv_as_shf_merge = yes; then echo 1; else echo 0; fi`], [`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.]) [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_GAS_CHECK_FEATURE([COMDAT group support (GNU as)],
gcc_cv_as_comdat_group, gcc_cv_as_comdat_group,
[elf,2,16,0], [--fatal-warnings], [elf,2,16,0], [--fatal-warnings],
......
...@@ -1833,6 +1833,9 @@ time) should be run on this target. This can be enabled by setting the ...@@ -1833,6 +1833,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 Test system runs executables on a simulator (i.e. slowly) rather than
hardware (i.e. fast). hardware (i.e. fast).
@item stabs
Target supports the stabs debugging format.
@item stdint_types @item stdint_types
Target has the basic signed and unsigned C types in @code{stdint.h}. 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 This will be obsolete when GCC ensures a working @code{stdint.h} for
......
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.
2015-12-17 Andrew Burgess <andrew.burgess@embecosm.com> 2015-12-17 Andrew Burgess <andrew.burgess@embecosm.com>
* gcc.target/arc/jump-around-jump.c (rtc_set_time): Declare. * gcc.target/arc/jump-around-jump.c (rtc_set_time): Declare.
......
// Origin: PR c++/51032 // Origin: PR c++/51032
// { dg-do compile { target c++11 } } // { dg-do compile { target { c++11 && stabs } } }
// { dg-skip-if "No stabs" { aarch64*-*-* mmix-*-* *-*-aix* alpha*-*-* hppa*64*-*-* ia64-*-* *-*-vxworks* nios2-*-* } { "*" } { "" } }
// { dg-options "-gstabs+" } // { dg-options "-gstabs+" }
template <class C> template <class C>
......
/* { dg-do compile } */ /* { dg-do compile { target stabs } } */
/* { dg-skip-if "No stabs" { aarch64*-*-* mmix-*-* *-*-aix* alpha*-*-* hppa*64*-*-* ia64-*-* nios2-*-* tile*-*-* *-*-vxworks } { "*" } { "" } } */
/* { dg-options "-gstabs+ -fno-eliminate-unused-debug-types" } */ /* { dg-options "-gstabs+ -fno-eliminate-unused-debug-types" } */
const int foobar = 4; const int foobar = 4;
......
/* { dg-do compile } */ /* { dg-do compile { target stabs } } */
/* { dg-skip-if "No stabs" { aarch64*-*-* mmix-*-* *-*-aix* alpha*-*-* hppa*64*-*-* ia64-*-* tile*-*-* nios2-*-* } { "*" } { "" } } */
/* { dg-options "-gstabs+ -fno-eliminate-unused-debug-types -ftoplevel-reorder" } */ /* { dg-options "-gstabs+ -fno-eliminate-unused-debug-types -ftoplevel-reorder" } */
const int foobar = 4; const int foobar = 4;
......
/* Test lang in N_SO stab. */ /* Test lang in N_SO stab. */
/* Contributed by Devang Patel <dpatel@apple.com> */ /* Contributed by Devang Patel <dpatel@apple.com> */
/* { dg-do compile } */ /* { dg-do compile { target stabs } } */
/* { dg-skip-if "No stabs" { aarch64*-*-* mmix-*-* *-*-aix* alpha*-*-* hppa*64*-*-* ia64-*-* tile*-*-* nios2-*-* *-*-vxworks* nvptx-*-* } { "*" } { "" } } */
/* { dg-options "-gstabs" } */ /* { dg-options "-gstabs" } */
int int
......
/* Test dead code strip support. */ /* Test dead code strip support. */
/* Contributed by Devang Patel <dpatel@apple.com> */ /* 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" } */ /* { dg-options "-gstabs+ -fno-eliminate-unused-debug-symbols" } */
int int
......
...@@ -938,6 +938,15 @@ proc check_effective_target_pthread {} { ...@@ -938,6 +938,15 @@ proc check_effective_target_pthread {} {
} "-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 # Return 1 if compilation with -mpe-aligned-commons is error-free
# for trivial code, 0 otherwise. # for trivial code, 0 otherwise.
......
/* Check if the final SO STABS record goes into the .text section. */ /* Check if the final SO STABS record goes into the .text section. */
/* Contributed by Ziemowit Laski <zlaski@apple.com> */ /* Contributed by Ziemowit Laski <zlaski@apple.com> */
/* { dg-do compile } */ /* { dg-do compile { target stabs } } */
/* { dg-skip-if "No stabs" { mmix-*-* *-*-aix* alpha*-*-* hppa*64*-*-* ia64-*-* } { "*" } { "" } } */
/* { dg-options "-gstabs" } */ /* { dg-options "-gstabs" } */
@interface MyClass @interface MyClass
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment