]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
* include/features.h (__USE_FORTIFY_LEVEL): Also set for Red Hat
authorJakub Jelinek <jakub@redhat.com>
Tue, 2 Nov 2004 13:30:19 +0000 (13:30 +0000)
committerJakub Jelinek <jakub@redhat.com>
Tue, 2 Nov 2004 13:30:19 +0000 (13:30 +0000)
GCC 3.4.x-RH >= 3.4.2-8.
* libio/bits/features.h (printf, fprintf, vprintf, vfprintf): For
GCC 3.4.x-RH use __builtin___{,v}{,f}printf_chk instead of
__{,v}{,f}printf_chk.
* debug/tst-chk1.c (do_test): Deal with GCC 3.4.x-RH not
being able to recognize subobjects.

ChangeLog
debug/tst-chk1.c
include/features.h
libio/bits/stdio2.h

index 7f06c853474a6fcba22d818a6ae743017ff264a9..0bbe073a7a7df3c851fb9450ab0663a162dba4e5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2004-11-02  Jakub Jelinek  <jakub@redhat.com>
+
+       * include/features.h (__USE_FORTIFY_LEVEL): Also set for Red Hat
+       GCC 3.4.x-RH >= 3.4.2-8.
+       * libio/bits/features.h (printf, fprintf, vprintf, vfprintf): For
+       GCC 3.4.x-RH use __builtin___{,v}{,f}printf_chk instead of
+       __{,v}{,f}printf_chk.
+       * debug/tst-chk1.c (do_test): Deal with GCC 3.4.x-RH not
+       being able to recognize subobjects.
+
 2004-11-01  Jakub Jelinek  <jakub@redhat.com>
 
        * sysdeps/unix/sysv/linux/x86_64/sys/procfs.h [__WORDSIZE == 32]
index 639da3847c8c13ec0619bf7ff0c57c03898f9c06..27b4f1534662ad8dd51b6cd2187ab41bed58246e 100644 (file)
@@ -201,7 +201,7 @@ do_test (void)
   if (memcmp (a.buf1, "aabcdabcjj", 10))
     FAIL ();
 
-#if __USE_FORTIFY_LEVEL < 2
+#if __USE_FORTIFY_LEVEL < 2 || !__GNUC_PREREQ (4, 0)
   /* The following tests are supposed to crash with -D_FORTIFY_SOURCE=2
      and sufficient GCC support, as the string operations overflow
      from a.buf1 into a.buf2.  */
@@ -300,7 +300,7 @@ do_test (void)
   memset (a.buf1 + 9, 'j', l0 + 2);
   CHK_FAIL_END
 
-#if __USE_FORTIFY_LEVEL >= 2
+#if __USE_FORTIFY_LEVEL >= 2 && __GNUC_PREREQ (4, 0)
 # define O 0
 #else
 # define O 1
index 7551dcc5cc048d5fe9eeed63e3d459a17e26955e..ff1de8f4721c3e7ce1555efe5b60726c35b5e36e 100644 (file)
 
 #if _FORTIFY_SOURCE > 0 && __OPTIMIZE__ > 0 \
     && (__GNUC_PREREQ (4, 1) \
-        || (defined __GNUC_RH_RELEASE__ && __GNUC_PREREQ (4, 0)))
+        || (defined __GNUC_RH_RELEASE__ && __GNUC_PREREQ (4, 0)) \
+        || (defined __GNUC_RH_RELEASE__ && __GNUC_PREREQ (3, 4) \
+            && __GNUC_MINOR__ == 4 \
+            && (__GNUC_PATCHLEVEL__ > 2 \
+                || (__GNUC_PATCHLEVEL__ == 2 && __GNUC_RH_RELEASE__ >= 8))))
 # if _FORTIFY_SOURCE == 1
 #  define __USE_FORTIFY_LEVEL 1
 # elif _FORTIFY_SOURCE > 1
index acf07ea91bdbafc83ce0bc1c4b221f8df994a6c0..42a326c60ae156413f3292a1244cd14e2a21bd04 100644 (file)
@@ -61,14 +61,25 @@ extern int __vfprintf_chk (FILE *__restrict __stream, int __flag,
 extern int __vprintf_chk (int __flag, __const char *__restrict __format,
                          _G_va_list __ap);
 
-# define printf(...) \
+# if __GNUC_PREREQ (4, 0)
+#  define printf(...) \
   __printf_chk (__USE_FORTIFY_LEVEL - 1, __VA_ARGS__)
-# define fprintf(stream, ...) \
+#  define fprintf(stream, ...) \
   __fprintf_chk (stream, __USE_FORTIFY_LEVEL - 1, __VA_ARGS__)
-# define vprintf(format, ap) \
+#  define vprintf(format, ap) \
   __vprintf_chk (__USE_FORTIFY_LEVEL - 1, format, ap)
-# define vfprintf(stream, format, ap) \
+#  define vfprintf(stream, format, ap) \
   __vfprintf_chk (stream, __USE_FORTIFY_LEVEL - 1, format, ap)
+# else
+#  define printf(...) \
+  __builtin___printf_chk (__USE_FORTIFY_LEVEL - 1, __VA_ARGS__)
+#  define fprintf(stream, ...) \
+  __builtin___fprintf_chk (stream, __USE_FORTIFY_LEVEL - 1, __VA_ARGS__)
+#  define vprintf(format, ap) \
+  __builtin___vprintf_chk (__USE_FORTIFY_LEVEL - 1, format, ap)
+#  define vfprintf(stream, format, ap) \
+  __builtin___vfprintf_chk (stream, __USE_FORTIFY_LEVEL - 1, format, ap)
+# endif
 
 #endif