This is the mail archive of the mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more infromation.

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

Re: Cygwin hosted Linux toolchain -- Howto test run

Řystein wrote:

> Can my linking problem be due to my library files being corrupted? (remember
> I took this from a file I got from the net, glibc-2.0.bin.i386.tar.gz, so they
> are not really tested)

 Why you couldn't give the error messages? So we must guess your 
linking problem...

 A quick checklist:

 1. Are the libs in a place where GCC finds them?
    Use 'i686-pc-linux-gnu-gcc -print-search-dirs' to see the search paths.

 2. Is the '' there (in <the_lib_dir>) too?

 3. Have you added the '-rpath-link <the_lib_dir>' to your specs? The linker
    doesn't find the shared libs ('.so' - files) otherwise... It searches only
    the native places in Linux (like '/lib' and '/usr/lib')

 My Mingw32-to-linux-gnu cross-compiler has the following LINK_SPEC :

  -m elf_i386 %{shared:-shared} %{!shared: %{!ibcs: %{!static:
  %{!dynamic-linker:-dynamic-linker /lib/
  --rpath-link //E/usr/local/i586-linux-gnu/lib}} %{static:-static}}}

 Mingw32-binaries need that '//D' for finding the stuff in disk 'D:', Cygwin 
probably don't need the disk name if the 'd:\usr' is mounted as '/usr'...

Cheers, Kai

BTW, a successfull compile/link log:

E:\usr\local\samples\sort>gcc-linux-gnu -v -o sort_linux.x sort.c
Reading specs from E:/usr/local/lib/gcc-lib/i586-linux-gnu/2.95/specs
gcc version gcc-2.95 19990615 (prerelease)
 E:/usr/local/lib/gcc-lib/i586-linux-gnu/2.95/cpp.exe -lang-c -v -iprefix E:/usr
/local/lib/gcc-lib\i586-linux-gnu/2.95/ -D__GNUC__=2 -D__GNUC_MINOR__=95 -D__ELF
__ -Dunix -D__i386__ -Dlinux -D__ELF__ -D__unix__ -D__i386__ -D__linux__ -D__uni
x -D__linux -Asystem(posix) -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386
__ -Di486 -D__i486 -D__i486__ sort.c e:\temp\ccxcaaaa.i GNU CPP version gcc-2.95
19990615 (prerelease) (i386 Linux/ELF) #include "..." search starts here:
#include <...> search starts here:

End of search list. The following default directories have been omitted from the
search path:
de End of omitted list.
 E:/usr/local/lib/gcc-lib/i586-linux-gnu/2.95/cc1.exe e:\temp\ccxcaaaa.i -quiet
-dumpbase sort.c -version -o e:\temp\ccUeaaaa.s GNU C version gcc-2.95 19990615
(prerelease) (i586-linux-gnu) compiled by GNU C version egcs-2.91.66 19990314
(egcs-1.1.2 release).
exe -V -Qy -o e:\temp\cchhaaaa.o e:\temp\ccUeaaaa.s GNU assembler version 990324
(i386-elf) using BFD version 990324
exe -m elf_i386 -dynamic-linker /lib/ --rpath-link //E/usr/local/i5
86-linux-gnu/lib -o sort_linux.x E:/usr/local/lib/gcc-lib/i586-linux-gnu/2.95/..
/../../../i586-linux-gnu/lib/crt1.o E:/usr/local/lib/gcc-lib/i586-linux-gnu/2.95
/../../../../i586-linux-gnu/lib/crti.o E:/usr/local/lib/gcc-lib/i586-linux-gnu/2
.95/crtbegin.o -LE:/usr/local/lib/gcc-lib/i586-linux-gnu/2.95 -LE:/usr/local/lib
/gcc-lib -L/usr/local/lib/gcc-lib/i586-linux-gnu/2.95 -LE:/usr/local/lib/gcc-lib
/i586-linux-gnu/2.95/../../../../i586-linux-gnu/lib -L/usr/local/lib/gcc-lib/i58
6-linux-gnu/2.95/../../../../i586-linux-gnu/lib -LE:/usr/local/lib/gcc-lib/i586-
linux-gnu/2.95/../../.. e:\temp\cchhaaaa.o -lgcc -lc -lgcc E:/usr/local/lib/gcc-
lib/i586-linux-gnu/2.95/crtend.o E:/usr/local/lib/gcc-lib/i586-linux-gnu/2.95/..

E:\usr\local\samples\sort>objdump -p sort_linux.x

sort_linux.x:     file format elf32-i386

Program Header:
    PHDR off    0x0000000000000034 vaddr 0x0000000008048034 paddr 0x000000000804
8034 align 2**2
         filesz 0x00000000000000a0 memsz 0x00000000000000a0 flags r-x
  INTERP off    0x00000000000000d4 vaddr 0x00000000080480d4 paddr 0x000000000804
80d4 align 2**0
         filesz 0x0000000000000013 memsz 0x0000000000000013 flags r--
    LOAD off    0x0000000000000000 vaddr 0x0000000008048000 paddr 0x000000000804
8000 align 2**12
         filesz 0x000000000000087e memsz 0x000000000000087e flags r-x
    LOAD off    0x0000000000000880 vaddr 0x0000000008049880 paddr 0x000000000804
9880 align 2**12
         filesz 0x00000000000010a0 memsz 0x00000000000010bc flags rw-
 DYNAMIC off    0x0000000000001898 vaddr 0x000000000804a898 paddr 0x000000000804
a898 align 2**2
         filesz 0x0000000000000088 memsz 0x0000000000000088 flags rw-

Dynamic Section:
  INIT        0x80483c0
  FINI        0x8048810
  HASH        0x80480e8
  STRTAB      0x80482c4
  SYMTAB      0x8048184
  STRSZ       0xb7
  SYMENT      0x10
  DEBUG       0x0
  PLTGOT      0x804a874
  PLTRELSZ    0x28
  PLTREL      0x11
  JMPREL      0x804838c
  REL         0x804837c
  RELSZ       0x10
  RELENT      0x8

New CrossGCC FAQ:
To remove yourself from the crossgcc list, send
mail to with the
text 'unsubscribe' (without the quotes) in the
body of the message.

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