GNOME Bugzilla – Bug 106097
Build fails on SPARC64 running Linux 2.4.20 SMP
Last modified: 2009-08-15 18:40:50 UTC
Hello! When trying to build GStreamer on a Linux/SPARC host (SuSE 7.3, SPARC64 architecture), configure detects this: checking for asm/atomic.h... yes configure: WARNING: Atomic reference counting is out of date: doing without. checking ucontext.h usability... yes It then fails with: In file included from gstatomic.c:24: gstatomic_impl.h: In function `gst_atomic_int_dec_and_test': gstatomic_impl.h:274: `val' undeclared (first use in this function) gstatomic_impl.h:274: (Each undeclared identifier is reported only once gstatomic_impl.h:274: for each function it appears in.) make[4]: *** [libgstreamer_0.6_la-gstatomic.lo] Error 1 No big deal, I put a int val = 1; before line 274 since other CPU-Sections had that too, I hope that was a right assumption. Next problem is gcc -g -O2 -o .libs/autoplugtest autoplugtest-autoplugtest.o -pthread -Wl,--export-dynamic -L/ofc/xdt2/sys/lib -L/usr/X11R6/lib ../../gst/.libs/libgstreamer-0.6.so /ofc/xdt2/sys/lib/libxml2.so -lz -lm /ofc/xdt2/sys/lib/libgobject-2.0.so /ofc/xdt2/sys/lib/libgthread-2.0.so -lpthread /ofc/xdt2/sys/lib/libgmodule-2.0.so -ldl /ofc/xdt2/sys/lib/libglib-2.0.so /usr/lib/libpopt.so -Wl,--rpath -Wl,/ofc/xdt2/sys/lib ../../gst/.libs/libgstreamer-0.6.so: undefined reference to `___atomic_sub' ../../gst/.libs/libgstreamer-0.6.so: undefined reference to `___atomic_add' collect2: ld returned 1 exit status make[4]: *** [autoplugtest] Error 1 It seems that the code in gstatomic_impl.h, namely these lines (243-289): GST_INLINE_FUNC void gst_atomic_int_add (GstAtomicInt *aint, gint val) { register volatile int *ptr asm ("g1"); register int increment asm ("g2"); ptr = &aint->counter; increment = val; __asm__ __volatile__( "mov %%o7, %%g4\n\t" "call ___atomic_add\n\t" " add %%o7, 8, %%o7\n" : "=&r" (increment) : "0" (increment), "r" (ptr) : "g3", "g4", "g7", "memory", "cc"); } [...] which only get included on a SPARC with SMP-support in the kernel, somehow do not work. Some more info about my system: pinky:~ # uname -a Linux pinky 2.4.20-PPW #1 SMP Thu Jan 30 09:53:41 MET 2003 sparc64 unknown pinky:~ # rpm -q glibc glibc-2.2.4-45 I solved the problem by copying the generic implementation in the SPARC-section and deleting the above lines. Is this a problem with my installation or am I the first one to build GStreamer on a (actually one CPU-Slot is empty) SPARC64 box with an SMP-Kernel? And no, it is not my box :) Jochen
Sparc Support has been disabled in cvs HEAD. Somebody should just disable it in the 0.6 branch, too. See here: http://cvs.sourceforge.net/cgi- bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstatomic_impl.h.diff?r1=1.2&r 2=1.3&diff_format=u
Hello! This is very sad. But the way I read the patch it uses the generic implementation now? At least s.th. Sorry that I cannot provide coding support, but I could test if somebody fixes the code. BTW, the URL you provided was split into three lines, was that bugzilla's fault? Jochen
Sparc support disabled? Considering Brian is working on Sparc Solaris support I would think that getting GStreamer to compile on Linux for Sparc should be possible. Jochen, does CVS head compile on your SPARC machine?
Side note, s.b. should fix config.h: /* Define if the target CPU is a PPC */ #define HAVE_CPU_SPARC 1 It's a SPARC, not a PPC :) CVS (snapshot.sh, autogen.sh) fails at gstatomic_impl.h:384:2: #warning consider putting your architecture specific atomic implementations here make[4]: *** [libgstreamer_0.7_la-gstatomic.lo] Error 1 b/c gcc is running with -Werror. So I removed that from the Makefile in gst/ which made it compile, SPARC was commented out, as mentioned before, though. When I remove the "&& 0" in gstatomic_impl.h I still get gcc -g -O2 -o .libs/gst-launch gst_launch-gst-launch.o -pthread -Wl,--export-dynamic -L/ofc/xdt2/sys/lib -L/usr/X11R6/lib ../gst/.libs/libgstreamer-0.7.so /ofc/xdt2/sys/lib/libxml2.so -lz -lm /ofc/xdt2/sys/lib/libgobject-2.0.so /ofc/xdt2/sys/lib/libgthread-2.0.so -lpthread /ofc/xdt2/sys/lib/libgmodule-2.0.so -ldl /ofc/xdt2/sys/lib/libglib-2.0.so /usr/lib/libpopt.so -Wl,--rpath -Wl,/ofc/xdt2/sys/lib ../gst/.libs/libgstreamer-0.7.so: undefined reference to `___atomic_sub' ../gst/.libs/libgstreamer-0.7.so: undefined reference to `___atomic_add' collect2: ld returned 1 exit status make[2]: *** [gst-launch] Error 1 Oh, Dist is a Debian 3.0 now but the Kernel is the same as before. Any other info I can provide?
the SPARC asm is broken; using the default implementation is the only option for now. Can somebody provide an asm atomic int/swap implementation?
Hi Jochen, I added the simple fix for the config.h As for a specific sparc implementation, we need a sparc assembler coder. until then, the default implementation will be fine. Reopen this bug if you have any omre problems or ideas on how we can do the sparc assembly stuff. Thanks