Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: [lpc2100] Can someone help me to build gnucc form arm?

2003-12-16 by David Willmore

> Bill Gatliff have on his Homepage a good instruction to build the gcc 
> for a ARM. The link is : 
> http://www.billgatliff.com/articles/gnu/gnu-arm7t.html/index.html
> 
> For the lpc2106 , use as target "arm-thumb-elf"  and if you ready
> to Compile you need the switch  "-mcpu=arm7tdmi"  for the gcc.
> 
>  sincerely yours
>    Oliver Schneidewind 

I built the toolchain last night in anticipation of producing code
for chips that are anticipated shortly. :)  The default instructions
didn't work for me, so I made a few changes.  I also made some
changes to customize the generated tools for the lpc21xx family.

For the final gcc build, I did:
../gcc-3.3.2/configure --target=$TARGET --prefix=$PREFIX --with-gnu-as --with-gnu-ld --disable-shared --with-newlib --disable-threads --with-cpu=arm7tdmi --enable-target-optspace --enable-languages=c --with-headers

The only important part was the --enable-languages=c, I think.  It was
having trouble building the C++ standard library--why, I'm not sure.
The other stuff just looks like it would be handy.

--disable-shared -- well, there's no OS on there to provide shared
libraries, so no point in building in support for them.

--disable-threads -- I'm not building a multithreading executive

--with-newlib -- it's not obvious if this was needed, but it seemed save
to add as I was using newlib.

--with-cpu=arm7tdmi -- this just tells the compiler that the default target
for which to produce code is the arm7tdmi, so we never have to specify it on
the command line when we build code.

--enable-target-optspace -- I have no idea if this makes any difference
at all, but it might.  It tells the compiler to optimize for space on
generated code.  Seems handy for these little chips.

--enable-languages=c -- tells it to just build the C compiler.  It's all
I plan to program in--aside from assembly.  I used this to keep it from
building C++ and the problems that was having.

--with-headers -- this tells it to build with a different set of system
headers.  It should get the path correctly from the --prefix option.

Oh, I think you can speed up the build by adding a '--enable-languages=c'
to the bootstrap build of the compiler as I don't think the other ones
are used.

I was doing this on a Linux host.  Running RH9 with all current updates.

Good luck!

Cheers,
David

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.