]> sourceware.org Git - newlib-cygwin.git/commitdiff
newlib: ignore _FORTIFY_SOURCE when building newlib
authorMike Frysinger <vapier@gentoo.org>
Tue, 9 Nov 2021 02:42:12 +0000 (21:42 -0500)
committerMike Frysinger <vapier@gentoo.org>
Sat, 13 Nov 2021 05:09:21 +0000 (00:09 -0500)
Some distros enable _FORTIFY_SOURCE by default which upsets building
newlib which itself implements the logic for this define.  For example,
building gets.c fails because the includes set up a gets() macro which
expands in the definition.

Since newlib isn't prepared to build itself with _FORTIFY_SOURCE, and
it's not clear if it's even useful, ignore it when building the code.
This also matches what glibc is doing.

newlib/libc/include/sys/features.h

index 2188071785f63607aa893a82aea01a2d3167be52..6b4999e83482d8996c809ff2827b77c3efec702a 100644 (file)
@@ -320,7 +320,8 @@ extern "C" {
 #endif
 
 #if _FORTIFY_SOURCE > 0 && !defined(__cplusplus) && !defined(__lint__) && \
-   (__OPTIMIZE__ > 0 || defined(__clang__)) && __GNUC_PREREQ__(4, 1)
+   (__OPTIMIZE__ > 0 || defined(__clang__)) && __GNUC_PREREQ__(4, 1) && \
+   !defined(_COMPILING_NEWLIB)
 #  if _FORTIFY_SOURCE > 1
 #    define __SSP_FORTIFY_LEVEL 2
 #  else
This page took 0.030626 seconds and 5 git commands to generate.