Operating System - HP-UX
1827835 Members
8823 Online
109969 Solutions
New Discussion

Can't find path for shared library: libgcc_s.sl

 
siba
Advisor

Can't find path for shared library: libgcc_s.sl

hi,
Sorry if this question has already answered in this forum.
I have compiled and linked a program using gcc 3.4.2 on HP 11i.
While executing the program core is dumped with message
/usr/lib/dld.sl: Can't find path for shared library: libgcc_s.sl
/usr/lib/dld.sl: No such file or directory
(coredump)

Strange part is that the path for libgcc_s.sl is present in the SHLIB_PATH and has got appropriate permissions.

My GCC version is Configured with: /scratch/njs/pkgbuild/3.3.1/hpux-11/gcc-3.4.2/configure --enable-languages=c,c++ --enable-threads=posix --disable-n
ls --with-gnu-as --without-gnu-ld --with-as=/usr/local/bin/as --with-ld=/usr/ccs/bin/ld --with-libiconv-prefix=/usr/local --prefix=/
usr/local
Thread model: posix
gcc version 3.4.2.

Please help.

thanks in advance
shiva
9 REPLIES 9
Steven E. Protter
Exalted Contributor

Re: Can't find path for shared library: libgcc_s.sl

ll /usr/lib/dld.sl

if its there then:

SHLIB_PATH=/usr/lib:$SHLIB_PATH
export SHLIB_PATH

try again

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Fred Ruffet
Honored Contributor

Re: Can't find path for shared library: libgcc_s.sl

Sorry SEP, but dld.sl is not the problem. It just can't load libgcc_s.sl. As long as you compiled with --prefix=/usr/local, your lib should be in /usr/local/lib. Is this directory in SHLIB_PATH ? Can you post your exact SHLIB_PATH and LD_LIBRARY_PATH when launching program, and also an output from ldd over your program ?

Regards,

Fred
--

"Reality is just a point of view." (P. K. D.)
Stephen Keane
Honored Contributor

Re: Can't find path for shared library: libgcc_s.sl

Have you run chatr +s enable, on the exectuable ?
Amit Agarwal_1
Trusted Contributor

Re: Can't find path for shared library: libgcc_s.sl

By any chance do you do 'chroot' to enter a new build environemnt.

If not, then `chatr ` output would be useful to figure out the probelm.
siba
Advisor

Re: Can't find path for shared library: libgcc_s.sl

>> Can you post your exact SHLIB_PATH and >> LD_LIBRARY_PATH when launching program, and >> also an output from ldd

The problem is not with my program but with libstdc++.

all my libs are not installed on /usr/local/lib but in my local profile.

ldd -v of libstdc++.sl gives
find library=/usr/lib/libc.2; required by libstdc++.sl
/usr/lib/libc.2 => /usr/lib/libc.2

find library=/usr/lib/libdld.2; required by /usr/lib/libc.2
/usr/lib/libdld.2 => /usr/lib/libdld.2

find library=/usr/lib/libc.2; required by implicit load
/usr/lib/libc.2 => /usr/lib/libc.2

find library=/scratch/njs/pkgbuild/3.3.1/hpux-11/gcc-3.4.2-b/gcc/libgcc_s.sl; required by libstdc++.sl
/usr/lib/dld.sl: Can't find path for shared library: libgcc_s.sl
/usr/lib/dld.sl: No such file or directory

my gcc is installed in /home/user/usr/local/bin.


SHLIB_PATH=/home/user/apache/libexec:/home/user/apache:/
home/nesic/usr/local/lib:.

I had not included LD_LIBRARY_PATH earlier. Though i export the path for LD_LIBRARY_PATH as /home/user/usr/local/lib still it gives the same issue.

Please help
siba
Advisor

Re: Can't find path for shared library: libgcc_s.sl

hi amit.
the chatr command give the foll output

TestAppTool:
shared executable
shared library dynamic path search:
SHLIB_PATH disabled second
embedded path disabled first Not Defined
shared library list:
dynamic /home/user/usr/local/lib/libstdc++.sl.6
dynamic /usr/lib/libc.2
shared library binding:
deferred
global hash table disabled
plabel caching disabled
global hash array size:1103
global hash array nbuckets:3
shared vtable support disabled
explicit unloading enabled
static branch prediction disabled
executable from stack: D (default)
kernel assisted branch prediction enabled
lazy swap allocation disabled
text segment locking disabled
data segment locking disabled
third quadrant private data space disabled
fourth quadrant private data space disabled
third quadrant global data space disabled
data page size: D (default)
instruction page size: D (default)
nulptr references enabled
shared library private mapping disabled
shared library text merging disabled

any clue...
siba
Advisor

Re: Can't find path for shared library: libgcc_s.sl

Hi some more information,
Though strange but i have verified it.

I copied libstdc++ related libraries to /usr/local/lib and my application works fine.

But in case i dont have libstdc++ related libraries and i recompile my application it fails and dumps core

/usr/lib/dld.sl: Can't find path for shared library: libgcc_s.sl
/usr/lib/dld.sl: No such file or directory
Abort(coredump)


Is there something which i am doing wrong??
siba
Advisor

Re: Can't find path for shared library: libgcc_s.sl

Hi,
The problem is solved when i do a chatr +s enable .

Is there any way that i can resolve it during make itself?
ranganath ramachandra
Esteemed Contributor

Re: Can't find path for shared library: libgcc_s.sl

pa32 loader does not look at LD_LIBRARY_PATH, it only looks at SHLIB_PATH.

you can turn on SHLIB_PATH lookup at link (build) time with the linker option "+s". you can either pass it to linker directly or through compiler as "-Wl,+s" or set LDOPTS="... +s ..." (where "..." is other ld options you may have already).
 
--
ranga
hp-ux 11i v3[i work for hpe]

Accept or Kudo