seank has asked for the wisdom of the Perl Monks concerning the following question:

Hello. I have a set of functionality written in Perl that has been bound to Java. I had this setup working for Perl 5.8, but I have now upgraded and built from source Perl 5.10.0 and am trying to use that instead.

The problem is, I have a Makefile looking for DynaLoader.a but it doesn't exist in this distribution. What do I do when running the Configure script to make sure it is built?

Here is a snippet of the Makefile I am trying to make valid:
Makefile:
----------------
# The Perl documentation advises to obtain compiler and linker options + from using the commands # "perl -MExtUtils::Embed -e ccopts" and "perl -MExtUtils::Embed -e ld +opts" respectively. Of the # resulting output, it seemed meaningful to use the linker options # # Wl,-E -Wl,-rpath,/usr/lib/perl5/lib/5.8.8/x86_64-linux/CORE # # This may need to be revised as our understanding of using Perl in th +is way develops. # always: -rm -f $(TARGET_SO) $(JAVAH) -d . -classpath ../build com.dajeil.dais.webui.toolki +t.DaisCliUtil $(CC) $(CFLAGS) -c -shared -fpic -pthread -D _REENTRANT $(INCL +UDES) $(SOURCES) XSInit.c $(LD) -r XSInit.o /usr/lib/perl5/5.10.0/i686-linux/auto/DynaL +oader/DynaLoader.a -o XSInit_r.o $(CC) -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.10.0/i686-linux/CORE +-shared -fpic -pthread -D _REENTRANT $(LIBS) $(OBJECTS) XSInit_r.o -o + $(TARGET_SO) cp $(TARGET_SO) ../dist
XSInit.c
------------------------
#include <jni.h> #include <EXTERN.h> #include <perl.h> #include <dlfcn.h> /* The following code was optained by running the command "perl -MExt +Utils::Embed -e xsinit -- -o perlxsi.c" and pasting the result into this file. */ EXTERN_C void boot_DynaLoader(pTHX_ CV* cv); EXTERN_C void XSInit(pTHX) { char *file = __FILE__; dXSUB_SYS; /* DynaLoader is a special case */ newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file); }

Replies are listed 'Best First'.
Re: perl-5.10.0: Where is DynaLoader.a?
by almut (Canon) on Jul 25, 2008 at 12:41 UTC

    With 5.10.0, just don't link against DynaLoader.a any longer. Its contents have been moved into libperl.a / libperl.so.

    .../lib/5.10.0/i686-linux/CORE $ nm libperl.a | grep Dyna DynaLoader.o: 0000000000000790 T boot_DynaLoader 00000000000006a0 T XS_DynaLoader_dl_error 0000000000000380 T XS_DynaLoader_dl_find_symbol 0000000000000540 T XS_DynaLoader_dl_install_xsub 0000000000000090 T XS_DynaLoader_dl_load_file 00000000000004e0 T XS_DynaLoader_dl_undef_symbols 00000000000001f0 T XS_DynaLoader_dl_unload_file
Re: perl-5.10.0: Where is DynaLoader.a?
by moritz (Cardinal) on Jul 25, 2008 at 12:05 UTC
    My perl-5.10.0 installation only contains a DynaLoader.o. I know next to nothing about the various object files, but maybe that one works for your?
      My perl-5.10.0 installation only contains a DynaLoader.o

      Are you sure ? My 5.10 installations don't contain either DynaLoader.a or DynaLoader.o. There's a DynaLoader.o in the build tree - but not anywhere in the perl installation that I can see.

      For pre-5.10 I find that auto/DynaLoader/DynaLoader.a exists.

      Cheers,
      Rob
      I think it is strange that any distribution of software would have object files in it. It should consist only only of archives *.a, shared objects *.so, and additionally in the case of Perl *.pm, *.pl, *.al, ... . The fact that you're dist has any *.o in it, suggests to me that it was built, but not 'installed' correctly.

      Since I built and ran 'make install' I don't have any *.o files. More relevantly, the only DynaLoader-related files I have are:
      native]$ ls /usr/lib/perl5/5.10.0/i686-linux/auto/DynaLoader/ autosplit.ix dl_expandspec.al dl_findfile.al dl_find_symbol_anywher +e.al native]$ /usr/lib/perl5/5.10.0/i686-linux/DynaLoader.pm

      Thanks for the response, but I'm afraid it doesn't help.
Re: perl-5.10.0: Where is DynaLoader.a?
by Anonymous Monk on Jul 25, 2008 at 12:16 UTC
      Inaccurate statement. If you run 'perl -MExtUtils::Embed -e ldopts' nilly-willy on an arbitrary perl distribution, then yes you might find, as in you're case, that there is no DynaLoader.a mentioned.That does not mean that is the case for all dists.

      [ @ ~]$ perl -v This is perl, v5.8.8 built for i386-linux-thread-multi Copyright 1987-2006, Larry Wall Perl may be copied only under the terms of either the Artistic License + or the GNU General Public License, which may be found in the Perl 5 source ki +t. Complete documentation for Perl, including FAQ lists, should be found +on this system using "man perl" or "perldoc perl". If you have access to + the Internet, point your browser at http://www.perl.org/, the Perl Home Pa +ge. [@localhost ~]$ perl -MExtUtils::Embed -e ldopts -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE - +L/usr/local/lib /usr/lib/perl5/5.8.8/i386-linux-thread-multi/auto/Dyn +aLoader/DynaLoader.a -L/usr/lib/perl5/5.8.8/i386-linux-thread-multi/C +ORE -lperl -lresolv -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc [@localhost ~]$

        Well then:

        qwurx [shmem] ~ > perl5.10.0 -MExtUtils::Embed -e ldopts -Wl,-E -Wl,-rpath,/usr/local/lib/perl5/5.10.0/i386-linux-thread-multi/ +CORE -L/usr/local/lib -L/usr/local/lib/perl5/5.10.0/i386-linux-thre +ad-multi/CORE -lperl -lresolv -lnsl -ldl -lm -lcrypt -lutil -lpthread + -lc

        Use these for perl 5.10. boot_DynaLoader is in libperl.so.

        --shmem

        _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                      /\_¯/(q    /
        ----------------------------  \__(m.====·.(_("always off the crowd"))."·
        ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
        We're talking about perl-5.10, and if you read the links, you'll know DynaLoader.a moved.