glibc/glibc-sw13979.patch

31 lines
957 B
Diff

diff -rup c/include/features.h d/include/features.h
--- c/include/features.h 2012-05-08 21:26:45.294191922 -0600
+++ d/include/features.h 2012-05-08 21:32:42.889297128 -0600
@@ -309,19 +309,18 @@
# define __USE_REENTRANT 1
#endif
-#if defined _FORTIFY_SOURCE && _FORTIFY_SOURCE > 0 \
- && defined __OPTIMIZE__ && __OPTIMIZE__ > 0
-# if !__GNUC_PREREQ (4, 1)
-# ifdef __GNUC_RH_RELEASE__
-# warning _FORTIFY_SOURCE supported only with GCC 4.1 and later
-# endif
-# define __USE_FORTIFY_LEVEL 0
+#if defined _FORTIFY_SOURCE && _FORTIFY_SOURCE > 0
+# if !defined __OPTIMIZE__ || __OPTIMIZE__ <= 0
+# warning _FORTIFY_SOURCE requires compiling with optimization (-O)
+# elif !__GNUC_PREREQ (4, 1)
+# warning _FORTIFY_SOURCE requires GCC 4.1 or later
# elif _FORTIFY_SOURCE > 1
# define __USE_FORTIFY_LEVEL 2
# else
# define __USE_FORTIFY_LEVEL 1
# endif
-#else
+#endif
+#ifndef __USE_FORTIFY_LEVEL
# define __USE_FORTIFY_LEVEL 0
#endif