This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: gcc problem or not ?
- From: Andrew Lunn <andrew at lunn dot ch>
- To: Nickolay <nickolay at protei dot ru>
- Cc: ecos-discuss at sources dot redhat dot com
- Date: Fri, 14 Jan 2005 17:50:11 +0100
- Subject: Re: [ECOS] gcc problem or not ?
- References: <41E7F152.5030908@protei.ru>
On Fri, Jan 14, 2005 at 07:20:34PM +0300, Nickolay wrote:
> Hello
>
> Board IXDP425.
>
> Attempt build simple Hello World application:
>
> #include <stdio.h>
>
> int main() {
> printf ("Hello World!\n");
> return 0;
> }
>
> arm-elf-gcc -mcpu=xscale -mbig-endian -I/gnutools/arm-elf/include/ -L
> /gnutools/arm-elf/lib/xscale/be/ a.c -lc
>
> but ./a.out fall with "Segmentation Fault".
> Where i am mistaked?
This is not a gcc bug, its a user bug. -lc will cause the linker to
try to link your ARM application with your hosts i386 libc. This is
getting the linker confused and its bombing out.
Take a look at the following document which will tell you how to build
hello world.
http://ecos.sourceware.org/docs-latest/user-guide/building-and-running-sample-appliations.html
Andrew
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss