This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Shared Object Dependencies


Hello all,

I have created a shared object which allows my java web app to talk to
some legacy FORTRAN code.  Everything works fine, however, we are in
the midst of some system upgrades and are now using the following:

gcc -v
Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.2.1/specs
Configured with:
../configure --disable-nls --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/
ld
Thread model: posix
gcc version 3.2.1

I had to make some modifications (we were using gcc version 2.8.x) and
everything works as did before.

*****The problem now is that when I put this shared object on a box
that has not been upgraded, it doesn't work because it can't find the
dependencies:

The following dynamic dependencies on the shared object are as follows:

ldd libjniCheck.so
        libstdc++.so.5 =>        /usr/local/lib/libstdc++.so.5
        libg2c.so.0 =>   /usr/local/lib/libg2c.so.0
        libm.so.1 =>     /lib/libm.so.1
        libc.so.1 =>     /lib/libc.so.1
        libgcc_s.so.1 =>         /usr/local/lib/libgcc_s.so.1
        libdl.so.1 =>    /lib/libdl.so.1
        /usr/platform/SUNW,Ultra-250/lib/libc_psr.so.1

I was wondering if there was a way to eliminate the dependencies by possibly
including them into the .so file I am creating.?.? Or maybe some other
solution?
Granted we have a fix for this - upgrade the box, or at least include the
shared
objects required by mine.  But I would like, if possible, to have this as
self
contained as possible.

The following details my steps:

#This takes the FORTRAN source and compiles them into the objects for
#use by the linker
echo Building object files
(
cd ../source
for source_f in *.FOR ; do
  object_f=../objects/$source_f
  object_f=${object_f/%FOR/o}
  g77 -ff77 -fPIC -finit-local-zero -fno-automatic -fugly-logint  -c
$source_f -o $object_f
done
)
echo Objects created ...

#This takes the java/c/and FORTRAN objects (created from the previous step)
to
#create the libjniCheck.so object.

echo Compiling jniCheck.java ...
jmake ~/netapp/web/dsi/WEB-INF/build_src/com/brightlane/check/jniCheck.java

echo Creating Header file from jniCheck.class ...
javah -d ../cplusplus -jni com.brightlane.check.jniCheck

echo Building library ...
g77 -ff77 -fPIC -finit-local-zero -fno-automatic -fugly-logint -shared -mimp
ure-text -o
../libjniCheck.so -I/usr/java/include -I/usr/java/include/solaris
../cplusplus/jniCheck.cpp ../objects/*.o -lstdc++ -lm -lgcc -lc -lg2c -v

thanks in advance for your help,
andy


Andrew Stone
XML Architect/Developer
BrightLane, a TeamStaff Inc. Company
Office: 678-385-2823


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]