Fix Mesa build with clang 10 on mips64.

On mips64, the compiler does not allow use of non-zero argument with
__builtin_frame_address(). However, the returned frame address is only
used when PIPE_ARCH_X86 is defined. The compile error can be avoided
by making #ifdef PIPE_ARCH_X86 cover the getting of frame address too.

The argument checking of __builtin_frame_address() has been present
as a debug assert in clang 8. In clang 10, there is a proper runtime
check for the argument. This is why the build has not failed before.

OK jsg@
This commit is contained in:
visa 2020-08-01 03:51:31 +00:00
parent 0a2f4bc72f
commit 587f130e27

View File

@ -265,6 +265,7 @@ debug_backtrace_capture(struct debug_stack_frame *backtrace,
}
#endif
#ifdef PIPE_ARCH_X86
#if defined(PIPE_CC_GCC) && (PIPE_CC_GCC_VERSION > 404) || defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wframe-address"
@ -279,7 +280,6 @@ debug_backtrace_capture(struct debug_stack_frame *backtrace,
frame_pointer = NULL;
#endif
#ifdef PIPE_ARCH_X86
while (nr_frames) {
const void **next_frame_pointer;