aboutsummaryrefslogtreecommitdiff
path: root/newlib
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-11-08 21:42:12 -0500
committerMike Frysinger <vapier@gentoo.org>2021-11-13 00:09:21 -0500
commitdf5de02e0ebc8627683bc50aeb68d0d2b0806f09 (patch)
tree4b8c3e2489871a6a06aa1be09b89407e6da8a3e3 /newlib
parent372093689c07d7175f373abd054e22250a9f87fa (diff)
downloadnewlib-df5de02e0ebc8627683bc50aeb68d0d2b0806f09.zip
newlib-df5de02e0ebc8627683bc50aeb68d0d2b0806f09.tar.gz
newlib-df5de02e0ebc8627683bc50aeb68d0d2b0806f09.tar.bz2
newlib: ignore _FORTIFY_SOURCE when building newlib
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.
Diffstat (limited to 'newlib')
-rw-r--r--newlib/libc/include/sys/features.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/newlib/libc/include/sys/features.h b/newlib/libc/include/sys/features.h
index 2188071..6b4999e 100644
--- a/newlib/libc/include/sys/features.h
+++ b/newlib/libc/include/sys/features.h
@@ -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