about summary refs log tree commit diff
path: root/sysdeps/x86/tst-ifunc-isa.h
diff options
context:
space:
mode:
authorSiddhesh Poyarekar <siddhesh@sourceware.org>2021-03-15 20:24:45 +0530
committerSiddhesh Poyarekar <siddhesh@sourceware.org>2021-03-15 20:24:45 +0530
commit941ea10f8099cb4fcc98c65249fc17a63fcff6a4 (patch)
tree4482a878b1246d1f83de352d855d0e31704f9ca1 /sysdeps/x86/tst-ifunc-isa.h
parent03f42a56eb4e88601ebb334787c8198156197b29 (diff)
downloadglibc-941ea10f8099cb4fcc98c65249fc17a63fcff6a4.tar.gz
glibc-941ea10f8099cb4fcc98c65249fc17a63fcff6a4.tar.xz
glibc-941ea10f8099cb4fcc98c65249fc17a63fcff6a4.zip
Build get-cpuid-feature-leaf.c without stack-protector [BZ #27555]
__x86_get_cpuid_feature_leaf is called during early startup, before
the stack check guard is initialized and is hence not safe to build
with stack-protector.

Additionally, IFUNC resolvers for static tst-ifunc-isa tests get
called too early for stack protector to be useful, so fix them to
disable stack protector for the resolver functions.

This fixes all failures seen with --enable-stack-protector=all
configuration.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'sysdeps/x86/tst-ifunc-isa.h')
-rw-r--r--sysdeps/x86/tst-ifunc-isa.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/sysdeps/x86/tst-ifunc-isa.h b/sysdeps/x86/tst-ifunc-isa.h
index 60aa1cea6a..6d906966a7 100644
--- a/sysdeps/x86/tst-ifunc-isa.h
+++ b/sysdeps/x86/tst-ifunc-isa.h
@@ -29,6 +29,7 @@ enum isa
 };
 
 enum isa
+__attribute__ ((__optimize__ ("-fno-stack-protector")))
 get_isa (void)
 {
   if (CPU_FEATURE_USABLE (AVX512F))
@@ -83,6 +84,7 @@ isa_none (void)
 int foo (void) __attribute__ ((ifunc ("foo_ifunc")));
 
 void *
+__attribute__ ((__optimize__ ("-fno-stack-protector")))
 foo_ifunc (void)
 {
   switch (get_isa ())