Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

Esteemed knowers of things Perl:

I'm get relocation errors when testing Crypt::SSLeay against OpenSSL 0.9.7 (the version bundled with SunOS 5.10). I've been using GCC in the past successfully, setting RPATH through LDDLFLAGS=-Wl.

Check it out:

cpan[1]> o conf $CPAN::Config options from /export/home/pprepago/.cpan/CPAN/MyConfig.p +m: ... make [/usr/sfw/bin/gmake] make_arg [] make_install_arg [] make_install_make_command [/usr/sfw/bin/gmake] makepl_arg [LDDLFLAGS="-m64 -G -Wl,-rpath,/usr/sfw/lib/64/ +"] mbuild_arg [] mbuild_install_arg [] ... cpan[2]> make Crypt::SSLeay ... /my_path_to/perl5/bin/perl /my_path_to/perl5/lib/perl5/site_perl/5.18. +0/ExtUtils/xsubpp -typemap /my_path_to/perl5/lib/perl5/5.18.0/ExtUti +ls/typemap -typemap typemap SSLeay.xs > SSLeay.xsc && mv SSLeay.xsc +SSLeay.c gcc -c -mcpu=v9 -m64 -fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE +-D_FILE_OFFSET_BITS=64 -DPERL_USE_SAFE_PUTENV -O2 -DVERSION=\"0.64\ +" -DXS_VERSION=\"0.64\" -fPIC "-I/my_path_to/perl5/lib/perl5/5.18.0/s +un4-solaris-64/CORE" SSLeay.c rm -f blib/arch/auto/Crypt/SSLeay/ LD_RUN_PATH="/usr/lib/sparcv9" gcc -m64 -G -Wl,-rpath,/usr/sfw/lib/64 +/ SSLeay.o -o blib/arch/auto/Crypt/SSLeay/ \ -lz \ ... /my_path_to/perl5/bin/perl -MExtUtils::Command::MM -e 'cp_nonempty' -- + blib/arch/auto/Crypt/SSLeay/ 644 ... /usr/sfw/bin/gmake -- OK 'YAML' not installed, will not store persistent state cpan[3]> test Crypt::SSLeay ... PERL_DL_NONLAZY=1 /my_path_to/perl5/bin/perl "-MExtUtils::Command::MM" + "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness +(0, 'blib/lib', 'blib/arch')" t/*.t t/00-basic.t .... 1/12 # Failed test 'use Crypt::SSLeay;' # at t/00-basic.t line 6. # Tried to use 'Crypt::SSLeay'. # Error: Can't load '/export/home/pprepago/.cpan/build/Crypt-SSLe +ay-0.64-dCcYQu/blib/arch/auto/Crypt/SSLeay/' for module Cryp +t::SSLeay: perl: fatal: relocation error: file /export/home/ +pprepago/.cpan/build/Crypt-SSLeay-0.64-dCcYQu/blib/arch/auto/Crypt/SS +Leay/ symbol SSL_alert_type_string_long: referenced symbol +not found at /my_path_to/perl5/lib/perl5/5.18.0/sun4-solaris-64/DynaL line 190.

Bummer. Let's check for the 'missing' symbol and that has the right RPATH:

$ file /usr/sfw/lib/64/ blib/arch/auto/Crypt/SSLeay/ /usr/sfw/lib/64/ ELF 64-bit MSB dynamic lib SPARCV9 Ver +sion 1, dynamically linked, not stripped, no debugging information av +ailable blib/arch/auto/Crypt/SSLeay/ ELF 64-bit MSB dynamic lib SPA +RCV9 Version 1, dynamically linked, not stripped, no debugging inform +ation available $ /usr/ccs/bin/elfdump Crypt-SSLeay-0.64-dCcYQu/blib/arch/auto/Crypt/S +SLeay/ | grep PATH [4] RUNPATH 0x6d7 /lib/64:/usr/lib/64: +/usr/sfw/lib/64:/usr/sfw/lib/64/ [5] RPATH 0x6d7 /lib/64:/usr/lib/64: +/usr/sfw/lib/64:/usr/sfw/lib/64/ $ /usr/ccs/bin/elfdump -s /usr/sfw/lib/64/ | grep SSL_a +lert_type_string_long [37] 0x0000000000033370 0x000000000000005c FUNC GLOB D 0 . +text SSL_alert_type_string_long [1387] 0x0000000000033370 0x000000000000005c FUNC GLOB D 0 . +text SSL_alert_type_string_long
perl -V:
$ /my_path_to/perl5/bin/perl -V Summary of my perl5 (revision 5 version 18 subversion 0) configuration +: Platform: osname=solaris, osvers=2.10, archname=sun4-solaris-64 uname='sunos cfprepagop01 5.10 generic_148888-05 sun4v sparc sun4v + ' config_args='-des -Dprefix=/ -Duse64bitall -Duserelocatableinc -Di +nitialinstalllocation=/foo -Dmake=/usr/sfw/bin/gmake -Dcc=gcc -Doptim +ize=-O2 -Dcf_by=arielCo' hint=recommended, useposix=true, d_sigaction=define useithreads=undef, usemultiplicity=undef useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=und +ef use64bitint=define, use64bitall=define, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='gcc', ccflags ='-mcpu=v9 -m64 -fno-strict-aliasing -pipe -D_LA +RGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DPERL_USE_SAFE_PUTENV', optimize='-O2', cppflags='-mcpu=v9 -m64 -fno-strict-aliasing -pipe' ccversion='', gccversion='3.4.3 (csl-sol210-3_4-branch+sol_rpath)' +, gccosandvers='solaris2.10' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=87654321 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=1 +6 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', + lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='gcc', ldflags =' -m64 -L/usr/lib/sparcv9 ' libpth=/usr/lib/sparcv9 /usr/lib /usr/ccs/lib libs=-lsocket -lnsl -ldl -lm -lc perllibs=-lsocket -lnsl -ldl -lm -lc libc=/usr/lib/sparcv9/, so=so, useshrplib=false, libperl=li +bperl.a gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' ' cccdlflags='-fPIC', lddlflags=' -G -m64 -L/usr/lib/sparcv9' Characteristics of this binary (from libperl): Compile-time options: HAS_TIMES PERLIO_LAYERS PERL_DONT_CREATE_GVSV PERL_HASH_FUNC_ONE_AT_A_TIME_HARD PERL_MALLOC_ +WRAP PERL_PRESERVE_IVUV PERL_SAWAMPERSAND PERL_USE_SAFE_PUTENV USE_64_BIT_ALL USE_64_BIT +_INT USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_PERLIO USE_PERL_ATOF Built under solaris Compiled at Sep 9 2013 13:09:04 @INC: /my_path_to/perl5/lib/perl5/site_perl/5.18.0/sun4-solaris-64 /my_path_to/perl5/lib/perl5/site_perl/5.18.0 /my_path_to/perl5/lib/perl5/5.18.0/sun4-solaris-64 /my_path_to/perl5/lib/perl5/5.18.0 .
Other things I've tried:
  • Supplying LD_LIBRARY_PATH=/usr/sfw/lib/64 doesn't help. LD_LIBRARY_PATH_64 is unset. LD_PRELOAD_64=/usr/sfw/lib/64/ does work.
  • ldd -s Crypt-SSLeay-0.64-*/blib/arch/auto/Crypt/SSLeay/ doesn't even mention ldd -sr complains about several SSL_* symbols missing plus some other symbols like main and Perl_*.
  • It makes no difference to use /usr/sfw/lib/64 (symlink) or /usr/sfw/lib/sparcv9

In reply to Relocation errors in Crypt::SSLeay in Solaris 10 by arielCo

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others examining the Monastery: (5)
    As of 2017-03-24 00:36 GMT
    Find Nodes?
      Voting Booth?
      Should Pluto Get Its Planethood Back?

      Results (294 votes). Check out past polls.