summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/glibc/glibc/0025-Revert-Linux-Implement-a-useful-version-of-_startup_.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/glibc/glibc/0025-Revert-Linux-Implement-a-useful-version-of-_startup_.patch')
-rw-r--r--meta/recipes-core/glibc/glibc/0025-Revert-Linux-Implement-a-useful-version-of-_startup_.patch128
1 files changed, 128 insertions, 0 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
new file mode 100644
index 0000000000..1982598339
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0025-Revert-Linux-Implement-a-useful-version-of-_startup_.patch
@@ -0,0 +1,128 @@
1From 18b04419d5984f5c6c89fab5e72fcdd1942491cb Mon Sep 17 00:00:00 2001
2From: Martin Jansa <Martin.Jansa@gmail.com>
3Date: Sun, 7 Aug 2022 12:51:48 +0200
4Subject: [PATCH] Revert "Linux: Implement a useful version of _startup_fatal"
5
6This reverts commit a2a6bce7d7e52c1c34369a7da62c501cc350bc31.
7
8Upstream-Status: Inappropriate [temporary work around]
9
10Signed-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
19diff --git a/sysdeps/unix/sysv/linux/i386/startup.h b/sysdeps/unix/sysv/linux/i386/startup.h
20index 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
56diff --git a/sysdeps/unix/sysv/linux/ia64/startup.h b/sysdeps/unix/sysv/linux/ia64/startup.h
57deleted file mode 100644
58index 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>
84diff --git a/sysdeps/unix/sysv/linux/startup.h b/sysdeps/unix/sysv/linux/startup.h
85deleted file mode 100644
86index 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 */