I've been meditating unsuccessfully on a perplexing problem oh wise ones. When I try to compile modperl.so against 5.12.2 libperl.a, I get a PIC error:

ld: fatal: relocation error: R_SPARC_H44: file /dsk01/apache/app/build +2064/perl-5.12.2/lib/5.12.2/sun4-solaris-thread-multi-64/CORE/libperl +.a(op.o): symbol <unknown>: relocations based on the ABS44 coding mod +el can not be used in building a shared object

When I check libperl.a using elfdump, it has no GOT.

My compiler is sparc-sun-solaris2.10-gcc (GCC) 4.3.3 (20091210) (gccfss)

My perl is built as:

CC="gcc -m64 -mcpu=niagara2 -O3 -R${GCCRT_DIR}/lib/sparcv9 -L${GCCRT_D +IR}/lib/sparcv9 -R/usr/sfw/lib/64 -L/usr/sfw/lib/64" sh Configure -d -Dcc="${CC}" -Dprefix=${PERL_DIR} -Dusethreads

Most of the links I can find on this problem relate it to the Solaris compiler cc option -xcode, but I'm using gcc. I assumed that meant I needed to add the -fPIC option to gcc; however, that did not create a GOT either.

Addendum:

Actually my compile just finished and libperl.a still doesn't have a GOT, but by adding the -fPIC flag to my perl compile, mod_perl.so was able to link. I'm now thoroughly confused...


In reply to ModPerl not happy with libperl.a by RachunZero

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.