From c7509d49c4e8fa494120c5ead21338559dad16f5 Mon Sep 17 00:00:00 2001 From: Raphael Moreira Zinsly Date: Wed, 24 Aug 2022 11:43:37 -0300 Subject: Apply asm redirections in wchar.h before first use Similar to d0fa09a770, but for wchar.h. Fixes [BZ #27087] by applying all long double related asm redirections before using functions in bits/wchar2.h. Moves the function declarations from wcsmbs/bits/wchar2.h to a new file wcsmbs/bits/wchar2-decl.h that will be included first in wcsmbs/wchar.h. Tested with build-many-glibcs.py. Reviewed-by: Adhemerval Zanella --- wcsmbs/wchar.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'wcsmbs/wchar.h') diff --git a/wcsmbs/wchar.h b/wcsmbs/wchar.h index 5d6a408..c1321c7 100644 --- a/wcsmbs/wchar.h +++ b/wcsmbs/wchar.h @@ -864,14 +864,21 @@ extern size_t wcsftime_l (wchar_t *__restrict __s, size_t __maxsize, /* Define some macros helping to catch buffer overflows. */ #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function -# include +/* Declare all functions from bits/wchar2-decl.h first. */ +# include #endif -#include +/* The following headers provide asm redirections. These redirections must + appear before the first usage of these functions, e.g. in bits/wchar.h. */ #if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # include #endif +#if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function +/* Now include the function definitions and redirects too. */ +# include +#endif + __END_DECLS #endif /* wchar.h */ -- cgit v1.1