diff options
Diffstat (limited to 'meta/recipes-devtools/pseudo/files/older-glibc-symbols.patch')
| -rw-r--r-- | meta/recipes-devtools/pseudo/files/older-glibc-symbols.patch | 49 |
1 files changed, 49 insertions, 0 deletions
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 @@ | |||
| 1 | If we link against a newer glibc 2.34 and then try and our LD_PRELOAD is run against a | ||
| 2 | binary on a host with an older libc, we see symbol errors since in glibc 2.34, pthread | ||
| 3 | and dl are merged into libc itself. | ||
| 4 | |||
| 5 | We need to use the older form of linking so use glibc binaries from an older release | ||
| 6 | to force this. We only use minimal symbols from these anyway. | ||
| 7 | |||
| 8 | pthread_atfork is problematic, particularly on arm so use the internal glibc routine | ||
| 9 | it maps too. This was always present in the main libc from 2.3.2 onwards. | ||
| 10 | |||
| 11 | Yes this is horrible. Better solutions welcome. | ||
| 12 | |||
| 13 | There is more info in the bug: [YOCTO #14521] | ||
| 14 | |||
| 15 | Upstream-Status: Inappropriate [this patch is native only] | ||
| 16 | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> | ||
| 17 | |||
| 18 | Index: 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. | ||
| 31 | Index: 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(); | ||
