LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-14-2011, 07:20 AM   #1
packets
Member
 
Registered: Oct 2005
Posts: 339

Rep: Reputation: 32
recompile with -fPIC


I'm having a trouble compiling perl module NET-SSLeay. I've openssl already configured with -fPIC. Below is the error I got from my 64bit CentOS architecture

Code:
[root@qmail Net-SSLeay-1.36]# perl Makefile.PL
Cannot determine perl version info from lib/Net/SSLeay.pm
Cannot determine license info from lib/Net/SSLeay.pm
*** Found OpenSSL-0.9.8r installed in /usr/local/ssl
*** Be sure to use the same compiler and options to compile your OpenSSL, perl,
    and Net::SSLeay. Mixing and matching compilers is not supported.
Do you want to run external tests?
These tests *will* *fail* if you do not have network connectivity. [n]
Writing Makefile for Net::SSLeay
Writing MYMETA.yml
[root@qmail Net-SSLeay-1.36]# make
Skip blib/lib/Net/SSLeay.pm (unchanged)
Skip blib/lib/Net/SSLeay/Handle.pm (unchanged)
cc -c  -I/usr/local/ssl/include -I/usr/local/ssl/inc32 -I/usr/kerberos/include -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g   -DVERSION=\"1.36\" -DXS_VERSION=\"1.36\" -fPIC "-I/usr/local/lib/perl5/5.14.1/x86_64-linux/CORE"   SSLeay.c
Running Mkbootstrap for Net::SSLeay ()
chmod 644 SSLeay.bs
rm -f blib/arch/auto/Net/SSLeay/SSLeay.so
LD_RUN_PATH="/usr/lib" cc  -shared -O2 -L/usr/local/lib -fstack-protector SSLeay.o  -o blib/arch/auto/Net/SSLeay/SSLeay.so      \
           -L/usr/local/ssl -L/usr/local/ssl/lib -lssl -lcrypto -lz     \

/usr/bin/ld: /usr/local/ssl/lib/libcrypto.a(x86_64cpuid.o): relocation R_X86_64_PC32 against `OPENSSL_cpuid_setup' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: ld returned 1 exit status
make: *** [blib/arch/auto/Net/SSLeay/SSLeay.so] Error 1
Can anyone recommend a solution for this or atleast give me a right direction? Your help will be very much appreciated.
 
Old 07-14-2011, 01:15 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Why not do # yum install perl-Net-SSLeay


About openssl : It is quite unusual to have an extra openssl in /usr/local/.
Openssl is already installed. ( /lib64/libssl.so.0.9.8e etc.)
The command : 'rpm -qa | grep openssl' will show.

If you have no Internet, the packages can be found here :
http://mirror.centos.org/centos/5.6/os/x86_64/
http://mirror.centos.org/centos/5.6/
Quote:
recompile with -fPIC
This means you only have the static libcrypto.a, libssl.a :
The shared libraries are required : libcrypto.so, libssl.so
→ → # yum install openssl-devel

.
 
Old 07-14-2011, 01:31 PM   #3
packets
Member
 
Registered: Oct 2005
Posts: 339

Original Poster
Rep: Reputation: 32
I've already installed perl-Net-SSLeay from yum. But since the application I'm installing is from source, its also looking for perl modules generated from source. I've also installed openssl-devel but no luck.

Quote:
Originally Posted by knudfl View Post
Why not do # yum install perl-Net-SSLeay


About openssl : It is quite unusual to have an extra openssl in /usr/local/.
Openssl is already installed. ( /lib64/libssl.so.0.9.8e etc.)
The command : 'rpm -qa | grep openssl' will show.

If you have no Internet, the packages can be found here :
http://mirror.centos.org/centos/5.6/os/x86_64/
http://mirror.centos.org/centos/5.6/

This means you only have the static libcrypto.a, libssl.a :
The shared libraries are required : libcrypto.so, libssl.so
→ → # yum install openssl-devel

.
 
Old 07-14-2011, 02:05 PM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Quote:
But since the application I'm installing .. ..
Which application ?
 
Old 07-14-2011, 02:37 PM   #5
Elv13
Member
 
Registered: Apr 2006
Location: Montreal,Quebec
Distribution: Gentoo
Posts: 825

Rep: Reputation: 129Reputation: 129
CFLAGS=" -fno-PIC -fnoPIC"$CFLAGS" -fno-PIC -fnoPIC"
CXXGLAGS=$CFLAGS

export those variables and try again. If my syntax is right, it should turn off fPIC for your package and remove the dependency to OpenSSL fPIC objects.
 
Old 07-14-2011, 02:37 PM   #6
packets
Member
 
Registered: Oct 2005
Posts: 339

Original Poster
Rep: Reputation: 32
Quote:
Which application ?
ASSP
 
Old 07-14-2011, 10:30 PM   #7
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
OK, ASSP. A new openssl is not required. Only a "local" perl-5.10.x.

Net-SSLeay-1.36 will build with no errors using the default 'CentOS 5'
openssl version. The openssl you have in /usr/local/ will not work.
Suggest : Start from scratch with Net-SSLeay-1.36 in a new directory.

Why are you typing # perl Makefile.PL ?
'perl' is /usr/bin/perl(5.8.8). I would expect $ /usr/local/bin/perl(5.10).
( Or whatever your location is for perl 5.10.x ).
And by the way: build commands are not to be run as root. Only 'make install'.


Other hints : The most perl modules can be installed with cpan.
Example : 1) su ; 2) /usr/local/bin/cpan ( The cpan from your perl 5.10 ).
3) cpan > install Text::Glob

.
 
Old 07-15-2011, 04:43 AM   #8
packets
Member
 
Registered: Oct 2005
Posts: 339

Original Poster
Rep: Reputation: 32
Here's the solution for this.

Recompile openssl with shared attributes

Quote:
./config shared
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
recompile with -fPIC coveykw@netscape.net *BSD 9 03-19-2010 10:08 AM
Can someone help me understand how to fix my recompile with -fPIC error ? Bascom49 Linux - Software 3 12-26-2009 05:57 AM
Error recompile with fPIC, but fPIC is already as a compilation option eolmsan Linux - Software 4 12-03-2008 11:05 AM
about -fpic/-fPIC option for gcc George2 Programming 2 09-04-2006 01:38 AM
What does 'recompile with -fPIC' mean cocteau Linux - Software 1 03-31-2005 01:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration