]> git.ipfire.org Git - people/stevee/ipfire-2.x.git/blob - src/patches/glibc-2.38/0006-i686-Fix-build-with-disable-multiarch.patch
core185: Ship binutils
[people/stevee/ipfire-2.x.git] / src / patches / glibc-2.38 / 0006-i686-Fix-build-with-disable-multiarch.patch
1 From 7ac405a74c6069b0627dc2d8449a82a621f8ff06 Mon Sep 17 00:00:00 2001
2 From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3 Date: Tue, 8 Aug 2023 09:27:55 -0300
4 Subject: [PATCH 06/44] i686: Fix build with --disable-multiarch
5
6 Since i686 provides the fortified wrappers for memcpy, mempcpy,
7 memmove, and memset on the same string implementation, the static
8 build tries to optimized it by not tying the fortified wrappers
9 to string routine (to avoid pulling the fortify function if
10 they are not required).
11
12 Checked on i686-linux-gnu building with different option:
13 default and --disable-multi-arch plus default, --disable-default-pie,
14 --enable-fortify-source={2,3}, and --enable-fortify-source={2,3}
15 with --disable-default-pie.
16 Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
17
18 (cherry picked from commit c73c96a4a1af1326df7f96eec58209e1e04066d8)
19 ---
20 sysdeps/i386/i686/memcpy.S | 2 +-
21 sysdeps/i386/i686/mempcpy.S | 2 +-
22 sysdeps/i386/i686/multiarch/memcpy_chk.c | 2 ++
23 sysdeps/i386/i686/multiarch/memmove_chk.c | 2 ++
24 sysdeps/i386/i686/multiarch/mempcpy_chk.c | 2 ++
25 sysdeps/i386/i686/multiarch/memset_chk.c | 2 ++
26 6 files changed, 10 insertions(+), 2 deletions(-)
27
28 diff --git a/sysdeps/i386/i686/memcpy.S b/sysdeps/i386/i686/memcpy.S
29 index 9b48ec0ea1..b86af4aac9 100644
30 --- a/sysdeps/i386/i686/memcpy.S
31 +++ b/sysdeps/i386/i686/memcpy.S
32 @@ -27,7 +27,7 @@
33 #define LEN SRC+4
34
35 .text
36 -#if defined PIC && IS_IN (libc)
37 +#if defined SHARED && IS_IN (libc)
38 ENTRY_CHK (__memcpy_chk)
39 movl 12(%esp), %eax
40 cmpl %eax, 16(%esp)
41 diff --git a/sysdeps/i386/i686/mempcpy.S b/sysdeps/i386/i686/mempcpy.S
42 index 26f8501e7d..14d9dd681a 100644
43 --- a/sysdeps/i386/i686/mempcpy.S
44 +++ b/sysdeps/i386/i686/mempcpy.S
45 @@ -27,7 +27,7 @@
46 #define LEN SRC+4
47
48 .text
49 -#if defined PIC && IS_IN (libc)
50 +#if defined SHARED && IS_IN (libc)
51 ENTRY_CHK (__mempcpy_chk)
52 movl 12(%esp), %eax
53 cmpl %eax, 16(%esp)
54 diff --git a/sysdeps/i386/i686/multiarch/memcpy_chk.c b/sysdeps/i386/i686/multiarch/memcpy_chk.c
55 index ec945dc91f..c3a8aeaf18 100644
56 --- a/sysdeps/i386/i686/multiarch/memcpy_chk.c
57 +++ b/sysdeps/i386/i686/multiarch/memcpy_chk.c
58 @@ -32,4 +32,6 @@ libc_ifunc_redirected (__redirect_memcpy_chk, __memcpy_chk,
59 __hidden_ver1 (__memcpy_chk, __GI___memcpy_chk, __redirect_memcpy_chk)
60 __attribute__ ((visibility ("hidden"))) __attribute_copy__ (__memcpy_chk);
61 # endif
62 +#else
63 +# include <debug/memcpy_chk.c>
64 #endif
65 diff --git a/sysdeps/i386/i686/multiarch/memmove_chk.c b/sysdeps/i386/i686/multiarch/memmove_chk.c
66 index 55c7601d5d..070dde083a 100644
67 --- a/sysdeps/i386/i686/multiarch/memmove_chk.c
68 +++ b/sysdeps/i386/i686/multiarch/memmove_chk.c
69 @@ -32,4 +32,6 @@ libc_ifunc_redirected (__redirect_memmove_chk, __memmove_chk,
70 __hidden_ver1 (__memmove_chk, __GI___memmove_chk, __redirect_memmove_chk)
71 __attribute__ ((visibility ("hidden"))) __attribute_copy__ (__memmove_chk);
72 # endif
73 +#else
74 +# include <debug/memmove_chk.c>
75 #endif
76 diff --git a/sysdeps/i386/i686/multiarch/mempcpy_chk.c b/sysdeps/i386/i686/multiarch/mempcpy_chk.c
77 index 83569cf9d9..14360f1828 100644
78 --- a/sysdeps/i386/i686/multiarch/mempcpy_chk.c
79 +++ b/sysdeps/i386/i686/multiarch/mempcpy_chk.c
80 @@ -32,4 +32,6 @@ libc_ifunc_redirected (__redirect_mempcpy_chk, __mempcpy_chk,
81 __hidden_ver1 (__mempcpy_chk, __GI___mempcpy_chk, __redirect_mempcpy_chk)
82 __attribute__ ((visibility ("hidden"))) __attribute_copy__ (__mempcpy_chk);
83 # endif
84 +#else
85 +# include <debug/mempcpy_chk.c>
86 #endif
87 diff --git a/sysdeps/i386/i686/multiarch/memset_chk.c b/sysdeps/i386/i686/multiarch/memset_chk.c
88 index 1a7503858d..8179ef7c0b 100644
89 --- a/sysdeps/i386/i686/multiarch/memset_chk.c
90 +++ b/sysdeps/i386/i686/multiarch/memset_chk.c
91 @@ -32,4 +32,6 @@ libc_ifunc_redirected (__redirect_memset_chk, __memset_chk,
92 __hidden_ver1 (__memset_chk, __GI___memset_chk, __redirect_memset_chk)
93 __attribute__ ((visibility ("hidden"))) __attribute_copy__ (__memset_chk);
94 # endif
95 +#else
96 +# include <debug/memset_chk.c>
97 #endif
98 --
99 2.39.2
100