in reply to MakeMaker failing to locate libs for shared objects

Try prefixing LIBS with ":nosearch", don't ask me to explain this idiocy
  • Comment on Re: MakeMaker failing to locate libs for shared objects

Replies are listed 'Best First'.
Re^2: MakeMaker failing to locate libs for shared objects
by houst0n (Novice) on Aug 01, 2010 at 20:23 UTC
    Unfortunately that didn't help.

    Thanks for the tip though I'll have a dig around ExtUtils::Liblist next.
      Unfortunately that didn't help.

      How? If -lssl -lcrypto were being removed from the LIBS argument, adding :nosearch would ensure that they aren't removed. I just tested this

      Crypt-OpenSSL-Random-0.04$ perl Makefile.PL Checking if your kit is complete... Looks good Note (probably harmless): No library found for -lssl Note (probably harmless): No library found for -lcrypto Note (probably harmless): No library found for -lmoldname Note (probably harmless): No library found for -lkernel32 Note (probably harmless): No library found for -luser32 Note (probably harmless): No library found for -lgdi32 Note (probably harmless): No library found for -lwinspool Note (probably harmless): No library found for -lcomdlg32 Note (probably harmless): No library found for -ladvapi32 Note (probably harmless): No library found for -lshell32 Note (probably harmless): No library found for -lole32 Note (probably harmless): No library found for -loleaut32 Note (probably harmless): No library found for -lnetapi32 Note (probably harmless): No library found for -luuid Note (probably harmless): No library found for -lws2_32 Note (probably harmless): No library found for -lmpr Note (probably harmless): No library found for -lwinmm Note (probably harmless): No library found for -lversion Note (probably harmless): No library found for -lodbc32 Note (probably harmless): No library found for -lodbccp32 Writing Makefile for Crypt::OpenSSL::Random Crypt-OpenSSL-Random-0.04$ grep lcrypto Makefile # LIBS => [q[-lssl -lcrypto]] Crypt-OpenSSL-Random-0.04$ perl Makefile.PL LIBS=":nosearch -lssl -lcr +ypto" Writing Makefile for Crypt::OpenSSL::Random $ grep lcrypto Makefile # MakeMaker ARGV: (q[LIBS=:nosearch -lssl -lcrypto]) # LIBS => [q[-lssl -lcrypto]] EXTRALIBS = -lssl -lcrypto -lmoldname -lkernel32 -luser32 -lgdi32 -lwi +nspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -lo leaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -l +odbccp32 LDLOADLIBS = -lssl -lcrypto -lmoldname -lkernel32 -luser32 -lgdi32 -lw +inspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -l oleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 - +lodbccp32 cd $(DISTVNAME) && $(ABSPERLRUN) Makefile.PL "LIBS=:nosearch - +lssl -lcrypto" $(PERLRUN) Makefile.PL "LIBS=:nosearch -lssl -lcrypto" LIBS=':nosearch -lssl -lcrypto' Crypt-OpenSSL-Random-0.04$
        Weird one huh?

        This isn't a case of my misusing MakeMaker, I can only assume something is apparently borked with my perl build.

        Even with :nosearch in my LIBS var, linking is still missing some options:

        /opt/csw/gcc4/bin/gcc -c -D_REENTRANT -fno-strict-aliasing -pipe -I/opt/bw/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DPERL_USE_SAFE_PUTENV -march=pentium4 -msse -msse2 -mtune=opteron -I/opt/bw/include -DVERSION=\"0.04\" -DXS_VERSION=\"0.04\" -fPIC "-I/opt/bw/lib/perl/5.12.1/distro/i386/CORE" Random.c

        Running Mkbootstrap for Crypt::OpenSSL::Random ()
        chmod 644 Random.bs
        rm -f blib/arch/auto/Crypt/OpenSSL/Random/Random.so


        gcc -G -L/opt/bw/lib/i386 -L/opt/bw/lib Random.o -o blib/arch/auto/Crypt/OpenSSL/Random/Random.so \
        \

        ^^^ Here

        When you run the testsuite, we get the relocation error:

        PERL_DL_NONLAZY=1 /opt/bw/bin/i386/perl "-Iblib/lib" "-Iblib/arch" test.pl
        1..5 Can't load 'blib/arch/auto/Crypt/OpenSSL/Random/Random.so' for module Crypt::OpenSSL::Random:

        ld.so.1: perl: fatal: relocation error:
        file blib/arch/auto/Crypt/OpenSSL/Random/Random.so: symbol RAND_bytes: referenced symbol not found at /opt/bw/lib/perl/5.12.1/distro/i386/DynaLoader.pm line 200. at test.pl line 11
        :'(