summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/pseudo
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2023-08-17 07:40:47 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-08-17 22:19:43 +0100
commita3c294691fc1ceaddafd2dd870a6ecbbf313d5c6 (patch)
treed49e1428fdfca3a231836df21fea3e677987170d /meta/recipes-devtools/pseudo
parent12d9280c3de24c1c2b835e80fa1b8be72e9bc63a (diff)
downloadpoky-a3c294691fc1ceaddafd2dd870a6ecbbf313d5c6.tar.gz
pseudo: Fix to work with glibc 2.38
This adds a horrible hack to get pseudo working with glibc 2.38. We can't drop _GNU_SOURCE to something like _DEFAULT_SOURCE since we need the defines the gnu options bring in. That leaves using internal glibc defines to disable the c23 versions of strtol/fscanf and friends. Which would break pseudo build with 2.38 from running on hosts with older glibc. We'll probably need to come up with something better but this gets glibc 2.38 and working and avoids autobuilder failures. (From OE-Core rev: 596fb699d470d7779bfa694e04908929ffeabcf7) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/pseudo')
-rw-r--r--meta/recipes-devtools/pseudo/files/glibc238.patch72
-rw-r--r--meta/recipes-devtools/pseudo/pseudo_git.bb1
2 files changed, 73 insertions, 0 deletions
diff --git a/meta/recipes-devtools/pseudo/files/glibc238.patch b/meta/recipes-devtools/pseudo/files/glibc238.patch
new file mode 100644
index 0000000000..76ca8c11eb
--- /dev/null
+++ b/meta/recipes-devtools/pseudo/files/glibc238.patch
@@ -0,0 +1,72 @@
1glibc 2.38 would include __isoc23_strtol and similar symbols. This is trggerd by
2_GNU_SOURCE but we have to set that for other definitions. Therefore play with defines
3to turn this off within pseudo_wrappers.c. Elsewhere we can switch to _DEFAULT_SOURCE
4rather than _GNU_SOURCE.
5
6Upstream-Status: Pending
7
8Index: git/pseudo_wrappers.c
9===================================================================
10--- git.orig/pseudo_wrappers.c
11+++ git/pseudo_wrappers.c
12@@ -6,6 +6,15 @@
13 * SPDX-License-Identifier: LGPL-2.1-only
14 *
15 */
16+/* glibc 2.38 would include __isoc23_strtol and similar symbols. This is trggerd by
17+ * _GNU_SOURCE but we have to set that for other definitions. Therefore play with defines
18+ * to turn this off.
19+ */
20+#include <features.h>
21+#undef __GLIBC_USE_ISOC2X
22+#undef __GLIBC_USE_C2X_STRTOL
23+#define __GLIBC_USE_C2X_STRTOL 0
24+
25 #include <assert.h>
26 #include <stdlib.h>
27 #include <limits.h>
28Index: git/pseudo_util.c
29===================================================================
30--- git.orig/pseudo_util.c
31+++ git/pseudo_util.c
32@@ -8,6 +8,14 @@
33 */
34 /* we need access to RTLD_NEXT for a horrible workaround */
35 #define _GNU_SOURCE
36+/* glibc 2.38 would include __isoc23_strtol and similar symbols. This is trggerd by
37+ * _GNU_SOURCE but we have to set that for other definitions. Therefore play with defines
38+ * to turn this off.
39+ */
40+#include <features.h>
41+#undef __GLIBC_USE_ISOC2X
42+#undef __GLIBC_USE_C2X_STRTOL
43+#define __GLIBC_USE_C2X_STRTOL 0
44
45 #include <ctype.h>
46 #include <errno.h>
47Index: git/pseudolog.c
48===================================================================
49--- git.orig/pseudolog.c
50+++ git/pseudolog.c
51@@ -8,7 +8,7 @@
52 */
53 /* We need _XOPEN_SOURCE for strptime(), but if we define that,
54 * we then don't get S_IFSOCK... _GNU_SOURCE turns on everything. */
55-#define _GNU_SOURCE
56+#define _DEFAULT_SOURCE
57
58 #include <ctype.h>
59 #include <limits.h>
60Index: git/pseudo_client.c
61===================================================================
62--- git.orig/pseudo_client.c
63+++ git/pseudo_client.c
64@@ -6,7 +6,7 @@
65 * SPDX-License-Identifier: LGPL-2.1-only
66 *
67 */
68-#define _GNU_SOURCE
69+#define _DEFAULT_SOURCE
70
71 #include <stdio.h>
72 #include <signal.h>
diff --git a/meta/recipes-devtools/pseudo/pseudo_git.bb b/meta/recipes-devtools/pseudo/pseudo_git.bb
index c3c4bb0ed9..9260a3faa3 100644
--- a/meta/recipes-devtools/pseudo/pseudo_git.bb
+++ b/meta/recipes-devtools/pseudo/pseudo_git.bb
@@ -2,6 +2,7 @@ require pseudo.inc
2 2
3SRC_URI = "git://git.yoctoproject.org/pseudo;branch=master;protocol=https \ 3SRC_URI = "git://git.yoctoproject.org/pseudo;branch=master;protocol=https \
4 file://0001-configure-Prune-PIE-flags.patch \ 4 file://0001-configure-Prune-PIE-flags.patch \
5 file://glibc238.patch \
5 file://fallback-passwd \ 6 file://fallback-passwd \
6 file://fallback-group \ 7 file://fallback-group \
7 " 8 "