diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc index e09a4a8ae25fd8..bf5bb43018efc4 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc @@ -127,6 +127,39 @@ extern const short *_toupper_tab_; extern const short *_tolower_tab_; #endif +#if SANITIZER_LINUX && SANITIZER_SPARC32 +// On 32-bit Linux/sparc64, double and long double are identical and glibc +// uses a __nldbl_ (no long double) prefix for various stdio functions. +# define __isoc23_fscanf __nldbl___isoc23_fscanf +# define __isoc23_scanf __nldbl___isoc23_scanf +# define __isoc23_sscanf __nldbl___isoc23_sscanf +# define __isoc23_vfscanf __nldbl___isoc23_vfscanf +# define __isoc23_vscanf __nldbl___isoc23_vscanf +# define __isoc23_vsscanf __nldbl___isoc23_vsscanf +# define __isoc99_fscanf __nldbl___isoc99_fscanf +# define __isoc99_scanf __nldbl___isoc99_scanf +# define __isoc99_sscanf __nldbl___isoc99_sscanf +# define __isoc99_vfscanf __nldbl___isoc99_vfscanf +# define __isoc99_vscanf __nldbl___isoc99_vscanf +# define __isoc99_vsscanf __nldbl___isoc99_vsscanf +# define asprintf __nldbl_asprintf +# define fprintf __nldbl_fprintf +# define fscanf __nldbl_fscanf +# define printf __nldbl_printf +# define scanf __nldbl_scanf +# define snprintf __nldbl_snprintf +# define sprintf __nldbl_sprintf +# define sscanf __nldbl_sscanf +# define vasprintf __nldbl_vasprintf +# define vfprintf __nldbl_vfprintf +# define vfscanf __nldbl_vfscanf +# define vprintf __nldbl_vprintf +# define vscanf __nldbl_vscanf +# define vsnprintf __nldbl_vsnprintf +# define vsprintf __nldbl_vsprintf +# define vsscanf __nldbl_vsscanf +#endif + #if SANITIZER_MUSL && \ (defined(__i386__) || defined(__arm__) || SANITIZER_MIPS32 || SANITIZER_PPC32) // musl 1.2.0 on existing 32-bit architectures uses new symbol names for the