diff options
Diffstat (limited to 'meta/recipes-core/glibc')
3 files changed, 29 insertions, 129 deletions
diff --git a/meta/recipes-core/glibc/glibc/0025-Revert-Linux-Implement-a-useful-version-of-_startup_.patch b/meta/recipes-core/glibc/glibc/0025-Revert-Linux-Implement-a-useful-version-of-_startup_.patch deleted file mode 100644 index 1982598339..0000000000 --- a/meta/recipes-core/glibc/glibc/0025-Revert-Linux-Implement-a-useful-version-of-_startup_.patch +++ /dev/null | |||
@@ -1,128 +0,0 @@ | |||
1 | From 18b04419d5984f5c6c89fab5e72fcdd1942491cb Mon Sep 17 00:00:00 2001 | ||
2 | From: Martin Jansa <Martin.Jansa@gmail.com> | ||
3 | Date: Sun, 7 Aug 2022 12:51:48 +0200 | ||
4 | Subject: [PATCH] Revert "Linux: Implement a useful version of _startup_fatal" | ||
5 | |||
6 | This reverts commit a2a6bce7d7e52c1c34369a7da62c501cc350bc31. | ||
7 | |||
8 | Upstream-Status: Inappropriate [temporary work around] | ||
9 | |||
10 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> | ||
11 | --- | ||
12 | sysdeps/unix/sysv/linux/i386/startup.h | 23 ++++++++++++--- | ||
13 | sysdeps/unix/sysv/linux/ia64/startup.h | 22 --------------- | ||
14 | sysdeps/unix/sysv/linux/startup.h | 39 -------------------------- | ||
15 | 3 files changed, 19 insertions(+), 65 deletions(-) | ||
16 | delete mode 100644 sysdeps/unix/sysv/linux/ia64/startup.h | ||
17 | delete mode 100644 sysdeps/unix/sysv/linux/startup.h | ||
18 | |||
19 | diff --git a/sysdeps/unix/sysv/linux/i386/startup.h b/sysdeps/unix/sysv/linux/i386/startup.h | ||
20 | index 213805d7d2..67c9310f3a 100644 | ||
21 | --- a/sysdeps/unix/sysv/linux/i386/startup.h | ||
22 | +++ b/sysdeps/unix/sysv/linux/i386/startup.h | ||
23 | @@ -1,5 +1,5 @@ | ||
24 | /* Linux/i386 definitions of functions used by static libc main startup. | ||
25 | - Copyright (C) 2022 Free Software Foundation, Inc. | ||
26 | + Copyright (C) 2017-2022 Free Software Foundation, Inc. | ||
27 | This file is part of the GNU C Library. | ||
28 | |||
29 | The GNU C Library is free software; you can redistribute it and/or | ||
30 | @@ -16,7 +16,22 @@ | ||
31 | License along with the GNU C Library; if not, see | ||
32 | <https://www.gnu.org/licenses/>. */ | ||
33 | |||
34 | -/* Can't use "call *%gs:SYSINFO_OFFSET" during startup. */ | ||
35 | -#define I386_USE_SYSENTER 0 | ||
36 | +#if BUILD_PIE_DEFAULT | ||
37 | +/* Can't use "call *%gs:SYSINFO_OFFSET" during statup in static PIE. */ | ||
38 | +# define I386_USE_SYSENTER 0 | ||
39 | |||
40 | -#include_next <startup.h> | ||
41 | +# include <sysdep.h> | ||
42 | +# include <abort-instr.h> | ||
43 | + | ||
44 | +__attribute__ ((__noreturn__)) | ||
45 | +static inline void | ||
46 | +_startup_fatal (const char *message __attribute__ ((unused))) | ||
47 | +{ | ||
48 | + /* This is only called very early during startup in static PIE. | ||
49 | + FIXME: How can it be improved? */ | ||
50 | + ABORT_INSTRUCTION; | ||
51 | + __builtin_unreachable (); | ||
52 | +} | ||
53 | +#else | ||
54 | +# include_next <startup.h> | ||
55 | +#endif | ||
56 | diff --git a/sysdeps/unix/sysv/linux/ia64/startup.h b/sysdeps/unix/sysv/linux/ia64/startup.h | ||
57 | deleted file mode 100644 | ||
58 | index 77f29f15a2..0000000000 | ||
59 | --- a/sysdeps/unix/sysv/linux/ia64/startup.h | ||
60 | +++ /dev/null | ||
61 | @@ -1,22 +0,0 @@ | ||
62 | -/* Linux/ia64 definitions of functions used by static libc main startup. | ||
63 | - Copyright (C) 2022 Free Software Foundation, Inc. | ||
64 | - This file is part of the GNU C Library. | ||
65 | - | ||
66 | - The GNU C Library is free software; you can redistribute it and/or | ||
67 | - modify it under the terms of the GNU Lesser General Public | ||
68 | - License as published by the Free Software Foundation; either | ||
69 | - version 2.1 of the License, or (at your option) any later version. | ||
70 | - | ||
71 | - The GNU C Library is distributed in the hope that it will be useful, | ||
72 | - but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
73 | - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
74 | - Lesser General Public License for more details. | ||
75 | - | ||
76 | - You should have received a copy of the GNU Lesser General Public | ||
77 | - License along with the GNU C Library; if not, see | ||
78 | - <https://www.gnu.org/licenses/>. */ | ||
79 | - | ||
80 | -/* This code is used before the TCB is set up. */ | ||
81 | -#define IA64_USE_NEW_STUB 0 | ||
82 | - | ||
83 | -#include_next <startup.h> | ||
84 | diff --git a/sysdeps/unix/sysv/linux/startup.h b/sysdeps/unix/sysv/linux/startup.h | ||
85 | deleted file mode 100644 | ||
86 | index 39859b404a..0000000000 | ||
87 | --- a/sysdeps/unix/sysv/linux/startup.h | ||
88 | +++ /dev/null | ||
89 | @@ -1,39 +0,0 @@ | ||
90 | -/* Linux definitions of functions used by static libc main startup. | ||
91 | - Copyright (C) 2017-2022 Free Software Foundation, Inc. | ||
92 | - This file is part of the GNU C Library. | ||
93 | - | ||
94 | - The GNU C Library is free software; you can redistribute it and/or | ||
95 | - modify it under the terms of the GNU Lesser General Public | ||
96 | - License as published by the Free Software Foundation; either | ||
97 | - version 2.1 of the License, or (at your option) any later version. | ||
98 | - | ||
99 | - The GNU C Library is distributed in the hope that it will be useful, | ||
100 | - but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
101 | - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
102 | - Lesser General Public License for more details. | ||
103 | - | ||
104 | - You should have received a copy of the GNU Lesser General Public | ||
105 | - License along with the GNU C Library; if not, see | ||
106 | - <https://www.gnu.org/licenses/>. */ | ||
107 | - | ||
108 | -#ifdef SHARED | ||
109 | -# include_next <startup.h> | ||
110 | -#else | ||
111 | -# include <sysdep.h> | ||
112 | - | ||
113 | -/* Avoid a run-time invocation of strlen. */ | ||
114 | -#define _startup_fatal(message) \ | ||
115 | - do \ | ||
116 | - { \ | ||
117 | - size_t __message_length = __builtin_strlen (message); \ | ||
118 | - if (! __builtin_constant_p (__message_length)) \ | ||
119 | - { \ | ||
120 | - extern void _startup_fatal_not_constant (void); \ | ||
121 | - _startup_fatal_not_constant (); \ | ||
122 | - } \ | ||
123 | - INTERNAL_SYSCALL_CALL (write, STDERR_FILENO, (message), \ | ||
124 | - __message_length); \ | ||
125 | - INTERNAL_SYSCALL_CALL (exit_group, 127); \ | ||
126 | - } \ | ||
127 | - while (0) | ||
128 | -#endif /* !SHARED */ | ||
diff --git a/meta/recipes-core/glibc/glibc/0025-startup-Force-O2.patch b/meta/recipes-core/glibc/glibc/0025-startup-Force-O2.patch new file mode 100644 index 0000000000..1f3426295a --- /dev/null +++ b/meta/recipes-core/glibc/glibc/0025-startup-Force-O2.patch | |||
@@ -0,0 +1,28 @@ | |||
1 | From 5e635e5dc7d1b21a78f38109d4f43a03bec865c8 Mon Sep 17 00:00:00 2001 | ||
2 | From: "H.J. Lu" <hjl.tools@gmail.com> | ||
3 | Date: Sun, 7 Aug 2022 12:51:48 +0200 | ||
4 | Subject: [PATCH] startup: Force -O2 | ||
5 | |||
6 | Upstream-Status: Submitted [https://sourceware.org/bugzilla/show_bug.cgi?id=29249] | ||
7 | |||
8 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> | ||
9 | --- | ||
10 | sysdeps/unix/sysv/linux/startup.h | 5 +++++ | ||
11 | 1 file changed, 5 insertions(+) | ||
12 | |||
13 | diff --git a/sysdeps/unix/sysv/linux/startup.h b/sysdeps/unix/sysv/linux/startup.h | ||
14 | index 39859b404a..e1fc1b682d 100644 | ||
15 | --- a/sysdeps/unix/sysv/linux/startup.h | ||
16 | +++ b/sysdeps/unix/sysv/linux/startup.h | ||
17 | @@ -21,6 +21,11 @@ | ||
18 | #else | ||
19 | # include <sysdep.h> | ||
20 | |||
21 | +# if !defined __OPTIMIZE__ || __OPTIMIZE__ < 2 | ||
22 | +/* Force to fold strlen. */ | ||
23 | +# pragma GCC optimize(2) | ||
24 | +# endif | ||
25 | + | ||
26 | /* Avoid a run-time invocation of strlen. */ | ||
27 | #define _startup_fatal(message) \ | ||
28 | do \ | ||
diff --git a/meta/recipes-core/glibc/glibc_2.36.bb b/meta/recipes-core/glibc/glibc_2.36.bb index 6ccb392f09..1cfa8101ef 100644 --- a/meta/recipes-core/glibc/glibc_2.36.bb +++ b/meta/recipes-core/glibc/glibc_2.36.bb | |||
@@ -50,7 +50,7 @@ SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \ | |||
50 | file://0022-tzselect.ksh-Use-bin-sh-default-shell-interpreter.patch \ | 50 | file://0022-tzselect.ksh-Use-bin-sh-default-shell-interpreter.patch \ |
51 | file://0023-fix-create-thread-failed-in-unprivileged-process-BZ-.patch \ | 51 | file://0023-fix-create-thread-failed-in-unprivileged-process-BZ-.patch \ |
52 | file://0024-Avoid-hardcoded-build-time-paths-in-the-output-binar.patch \ | 52 | file://0024-Avoid-hardcoded-build-time-paths-in-the-output-binar.patch \ |
53 | file://0025-Revert-Linux-Implement-a-useful-version-of-_startup_.patch \ | 53 | file://0025-startup-Force-O2.patch \ |
54 | " | 54 | " |
55 | S = "${WORKDIR}/git" | 55 | S = "${WORKDIR}/git" |
56 | B = "${WORKDIR}/build-${TARGET_SYS}" | 56 | B = "${WORKDIR}/build-${TARGET_SYS}" |