Package: massivethreads
Version: 1.00-4
Severity: serious
Tags: patch experimental
Justification: FTBFS
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu kinetic ubuntu-patch

Dear maintainer,

In Ubuntu the massivethreads package FTBFS because Ubuntu has moved to glibc
2.34 which includes a refactoring of the pthreads implementation:

[...]
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -Wdate-time -D_FORTIFY_SOURCE=2 
-D_GNU_SOURCE -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/<<PKGBUILDDIR>>/include 
-DMYTH_WRAP=MYTH_WRAP_DL -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. 
-fstack-protector-strong -Wformat -Werror=format-security -c 
myth_wrap_pthread.c  -fPIC -DPIC -o .libs/libmyth_dl_la-myth_wrap_pthread.o
[...]
/tmp/ccbMBQpP.s: Assembler messages:
/tmp/ccbMBQpP.s:27485: Error: symbol `sched_yield' is already defined
make[4]: *** [Makefile:852: libmyth_dl_la-myth_wrap_pthread.lo] Error 1
[...]

  (https://launchpad.net/ubuntu/+source/massivethreads/1.00-4/+build/23574059)

With the help of Michael Hudson-Doyle, I've uploaded the attached
non-obvious patch to Ubuntu which fixes the build failure.

Debian currently only has glibc 2.34 in experimental, but of course will be
updating at some point.

Please consider including the attached patch in Debian.

Thanks,
-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                   https://www.debian.org/
slanga...@ubuntu.com                                     vor...@debian.org
diff -Nru massivethreads-1.00/debian/patches/glibc-2.34-compat.patch 
massivethreads-1.00/debian/patches/glibc-2.34-compat.patch
--- massivethreads-1.00/debian/patches/glibc-2.34-compat.patch  1969-12-31 
16:00:00.000000000 -0800
+++ massivethreads-1.00/debian/patches/glibc-2.34-compat.patch  2022-07-07 
17:33:35.000000000 -0700
@@ -0,0 +1,26 @@
+Description: hack around pthread_yield() definition for glibc 2.34 compat
+ glibc 2.34 treats pthread_yield() as a deprecated alias for sched_yield()
+ so in order to provide a wrapper around pthread_yield, some ASM magic
+ is required.
+Author: Michael Hudson-Doyle <michael.hud...@canonical.com>,
+        Steve Langasek <steve.langa...@ubuntu.com>
+Last-Update: 2022-07-07
+Forwarded: no
+
+Index: massivethreads-1.00/src/myth_wrap_pthread.c
+===================================================================
+--- massivethreads-1.00.orig/src/myth_wrap_pthread.c
++++ massivethreads-1.00/src/myth_wrap_pthread.c
+@@ -567,7 +567,12 @@
+ 
+ #if defined(HAVE_PTHREAD_YIELD)
+ /* pthread_yield (3)    - yield the processor */
++#if MYTH_WRAP == MYTH_WRAP_DL
++extern int pthread_yield_foo (void) __asm__ ("" "pthread_yield");
++int __wrap(pthread_yield_foo)(void) {
++#else
+ int __wrap(pthread_yield)(void) {
++#endif
+   int _ = enter_wrapped_func(0);
+   int ret;
+   (void)_;
diff -Nru massivethreads-1.00/debian/patches/series 
massivethreads-1.00/debian/patches/series
--- massivethreads-1.00/debian/patches/series   2022-01-08 20:38:14.000000000 
-0800
+++ massivethreads-1.00/debian/patches/series   2022-07-07 16:32:45.000000000 
-0700
@@ -3,3 +3,4 @@
 0003-Prevent-myth_get_current_env-from-being-inlined-on-a.patch
 0004-tests-Fix-build-on-x86_32.patch
 0005-Add-support-sparc64.patch
+glibc-2.34-compat.patch

Reply via email to