This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Link error building eCos CVS host tools on FC2 -> resolved
- From: Craig Barratt <cbarratt at atheros dot com>
- To: Andrew Lunn <andrew at lunn dot ch>
- Cc: ecos-discuss at sources dot redhat dot com
- Date: Sat, 20 Nov 2004 22:40:08 -0800
- Subject: Re: [ECOS] Link error building eCos CVS host tools on FC2 -> resolved
Andrew Lunn writes:
> > I'm using gcc (GCC) 3.3.3 20040412 (Red Hat Linux 3.3.3-7).
>
> This sounds like a compiler/linker bug. It compiles fine on my Debian
> unstable system with gcc version 3.3.5.
>
> The post says he had to tell gcc where libstdc++. For my toolchain
> this happens automatically:
My libstdc++ is in /usr/lib.
I discovered that the link succeeds if I put
-L/opt/ecos/ecos-cvs-build/host/libcdl
prior to -lcdl, so it looks like this:
c++ -pipe -Wall -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Woverloaded-virtual -O0 -o ecosconfig ecosconfig.o cdl_exec.o build.o flags.o -lcdl -lcyginfra -L/usr/lib -ltcl8.4 -L/opt/ecos/ecos-cvs-build/host/libcdl -L/opt/ecos/ecos-cvs-build/host/infra
instead of the default:
c++ -pipe -Wall -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Woverloaded-virtual -O0 -o ecosconfig ecosconfig.o cdl_exec.o build.o flags.o -L/opt/ecos/ecos-cvs-build/host/libcdl -lcdl -lcyginfra -L/usr/lib -ltcl8.4 -L/opt/ecos/ecos-cvs-build/host/infra
(I did this by editing the Makefile after the failure, and then
re-running make.)
This doesn't make sense, since the ld documentation clearly states that:
All -L options apply to all -l options, regardless of the order in
which the options appear.
I installed the latest binutils, but the effect was the same.
So even though I don't understand the root cause (some sort of
tool chain hiccup), I can now build the host tools.
Thanks for the suggestions.
Craig
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss