From 5ae74455302260a38ab46eea7f96eff43de7392f Mon Sep 17 00:00:00 2001
From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
Date: Tue, 19 Sep 2017 01:41:01 -0400
Subject: [PATCH] coreutils: remove conflicting _FORTIFY_SOURCE definition

Originally this was introduced in 055e646b ('coreutils: Guard against compiler not supporting __builtin_stpncpy_chk') four years ago. Right now this doesn't seem to serve any purpose and it conflicts with the hardening flags:

    <command line>:2:9: warning: '_FORTIFY_SOURCE' macro redefined [-Wmacro-redefined]
    #define _FORTIFY_SOURCE 2
            ^
    <command line>:1:9: note: previous definition is here
    #define _FORTIFY_SOURCE 0
            ^
    1 warning generated.
---
 pkgs/tools/misc/coreutils/default.nix | 2 --
 1 file changed, 2 deletions(-)

diff --git a/pkgs/tools/misc/coreutils/default.nix b/pkgs/tools/misc/coreutils/default.nix
index c3f4863fe6f..9a422a96d70 100644
--- a/pkgs/tools/misc/coreutils/default.nix
+++ b/pkgs/tools/misc/coreutils/default.nix
@@ -76,8 +76,6 @@ stdenv.mkDerivation rec {
   NIX_LDFLAGS = optionalString selinuxSupport "-lsepol";
   FORCE_UNSAFE_CONFIGURE = optionalString hostPlatform.isSunOS "1";
 
-  makeFlags = optionalString hostPlatform.isDarwin "CFLAGS=-D_FORTIFY_SOURCE=0";
-
   # Works around a bug with 8.26:
   # Makefile:3440: *** Recursive variable 'INSTALL' references itself (eventually).  Stop.
   preInstall = optionalString (hostPlatform != buildPlatform) ''