LLVM-gcc for ARM

Hello,


<br>I am building llvm-gcc4.2-2.6 for ARM target.<br>



<br>I used the next command line option:<br>>><br>../configure --enable-languages=c,c++ --enable-checking --target=arm-eabi<br>>> <br>and then<br>>><br> make target_alias=arm-eabi<br>>><br>And then I obtain the following error:<br><br>In file included from ../../gcc/config/arm/arm.c:59:<br>./../../libcpp/internal.h: In function ‘ufputs’:<br>./../../libcpp/internal.h:693: warning: implicit declaration of function ‘fputs_unlocked’<br>../../gcc/config/arm/arm.c: At top level:<br>../../gcc/config/arm/arm.c:514: error: ‘MASK_INTERWORK’ undeclared here (not in a function)<br>../../gcc/config/arm/arm.c: In function ‘optimization_options’:<br>../../gcc/config/arm/arm.c:23444: warning: unused parameter ‘level’<br><br>What would be the problem?<br>It is OK<br> the configure line? <br><br>Thanks,<br>Corina<br><br>

|

Hello

What would be the problem?

You're building llvm-gcc w/o LLVM.

It is OK the configure line?

No. Please do read readme.llvm file in the llvm-gcc's source
directory. In short: you missed --enable-llvm option

Hello

exec: 2: -meabi=4: not found
make[4]: *** [crtbegin.o] Error 1

It seems you don't have cross-binutils for arm-eabi installed. Note
that ARM binutils are known to be buggy - you should use the fresh
CVS snapshot.

PS: Please use "Reply All" button - this way the copy will be sent to
llvm-dev ML and others will be able to comment / use the information
as well.

From where can I take them? And how modifies the compiling procedure?

Thank you,
Corina

— On Fri, 1/15/10, Anton Korobeynikov anton@korobeynikov.info wrote:


> From: Anton Korobeynikov anton@korobeynikov.info
> Subject: Re: [LLVMdev] LLVM-gcc for ARM
> To: “corina s” corina_fff@yahoo.com
> Cc: “LLVM Developers Mailing List” llvmdev@cs.uiuc.edu
> Date: Friday, January 15, 2010, 4:03 PM
>
> Hello
>
> > exec: 2: -meabi=4: not found
> > make[4]: *** [crtbegin.o] Error 1
> It seems you don’t have cross-binutils for arm-eabi installed. Note
> that ARM binutils are known to be buggy - you should use the fresh
> CVS snapshot.
>
> PS: Please use “Reply All” button - this way the copy will be sent to
> llvm-dev ML and others will be able to comment / use the information
> as well.
>
> –
> With best regards, Anton Korobeynikov
> Faculty of Mathematics and Mechanics, Saint Petersburg State University

|

OK, I put in my classpath the binaries from this package

arm-2005q3-1-arm-none-linux-gnueabi-i686-pc-linux-gnu

futrhermore in the configure options I specified --with-gnu-ld and --with-gnu-as but I am getting the same error.

exec: 2: -meabi=4: not found

Any ideas?

exec: 2: -meabi=4: not found

Any ideas?

Yes. As it can be deduced from the name of the package, it's for
arm-none-linux-gnueabi, not for arm-eabi.

Also, note that the mentioned package is too old for anything useful.

Can you be more specific?
Where can I found it(arm-eabi)? please provide me with some basic steps.

Thank you.

— On Sat, 1/16/10, Anton Korobeynikov anton@korobeynikov.info wrote:


> From: Anton Korobeynikov anton@korobeynikov.info
> Subject: Re: [LLVMdev] LLVM-gcc for ARM
> To: “corina s” corina_fff@yahoo.com
> Cc: llvmdev@cs.uiuc.edu
> Date: Saturday, January 16, 2010, 1:29 PM
>
> > exec: 2: -meabi=4: not found
> >
> > Any ideas?
> Yes. As it can be deduced from the name of the package, it’s for
> arm-none-linux-gnueabi, not for arm-eabi.
>
> Also, note that the mentioned package is too old for anything useful.
> –
> With best regards, Anton Korobeynikov
> Faculty of Mathematics and Mechanics, Saint Petersburg State University

|

Hello

Can you be more specific?
Where can I found it(arm-eabi)? please provide me with some basic steps.

Hrm, I assumed one going to build a compiler for bare metal target
would know what to do...

Have you looked here: http://www.codesourcery.com/sgpp/lite/arm ?
Or maybe you linux distribution vendor provides some pre-built package?
I usually build it from sources: http://sourceware.org/binutils/

Also, for bare metal target you will need some C library e.g. newlib.
There is some script inside utils/crosstools to automate building of
cross-compilers, but I never run it by myself.

Hello Corina,

I used a two-stage sequence to build the llvm and llvm-gcc with the codesourcery toolchain and my custom built arm toolchain. There is some scripted chunks for each step. I have attached them as a single file to this email. May be it will help you somehow.

Viktor.

build-llvm-gcc-2-stage-seq.htm (8.44 KB)

We have had a script for a while that does this for you in http://llvm.org/svn/llvm-project/llvm/trunk/utils/crosstool/ARM/ .
It also uses the CodeSourcery toolchain so it saves you some effort.

Does that work for you?

It works in general, but it wasn’t enough for my cases. I knew about this script and I used this one and a script from the llvm buildbot as a start point to create a workable build sequence for llvm/llv-gcc as I needed. I just forgot to point out on this script because I don’t use it routinely.

Thank you.

-Viktor.