This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Help with -march and -mcpu issues
- From: Brian Dessent <brian at dessent dot net>
- To: Rick Mann <rmann at latencyzero dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Wed, 29 Aug 2007 18:49:21 -0700
- Subject: Re: Help with -march and -mcpu issues
- References: <E90E5807-8555-4028-823D-1A9867408615@latencyzero.com>
- Reply-to: binutils at sourceware dot org
Rick Mann wrote:
> $ arm-elf-gcc -c main.c -o main.o
> $ arm-elf-ld -e _start -o h.elf --script=link.lds start.o main.o
> $ arm-elf-objcopy --output-target=binary --gap-fill=0xff h.elf h
>
> The resulting file "h" works very well.
>
> However, if I add -mcpu=xscale or -march=armv5te to the gcc line, I
> get errors like this:
>
> arm-elf-ld: ERROR: main.o uses VFP instructions, whereas h.elf does not
You should ask this on the binutils list. The linker is not provided by
nor part of gcc, and your question seems to be about the linker.
Where does start.o come from? Are you not also rebuilding it with the
given -march? I'm guessing that the reason you get the error is that
the linker sees two objects that were built with different -march
settings (or rather one with the default and another with something
else), and that's why it's complaining. But that's just speculation, I
don't actually know.
Brian