Skip to content

Commit 5b54e99

Browse files
committedJun 26, 2017
glibc: fix i686 build
(cherry picked from commit 7cfd1c8)
1 parent d0ad6a7 commit 5b54e99

File tree

2 files changed

+46
-1
lines changed

2 files changed

+46
-1
lines changed
 

‎pkgs/development/libraries/glibc/common.nix

+4-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ stdenv.mkDerivation ({
5454
./CVE-2017-1000366-rtld-LD_PRELOAD.patch
5555
./CVE-2017-1000366-rtld-LD_AUDIT.patch
5656
]
57-
++ lib.optional stdenv.isi686 ./fix-i686-memchr.patch;
57+
++ lib.optionals stdenv.isi686 [
58+
./fix-i686-memchr.patch
59+
./i686-fix-vectorized-strcspn.patch
60+
];
5861

5962
postPatch =
6063
# Needed for glibc to build with the gnumake 3.82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
From adc7e06fb412a2a1ee52f8cb788caf436335b9f3 Mon Sep 17 00:00:00 2001
2+
From: Florian Weimer <fweimer@redhat.com>
3+
Date: Wed, 14 Jun 2017 08:11:22 +0200
4+
Subject: [PATCH] i686: Add missing IS_IN (libc) guards to vectorized strcspn
5+
6+
Since commit d957c4d3fa48d685ff2726c605c988127ef99395 (i386: Compile
7+
rtld-*.os with -mno-sse -mno-mmx -mfpmath=387), vector intrinsics can
8+
no longer be used in ld.so, even if the compiled code never makes it
9+
into the final ld.so link. This commit adds the missing IS_IN (libc)
10+
guard to the SSE 4.2 strcspn implementation, so that it can be used from
11+
ld.so in the future.
12+
13+
(cherry picked from commit 69052a3a95da37169a08f9e59b2cc1808312753c)
14+
---
15+
ChangeLog | 5 +++++
16+
sysdeps/i386/i686/multiarch/strcspn-c.c | 6 ++++--
17+
sysdeps/i386/i686/multiarch/varshift.c | 4 +++-
18+
3 files changed, 12 insertions(+), 3 deletions(-)
19+
20+
diff --git a/sysdeps/i386/i686/multiarch/strcspn-c.c b/sysdeps/i386/i686/multiarch/strcspn-c.c
21+
index 6d61e19..ec230fb 100644
22+
--- a/sysdeps/i386/i686/multiarch/strcspn-c.c
23+
+++ b/sysdeps/i386/i686/multiarch/strcspn-c.c
24+
@@ -1,2 +1,4 @@
25+
-#define __strcspn_sse2 __strcspn_ia32
26+
-#include <sysdeps/x86_64/multiarch/strcspn-c.c>
27+
+#if IS_IN (libc)
28+
+# define __strcspn_sse2 __strcspn_ia32
29+
+# include <sysdeps/x86_64/multiarch/strcspn-c.c>
30+
+#endif
31+
diff --git a/sysdeps/i386/i686/multiarch/varshift.c b/sysdeps/i386/i686/multiarch/varshift.c
32+
index 7760b96..6742a35 100644
33+
--- a/sysdeps/i386/i686/multiarch/varshift.c
34+
+++ b/sysdeps/i386/i686/multiarch/varshift.c
35+
@@ -1 +1,3 @@
36+
-#include <sysdeps/x86_64/multiarch/varshift.c>
37+
+#if IS_IN (libc)
38+
+# include <sysdeps/x86_64/multiarch/varshift.c>
39+
+#endif
40+
--
41+
2.9.3
42+

0 commit comments

Comments
 (0)