DynaLoader.a: could not read symbols: Bad value - Can"t build on vanilla Red Hat

DynaLoader.a: could not read symbols: Bad value - Can"t build on vanilla Red Hat

am 16.09.2008 09:07:38 von Bianca Taylor

Hello,

We're running RedHat (x86_64-linux) and have Perl 5.8.8 and Apache 2.2.9
installed, (both from source).

The Perl build says that my Linux is: 2.6.18-92.el5xen
and /etc/issue says it is: Red Hat Enterprise Linux Server release 5.2
(Tikanga)

When I try to install mod_perl 2.0.4 I keep getting the same error at
the 'make' step.

modperl_exports.lo -Wl,-E -L/usr/local/lib /tmp/unisolve/perl/lib/5.8.8/x86_64-linux/auto/DynaLoader/Dy naLoader.a -L/tmp/unisolve/perl/lib/5.8.8/x86_64-linux/CORE -lperl -lnsl -ldl -lm -lcrypt -lutil -lc
\
-o mod_perl.so
/bin/ld: /tmp/unisolve/perl/lib/5.8.8/x86_64-linux/auto/DynaLoader/Dy naLoader.a(DynaLoader.o):
relocation R_X86_64_32 against `a local symbol' can not be used when making a
shared object; recompile with -fPIC
/tmp/unisolve/perl/lib/5.8.8/x86_64-linux/auto/DynaLoader/Dy naLoader.a: could
not read symbols: Bad value
collect2: ld returned 1 exit status
make[1]: *** [mod_perl.so] Error 1
make[1]: Leaving directory `/home/unisolve/mod_perl-2.0.4/src/modules/perl'
make: *** [modperl_lib] Error 2


The error above shows that I am using a local version of Perl, but I get the
same error with the Perl I built in /usr/local/....

Does anyone have any suggestions?

Thanks in advance
Regards

Bianca
--
Unisolve Pty Ltd -
Melbourne Australia

Re: DynaLoader.a: could not read symbols: Bad value - Can"t buildon vanilla Red Hat

am 16.09.2008 22:54:20 von wrowe

Bianca Taylor wrote:
> /bin/ld: /tmp/unisolve/perl/lib/5.8.8/x86_64-linux/auto/DynaLoader/Dy naLoader.a(DynaLoader.o):
> relocation R_X86_64_32 against `a local symbol' can not be used when making a
> shared object; recompile with -fPIC
> /tmp/unisolve/perl/lib/5.8.8/x86_64-linux/auto/DynaLoader/Dy naLoader.a: could
> not read symbols: Bad value
> collect2: ld returned 1 exit status
> make[1]: *** [mod_perl.so] Error 1
> make[1]: Leaving directory `/home/unisolve/mod_perl-2.0.4/src/modules/perl'
> make: *** [modperl_lib] Error 2

Perl itself makes several bad calls w.r.t. CFLAGS, LDFLAGS, SHLDFLAGS etc,
that are propagated also into config_heavy.pl. On several platforms I've
noted that -fPIC is ignored, on others I've noted that specific flag values
are dropped for the building of shared libs.

It's a matter of working backwards from modperl's build into the config
script of perl to determine where perl went wrong.

Re: DynaLoader.a: could not read symbols: Bad value - Can"t buildon vanilla Red Hat

am 16.09.2008 23:29:58 von Fred Moyer

William A. Rowe, Jr. wrote:
> Bianca Taylor wrote:
>> /bin/ld:
>> /tmp/unisolve/perl/lib/5.8.8/x86_64-linux/auto/DynaLoader/Dy naLoader.a(DynaLoader.o):
>> relocation R_X86_64_32 against `a local symbol' can not be used when
>> making a shared object; recompile with -fPIC
>> /tmp/unisolve/perl/lib/5.8.8/x86_64-linux/auto/DynaLoader/Dy naLoader.a:
>> could not read symbols: Bad value
>> collect2: ld returned 1 exit status
>> make[1]: *** [mod_perl.so] Error 1
>> make[1]: Leaving directory
>> `/home/unisolve/mod_perl-2.0.4/src/modules/perl'
>> make: *** [modperl_lib] Error 2
>
> Perl itself makes several bad calls w.r.t. CFLAGS, LDFLAGS, SHLDFLAGS etc,
> that are propagated also into config_heavy.pl. On several platforms I've
> noted that -fPIC is ignored, on others I've noted that specific flag values
> are dropped for the building of shared libs.
>
> It's a matter of working backwards from modperl's build into the config
> script of perl to determine where perl went wrong.
>

The solution should be as easy as recompiling perl with -fPIC. Here's a
link to the list archives where this has been discussed in detail.

http://www.gossamer-threads.com/lists/engine?list=modperl;do =search_results;search_forum=forum_8;search_string=fpic;sear ch_type=AND&sb=post_time

Re: DynaLoader.a: could not read symbols: Bad value - Can"t buildon vanilla Red Hat

am 16.09.2008 23:37:33 von wrowe

Fred Moyer wrote:
> William A. Rowe, Jr. wrote:
>> Bianca Taylor wrote:
>>> /bin/ld:
>>> /tmp/unisolve/perl/lib/5.8.8/x86_64-linux/auto/DynaLoader/Dy naLoader.a(DynaLoader.o):
>>> relocation R_X86_64_32 against `a local symbol' can not be used when
>>> making a shared object; recompile with -fPIC
>>> /tmp/unisolve/perl/lib/5.8.8/x86_64-linux/auto/DynaLoader/Dy naLoader.a:
>>> could not read symbols: Bad value
>>> collect2: ld returned 1 exit status
>>> make[1]: *** [mod_perl.so] Error 1
>>> make[1]: Leaving directory
>>> `/home/unisolve/mod_perl-2.0.4/src/modules/perl'
>>> make: *** [modperl_lib] Error 2
>>
>> Perl itself makes several bad calls w.r.t. CFLAGS, LDFLAGS, SHLDFLAGS
>> etc,
>> that are propagated also into config_heavy.pl. On several platforms I've
>> noted that -fPIC is ignored, on others I've noted that specific flag
>> values
>> are dropped for the building of shared libs.
>>
>> It's a matter of working backwards from modperl's build into the config
>> script of perl to determine where perl went wrong.
>>
>
> The solution should be as easy as recompiling perl with -fPIC. Here's a
> link to the list archives where this has been discussed in detail.
>
> http://www.gossamer-threads.com/lists/engine?list=modperl;do =search_results;search_forum=forum_8;search_string=fpic;sear ch_type=AND&sb=post_time

Of course, that's what it says above. My point is, I've had perl yank -fPIC
from my demands on the build on PPC arch. Mighty kind of it, eh?

Re: DynaLoader.a: could not read symbols: Bad value - Can"t build on vanilla Red Hat

am 17.09.2008 03:50:29 von Bianca Taylor

Hello again,

....
>> The solution should be as easy as recompiling perl with -fPIC. Here's a
>> link to the list archives where this has been discussed in detail.
>>
>>
>>http://www.gossamer-threads.com/lists/engine?list=modperl; do=search_results
>>;search_forum=forum_8;search_string=fpic;search_type=AND&s b=post_time
>
>Of course, that's what it says above. My point is, I've had perl yank -fPIC
>from my demands on the build on PPC arch. Mighty kind of it, eh?



We attempted to compile perl with:

ccflags='-fPIC' sh Configure -de

(yes, make clean first)

but unfortunately to no avail. Like you said, Perl didn't seem to care -fPIC
is not used when Perl is built.

Next, we changed config.sh from -fpic to -fPIC and did the make again.
In this case Perl did use -fPIC but we get the same error, mod_perl is not
happy with the DynaLoader.

Also tried to clean everything out with 'make cleandist' first and
run ./Configure with -Doptimize='-g' to really make sure the -fPIC is passed
in.

I definitely see the -fPIC option, for example:

"...cc -c -DDEBUGGING -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -g -DVERSION=\"0.94\" -DXS_VERSION=\"0.94\" -fPIC "-I../../.."
shared.c..."

Everything seems happy until the make step in mod_perl, where I still get:


...lib/perl5/5.8.8/x86_64-linux/CORE -lperl -lnsl -ldl -lm -lcrypt -lutil -lc
\ -o mod_perl.so
/bin/ld:
/usr/local/lib/perl5/5.8.8/x86_64-linux/auto/DynaLoader/Dyna Loader.a(DynaLoa
der.o): relocation R_X86_64_32 against `a local symbol' can not be used when
making a shared object; recompile with -fPIC
/usr/local/lib/perl5/5.8.8/x86_64-linux/auto/DynaLoader/Dyna Loader.a: could
not read symbols: Bad value
collect2: ld returned 1 exit status...


So at this point, I am confident that I compile Perl with -fPIC. I read all
the ducumentation you pointed me to and that I could find, but it keeps
coming back to the same error.

Thanks again

Bianca
--
Unisolve Pty Ltd -
Melbourne Australia

Re: DynaLoader.a: could not read symbols: Bad value - Can"t buildon vanilla Red Hat

am 17.09.2008 04:08:47 von wrowe

Bianca Taylor wrote:
>
> So at this point, I am confident that I compile Perl with -fPIC. I read all
> the ducumentation you pointed me to and that I could find, but it keeps
> coming back to the same error.

You aren't... please review your shared cc flags from perl. The flag you
looked at was not a shlib cflag, but a program cflag.

Re: DynaLoader.a: could not read symbols: Bad value - Can"t build on vanilla Red Hat

am 17.09.2008 04:29:46 von Bianca Taylor

> Bianca Taylor wrote:
> > So at this point, I am confident that I compile Perl with -fPIC. I read
> > all the ducumentation you pointed me to and that I could find, but it
> > keeps coming back to the same error.
>
> On Wednesday 17 September 2008 12:08, William A. Rowe, Jr. wrote:
> You aren't... please review your shared cc flags from perl. The flag you
> looked at was not a shlib cflag, but a program cflag.


Here the whole snip for attrs.c whilst 'make'

"cc -c -DDEBUGGING -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -g -DVERSION=\"1.02\" -DXS_VERSION=\"1.02\" -fPIC "-I../.."
attrs.c
Running Mkbootstrap for attrs ()
chmod 644 attrs.bs
rm -f ../../lib/auto/attrs/attrs.so
cc -shared -L/usr/local/lib attrs.o -o ../../lib/auto/attrs/attrs.so \
\

chmod 755 ../../lib/auto/attrs/attrs.so
cp attrs.bs ../../lib/auto/attrs/attrs.bs
chmod 644 ../../lib/auto/attrs/attrs.bs
make[1]: Leaving directory `/home/unisolve/perl-5.8.8/ext/attrs' "


ok, so how do I do it?
where do I go wrong?

Thanks again

Re: DynaLoader.a: could not read symbols: Bad value - Can"t build on vanilla Red Hat

am 17.09.2008 04:59:38 von Bianca Taylor

On Wednesday 17 September 2008 12:08, you wrote:
> Bianca Taylor wrote:
> > So at this point, I am confident that I compile Perl with -fPIC. I read
> > all the ducumentation you pointed me to and that I could find, but it
> > keeps coming back to the same error.
>
> You aren't... please review your shared cc flags from perl. The flag you
> looked at was not a shlib cflag, but a program cflag.

Ok I see now what you mean.

I added -fPIC to the definitions of ccflags and cppflags in config.sh and now
I can successfully build mod_perl.

Since the makefile is being build incorrectly by the Perl installation
process, who can I report this bug to?

Kind regards

Bianca

--
Unisolve Pty Ltd -
Melbourne Australia