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

2008-09-16 Thread Fred Moyer

William A. Rowe, Jr. wrote:

Bianca Taylor wrote:
/bin/ld: 
/tmp/unisolve/perl/lib/5.8.8/x86_64-linux/auto/DynaLoader/DynaLoader.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/DynaLoader.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;search_type=ANDsb=post_time


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

2008-09-16 Thread William A. Rowe, Jr.

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/DynaLoader.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/DynaLoader.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;search_type=ANDsb=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

2008-09-16 Thread 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=ANDsb=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/DynaLoader.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/DynaLoader.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 build on vanilla Red Hat

2008-09-16 Thread William A. Rowe, Jr.

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

2008-09-16 Thread 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

2008-09-16 Thread 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