]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
string: Disable stack protector for memset in early static initialization
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Mon, 22 Jan 2024 13:42:19 +0000 (10:42 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 23 Jan 2024 13:22:59 +0000 (10:22 -0300)
For ports that use the default memset, the compiler might generate early
calls before the stack protector is initialized (for instance, riscv
with -fstack-protector-all on _dl_aux_init).

Checked on riscv64-linux-gnu-rv64imafdc-lp64d.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
string/Makefile

index 3ba77e1b2f5e5306957d7d0a3e806ea45136a582..8f31fa49e621c0351a2ce26ca2f8ca9c0eb53f3f 100644 (file)
@@ -270,6 +270,7 @@ CFLAGS-memcpy.c += $(no-stack-protector)
 CFLAGS-wordcopy.c += $(no-stack-protector)
 # Called during static initialization
 CFLAGS-strncmp.c += $(no-stack-protector)
+CFLAGS-memset.c += $(no-stack-protector)
 
 CFLAGS-argz-next.c += $(config-cflags-wno-ignored-attributes)
 CFLAGS-basename.c += $(config-cflags-wno-ignored-attributes)