From d82fb6f20a02babe8aff35c6d8e504e20753abba Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 27 Jun 2023 15:16:12 -0400 Subject: [PATCH] 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. --- gsk/gl/fp16.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 (); -- 2.30.2