summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/glibc/glibc
diff options
context:
space:
mode:
authorMartin Jansa <Martin.Jansa@gmail.com>2022-07-27 13:56:47 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-08-08 15:44:21 +0100
commit5f1bb85cfa3222468855d45201e090c9085ac9e2 (patch)
treeb4f94763d3b757c5e4d66302d86f0fe5b3bddd6c /meta/recipes-core/glibc/glibc
parentaa83bdc4394595a9d36a71c0461d89d32e89b45e (diff)
downloadpoky-5f1bb85cfa3222468855d45201e090c9085ac9e2.tar.gz
glibc: revert one upstream change to work around broken DEBUG_BUILD build
* work around for build failure with DEBUG_BUILD: http://errors.yoctoproject.org/Errors/Details/661468/ TOPDIR/tmp-glibc/work/core2-64-oe-linux/glibc/2.35-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/../../libexec/x86_64-oe-linux/gcc/x86_64-oe-linux/11.3.0/ld.bfd: TOPDIR/tmp-glibc/work/core2-64-oe-linux/glibc/2.35-r0/build-x86_64-oe-linux/libc.a(libc-tls.o): in function `__libc_setup_tls': /usr/src/debug/glibc/2.35-r0/git/csu/libc-tls.c:202: undefined reference to `_startup_fatal_not_constant' introduced in: https://git.openembedded.org/openembedded-core/commit/?id=50ca0eea5424c89c9b39cf69d8bd73fd65f06e95 with: https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=a2a6bce7d7e52c1c34369a7da62c501cc350bc31 Temporary reverting as discussed in: https://lists.openembedded.org/g/openembedded-core/message/168463 (it's also reverted in buildroot now with: https://lore.kernel.org/buildroot/20220720213853.1A27184110@busybox.osuosl.org/t/) instead of revert we can use -fexpensive-optimizations which will optimize-out the symbol, but that works only with -O1 and not -Og used by DEBUG_BUILD upstream report: https://sourceware.org/bugzilla/show_bug.cgi?id=29249 (From OE-Core rev: 642348f9b4656a090b5a272c18a6723c60100e08) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/glibc/glibc')
-rw-r--r--meta/recipes-core/glibc/glibc/0001-Revert-Linux-Implement-a-useful-version-of-_startup_.patch128
1 files changed, 128 insertions, 0 deletions
diff --git a/meta/recipes-core/glibc/glibc/0001-Revert-Linux-Implement-a-useful-version-of-_startup_.patch b/meta/recipes-core/glibc/glibc/0001-Revert-Linux-Implement-a-useful-version-of-_startup_.patch
new file mode 100644
index 0000000000..2421a63605
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0001-Revert-Linux-Implement-a-useful-version-of-_startup_.patch
@@ -0,0 +1,128 @@
1From 6b8959add09e425df262bf9178b39ca35bc4003c Mon Sep 17 00:00:00 2001
2From: Martin Jansa <Martin.Jansa@gmail.com>
3Date: Sun, 24 Jul 2022 19:41:41 +0200
4Subject: [PATCH] Revert "Linux: Implement a useful version of _startup_fatal"
5
6This reverts commit 2d05ba7f8ef979947e910a37ae8115a816eb4d08.
7Upstream-Status: Inappropriate [temporary work around]
8
9Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
10
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 */