From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1521) id F1157385840B; Sat, 13 Nov 2021 05:10:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F1157385840B Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Michael Frysinger To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] newlib: ignore _FORTIFY_SOURCE when building newlib X-Act-Checkin: newlib-cygwin X-Git-Author: Mike Frysinger X-Git-Refname: refs/heads/master X-Git-Oldrev: 372093689c07d7175f373abd054e22250a9f87fa X-Git-Newrev: df5de02e0ebc8627683bc50aeb68d0d2b0806f09 Message-Id: <20211113051001.F1157385840B@sourceware.org> Date: Sat, 13 Nov 2021 05:10:01 +0000 (GMT) X-BeenThere: newlib-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib GIT logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2021 05:10:02 -0000 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=df5de02e0ebc8627683bc50aeb68d0d2b0806f09 commit df5de02e0ebc8627683bc50aeb68d0d2b0806f09 Author: Mike Frysinger Date: Mon Nov 8 21:42:12 2021 -0500 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. Diff: --- newlib/libc/include/sys/features.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/newlib/libc/include/sys/features.h b/newlib/libc/include/sys/features.h index 218807178..6b4999e83 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