After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 106097 - Build fails on SPARC64 running Linux 2.4.20 SMP
Build fails on SPARC64 running Linux 2.4.20 SMP
Status: VERIFIED INCOMPLETE
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: 0.6.x
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2003-02-14 15:42 UTC by Jochen Kmietsch
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: 2.1/2.2



Description Jochen Kmietsch 2003-02-14 15:42:24 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
Comment 1 Benjamin Otte (Company) 2003-02-14 16:55:06 UTC
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
Comment 2 Jochen Kmietsch 2003-02-14 17:18:15 UTC
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
Comment 3 Christian Fredrik Kalager Schaller 2003-02-24 12:19:04 UTC
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? 
Comment 4 Jochen Kmietsch 2003-02-25 18:53:20 UTC
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?
Comment 5 Wim Taymans 2003-02-25 19:23:18 UTC
the SPARC asm is broken; using the default implementation is the only
option for now. Can somebody provide an asm atomic int/swap
implementation?
Comment 6 Thomas Vander Stichele 2003-12-16 16:28:24 UTC
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