about summary refs log tree commit diff
path: root/misc/sys
diff options
context:
space:
mode:
authorSiddhesh Poyarekar <siddhesh@sourceware.org>2022-01-12 18:46:28 +0530
committerSiddhesh Poyarekar <siddhesh@sourceware.org>2022-01-12 18:46:28 +0530
commit86bf0feb0e3ec8e37872f72499d6ae33406561d7 (patch)
tree6a769e608b3e78a6bcbe3d0d373bffd5c7b0643a /misc/sys
parent0005e54f762b2ec65cee2c4ecf1e9d42612030f0 (diff)
downloadglibc-86bf0feb0e3ec8e37872f72499d6ae33406561d7.tar.gz
glibc-86bf0feb0e3ec8e37872f72499d6ae33406561d7.tar.xz
glibc-86bf0feb0e3ec8e37872f72499d6ae33406561d7.zip
Enable _FORTIFY_SOURCE=3 for gcc 12 and above
gcc 12 now has support for the __builtin_dynamic_object_size builtin.
Adapt the macro checks to enable _FORTIFY_SOURCE=3 on gcc 12 and above.

Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
Diffstat (limited to 'misc/sys')
-rw-r--r--misc/sys/cdefs.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h
index abf13a9086..44d3826bca 100644
--- a/misc/sys/cdefs.h
+++ b/misc/sys/cdefs.h
@@ -143,7 +143,8 @@
 #define __bos0(ptr) __builtin_object_size (ptr, 0)
 
 /* Use __builtin_dynamic_object_size at _FORTIFY_SOURCE=3 when available.  */
-#if __USE_FORTIFY_LEVEL == 3 && __glibc_clang_prereq (9, 0)
+#if __USE_FORTIFY_LEVEL == 3 && (__glibc_clang_prereq (9, 0)		      \
+				 || __GNUC_PREREQ (12, 0))
 # define __glibc_objsize0(__o) __builtin_dynamic_object_size (__o, 0)
 # define __glibc_objsize(__o) __builtin_dynamic_object_size (__o, 1)
 #else