python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / development / libraries / glibc / fix-x64-abi.patch
blob1d60dcd7988b2f97f60787d85d6ded5f896e5b4f
1 From 3288c6da64add3b4561b8c10fff522027caea01c Mon Sep 17 00:00:00 2001
2 From: Nicholas Miell <nmiell@gmail.com>
3 Date: Sat, 17 Jun 2017 18:21:07 -0700
4 Subject: [PATCH] Align the stack on entry to __tls_get_addr()
6 Old versions of gcc (4 & 5) didn't align the stack according to the
7 AMD64 psABI when calling __tls_get_addr(). Apparently new versions of
8 gcc (7) got much more aggressive about vectorizing and generating MOVAPS
9 instructions, which means old binaries built with the buggy versions of
10 gcc are much more likely to crash when using versions of glibc built
11 using gcc 7.
13 For example, a large number of Linux games built using the Unity game
14 engine and available for purchase on Steam.
15 ---
16 elf/dl-tls.c | 4 ++++
17 1 file changed, 4 insertions(+)
19 diff --git a/elf/dl-tls.c b/elf/dl-tls.c
20 index 5aba33b3fa..3f3cb917de 100644
21 --- a/elf/dl-tls.c
22 +++ b/elf/dl-tls.c
23 @@ -827,6 +827,10 @@ rtld_hidden_proto (__tls_get_addr)
24 rtld_hidden_def (__tls_get_addr)
25 #endif
27 +#ifdef __x86_64__
28 +/* Old versions of gcc didn't align the stack. */
29 +__attribute__((force_align_arg_pointer))
30 +#endif
31 /* The generic dynamic and local dynamic model cannot be used in
32 statically linked applications. */
33 void *
35 2.13.0