# Tips and Tricks # What loader is this library configured to use? If a shared library or application is built: using a GCC that had an overridden rpath and dynamic-linker hardcoded and passed the -rpath flag and -dynamic-linker flags you'll see the following information (64-bit example): > readelf -l | grep INTERP -A 2 INTERP 0x0000000000000238 0x0000000010000238 0x0000000010000238 0x0000000000000045 0x0000000000000045 R 1 [Requesting program interpreter: /lib64/ld64] you'll see the following information (32-bit example): > readelf -l | grep INTERP -A 1 INTERP 0x113240 0x00113240 0x00113240 0x00013 0x00013 R 0x1 [Requesting program interpreter: /lib/ld-linux.so.2] [Loader Tips and Tricks](http://sourceware.org/glibc/wiki/Tips_and_Tricks/Loader_Tips_and_Tricks) # Building GLIBC without installing So you want to test out a glibc build, and you don't want to install it over your existing system glibc. Here are some tips: building glibc without installing Do "configure" and "make", but don't run "make install". Compile your test program, and invoke it with the loader you built. This is also how the "make check" runs tests. Note: if the executable under test resides in the current directory, don't forget to use "./" before the name. GLIBC= GCONV_PATH=${GLIBC}/iconvdata LC_ALL=C \ ${GLIBC}/elf/ld.so.1 --library-path \ ${GLIBC}:\ ${GLIBC}/math:\ ${GLIBC}/elf:\ ${GLIBC}/dlfcn:\ ${GLIBC}/nss:\ ${GLIBC}/nis:\ ${GLIBC}/rt:\ ${GLIBC}/resolv:\ ${GLIBC}/crypt:\ ${GLIBC}/nptl:\ ${GLIBC}/dfp \ building glibc with installing Do "configure" with a --prefix install directory that you can write to, then "make" and "make install". Compile your test program and give some extra options to gcc to use the install directory as the sysroot, and some options to the linker to set the shared library search path and dynamic linker. It is a good idea to verify the location of the dynamic linker using "readelf" and the library search paths with "ldd". (See loader tips and tricks) SYSROOT= gcc ... \ --sysroot=${SYSROOT} \ -Wl,--rpath=${SYSROOT}/lib \ -Wl,--dynamic-linker=${SYSROOT}/lib/ld.so.1 [Testing builds](http://sourceware.org/glibc/wiki/Testing/Builds) # How to port new instruction set architectures to binutils [GGX patch archive](http://spindazzle.org/ggx/) # OnChip Bus architectures [On-chip communications](http://moxielogic.org/blog/?p=474) # Debugging [Stack Backtracing Inside Your Program](http://www.linuxjournal.com/article/6391) [GNU Backtraces](http://www.gnu.org/s/libc/manual/html_node/Backtraces.html) [Wine Backtraces](http://wiki.winehq.org/Backtraces) [Debian Backtrace](http://wiki.debian.org/HowToGetABacktrace) [How do I use gcc, g++, and gdb?](http://www.seas.upenn.edu/cets/answers/gcc.html) [Debugging GCC](http://gcc.gnu.org/wiki/DebuggingGCC) [How to debug lto1 ICE?](http://gcc.gnu.org/ml/gcc/2009-11/msg00047.html) [Generate a core dump in linux](http://stackoverflow.com/questions/17965/generate-a-core-dump-in-linux) [Generating core files from gdb](http://prefetch.net/blog/index.php/2006/12/21/generating-core-files-from-gdb/) [Analizar un fichero core](http://www.wikilearning.com/tutorial/introduccion_a_gnu_debugger_gdb/422-4) [FreeBSD HandBook](http://www.freebsd.org/doc/en/books/developers-handbook/debugging.html)