public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/13989] New: gdb invalid search order for shared libraries by cross debuging
@ 2012-04-18 11:30 Daniel.Lehne@amk-drives.bg
  2012-04-18 11:50 ` [Bug gdb/13989] " palves at redhat dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Daniel.Lehne@amk-drives.bg @ 2012-04-18 11:30 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=13989

             Bug #: 13989
           Summary: gdb invalid search order for shared libraries by cross
                    debuging
           Product: gdb
           Version: 7.4
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
        AssignedTo: unassigned@sourceware.org
        ReportedBy: Daniel.Lehne@amk-drives.bg
    Classification: Unclassified


Hello,

i think the order to search libraries:

1st sysroot
2nd host-sysroot (absolute path of lib on host)
3rd solib-search-path 

for cross debugging is not usable. In this case libraries of the host-sysroot
replace the libraries for cross target in solib-search-path, and debugging
becomes impossible.
I configured GDB with --with-sysroot, declared additional set sysroot, set
solib-search-path, set solib-absolute-path (nevermind alias of set sysroot). 

Example:
Simple Hello world project, additional lib freetype and jpeg (they should
exists host-sysroot), linked to binary. Gdb session started with init:
set sysroot <TOOLCHAIN>
set solib-search-path <SPECIAL LIBS>

#include "stdio.h"

int main(int argc, char **argv) {
    printf("test");
}

Invoking: Cross GCC Compiler
arm-1136jfs-linux-gnueabi-gcc -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP
-MF"main.d" -MT"main.d" -o "main.o" "../main.c"
../main.c: In function 'main':
../main.c:5:1: warning: control reaches end of non-void function
Finished building: ../main.c

Building target: gdb_bug_sysroot
Invoking: Cross GCC Linker
arm-1136jfs-linux-gnueabi-gcc -L/home/opt/amklibs/arm-1136jfs -o
"gdb_bug_sysroot"  ./main.o   -lz -ljpeg -lfreetype
Finished building target: gdb_bug_sysroot

GDB-Session:

...
252,189
=library-loaded,id="/usr/lib/libz.so.1",target-name="/usr/lib/libz.so.1",host-name="/home/opt/libs/arm-1136jfs/libz.so.1",symbols-loaded="0",thread-group="i1"
252,190 &"warning: `/usr/lib/libjpeg.so.8': Shared library architecture unknown
is not compatible with target architecture arm.\n"
252,190
=library-loaded,id="/usr/lib/libjpeg.so.8",target-name="/usr/lib/libjpeg.so.8",host-name="/usr/lib/libjpeg.so.8",symbols-loaded="0",thread-group="i1"
252,190
=library-loaded,id="/lib/libc.so.6",target-name="/lib/libc.so.6",host-name="/home/opt/Toolchain/arm-1136jfs-linux-gnueabi/gcc-4.5.2-glibc-2.13-binutils-2.21-kernel-2.6.36-sanitized/sysroot-arm-1136jfs-linux-gnueabi/lib/libc.so.6",symbols-loaded="0",thread-group="i1"
252,190 &"warning: `/lib/libgcc_s.so.1': Shared library architecture unknown is
not compatible with target architecture arm.\n"
252,190
=library-loaded,id="/lib/libgcc_s.so.1",target-name="/lib/libgcc_s.so.1",host-name="/lib/libgcc_s.so.1",symbols-loaded="0",thread-group="i1"
...

The library libz loaded correctly from solib-search-path. The library libc.so.6
loaded correctly from Toolchain by sysroot. 

The libjpeg and libfreetype (cut out of log) loaded incorrectly from host
rootfs instead of solib-search-path.

Thanks for a request.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-09-28 21:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-18 11:30 [Bug gdb/13989] New: gdb invalid search order for shared libraries by cross debuging Daniel.Lehne@amk-drives.bg
2012-04-18 11:50 ` [Bug gdb/13989] " palves at redhat dot com
2012-04-18 12:33 ` Daniel.Lehne@amk-drives.bg
2012-04-18 12:58 ` Daniel.Lehne@amk-drives.bg
2012-05-10 14:31 ` palves at redhat dot com
2012-09-28 19:50 ` palves at redhat dot com
2012-09-28 20:20 ` cvs-commit at gcc dot gnu.org
2012-09-28 21:10 ` palves at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).