From: Matthias Clasen Date: Tue, 27 Jun 2023 19:16:12 +0000 (-0400) Subject: Fix fp16 with asan X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~1^2~90^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=d82fb6f20a02babe8aff35c6d8e504e20753abba;p=gtk4.git Fix fp16 with asan The IFUNC resolvers that we are using here get run early, before asan had a chance to set up its plumbing, and therefore things go badly if they are compiled with asan. Turning it off makes things work again. The gcc bug tracking this problem: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110442 Thanks to Jakub Jelinek and Florian Weimer for analyzing this and recommending the workaround. --- diff --git a/gsk/gl/fp16.c b/gsk/gl/fp16.c index 29e83527f3..0f767e9334 100644 --- a/gsk/gl/fp16.c +++ b/gsk/gl/fp16.c @@ -165,7 +165,7 @@ void half_to_float4 (const guint16 h[4], float f[4]) __attribute__((ifunc ("reso void float_to_half (const float *f, guint16 *h, int n) __attribute__((ifunc ("resolve_float_to_half"))); void half_to_float (const guint16 *h, float *f, int n) __attribute__((ifunc ("resolve_half_to_float"))); -static void * +static void * __attribute__ ((no_sanitize_address)) resolve_float_to_half4 (void) { __builtin_cpu_init (); @@ -175,7 +175,7 @@ resolve_float_to_half4 (void) return float_to_half4_c; } -static void * +static void * __attribute__ ((no_sanitize_address)) resolve_half_to_float4 (void) { __builtin_cpu_init (); @@ -185,7 +185,7 @@ resolve_half_to_float4 (void) return half_to_float4_c; } -static void * +static void * __attribute__ ((no_sanitize_address)) resolve_float_to_half (void) { __builtin_cpu_init (); @@ -195,7 +195,7 @@ resolve_float_to_half (void) return float_to_half_c; } -static void * +static void * __attribute__ ((no_sanitize_address)) resolve_half_to_float (void) { __builtin_cpu_init ();