From 4e166ca7d7c02e31b3bd597234e0da133c49afc7 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Sat, 24 Aug 2013 20:32:11 +0400 Subject: [PATCH] Prevent use of unsupported __builtin_return_address(1) in GC_DBG_EXTRAS * include/gc_config_macros.h (GC_CAN_SAVE_CALL_STACKS): Define also for __amd64__ (synonym for __x86_64__). * include/gc_config_macros.h (GC_RETURN_ADDR_PARENT): Define only for x86 and x86_64 (which have frame-pointer register, for other targets GCC might report "unsupported argument to __builtin_return_address" warning). --- include/gc_config_macros.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/gc_config_macros.h b/include/gc_config_macros.h index 1c1a2ab2..eba31205 100644 --- a/include/gc_config_macros.h +++ b/include/gc_config_macros.h @@ -252,7 +252,7 @@ && !defined(GC_HAVE_BUILTIN_BACKTRACE) # define GC_HAVE_BUILTIN_BACKTRACE # endif -# if defined(__i386__) || defined(__x86_64__) +# if defined(__i386__) || defined(__amd64__) || defined(__x86_64__) # define GC_CAN_SAVE_CALL_STACKS # endif #endif /* GLIBC */ @@ -287,7 +287,10 @@ /* gcc knows how to retrieve return address, but we don't know */ /* how to generate call stacks. */ # define GC_RETURN_ADDR (GC_word)__builtin_return_address(0) -# define GC_RETURN_ADDR_PARENT (GC_word)__builtin_return_address(1) +# if defined(__i386__) || defined(__amd64__) \ + || defined(__x86_64__) /* and probably others... */ +# define GC_RETURN_ADDR_PARENT (GC_word)__builtin_return_address(1) +# endif # else /* Just pass 0 for gcc compatibility. */ # define GC_RETURN_ADDR 0 -- 2.49.0