From: Ivan Maidanski Date: Sat, 24 Aug 2013 16:32:11 +0000 (+0400) Subject: Prevent use of unsupported __builtin_return_address(1) in GC_DBG_EXTRAS X-Git-Tag: gc7_4_0~23^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e432c9688374ffb31721caf8ffac6d28b1472365;p=gc 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). --- diff --git a/include/gc_config_macros.h b/include/gc_config_macros.h index bdd25f36..e6525933 100644 --- a/include/gc_config_macros.h +++ b/include/gc_config_macros.h @@ -287,7 +287,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 */ @@ -323,7 +323,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