From 3ee1c031b5a2b4739344263c3311a4dbf1b70b60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Wed, 1 Jan 2014 15:50:02 +0100 Subject: [PATCH] glibc: pull a bug work-around from Arch (i686-only ATM) This should work around some of our build problems, e.g. http://hydra.nixos.org/build/7575893/nixlog/1/tail-reload Cf. #1446; unconditional on stdenv-updates: c6b92053c --- pkgs/development/libraries/glibc/2.18/common.nix | 4 +++- .../libraries/glibc/2.18/strstr-sse42-hack.patch | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/libraries/glibc/2.18/strstr-sse42-hack.patch diff --git a/pkgs/development/libraries/glibc/2.18/common.nix b/pkgs/development/libraries/glibc/2.18/common.nix index 6692bd90ff9..9271e33cf07 100644 --- a/pkgs/development/libraries/glibc/2.18/common.nix +++ b/pkgs/development/libraries/glibc/2.18/common.nix @@ -61,7 +61,9 @@ stdenv.mkDerivation ({ ./cve-2013-4332.patch ./cve-2013-4458.patch ./cve-2013-4788.patch - ]; + ] + # the problem only seems to affect i686, so avoid re-hash x86_64 ATM + ++ stdenv.lib.optional stdenv.isi686 ./strstr-sse42-hack.patch; postPatch = '' # Needed for glibc to build with the gnumake 3.82 diff --git a/pkgs/development/libraries/glibc/2.18/strstr-sse42-hack.patch b/pkgs/development/libraries/glibc/2.18/strstr-sse42-hack.patch new file mode 100644 index 00000000000..cdf4c025316 --- /dev/null +++ b/pkgs/development/libraries/glibc/2.18/strstr-sse42-hack.patch @@ -0,0 +1,14 @@ +https://bugs.archlinux.org/task/36556 +diff --git a/sysdeps/x86_64/multiarch/strstr.c b/sysdeps/x86_64/multiarch/strstr.c +index cd63b68..03d8b9a 100644 +--- a/sysdeps/x86_64/multiarch/strstr.c ++++ b/sysdeps/x86_64/multiarch/strstr.c +@@ -86,7 +86,7 @@ + /* Simple replacement of movdqu to address 4KB boundary cross issue. + If EOS occurs within less than 16B before 4KB boundary, we don't + cross to next page. */ +-static __m128i ++static inline __m128i + __m128i_strloadu (const unsigned char * p, __m128i zero) + { + if (__builtin_expect ((int) ((size_t) p & 0xfff) > 0xff0, 0))