summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/pseudo
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-08-17 15:21:26 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-08-25 21:53:34 +0100
commit4cc61c81f7558f5fdbc8cc83a5c2be85545a8181 (patch)
treef104f53010367826e78a3388c93fbdaf903bb92e /meta/recipes-devtools/pseudo
parentc3e72164e7a0c51de04a9295e5f50c2e233965f7 (diff)
downloadpoky-4cc61c81f7558f5fdbc8cc83a5c2be85545a8181.tar.gz
pseudo: Fix to work with glibc 2.34 systems
The merge of libdl into libc in glibc 2.34 causes problems for pseudo. Add a fix that works around this issue. (From OE-Core rev: dd3e46a043c81cd4d81731a0f691868d3c059742) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/pseudo')
-rwxr-xr-xmeta/recipes-devtools/pseudo/files/build-oldlibc20
-rw-r--r--meta/recipes-devtools/pseudo/files/older-glibc-symbols.patch49
-rw-r--r--meta/recipes-devtools/pseudo/pseudo_git.bb4
3 files changed, 73 insertions, 0 deletions
diff --git a/meta/recipes-devtools/pseudo/files/build-oldlibc b/meta/recipes-devtools/pseudo/files/build-oldlibc
new file mode 100755
index 0000000000..85c438de4e
--- /dev/null
+++ b/meta/recipes-devtools/pseudo/files/build-oldlibc
@@ -0,0 +1,20 @@
1#!/bin/sh
2#
3# Script to re-generate pseudo-prebuilt-2.33.tar.xz
4#
5# Copyright (C) 2021 Richard Purdie
6#
7# SPDX-License-Identifier: GPL-2.0-only
8#
9
10for i in x86_64 aarch64 i686; do
11 if [ ! -e $i-nativesdk-libc.tar.xz ]; then
12 wget http://downloads.yoctoproject.org/releases/uninative/3.2/$i-nativesdk-libc.tar.xz
13 fi
14 tar -xf $i-nativesdk-libc.tar.xz --wildcards \*/lib/libpthread\* \*/lib/libdl\*
15 cd $i-linux/lib
16 ln -s libdl.so.2 libdl.so
17 ln -s libpthread.so.0 libpthread.so
18 cd ../..
19done
20tar -cJf pseudo-prebuilt-2.33.tar.xz *-linux \ No newline at end of file
diff --git a/meta/recipes-devtools/pseudo/files/older-glibc-symbols.patch b/meta/recipes-devtools/pseudo/files/older-glibc-symbols.patch
new file mode 100644
index 0000000000..1552c69b52
--- /dev/null
+++ b/meta/recipes-devtools/pseudo/files/older-glibc-symbols.patch
@@ -0,0 +1,49 @@
1If we link against a newer glibc 2.34 and then try and our LD_PRELOAD is run against a
2binary on a host with an older libc, we see symbol errors since in glibc 2.34, pthread
3and dl are merged into libc itself.
4
5We need to use the older form of linking so use glibc binaries from an older release
6to force this. We only use minimal symbols from these anyway.
7
8pthread_atfork is problematic, particularly on arm so use the internal glibc routine
9it maps too. This was always present in the main libc from 2.3.2 onwards.
10
11Yes this is horrible. Better solutions welcome.
12
13There is more info in the bug: [YOCTO #14521]
14
15Upstream-Status: Inappropriate [this patch is native only]
16Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
17
18Index: git/Makefile.in
19===================================================================
20--- git.orig/Makefile.in
21+++ git/Makefile.in
22@@ -122,7 +122,7 @@ libpseudo: $(LIBPSEUDO)
23 $(LIBPSEUDO): $(WRAPOBJS) pseudo_client.o pseudo_ipc.o $(SHOBJS) | $(LIB)
24 $(CC) $(CFLAGS) $(CFLAGS_PSEUDO) -shared -o $(LIBPSEUDO) \
25 pseudo_client.o pseudo_ipc.o \
26- $(WRAPOBJS) $(SHOBJS) $(LDFLAGS) $(CLIENT_LDFLAGS)
27+ $(WRAPOBJS) $(SHOBJS) $(LDFLAGS) -Lprebuilt/$(shell uname -m)-linux/lib/ $(CLIENT_LDFLAGS)
28
29 # *everything* now relies on stuff that's generated in the
30 # wrapper process.
31Index: git/pseudo_wrappers.c
32===================================================================
33--- git.orig/pseudo_wrappers.c
34+++ git/pseudo_wrappers.c
35@@ -100,10 +100,13 @@ static void libpseudo_atfork_child(void)
36 pseudo_mutex_holder = 0;
37 }
38
39+extern void *__dso_handle;
40+extern int __register_atfork (void (*) (void), void (*) (void), void (*) (void), void *);
41+
42 static void
43 _libpseudo_init(void) {
44 if (!_libpseudo_initted)
45- pthread_atfork(NULL, NULL, libpseudo_atfork_child);
46+ __register_atfork (NULL, NULL, libpseudo_atfork_child, &__dso_handle == NULL ? NULL : __dso_handle);
47
48 pseudo_getlock();
49 pseudo_antimagic();
diff --git a/meta/recipes-devtools/pseudo/pseudo_git.bb b/meta/recipes-devtools/pseudo/pseudo_git.bb
index dacaef1a66..79b7123e38 100644
--- a/meta/recipes-devtools/pseudo/pseudo_git.bb
+++ b/meta/recipes-devtools/pseudo/pseudo_git.bb
@@ -5,6 +5,10 @@ SRC_URI = "git://git.yoctoproject.org/pseudo;branch=oe-core \
5 file://fallback-passwd \ 5 file://fallback-passwd \
6 file://fallback-group \ 6 file://fallback-group \
7 " 7 "
8SRC_URI:append:class-native = " \
9 http://downloads.yoctoproject.org/mirror/sources/pseudo-prebuilt-2.33.tar.xz;subdir=git/prebuilt;name=prebuilt \
10 file://older-glibc-symbols.patch"
11SRC_URI[prebuilt.sha256sum] = "ed9f456856e9d86359f169f46a70ad7be4190d6040282b84c8d97b99072485aa"
8 12
9SRCREV = "b988b0a6b8afd8d459bc9a2528e834f63a3d59b2" 13SRCREV = "b988b0a6b8afd8d459bc9a2528e834f63a3d59b2"
10S = "${WORKDIR}/git" 14S = "${WORKDIR}/git"