[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: rev 1015 - trunk/subversion/bindings/ruby

From: Yoshiki Hayashi <yoshiki_at_xemacs.org>
Date: 2002-01-23 10:23:49 CET

Justin Erenkrantz <jerenkrantz@ebuilt.com> writes:

> (Since I'm relatively new to the SVN lists, I don't know what
> patch you are talking about - do you have a link?)

You can find the patch to Subversion at
http://subversion.tigris.org/servlets/ReadMsg?msgId=43827&listName=dev

> APR should be handling threading correctly - if not, we need to
> fix that. -- justin

APR handles threading in normal cases but it does not have
enough flags for DSO libraries. This is highly system
dependent, so I start with the system I'm using. I'm using
Debian unstable, Linux 2.4.18pre2 and glibc 2.2.4, and gcc
is
% gcc -v
Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.4/specs
gcc version 2.95.4 (Debian prerelease)

My system has pthread so APR adds -pthread to CFLAGS. This
flag is OK if the application is also compiled with flags
APR provides. But in the case of DSO, you have no control
over the application and since Ruby has no native thread
support, it is not compiled with -pthread. When Ruby
interpreter tries to load Subversion bindings (svn.so), it
links in libapr and bombs out issuing the following error:

relocation error: /usr/local/lib/libapr.so.0: undefined symbol: pthread_mutexattr_init

If svn.so is linked with -lpthread, it runs fine. I
actually add it explicitly when I build Ruby bindings. The
flag munging Greg referred was that my first patch add
-lpthread to LDFLAGS when -pthread option is present in
CFLAGS to work around above problem.

I have written small test program so that others can also
see what happens. It is attached in this mail. I hardcoded
CFLAGS etc so I doubt it runs on any systems other than
Linux. The values are directly taken from APRVARS (because
when I wrote it, there was no apr-config) but -pthread is
removed when main.c is compiled. When you run ./main, then
you'll also see above error. main.c corresponds to Ruby
interpreter and test.so corresponds to svn.so.

Now that I think of it, may be we can just say "when you
want to compile ruby bindings on Linux, do LDFLAGS=-lpthread
./configure --enable-ruby-bindings"...

-- 
Yoshiki Hayashi

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Received on Sat Oct 21 14:36:58 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.