what exactly is a "patch," anyway?

Dan Kegel dank@kegel.com
Mon Sep 12 03:43:00 GMT 2005

Michael N. Moran wrote:
> # touch a.c
> # arm-linux-gcc -malignment-traps -mapcs-32 -c a.c
> # armv5b-softfloat-linux-gcc -malignment-traps -mapcs-32 -c a.c
> cc1: error: invalid option 'alignment-traps'
> cc1: error: invalid option 'apcs-32'
> The (abreviated) versions
> # arm-linux-gcc --version
> arm-linux-gcc (GCC) 3.2.1
> # armv5b-softfloat-linux-gcc --version
> armv5b-softfloat-linux-gcc (GCC) 4.0.1
> The options chosen to compile the empty "a.c" file
> are those chosen by the "linux-2.6.x/arch/arm/Makefile" .

Googling for the error message brings up three hits.  One of them is
which says

> Both -malignment-traps and -mapcs-32 options are no longer needed in
> gcc-3.4.2 (and hence removed). You can either use a newer kernel
> ... which fixes this or modify the arch/arm/Makefile file.

It looks like 2.6.11 checks for the option being legal:

CFLAGS_ABI      :=$(call cc-option,-mapcs-32,-mabi=apcs-gnu)

cc-option is defined in Makefile as

cc-option = $(shell if $(CC) $(CFLAGS) $(1) -S -o /dev/null -xc /dev/null \
              > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)

so it looks like they use -mapcs-32 if $CC doesn't barf on it,
else they use -mabi=apcs-gnu.

So which version of the kernel were you using?  Something earlier than 2.6.11?
- Dan

p.s. if an explicit version check is needed, maybe something like
would do.  (I just found that by googling for call cc-option.)

Trying to get a job as a c++ developer?  See http://kegel.com/academy/getting-hired.html

Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com

More information about the crossgcc mailing list