Building DBD::Sybase, I want to add /usr/local/dept/lib to the RPATH in the .so. Defining CCFLAGS or LDDLFLAGS on the Makefile.PL command line doesn't work. Mr. Peppler suggested I try here. I will forward any fix to him for future versions.

A normal invocation produces a link command like this:
gcc -L/usr/local/dept/lib \ -shared \ -O2 \ -g \ -pipe \ -Wall \ -Wp,-D_FORTIFY_SOURCE=2 \ -fexceptions \ -fstack-protector \ --param=ssp-buffer-size=4 \ -m64 \ -mtune=generic Sybase.o dbdimp.o \ -o blib/arch/auto/DBD/Sybase/Sybase.so
I can add the RPATH manually by relinking thus:
$ sh -x relink && readelf -d blib/arch/auto/DBD/Sybase/Sybase.so | gre +p -i rpath + gcc -L/usr/local/dept/lib -Wl,-R/usr/local/dept/lib -shared -O2 -g - +pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --p +aram=ssp-buffer-size=4 -m64 -mtune=generic Sybase.o dbdimp.o -o blib/ +arch/auto/DBD/Sybase/Sybase.so 0x000000000000000f (RPATH) Library rpath: [/usr/local/de +pt/lib]
but using LDDLFLAGS damages the command line:
$ perl Makefile.PL PREFIX=$DEPT/perl LDDLFLAGS=-Wl,-R$DEPT/lib < answe +rs && rm -f nohup.out && nohup make || grep ^gcc nohup.out | tail -1 Unknown Client Library version - assuming FreeTDS. ... Writing Makefile for DBD::Sybase nohup: appending output to `nohup.out' gcc -Wl,-R/usr/local/dept/lib Sybase.o dbdimp.o -o blib/arch/auto/DB +D/Sybase/Sybase.so
Many thanks. --jkl

In reply to adding RPATH to Sybase.so by jklowden

Title:
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, details, 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, summary, 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.