]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/glibc-2.38/0006-i686-Fix-build-with-disable-multiarch.patch
glibc: Import latest patches from upstream
[ipfire-2.x.git] / src / patches / glibc-2.38 / 0006-i686-Fix-build-with-disable-multiarch.patch
CommitLineData
b9215da1
MT
1From 7ac405a74c6069b0627dc2d8449a82a621f8ff06 Mon Sep 17 00:00:00 2001
2From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3Date: Tue, 8 Aug 2023 09:27:55 -0300
a61a21ef 4Subject: [PATCH 06/44] i686: Fix build with --disable-multiarch
b9215da1
MT
5
6Since i686 provides the fortified wrappers for memcpy, mempcpy,
7memmove, and memset on the same string implementation, the static
8build tries to optimized it by not tying the fortified wrappers
9to string routine (to avoid pulling the fortify function if
10they are not required).
11
12Checked on i686-linux-gnu building with different option:
13default and --disable-multi-arch plus default, --disable-default-pie,
14--enable-fortify-source={2,3}, and --enable-fortify-source={2,3}
15with --disable-default-pie.
16Reviewed-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
28diff --git a/sysdeps/i386/i686/memcpy.S b/sysdeps/i386/i686/memcpy.S
29index 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)
41diff --git a/sysdeps/i386/i686/mempcpy.S b/sysdeps/i386/i686/mempcpy.S
42index 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)
54diff --git a/sysdeps/i386/i686/multiarch/memcpy_chk.c b/sysdeps/i386/i686/multiarch/memcpy_chk.c
55index 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
65diff --git a/sysdeps/i386/i686/multiarch/memmove_chk.c b/sysdeps/i386/i686/multiarch/memmove_chk.c
66index 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
76diff --git a/sysdeps/i386/i686/multiarch/mempcpy_chk.c b/sysdeps/i386/i686/multiarch/mempcpy_chk.c
77index 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
87diff --git a/sysdeps/i386/i686/multiarch/memset_chk.c b/sysdeps/i386/i686/multiarch/memset_chk.c
88index 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--
992.39.2
100