in reply to How To Link -lperl to Extensions During Build

Please use the quick non-interactive Configure with -des, like Corion has shown above. For example

./Configure -des -Dprefix=... -Duseshrplib -Alddlflags='-shared -O2 -Wl,-E,-z,now'
Are you sure you want a shared libperl? Do you need shared objects linked with -lperl? Perhaps it will suffice if libperl uses options -z now and/or -z global? (Android apparently has its own elf loader; dark territory I'm afraid.)

  • Comment on Re: How To Link -lperl to Extensions During Build

Replies are listed 'Best First'.
Re^2: How To Link -lperl to Extensions During Build
by cyd (Novice) on May 12, 2015 at 12:22 UTC

    Yes, I do need a shared libperl. Yes, I do need shared objects linked with -lperl, due to Android linker limitations (any symbols referenced in shared object must be in lib explicitly linked to object. )I will try z,-now as requested...but if it assumes linker can find symbols in loaded, non-linked libs, I fear it may not work

      Hmm. Not sure what the correct approach might be, but here's one possible hack to try:

      ./Configure -des -Dprefix=/foo -Dcc=gcc -Duseshrplib make install; make distclean ./Configure -des -Dprefix=/foo -Dcc=gcc -Duseshrplib \ -Alddlflags='-shared -O2 -Wl,-E,-L/foo/lib/perl5/5.20.2/armv7l-linux +-android/CORE,-as-needed,-lperl,-no-as-needed' make install
      This would compile and install perl twice, second time linking any shared objects against libperl. You may also want a ,-rpath,/foo... in the flags. But if you make a symlink in $KBOX/usr/lib to libperl.so, then neither -L nor -rpath should be required.

        Unfortunately make failed with the same error after running the simplified configure command.

        Regarding the suggestion above, are you suggesting that I run make install even though make fails?

        This is in reply to AnonymousMonk's post...unfortunately the convoluted approach resulted in the same error

        However, I DID notice that for each extension built (? I'm guessing here), the following error was generated

        make config PERL_CORE=1 LIBPERL_A=libperl.so LINKTYPE=dynamic failed, continuing anyway...

        Unfortunately I;m new to perl so I don't know how to get the build to stop when this error occurs or what exactly is going on. I'll keep digging but feel free to chime in