This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc 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]

re: Search path for ld.so


"C Jaiprakash, Noida" <cjaiprakash@hcltech.com> wrote:
I have build glibc for a cross platform. My prefix path is not default.
Problem i am facing is when i transfer the libraries in /lib on the target
machine. ld.so never searches into /lib it always try to serch in the
PREFIX path i used for building glibc. If i set LD_LIBRARY_PATH it works
correctly but i want that ldconfig, ld.so should use the default paths for
searching i.e /etc , /lib. Am i missing anything while building the gilbc? My toolchain linker scripts though have SEARCH_DIR as /lib and the PREFIX
path used for building glibc. Any ideas how can i make ld.so ldconfig to
search in default paths?

If I understand your question correctly, all you have to do is remove the path in the ascii files libc.so, libpthread.so, and libgcc_s.so. Here's how it's done in http://kegel.com/crosstool (ugly, ain't it?):

# Fix problems in linker scripts.
#
# 1. Remove absolute paths
# Any file in a list of known suspects that isn't a symlink is assumed to be a linker script.
# FIXME: test -h is not portable
# FIXME: probably need to check more files than just these three...
# Need to use sed instead of just assuming we know what's in libc.so because otherwise alpha breaks
# But won't need to do this at all once we use --with-sysroot (available in gcc-3.3.3 and up)
#
# 2. Remove lines containing BUG per http://sources.redhat.com/ml/bug-glibc/2003-05/msg00055.html,
# needed to fix gcc-3.2.3/glibc-2.3.2 targeting arm
#
# To make "strip *.so.*" not fail (ptxdist does this), rename to .so_orig rather than .so.orig
for file in libc.so libpthread.so libgcc_s.so; do
  for lib in lib lib64 usr/lib usr/lib64; do
        if test -f ${SYSROOT}/$lib/$file && test ! -h ${SYSROOT}/$lib/$file; then
                mv ${SYSROOT}/$lib/$file ${SYSROOT}/$lib/${file}_orig
                if test -z "$USE_SYSROOT"; then
                  sed 's,/usr/lib/,,g;s,/usr/lib64/,,g;s,/lib/,,g;s,/lib64/,,g;/BUG in libc.scripts.output-format.sed/d' < ${SYSROOT}/$lib/${file}_orig > ${SYSROOT}/$lib/$file
                else
                  sed '/BUG in libc.scripts.output-format.sed/d' < ${SYSROOT}/$lib/${file}_orig > ${SYSROOT}/$lib/$file
                fi
        fi
    done
done

--
Trying to get a job as a c++ developer?  See http://kegel.com/academy/getting-hired.html


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