diff --git a/pkgs/development/libraries/glibc-2.12/common.nix b/pkgs/development/libraries/glibc-2.12/common.nix index 2951c631d85..4dd157ea95e 100644 --- a/pkgs/development/libraries/glibc-2.12/common.nix +++ b/pkgs/development/libraries/glibc-2.12/common.nix @@ -74,6 +74,9 @@ stdenv.mkDerivation ({ /* Allow nixos and nix handle the locale-archive. */ ./nix-locale-archive.patch + + /* Allow nixos and nix handle the locale-archive. */ + ./nscd-ssp-linking.patch ]; postPatch = '' @@ -83,9 +86,7 @@ stdenv.mkDerivation ({ # nscd needs libgcc, and we don't want it dynamically linked # because we don't want it to depend on bootstrap-tools libs. - # It also needs -lssp when building with nixpkgs gcc (not of - # boostrap-tools) - echo "LDFLAGS-nscd += -static-libgcc -lssp" >> nscd/Makefile + echo "LDFLAGS-nscd += -static-libgcc" >> nscd/Makefile ''; configureFlags = [ diff --git a/pkgs/development/libraries/glibc-2.12/nscd-ssp-linking.patch b/pkgs/development/libraries/glibc-2.12/nscd-ssp-linking.patch new file mode 100644 index 00000000000..764103173bb --- /dev/null +++ b/pkgs/development/libraries/glibc-2.12/nscd-ssp-linking.patch @@ -0,0 +1,16 @@ +http://sources.redhat.com/bugzilla/show_bug.cgi?id=12125 + +diff --git a/nscd/Makefile b/nscd/Makefile +index 93874e5..63f7144 100644 +--- a/nscd/Makefile ++++ b/nscd/Makefile +@@ -90,6 +90,9 @@ CFLAGS-nscd_initgroups.c = -fexceptions + nscd-cflags = -DIS_IN_nscd=1 -D_FORTIFY_SOURCE=2 + ifeq (yesyes,$(have-fpie)$(build-shared)) + nscd-cflags += $(pie-ccflag) ++ifeq (yes,$(have-ssp)) ++LDFLAGS-nscd += -lssp_noshared -lssp ++endif + endif + ifeq (yes,$(have-ssp)) + nscd-cflags += -fstack-protector