]> granicus.if.org Git - gc/commitdiff
Prevent use of unsupported __builtin_return_address(1) in GC_DBG_EXTRAS
authorIvan Maidanski <ivmai@mail.ru>
Sat, 24 Aug 2013 16:32:11 +0000 (20:32 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Sat, 24 Aug 2013 16:32:11 +0000 (20:32 +0400)
* 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

index 1c1a2ab21105deb1a81c3c54057975eb19bcf8f6..eba312059c27cf1243fc20109b3cdb31a0ed9bfb 100644 (file)
         && !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 */
     /* 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