util: fix build with clang 10 on mips64
authorJonathan Gray <jsg@jsg.id.au>
Tue, 4 Aug 2020 08:48:34 +0000 (18:48 +1000)
committerMarge Bot <emma+marge@anholt.net>
Mon, 28 Feb 2022 14:28:23 +0000 (14:28 +0000)
commit0536b691338f2759b850f9ec94634033a5d1f9e1
treec9e8da468fe048dbfca35c1e127daf9b2dec0e4b
parentf12c107b030b0aacc0c8b11c99fdce13f38bc98f
util: fix 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.

Fixes: dc94a0506f1 ("gallium: Do not add -Wframe-address option for gcc <= 4.4.")
from Visa Hankala

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6511>
src/util/u_debug_stack.c