Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error when building arm-elf-gcc

I'm trying to build a arm-elf-gcc cross compiler.

So firts I installed binutils 2.18 with the following configure options:

./configure --target=arm-elf --enable-interwork --enable-multilib

This seems to work fine.

next I installed gmp, mpfr and libmpc

so now to the gcc itself.

//edit - removed previous error and updated with the current one (I tried to build everything separately)

First I install a bootstrap gcc with these configure options:

--target=arm-elf --disable-libssp --with-newlib --without-headers --with-gnu-as --with-gnu-ld

And afterwards I try to build newlib 1.17.0 with it

--target=arm-elf --disable-werror --disable-newlib-supplied-syscalls --disable-nls --with-gnu-as --with-gnu-ld

But this still results in the same error. Maybe newlib tries to build for x86 architecture with the apple gcc (I'm running these things all on OS X) which maybe doesn't understand these parameters?

    cc1: error: unrecognized command line option "-msse4"
../../../../../../newlib/libc/argz/dummy.c:1: error: bad value (core2) for -march= switch
cc1: error: unrecognized command line option "-msse4"
FATAL:/usr/bin/../libexec/gcc/darwin/x86_64/as: I don't understand 'm' flag!
../../../../../../newlib/libc/argz/argz_add.c:1: error: bad value (core2) for -march= switch
cc1: error: unrecognized command line option "-msse4"
../../../../../../newlib/libc/argz/argz_add_sep.c:1: error: bad value (core2) for -march= switch
cc1: error: unrecognized command line option "-msse4"
make[8]: *** [lib_a-argz_add.o] Error 1
make[8]: *** Waiting for unfinished jobs....
../../../../../../newlib/libc/argz/argz_append.c:1: error: bad value (core2) for -march= switch
FATAL:/usr/bin/../libexec/gcc/darwin/x86_64/as: I don't understand 'm' flag!
cc1: error: unrecognized command line option "-msse4"
../../../../../../newlib/libc/argz/argz_create.c:1: error: bad value (core2) for -march= switch
cc1: error: unrecognized command line option "-msse4"
../../../../../../newlib/libc/argz/argz_count.c:1: error: bad value (core2) for -march= switch
FATAL:/usr/bin/../libexec/gcc/darwin/x86_64/as: I don't understand 'm' flag!
cc1: error: unrecognized command line option "-msse4"
../../../../../../newlib/libc/argz/argz_delete.c:1: error: bad value (core2) for -march= switch
make[8]: *** [lib_a-dummy.o] Error 1
make[8]: *** [lib_a-argz_create.o] Error 1
FATAL:/usr/bin/../libexec/gcc/darwin/x86_64/as: I don't understand 'm' flag!
FATAL:/usr/bin/../libexec/gcc/darwin/x86_64/as: I don't understand 'm' flag!
FATAL:/usr/bin/../libexec/gcc/darwin/x86_64/as: I don't understand 'm' flag!
make[8]: *** [lib_a-argz_add_sep.o] Error 1
make[8]: *** [lib_a-argz_delete.o] Error 1
FATAL:/usr/bin/../libexec/gcc/darwin/x86_64/as: I don't understand 'm' flag!
make[8]: *** [lib_a-argz_count.o] Error 1
make[8]: *** [lib_a-argz_append.o] Error 1
FATAL:/usr/bin/../libexec/gcc/darwin/x86_64/as: I don't understand 'm' flag!
cc1: error: unrecognized command line option "-msse4"
../../../../../../newlib/libc/argz/argz_create_sep.c:1: error: bad value (core2) for -march= switch
make[8]: *** [lib_a-argz_create_sep.o] Error 1
make[7]: *** [all-recursive] Error 1
make[6]: *** [all-recursive] Error 1
make[5]: *** [all] Error 2
make[4]: *** [multi-do] Error 1
make[3]: *** [all-multi] Error 2
make[2]: *** [all] Error 2
make[1]: *** [all-target-newlib] Error 2
make: *** [all] Error 2
like image 315
V1ru8 Avatar asked Mar 09 '26 07:03

V1ru8


1 Answers

Not every combination of binutils, gcc, and newlib work. I gave up a long time ago personally trying to find any combinations. Last time I was successful was in the gcc 3.x days, and you cant cross compile gcc 3.x with gcc 4.x or at least it is getting harder.

Maybe try without the interwork and multilib until you get straight arm working. Maybe you need an eabi in there in some form arm-non-eabi, something like that?

Here is a combination that gets a working gcc and libgcc

http://www.cowlark.com/2009-07-04-building-gcc/

code sourcery should have their build information available to figure out how to, at least get as far as binutils and gcc.

Somehow you are getting a core2 architecture in there, I dont see anything obvious though.

like image 195
old_timer Avatar answered Mar 12 '26 08:03

old_timer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!