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

See the CrossGCC FAQ for lots more information.


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: *** SPAM ***why my cross-gcc cannot find system root libs?


Hi:
thanks for your help.
2009/9/20 Yann E. MORIN <yann.morin.1998@anciens.enib.fr>:
> Loody,
> All,
>
> On Sunday 20 September 2009 10:43:22 loody wrote:
>> I attach my error at the end of letter.
>> I did see libc.a in sysroot/usr/lib, but my ld complains he cannot find it.
>> I also check the options I set in ld.pdf but it seems all fine.
>
> ld.pdf ?
The document which describe the usage of ld.
(included in binutils documents)
I guess maybe the error comes from my wrong options.

>
>> mipsel-unknown-linux-uclibc-ld -T ./link.xn -o TestCode.elf -Map
>> TestCode.map --oformat elf32-tradlittlemips ?reset.o cpufunc.o host.o
>> Interrupt.o main.o memtst.o ntsys.o diskio.o FileSystem.o tff.o misc.o
>> DMA.o GPIO.o SDMMC.o Storage.o ntuart.o uart.o -static -lc
>> mipsel-unknown-linux-uclibc-ld: cannot find -lc
>> make: *** [TestCode.elf] Error 1
>
> Can you re-run with --verbose ?
the result is below:
......
......
attempt to open uart.o succeeded
uart.o
attempt to open
/root/x-tools/mipsel-unknown-linux-uclibc/bin/../lib/libc.a failed

why the mipsel-unknown-linux-uclibc-ld search this directory for libs?

>
> Was that line hand-written, or was it generated by an "upper-layer" tool
> (such as gcc)?

the line is made by Makefile, which is got as below:
LD        = $(TOOLCHAIN)ld
LDLIBS    = -static -lc
LDFLAGS   = -T $(LDSCRIPT) -o $(IMAGE_ELF) -Map $(IMAGE_MAP) --oformat
$(OFORMAT)

$(IMAGE_ELF) : $(OBJ) $(LDSCRIPT)
        $(LD) $(LDFLAGS) $(OBJ) $(LDLIBS)

>
>> # mipsel-unknown-linux-uclibc-gcc -v
>
> ld comes from binutils, not gcc, so gcc can't tell you how ld will find
> it libraries.
>
Is the option, "--with-sysroot" used to tell toolchain where to get
the libs and include files?
I saw a lot of libs and include headers located at where
"--with-sysroot" points to, so I think where is the place linker will
find the libs it needs.
appreciate your help,
miloody

--
For unsubscribe information see http://sourceware.org/lists.html#faq


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