mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-26 23:00:34 +01:00
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:dc94a0506f("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> (cherry picked from commit0536b69133)
This commit is contained in:
parent
381fe26b50
commit
4d5eea6732
2 changed files with 6 additions and 9 deletions
|
|
@ -1048,7 +1048,7 @@
|
|||
"description": "util: fix build with clang 10 on mips64",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "dc94a0506f1d267a761961d3ac905d77de3dae2e"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -199,7 +199,6 @@ debug_backtrace_capture(struct debug_stack_frame *backtrace,
|
|||
unsigned start_frame,
|
||||
unsigned nr_frames)
|
||||
{
|
||||
const void **frame_pointer = NULL;
|
||||
unsigned i = 0;
|
||||
|
||||
if (!nr_frames) {
|
||||
|
|
@ -250,21 +249,21 @@ 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"
|
||||
frame_pointer = ((const void **)__builtin_frame_address(1));
|
||||
const void **frame_pointer = ((const void **)__builtin_frame_address(1));
|
||||
#pragma GCC diagnostic pop
|
||||
#elif defined(PIPE_CC_MSVC) && defined(PIPE_ARCH_X86)
|
||||
#elif defined(PIPE_CC_MSVC)
|
||||
__asm {
|
||||
mov frame_pointer, ebp
|
||||
}
|
||||
frame_pointer = (const void **)frame_pointer[0];
|
||||
const void **frame_pointer = (const void **)frame_pointer[0];
|
||||
#else
|
||||
frame_pointer = NULL;
|
||||
const void **frame_pointer = NULL;
|
||||
#endif
|
||||
|
||||
#ifdef PIPE_ARCH_X86
|
||||
while (nr_frames) {
|
||||
const void **next_frame_pointer;
|
||||
|
||||
|
|
@ -287,8 +286,6 @@ debug_backtrace_capture(struct debug_stack_frame *backtrace,
|
|||
|
||||
frame_pointer = next_frame_pointer;
|
||||
}
|
||||
#else
|
||||
(void) frame_pointer;
|
||||
#endif
|
||||
|
||||
while (nr_frames) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue