| This reverts the upstream patch. |
| |
| Warn if user requests __FORTIFY_SOURCE but it is disabled |
| author Roland Mc Grath <roland@hack.frob.com> |
| Tue, 8 May 2012 17:44:57 +0000 (19:44 +0200) |
| committer Andreas Jaeger <jaegerandi@gmail.com> |
| Tue, 8 May 2012 17:44:57 +0000 (19:44 +0200) |
| commit 05c2c9618f583ea4acd69b3fe5ae2a2922dd2ddc |
| tree cf5cd345bf757fd5296ff7e0b8dcd7f142fc3d37 |
| parent 4b30f61a1ea78de9b0e84a54fc6ee96ea70e6ed5 |
| |
| The reason to revert it is that some packages that use |
| autoconf to detect system headers, the warning will give the |
| wrong result. |
| |
| --- include/features.h 2016-06-01 16:26:04.534295058 -0700 |
| +++ include/features.h 2016-06-01 16:27:48.485859977 -0700 |
| @@ -326,18 +326,14 @@ |
| # define __USE_REENTRANT 1 |
| #endif |
| |
| -#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 |
| +#if defined _FORTIFY_SOURCE && _FORTIFY_SOURCE > 0 \ |
| + && __GNUC_PREREQ (4, 1) && defined __OPTIMIZE__ && __OPTIMIZE__ > 0 |
| +# if _FORTIFY_SOURCE > 1 |
| # define __USE_FORTIFY_LEVEL 2 |
| # else |
| # define __USE_FORTIFY_LEVEL 1 |
| # endif |
| -#endif |
| -#ifndef __USE_FORTIFY_LEVEL |
| +#else |
| # define __USE_FORTIFY_LEVEL 0 |
| #endif |
| |