* DU 4.0D and shared objects
@ 1999-05-20 4:00 Gordon Burditt
1999-05-25 4:00 ` Randall Hopper
0 siblings, 1 reply; 2+ messages in thread
From: Gordon Burditt @ 1999-05-20 4:00 UTC (permalink / raw)
I am attempting to create a shared object under DU 4.0D for use with
TCL. I'm not getting very far - it seems to link OK, possibly with
undefined symbol warnings, and then all I get out of dlopen()
and dlerror() is "cannot load ./sql.so". Besides trying with TCL,
I've tried just invoking dlopen() alone. TCL is just reporting the
error from dlerror(). I've also tried building using the 4.0B linker,
due to some problems with the 4.0D linker and MySQL, but it didn't seem
to make any difference. Attempts have been made on various machines
with and without patchkit 3. Same error.
Is there any way to get dlopen() to be a LOT more verbose about
WHY it can't load this file? I notice I get the same type error
message if I simply spell the filename wrong, but if I spell it
right, something actually does update the access time on the file.
It would really be nice to get a different error message for
trying to dlopen() the library vs. dlopen()ing the source code.
Can anyone spot any stupid errors in the command lines I'm using
(g++ as a compiler, ld to create the shared object)?
If I am, in fact, missing a library, wouldn't the error message say so?
I have had that happen with other programs.
% g++ -c -I/usr/local/include -I/usr/include/mysql \
-I/usr/local/mysql/include -I/usr/local/include/mysql -fPIC \
-o obj/sql-mysql.o sql-mysql.cc
% g++ -c -I/usr/local/include -I/usr/include/mysql \
-I/usr/local/mysql/include -I/usr/local/include/mysql -fPIC \
-o obj/sql.o sql.cc
% g++ -c -I/usr/local/include -I/usr/include/mysql \
-I/usr/local/mysql/include -I/usr/local/include/mysql -fPIC \
-o obj/sql-manager.o sql-manager.cc
% ld -shared -expect_unresolved "*" obj/sql-mysql.o obj/sql.o \
obj/sql-manager.o -L/usr/lib/mysql -L/usr/local/mysql/lib \
-L/usr/local/lib/mysql -L/usr/lib -lmysqlclient \
-rpath /usr/lib:/usr/local/lib:/usr/local/lib/mysql: -o sql.so
(Actual command lines generated by make all on one line - these have
been split into multiple lines with backslashes for readability).
Gordon L. Burditt
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: DU 4.0D and shared objects
1999-05-20 4:00 DU 4.0D and shared objects Gordon Burditt
@ 1999-05-25 4:00 ` Randall Hopper
0 siblings, 0 replies; 2+ messages in thread
From: Randall Hopper @ 1999-05-25 4:00 UTC (permalink / raw)
Gordon Burditt <gordonb.44lkz@sneaky.lerctr.org> wrote:
|I am attempting to create a shared object under DU 4.0D for use with
|TCL. I'm not getting very far - it seems to link OK, possibly with
|undefined symbol warnings, and then all I get out of dlopen()
|and dlerror() is "cannot load ./sql.so".
...
|Is there any way to get dlopen() to be a LOT more verbose
...
|% ld -shared -expect_unresolved "*" ... -lmysqlclient \
| -rpath /usr/lib:/usr/local/lib:/usr/local/lib/mysql: -o sql.so
I have a possible answer to your question, and a follow-up question for the
group.
To get the loader to be more verbose:
setenv _RLD_ARGS -trace
However, this may not help. It didn't tell me anything useful (resolving
symX, resolving symY, mapping libA.so, then the same old dlopen failure
error for libA.so).
It turned out that OSF1 seems to be a bit broken in that it doesn't honor
RPATH settings in shared libraries. In my case libA.so depends on libB.so.
libA was compiled with an RPATH which includes libB's location. This
resolves just fine on Solaris and IRIX. But no dice on OSF1. It appears
this might be tripping up your build as well.
Resorting to the old LD_LIBRARY_PATH hack (augmenting it at runtime to
include the directory libA lives in) was the only reasonable way I could
find to get the dynamic loader to load libB. Compiling a new RPATH into
the executable, the Python language interpreter, isn't an option (libA is a
Python module).
Two questions for the OSF1 experts:
1) Is there a way to get dependent shared library resolution to work
without LD_LIBRARY_PATH?
2) Why isn't an RPATH setting in a shared library used to find
dependent shared libraries?
--
Randall Hopper
aa8vb@-nojunk-ipass.net
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1999-05-25 4:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-05-20 4:00 DU 4.0D and shared objects Gordon Burditt
1999-05-25 4:00 ` Randall Hopper
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox