LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 11-13-2007, 03:15 PM   #1
RaduH
LQ Newbie
 
Registered: Nov 2007
Location: Colorado, USA
Posts: 11

Rep: Reputation: 0
Libssh2 version


Hi all,

How can I tell what version of libssh2 I have on my Linux machine?

In addition to this, I am experiencing difficulties installing libssh 0.18. I installed openssl0.9.8g and zlib1.2.3 but when I try to build libssh I get this error:

/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/bin/ld: /usr/local/ssl/lib/libcrypto.a(md5_dgst.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/usr/local/ssl/lib/libcrypto.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[2]: *** [libssh2.la] Error 1

and I have no idea what to do next. Any advice would be appreciated.

Thanks!

Last edited by RaduH; 11-13-2007 at 03:56 PM.
 
Old 11-14-2007, 01:33 PM   #2
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 70
On certain architectures (e.g., amd64), you can’t create shared object files which are position dependent. So in creating a shared library, you must link object files which have been compiled with the flag “-fPIC” (which ensures position independent code). It seems your target shared library is trying to incorporate a static archive of libcrypto. To remedy the problem, install a shared version of libcrypto. Alternatively, you might forgo building a shared libssh.
 
Old 11-15-2007, 09:37 AM   #3
RaduH
LQ Newbie
 
Registered: Nov 2007
Location: Colorado, USA
Posts: 11

Original Poster
Rep: Reputation: 0
I built both openssl (which generates libcrypto.a) and libssh2 (which uses that library) with the -fPIC flag. It seems to make no difference (at not one I can see) since the build crashes with the very same error message.
 
Old 11-15-2007, 12:11 PM   #4
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 70
Even if your static archive (libcrypto.a) has none of those relocations (obviously, it still does, even if you think you got rid of them. to check this is the case, try “readelf -r /usr/lib/libcrypto.a”), the recommended practice is to linked shared objects to shared objects. So you have two such solutions:
  1. Install the shared version of libcrypto. When building openssl, specify “--enable-shared” as a configure parameter.
  2. Don’t try to create a shared version of libssh. When building libssh, specify “--disable-shared” as a configure parameter.
…and it’s just that simple.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Regarding distribution + kernel version + gcc version + glib version. JCipriani Linux - General 8 04-19-2008 02:54 PM
redhat fedora gcc version (compiled for 2.4.20) doesn't match kernel version 2.4.22 start1000 Linux - Software 0 03-16-2004 08:17 PM
Xfree Error (EE) module ABI minor version (7) is newer than the server's version (6) jimdaworm Slackware 0 10-17-2003 05:26 PM
Xfree prob radeon.o kernel module version is 1.1.1 but version 1.5.0 or newer needed. jimdaworm Slackware 0 10-01-2003 06:27 PM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration