in reply to Re: How To Link -lperl to Extensions During Build
in thread How To Link -lperl to Extensions During Build

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

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

Replies are listed 'Best First'.
Re^3: How To Link -lperl to Extensions During Build
by Anonymous Monk on May 12, 2015 at 14:01 UTC

    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?

        Well, this is totally convoluted. The build process does not use -lperl when compiling dynamic extensions. To make it happen, I tried something like this:

        ./Configure -des -Dprefix=/foo -Duseshrplib -Alddlflags="-shared -O2 - +Wl,-E,-L/foo/lib/perl5/5.20.2/armv7l-linux-android/CORE,-as-needed,-l +perl,-no-as-needed" make libperl.so COMMA=, SHRPLDFLAGS='$(subst $(COMMA)-lperl,,$(LDDLFLA +GS))' mkdir -p /foo/lib/perl5/5.20.2/armv7l-linux-android/CORE/ cp libperl.so /foo/lib/perl5/5.20.2/armv7l-linux-android/CORE/ make; make install
        Mind you, I don't actually have an android setup to play with...

      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

        FYI...running make distclean cleared up the error in the previous reply, but the original error remains