3

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
1
  • The config.log will attempt to tell you. Please post the relevant fragment (it's usually big). Commented Aug 27, 2010 at 12:28

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

see my updated post, I tried to build with just the minimum options and still getting errors when building newlib.
0

Yes this is an old post, but I found it as I was looking for an answer. Now I found the answer, so I'll post it here.

Look closely at the "as" - which as is actually executed, your as for the host-computer or for the target architecture ?

The answer is: The as for the target architecture.

This happens when you build on Mac - both on PowerPC and on intel. You should set up your PATH environment variable right after building binutils, so that the correct binutils will be found, otherwise your native x86 (or PowerPC) tools will be used to build your ARM target. That just won't work.

2 Comments

How do you set the PATH env in the middle of a build? Do you hack the Makefile? Thx. I am trying to build android source on a Mac laptopn running Intel and i am getting the same "I don't understand 'm' option".
No, you don't hack the Makefile. -After your binutils build and install finishes (eg. make && sudo make install), you run export PATH="/usr/local/arm-none-eabi/bin:$PATH"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.