re PR debug/83917 (with -mcall-ms2sysv-xlogues, stepping into x86 tail-call restore stub gives bad backtrace)

PR debug/83917
	* configure.ac (AS_HIDDEN_DIRECTIVE): AC_DEFINE_UNQUOTED this to
	$asm_hidden_op if visibility ("hidden") attribute works.
	(HAVE_AS_CFI_SECTIONS): New AC_DEFINE.
	* config/i386/i386-asm.h: Don't include auto-host.h.
	(PACKAGE_VERSION, PACKAGE_NAME, PACKAGE_STRING, PACKAGE_TARNAME,
	PACKAGE_URL): Don't undefine.
	(USE_GAS_CFI_DIRECTIVES): Don't use nor define this macro, instead
	guard cfi_startproc only on ifdef __GCC_HAVE_DWARF2_CFI_ASM.
	(FN_HIDDEN): Change guard from #ifdef HAVE_GAS_HIDDEN to
	#ifdef AS_HIDDEN_DIRECTIVE, use AS_HIDDEN_DIRECTIVE macro in the
	definition instead of hardcoded .hidden.
	* config/i386/cygwin.S: Include i386-asm.h first before .cfi_sections
	directive.  Use #ifdef HAVE_AS_CFI_SECTIONS rather than
	#ifdef HAVE_GAS_CFI_SECTIONS_DIRECTIVE to guard .cfi_sections.
	(USE_GAS_CFI_DIRECTIVES): Don't define.
	* configure: Regenerated.
	* config.in: Likewise.

From-SVN: r258057
This commit is contained in:
Jakub Jelinek 2018-02-28 09:59:15 +01:00 committed by Jakub Jelinek
parent 678127a85e
commit ce579a4fe0
6 changed files with 89 additions and 22 deletions

View File

@ -1,3 +1,24 @@
2018-02-28 Jakub Jelinek <jakub@redhat.com>
PR debug/83917
* configure.ac (AS_HIDDEN_DIRECTIVE): AC_DEFINE_UNQUOTED this to
$asm_hidden_op if visibility ("hidden") attribute works.
(HAVE_AS_CFI_SECTIONS): New AC_DEFINE.
* config/i386/i386-asm.h: Don't include auto-host.h.
(PACKAGE_VERSION, PACKAGE_NAME, PACKAGE_STRING, PACKAGE_TARNAME,
PACKAGE_URL): Don't undefine.
(USE_GAS_CFI_DIRECTIVES): Don't use nor define this macro, instead
guard cfi_startproc only on ifdef __GCC_HAVE_DWARF2_CFI_ASM.
(FN_HIDDEN): Change guard from #ifdef HAVE_GAS_HIDDEN to
#ifdef AS_HIDDEN_DIRECTIVE, use AS_HIDDEN_DIRECTIVE macro in the
definition instead of hardcoded .hidden.
* config/i386/cygwin.S: Include i386-asm.h first before .cfi_sections
directive. Use #ifdef HAVE_AS_CFI_SECTIONS rather than
#ifdef HAVE_GAS_CFI_SECTIONS_DIRECTIVE to guard .cfi_sections.
(USE_GAS_CFI_DIRECTIVES): Don't define.
* configure: Regenerated.
* config.in: Likewise.
2018-02-26 Jakub Jelinek <jakub@redhat.com>
PR debug/83917

View File

@ -1,8 +1,15 @@
/* config.in. Generated from configure.ac by autoheader. */
/* Define to the .hidden-like directive if it exists. */
#undef AS_HIDDEN_DIRECTIVE
/* Define to 1 if the assembler supports AVX. */
#undef HAVE_AS_AVX
/* Define to 1 if the assembler supports .cfi_sections .debug_frame directive.
*/
#undef HAVE_AS_CFI_SECTIONS
/* Define to 1 if the target assembler supports thread-local storage. */
#undef HAVE_CC_TLS

View File

@ -23,14 +23,12 @@
* <http://www.gnu.org/licenses/>.
*/
#ifdef HAVE_GAS_CFI_SECTIONS_DIRECTIVE
# define USE_GAS_CFI_DIRECTIVES 1
.cfi_sections .debug_frame
#else
# define USE_GAS_CFI_DIRECTIVES 0
#endif
#include "i386-asm.h"
#ifdef HAVE_AS_CFI_SECTIONS
.cfi_sections .debug_frame
#endif
#ifdef L_chkstk
/* Function prologue calls __chkstk to probe the stack when allocating more
than CHECK_STACK_LIMIT bytes in one go. Touching the stack at 4K

View File

@ -27,21 +27,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define I386_ASM_H
#include "auto-target.h"
#undef PACKAGE_VERSION
#undef PACKAGE_NAME
#undef PACKAGE_STRING
#undef PACKAGE_TARNAME
#undef PACKAGE_URL
#include "auto-host.h"
#ifndef USE_GAS_CFI_DIRECTIVES
# ifdef __GCC_HAVE_DWARF2_CFI_ASM
# define USE_GAS_CFI_DIRECTIVES 1
# else
# define USE_GAS_CFI_DIRECTIVES 0
# endif
#endif
#if USE_GAS_CFI_DIRECTIVES
#ifdef __GCC_HAVE_DWARF2_CFI_ASM
# define cfi_startproc() .cfi_startproc
# define cfi_endproc() .cfi_endproc
# define cfi_adjust_cfa_offset(X) .cfi_adjust_cfa_offset X
@ -76,8 +63,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#ifdef __ELF__
# define FN_TYPE(fn) .type fn,@function
# define FN_SIZE(fn) .size fn,.-fn
# ifdef HAVE_GAS_HIDDEN
# define FN_HIDDEN(fn) .hidden fn
# ifdef AS_HIDDEN_DIRECTIVE
# define FN_HIDDEN(fn) AS_HIDDEN_DIRECTIVE fn
# endif
#else
# define FN_TYPE(fn)

36
libgcc/configure vendored
View File

@ -5214,11 +5214,47 @@ $as_echo "$libgcc_cv_hidden_visibility_attribute" >&6; }
if test $libgcc_cv_hidden_visibility_attribute = yes; then
vis_hide='-fvisibility=hidden -DHIDE_EXPORTS'
cat >>confdefs.h <<_ACEOF
#define AS_HIDDEN_DIRECTIVE $asm_hidden_op
_ACEOF
else
vis_hide=
fi
# Check for .cfi_sections .debug_frame support.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for .cfi_sections .debug_frame" >&5
$as_echo_n "checking for .cfi_sections .debug_frame... " >&6; }
if test "${libgcc_cv_cfi_sections_directive+set}" = set; then :
$as_echo_n "(cached) " >&6
else
echo 'int foo (int, char *);' > conftest.c
echo 'int bar (int x) { char *y = __builtin_alloca (x); return foo (x + 1, y) + 1; }' >> conftest.c
libgcc_cv_cfi_sections_directive=no
if { ac_try='${CC-cc} -Werror -g -fno-asynchronous-unwind-tables -fno-unwind-tables -fno-exceptions -S conftest.c -o conftest.s 1>&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
if grep "\\.cfi_sections.*\\.debug_frame" conftest.s >/dev/null; then
libgcc_cv_cfi_sections_directive=yes
fi
fi
rm -f conftest.*
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgcc_cv_cfi_sections_directive" >&5
$as_echo "$libgcc_cv_cfi_sections_directive" >&6; }
if test $libgcc_cv_cfi_sections_directive = yes; then
$as_echo "#define HAVE_AS_CFI_SECTIONS 1" >>confdefs.h
fi
# See if we have thread-local storage. We can only test assembler
# since link-time and run-time tests require the newly built
# gcc, which can't be used to build executable due to that libgcc

View File

@ -486,11 +486,29 @@ AC_CACHE_CHECK([for __attribute__((visibility("hidden")))],
if test $libgcc_cv_hidden_visibility_attribute = yes; then
vis_hide='-fvisibility=hidden -DHIDE_EXPORTS'
AC_DEFINE_UNQUOTED(AS_HIDDEN_DIRECTIVE, $asm_hidden_op, [Define to the .hidden-like directive if it exists.])
else
vis_hide=
fi
AC_SUBST(vis_hide)
# Check for .cfi_sections .debug_frame support.
AC_CACHE_CHECK([for .cfi_sections .debug_frame],
libgcc_cv_cfi_sections_directive, [
echo 'int foo (int, char *);' > conftest.c
echo 'int bar (int x) { char *y = __builtin_alloca (x); return foo (x + 1, y) + 1; }' >> conftest.c
libgcc_cv_cfi_sections_directive=no
if AC_TRY_COMMAND(${CC-cc} -Werror -g -fno-asynchronous-unwind-tables -fno-unwind-tables -fno-exceptions -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then
if grep "\\.cfi_sections.*\\.debug_frame" conftest.s >/dev/null; then
libgcc_cv_cfi_sections_directive=yes
fi
fi
rm -f conftest.*
])
if test $libgcc_cv_cfi_sections_directive = yes; then
AC_DEFINE(HAVE_AS_CFI_SECTIONS, 1, [Define to 1 if the assembler supports .cfi_sections .debug_frame directive.])
fi
# See if we have thread-local storage. We can only test assembler
# since link-time and run-time tests require the newly built
# gcc, which can't be used to build executable due to that libgcc