Ticket #46 (closed defect)

Opened 9 years ago

Last modified 8 years ago

Cannot compile on libssh2 on Solaris 10 Sparc

Reported by: anonymous Owned by: bagder
Priority: normal Milestone:
Component: Version:
Keywords: Cc: bagder, dfandrich, jaymcg, yourjesus
Blocked By: Blocks:

Description

I have tried downloading and making versions 0.16-0.18. I receiving the following error trying to compile.

gcc -g -O2 -I/usr/sfw/include -I/usr/local/include -o .libs/ssh2 ssh2.o -L/usr/sfw/lib -L/usr/local/lib ../../src/.libs/libssh2.so -lssl -lcrypto -ldl -lz -lnsl -lsocket -R/usr/local/lib -R/usr/sfw/lib
Undefined first referenced

symbol in file

EVP_aes_192_cbc ../../src/.libs/libssh2.so
EVP_aes_256_cbc ../../src/.libs/libssh2.so
ld: fatal: Symbol referencing errors. No output written to .libs/ssh2
collect2: ld returned 1 exit status
make[3]: * [ssh2] Error 1
make[3]: Leaving directory `/scratch/source/libssh2-0.18.0-CVS/example/simple'
make[2]:
* [all] Error 2
make[2]: Leaving directory `/scratch/source/libssh2-0.18.0-CVS/example/simple'
make[1]: * [all-recursive] Error 1
make[1]: Leaving directory `/scratch/source/libssh2-0.18.0-CVS/example'
make:
* [all-recursive] Error 1
hal-/scratch/source/libssh2-0.18.0-CVS> env
MANPATH=/opt/SUNWexplo/man:/opt/SUNWvts/man::/usr/man:/usr/share/man:/usr/local/man
LC_MONETARY=en_US.ISO8859-15
TERM=xterm
SHELL=/usr/bin/bash
LC_NUMERIC=en_US.ISO8859-15
OLDPWD=/scratch/source
SSH_TTY=/dev/pts/19
USER=ctouchton
SSH_AUTH_SOCK=/tmp/ssh-POhl9132/agent.9132
PATH=/usr/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin:/usr/ccs/bin:/usr/platform/bin:/usr/platform/sbin:/usr/sfw/bin:/usr/sfw/sbin:/opt/SUNWspro/bin:/usr/openwin/bin
LC_MESSAGES=C
LC_COLLATE=en_US.ISO8859-15
PWD=/scratch/source/libssh2-0.18.0-CVS
EDITOR=vi
TZ=US/Eastern
SHLVL=1
LC_CTYPE=en_US.ISO8859-15
DISPLAY=localhost:11.0
_=/usr/bin/env
hal-/scratch/source/libssh2-0.18.0-CVS> crle

Configuration file [version 4]: /var/ld/ld.config

Default Library Path (ELF): /lib:/lib/secure:/usr/lib/secure:/usr/local/lib:/usr/lib:/usr/sfw/lib:/usr/local/ssl/lib/
Trusted Directories (ELF): /lib/secure:/usr/lib/secure (system default)

Command line:

crle -c /var/ld/ld.config -l /lib:/lib/secure:/usr/lib/secure:/usr/local/lib:/usr/lib:/usr/sfw/lib:/usr/local/ssl/lib/

hal-/scratch/source/libssh2-0.18.0-CVS>

Thanks.

solarisadmin@…

Change History

comment:1 Changed 9 years ago by dfandrich

This sounds like an old version of OpenSSL. What version are you using?

comment:2 Changed 9 years ago by anonymous

Logged In: NO

Here's my /usr/local/ssl version of openssl. Is it possible it is looking at other ssl libraries in /usr/sfw, or somewhere else?

hal-/usr/local/ssl/bin> ./openssl version
OpenSSL 0.9.8f 11 Oct 2007
hal-/usr/local/ssl/bin>

comment:3 Changed 9 years ago by anonymous

Logged In: NO

Here's my /usr/local/ssl version of openssl. Is it possible it is looking at other ssl libraries in /usr/sfw, or somewhere else?

hal-/usr/local/ssl/bin> ./openssl version
OpenSSL 0.9.8f 11 Oct 2007
hal-/usr/local/ssl/bin>

comment:4 Changed 9 years ago by dfandrich

Your guess is probably a good one. This shouldn't be failing in the link stage otherwise.

comment:5 Changed 9 years ago by anonymous

Logged In: NO

Hi

I am facing the same problem

libssh2-0.16/example/simple>make
make all-am
/bin/bash ../../libtool --tag=CC --mode=link gcc -g -O2
-I/tmp/pm/openssl-0.9.8f/include -I/usr/include
-L/tmp/pm/openssl-0.9.8f/lib -lcrypto -L/usr/lib -lz -o ssh2 ssh2.o
../../src/libssh2.la -lnsl -lsocket
gcc -g -O2 -I/tmp/pm/openssl-0.9.8f/include -I/usr/include -o .libs/ssh2
ssh2.o -L/tmp/pm/openssl-0.9.8f/lib -L/usr/lib
../../src/.libs/libssh2.so -lcrypto -lz -lnsl -lsocket
-R/tmp/pm/libssh2-0.16/lib
Undefined first referenced

symbol in file

EVP_aes_192_cbc ../../src/.libs/libssh2.so
EVP_Cipher ../../src/.libs/libssh2.so
EVP_aes_256_cbc ../../src/.libs/libssh2.so
ld: fatal: Symbol referencing errors. No output written to .libs/ssh2
collect2: ld returned 1 exit status
* Error code 1
make: Fatal error: Command failed for target `ssh2'
Current working directory /tmp/pm/libssh2-0.16/example/simple
* Error code 1
make: Fatal error: Command failed for target `all'

Please do let me know how to resolve this..

comment:6 Changed 9 years ago by dfandrich

What library defines those undefined symbols? Is it in the link line? To start, what's the output of 'grep -l /lib/* /usr/lib/* /tmp/pm/openssl-0.9.8f/lib/*'? Do you have more than one version of OpenSSL on your system? What does config.log say about the version being used?

comment:7 Changed 9 years ago by anonymous

Logged In: NO

Hi,

I want to use SFTP perl package from my application to do this i try to install Net-SSH2 package it requires libssh and openssl.

This is what I am doing:

Installed openssl.0.9.8 - when trying to do a make and make install i get a relocation error for the crypto library. i am not able to build the libcrypto.so.0.9.8, so i built the static .a libraries

The I installed libssh - I link it to the openssl static libraries... this gets built properly.

Then I built the Net-SSH2 library SSH2.so -
but when trying to run the example program read.pl i get an error:
Cannot load the library SSH2.so: relocation error, cannot find symbol EVP_Cipher.

Please advice what should i do?

comment:8 Changed 9 years ago by anonymous

Logged In: NO

Hi,

I want to use SFTP perl package from my application to do this i try to install Net-SSH2 package it requires libssh and openssl.

This is what I am doing:

Installed openssl.0.9.8 - when trying to do a make and make install i get a relocation error for the crypto library. i am not able to build the libcrypto.so.0.9.8, so i built the static .a libraries

The I installed libssh - I link it to the openssl static libraries... this gets built properly.

Then I built the Net-SSH2 library SSH2.so -
but when trying to run the example program read.pl i get an error:
Cannot load the library SSH2.so: relocation error, cannot find symbol EVP_Cipher.

Please advice what should i do?

comment:9 Changed 9 years ago by dfandrich

Is this the same "nobody" as the original one? This sounds more and more like a local build problem, not a libssh2 problem. Build questions should be brought to the libssh2-devel mailing list instead.

comment:10 Changed 9 years ago by jaymcg

It apears as though this it is enough to link against -lssl_extra

export LD_LIBRARY_PATH="/usr/sfw/lib/64:${LD_LIBRARY_PATH}"
export LDFLAGS='-L/usr/sfw/lib/64 -R/usr/sfw/lib/64'
export LIBS='-lcrypto -lssl_extra'

If your compiler/linker doesn't know -lssl_extra, you might have to

ln -s /usr/sfw/lib/64/lib(ssl|crypto)_extra.so.* to /usr/sfw/lib/64/lib$1_extra.so

And hope it doesn't break on deployment.

So long,
Igor

comment:11 Changed 9 years ago by anonymous

Logged In: NO

I was having this problem to.

I replaced the constants in openssl.h that refer to EVP_aes_192_cbc and EVP_aes_256_cbc with a 0. That seems to have fixed the build, but who knows what other problems I have caused. The perl Net::SSH2 bindings seem to be working correctly with this monkey patched build though, so I'm happy until a real fix comes out.

comment:12 Changed 9 years ago by yourjesus

Need to upgrade to a new update release of Solaris 10. Or install the SUNWcry and SUNWcryr packages (optional download) for strong crypto and then link against crypt_extra.

comment:13 Changed 8 years ago by bagder

So then it wasn't a bug in libssh2, closing this.

Note: See TracTickets for help on using tickets.