Discussion:
Problems compiling openssh
(too old to reply)
Cary Lewis
2003-09-16 19:23:16 UTC
Permalink
I am having trouble compiling the latest openssh release.

The process fails during the ./configure script, specifically when
testing the openssl header version.

Configure creates a small c program and attempts to compile / execute
it.

The cc line is:

cc -o conftest -g -belf -I/usr/local/ssl/include -I/usr/local/include
-L/usr/lo
cal/lib conftest.c -lcrypto -lsocket -lprot -lx -ltinfo -lm

The program conftest compiles cleanly, but when run:

# ./conftest
dynamic linker : ./conftest : error opening libcrypto.so.0.9.7
Killed
#

I have the required libcrypto.so.0.9.7 library in /usr/local/lib.

What is puzzling, is that if I use the following compile line:

cc -o conftest -g -belf -I/usr/local/ssl/include -I/usr/local/include
-L/usr/lo
cal/lib conftest.c

i.e. without the -l options, the program compiles and executes
perfectly.

Can someone explain this?

Furthermore, how can I get configure to omit the the -l options?
Bela Lubkin
2003-09-17 01:25:45 UTC
Permalink
Post by Cary Lewis
I am having trouble compiling the latest openssh release.
This is happening on no particular release of no particular operating
system? Also, just what is the "latest openssh release" -- your
statement would be incorrect if they've issued a new release in the
hours since you posted, before I replied.
Post by Cary Lewis
The process fails during the ./configure script, specifically when
testing the openssl header version.
Configure creates a small c program and attempts to compile / execute
it.
cc -o conftest -g -belf -I/usr/local/ssl/include -I/usr/local/include
-L/usr/lo
cal/lib conftest.c -lcrypto -lsocket -lprot -lx -ltinfo -lm
# ./conftest
dynamic linker : ./conftest : error opening libcrypto.so.0.9.7
Killed
#
I have the required libcrypto.so.0.9.7 library in /usr/local/lib.
cc -o conftest -g -belf -I/usr/local/ssl/include -I/usr/local/include
-L/usr/lo
cal/lib conftest.c
i.e. without the -l options, the program compiles and executes
perfectly.
Can someone explain this?
Not without a bunch of information you omitted. I can guess that you're
talking about OpenServer because I think the libraries invoked under
UnixWare would be a bit different. I can't guess what release, and it's
very important in this case because OSR507 ships with libcrypto, 506 did
not.

You say that you "have" the required library in /usr/local/lib. How did
it get there -- did you build it yourself (if so, you apparently didn't
test it until now, and the test is failing). Or did you install it from
some prepackaged source -- if so, where exactly did you get it? (Give
full URL so others can look at the same specific pile of bits.)

In this particular case, the conftest.c that's being compiled probably
doesn't refer to any symbols in libcrypto; so it compiles and links
happily without it. It does not, however, serve `configure`'s purpose
here, which is to figure out whether the libcrypto.so that it found
actually works.

Some things you could do here:

- look at the conftest.c that blew up (it should have been recorded in
config.log)

- link your own test program with libcrypto.so, see how it goes

- run `file /usr/local/lib/libcrypto.so.0.9.7`, see if it seems sane

- run `nm /usr/local/lib/libcrypto.so.0.9.7`, see if it seems sane

- check permissions on /usr/local/lib/libcrypto.so.0.9.7 -- it must be
both readable and executable by the user trying to run a program
linked against it (also make sure that the directories leading down
to it are accessible: at least executable(searchable) by the user)
Post by Cary Lewis
Furthermore, how can I get configure to omit the the -l options?
You probably don't want it to.
Post by Cary Lewis
Bela<
Cary Lewis
2003-09-17 14:13:01 UTC
Permalink
Post by Bela Lubkin
Post by Cary Lewis
I am having trouble compiling the latest openssh release.
This is happening on no particular release of no particular operating
system? Also, just what is the "latest openssh release" -- your
statement would be incorrect if they've issued a new release in the
hours since you posted, before I replied.
Post by Cary Lewis
The process fails during the ./configure script, specifically when
testing the openssl header version.
Configure creates a small c program and attempts to compile / execute
it.
cc -o conftest -g -belf -I/usr/local/ssl/include -I/usr/local/include
-L/usr/lo
cal/lib conftest.c -lcrypto -lsocket -lprot -lx -ltinfo -lm
# ./conftest
dynamic linker : ./conftest : error opening libcrypto.so.0.9.7
Killed
#
I have the required libcrypto.so.0.9.7 library in /usr/local/lib.
cc -o conftest -g -belf -I/usr/local/ssl/include -I/usr/local/include
-L/usr/lo
cal/lib conftest.c
i.e. without the -l options, the program compiles and executes
perfectly.
Can someone explain this?
Not without a bunch of information you omitted. I can guess that you're
talking about OpenServer because I think the libraries invoked under
UnixWare would be a bit different. I can't guess what release, and it's
very important in this case because OSR507 ships with libcrypto, 506 did
not.
You say that you "have" the required library in /usr/local/lib. How did
it get there -- did you build it yourself (if so, you apparently didn't
test it until now, and the test is failing). Or did you install it from
some prepackaged source -- if so, where exactly did you get it? (Give
full URL so others can look at the same specific pile of bits.)
In this particular case, the conftest.c that's being compiled probably
doesn't refer to any symbols in libcrypto; so it compiles and links
happily without it. It does not, however, serve `configure`'s purpose
here, which is to figure out whether the libcrypto.so that it found
actually works.
- look at the conftest.c that blew up (it should have been recorded in
config.log)
- link your own test program with libcrypto.so, see how it goes
- run `file /usr/local/lib/libcrypto.so.0.9.7`, see if it seems sane
- run `nm /usr/local/lib/libcrypto.so.0.9.7`, see if it seems sane
- check permissions on /usr/local/lib/libcrypto.so.0.9.7 -- it must be
both readable and executable by the user trying to run a program
linked against it (also make sure that the directories leading down
to it are accessible: at least executable(searchable) by the user)
Post by Cary Lewis
Furthermore, how can I get configure to omit the the -l options?
You probably don't want it to.
Post by Cary Lewis
Bela<
Thanks for the tips Bela, sorry for not being more clear:

Sco openserver 5.0.5
openssh-3.6.1p2
openssl-0.9.7b

All tests after making the openssl library passed.

The system has the UDK 5.0.5A installed as well.

The problem was that I was not specifying the path to the newly built
libcrypto.a in /usr/local/ssl/lib

i.e.

LDFLAGS="-L/usr/local/ssl/lib" CPPFLAGS="-I/usr/local/ssl/include"
./configure

There is still an issue with why the /usr/local/lib/libcrypto.so and
libcrypto.so.0.9.7 were not updated when I built the openssl 0.9.7.b
version.

Anyway I passed the openssl test, thanks again for your help.

Loading...