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

Problems building swig perl bindings

From: <Mathias.Weinert_at_gfa-net.de>
Date: 2005-08-10 15:17:56 CEST

Hi there

I want to build swig perl bindings under cygwin but always get errors. I
have installed swig 1.3.24 (from cygwin setup) and subversion 1.2.1 which
I built myself.

When I say "make swig-pl" I get the following (I just filled in some line
feeds):

/bin/bash /d/Subversion/subversion-1.2.1/libtool --tag=CC --silent
--mode=compile gcc -DCYGWIN -g -O2 -g -O2 -DNEON_ZLIB -DNEON_SSL
-I/d/Subversion/subversion-1.2.1/subversion/bindings/swig
-I/d/Subversion/subversion-1.2.1/subversion/include
-I/usr/share/swig/1.3.24 -DSVN_SWIG_VERSION=103024
-DSWIG_TABLE_TYPE=subversion -I/usr/local/apr/include/apr-0 -I/usr/include
  -DPERL_USE_SAFE_PUTENV -fno-strict-aliasing -pipe -I/usr/local/include
-I/usr/lib/perl5/5.8/cygwin/CORE -I./subversion/include -I./subversion
-I/usr/include/neon -I/usr/local/apr/include/apr-0 -I/usr/include -o
subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.lo -c
/d/Subversion/subversion-1.2.1/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c

In file included from
/d/Subversion/subversion-1.2.1/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c:37:
/usr/share/swig/1.3.24/perl5/perlrun.swg: In function
`SWIG_Perl_ConvertPtr':
/usr/share/swig/1.3.24/perl5/perlrun.swg:252: warning: cast to pointer
from integer of different size
/d/Subversion/subversion-1.2.1/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c:
In function `_swig_perl_type_query':
/d/Subversion/subversion-1.2.1/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c:61:
warning: cast to pointer from integer of different size
/d/Subversion/subversion-1.2.1/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c:64:
warning: cast from pointer to integer of different size

cd subversion/bindings/swig/perl/libsvn_swig_perl && /bin/bash
/d/Subversion/subversion-1.2.1/libtool --tag=CC --silent --mode=link gcc
-g -O2 -g -O2 -DNEON_ZLIB -DNEON_SSL -rpath /usr/local/lib -o
libsvn_swig_perl-1.la -no-undefined swigutil_pl.lo
../../../../../subversion/libsvn_subr/libsvn_subr-1.la
../../../../../subversion/libsvn_delta/libsvn_delta-1.la
/usr/lib/libaprutil-0.la -lgdbm -ldb-4.2 -lexpat -liconv
/usr/local/apr/lib/libapr-0.la -lcrypt -lintl

Creating library file: .libs/libsvn_swig_perl-1.dll.a

.libs/swigutil_pl.o(.text+0x7f8): In function
`SWIG_Perl_GetTypeListHandle':
/usr/share/swig/1.3.24/perl5/perlrun.swg:176: undefined reference to
`_Perl_Gthr_key_ptr'
.libs/swigutil_pl.o(.text+0x81a):/usr/share/swig/1.3.24/perl5/perlrun.swg:176:
undefined reference to `_Perl_get_sv'
.libs/swigutil_pl.o(.text+0x849):/usr/share/swig/1.3.24/perl5/perlrun.swg:178:
undefined reference to `_Perl_Gthr_key_ptr'
.libs/swigutil_pl.o(.text+0x85f):/usr/share/swig/1.3.24/perl5/perlrun.swg:178:
undefined reference to `_Perl_sv_2iv'
[...]

The problem of the missing references to _Perl_... seem to come from the
missing library libperl.
I can resolve it by adding

SWIG_PL_LIBS = -L/usr/lib/perl5/5.8/cygwin/CORE -lperl

to Makefile and add $(SWIG_PL_LIBS) to the line

subversion/bindings/swig/perl/libsvn_swig_perl/libsvn_swig_perl-1.la:
$(libsvn_swig_perl_DEPS)
        cd subversion/bindings/swig/perl/libsvn_swig_perl && $(LINK)
$(SWIG_PL_LIBS) -o libsvn_swig_perl-1.la $(LT_NO_UNDEFINED)
$(libsvn_swig_perl_OBJECTS) $(LSWIGPL)
../../../../../subversion/libsvn_subr/libsvn_subr-1.la
../../../../../subversion/libsvn_delta/libsvn_delta-1.la
$(SVN_APRUTIL_LIBS) $(SVN_APR_LIBS) $(LIBS)

in build-outputs.mk (for now this should be enough although it would be
better to enter this in build.conf and Makefile.in).

After doing this "make swig-pl" results in (again I added some line
feeds):

cd subversion/bindings/swig/perl/libsvn_swig_perl && /bin/bash
/d/Subversion/subversion-1.2.1/libtool --tag=CC --silent --mode=link gcc
-g -O2 -g -O2 -DNEON_ZLIB -DNEON_SSL -rpath /usr/local/lib
-L/usr/lib/perl5/5.8/cygwin/CORE -lperl -o libsvn_swig_perl-1.la
-no-undefined swigutil_pl.lo
../../../../../subversion/libsvn_subr/libsvn_subr-1.la
../../../../../subversion/libsvn_delta/libsvn_delta-1.la
/usr/lib/libaprutil-0.la -lgdbm -ldb-4.2 -lexpat -liconv
/usr/local/apr/lib/libapr-0.la -lcrypt -lintl

Creating library file: .libs/libsvn_swig_perl-1.dll.a

.libs/swigutil_pl.o(.text+0x4637): In function `svn_swig_pl_make_pool':
/d/Subversion/subversion-1.2.1/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c:1232:
undefined reference to `_svn_swig_pl_get_current_pool'
.libs/swigutil_pl.o(.text+0x4640):/d/Subversion/subversion-1.2.1/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c:1236:
undefined reference to `_svn_swig_pl_get_current_pool'
.libs/swigutil_pl.o(.text+0x4d97): In function `svn_swig_pl_make_stream':
/d/Subversion/subversion-1.2.1/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c:1337:
undefined reference to `_svn_swig_pl_get_current_pool'
collect2: ld returned 1 exit status
make: ***
[subversion/bindings/swig/perl/libsvn_swig_perl/libsvn_swig_perl-1.la]
Error 1

Does anybody have an idea what I have to do to avoid this undefined
reference?

I already tried to just comment all occurences of
svn_swig_pl_get_current_pool in swigutil_pl.c just to this how it will go
on and ended it up with this (again with additional some line feeds) :

[...]
make -f Makefile.repos
make[2]: Entering directory
`/d/Subversion/subversion-1.2.1/subversion/bindings/swig/perl/native'
[...]
gcc -shared -o _Repos.dll -Wl,--out-implib=lib_Repos.dll.a
-Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--stack,8388608 \
-s -L/usr/local/lib svn_repos.o
/usr/lib/perl5/5.8/cygwin/CORE/libperl.dll.a -L/usr/local/apr/lib -lapr-0
-lcrypt
-L/d/Subversion/subversion-1.2.1/subversion/bindings/swig/perl/libsvn_swig_perl/.libs
-L/d/Subversion/subversion-1.2.1/subversion/libsvn_client/.libs
-L/d/Subversion/subversion-1.2.1/subversion/libsvn_delta/.libs
-L/d/Subversion/subversion-1.2.1/subversion/libsvn_fs/.libs
-L/d/Subversion/subversion-1.2.1/subversion/libsvn_ra/.libs
-L/d/Subversion/subversion-1.2.1/subversion/libsvn_repos/.libs
-L/d/Subversion/subversion-1.2.1/subversion/libsvn_wc/.libs
-L/d/Subversion/subversion-1.2.1/subversion/libsvn_diff/.libs
-L/d/Subversion/subversion-1.2.1/subversion/libsvn_subr/.libs
-L/d/Subversion/subversion-1.2.1/subversion/libsvn_ra_local/.libs
-L/d/Subversion/subversion-1.2.1/subversion/libsvn_ra_svn/.libs
-L/d/Subversion/subversion-1.2.1/subversion/libsvn_ra_dav/.libs
-L/d/Subversion/subversion-1.2.1/subversion/libsvn_fs_base/.libs
-L/d/Subversion/subversion-1.2.1/subversion/libsvn_fs_fs/.libs
-lsvn_client-1 -lsvn_delta-1 -lsvn_fs-1 -lsvn_ra-1 -lsvn_repos-1
-lsvn_wc-1 -lsvn_diff-1 -lsvn_subr-1 -lsvn_swig_perl-1

Creating library file: lib_Repos.dll.a

svn_repos.o(.text+0x6daf): In function `_wrap_svn_repos_pre_get_file':
/d/Subversion/subversion-1.2.1/subversion/bindings/swig/perl/native/svn_repos.c:2278:
undefined reference to `_svn_repos_pre_get_file'

collect2: ld returned 1 exit status

perlld: *** system() failed to execute
[...]

After also commenting svn_repos_pre_get_file I am able to build the pearl
bindings (although they will not be correct due to the commented things).

So again the question if anybody has an idea what I have to do to avoid
this undefined reference?

Is there anyone who managed to build the swig perl bindings with cygwin,
subversion 1.2.1 and swig 1.3.24 (or any other version)?

Thanks a lot

Mathias
Received on Wed Aug 10 15:19:01 2005

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