EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

install gnu toolchain for Cortex-M3

Started by cerr December 22, 2011
Hi There,

I'm trying to get a gnu toolchain for ARM Cortex-M3 established, so
far unsuccesful.
I got instructions from  http://www.gnuarm.com/ [on the bottom] - I
setup cygwin and installed all the required things - so I thought...
However, at step 3 building the compiler I get:
cd /usr/src/binutils-2.22.51-1 && autogen Makefile.def
/usr/bin/sh: autogen: command not found
make: *** [/usr/src/binutils-2.22.51-1/Makefile.in] Error 127

this after configuring with these options:
$ /usr/src/binutils-2.22.51-1/configure --target=arm-elf --prefix=/
cygdrive/c/mingw/bin/ --enable-interwork --enable-multilib

So I thought I should install autogen, okay, downloaded sources with
cvs but the configure script here tells me it couldn't find a working
version of libguile (which I have installed in cygwin) - okay, I
downloaded the sources of libguile as well and wanted to build them
myself but I don't know how...

has anyone built a gnu toolchain before and can help me how to get
this accomplished in cygwin - if that's possible at all? Or should I
better get a virtual Linux system up and running?
Thanks for hints, tips or suggestions!
roN
On 22/12/11 22:38, cerr wrote:
> Hi There, > > I'm trying to get a gnu toolchain for ARM Cortex-M3 established, so > far unsuccesful. > I got instructions from http://www.gnuarm.com/ [on the bottom] - I > setup cygwin and installed all the required things - so I thought... > However, at step 3 building the compiler I get: > cd /usr/src/binutils-2.22.51-1&& autogen Makefile.def > /usr/bin/sh: autogen: command not found > make: *** [/usr/src/binutils-2.22.51-1/Makefile.in] Error 127 > > this after configuring with these options: > $ /usr/src/binutils-2.22.51-1/configure --target=arm-elf --prefix=/ > cygdrive/c/mingw/bin/ --enable-interwork --enable-multilib > > So I thought I should install autogen, okay, downloaded sources with > cvs but the configure script here tells me it couldn't find a working > version of libguile (which I have installed in cygwin) - okay, I > downloaded the sources of libguile as well and wanted to build them > myself but I don't know how... > > has anyone built a gnu toolchain before and can help me how to get > this accomplished in cygwin - if that's possible at all? Or should I > better get a virtual Linux system up and running? > Thanks for hints, tips or suggestions! > roN
I'd recommend against building gcc under cygwin. It's certainly possible, but it can be a lot of work and the cause of much frustration if you are not experienced in such builds. And the final binary will be quite a bit slower than one built with mingw. Building gcc is usually easier on Linux. But unless you have particular reason to want to build it, why not be lazy and use pre-built toolchains? You can get them for Windows or Linux from various sources - either commercial (but with free or cheap versions) from CodeSourcery, Code Red, or various others, or non-commercial from <http://www.yagarto.de> or <http://www.gnuarm.com> amongst others. Of course, if you /want/ to build it yourself (it's fun, and you can get the latest versions, including development versions), then it's certainly possible. But try to find instructions for using mingw and msys - the resulting binaries will be much more efficient, and feel more "native" to windows.
On Thu, 22 Dec 2011 13:38:01 -0800, cerr wrote:

> Hi There, > > I'm trying to get a gnu toolchain for ARM Cortex-M3 established, so far > unsuccesful. > I got instructions from http://www.gnuarm.com/ [on the bottom] - I > setup cygwin and installed all the required things - so I thought...
Cygwin?/Windows? Ouch. This is situation where it pays to run Linux. Under Debian I can use the emdebian pre-compiled cross development tools After setting up /etc/apt/sources.list, it becomes no more complicated than apt-get update apt-get install gcc-4.4-arm-linux apt-get install gdb-arm-linux-gnueabi
On Thu, 22 Dec 2011 13:38:01 -0800, cerr wrote:

> Hi There, > > I'm trying to get a gnu toolchain for ARM Cortex-M3 established, so far > unsuccesful. > I got instructions from http://www.gnuarm.com/ [on the bottom] - I > setup cygwin and installed all the required things - so I thought... > However, at step 3 building the compiler I get: cd > /usr/src/binutils-2.22.51-1 && autogen Makefile.def /usr/bin/sh: > autogen: command not found make: *** > [/usr/src/binutils-2.22.51-1/Makefile.in] Error 127 > > this after configuring with these options: $ > /usr/src/binutils-2.22.51-1/configure --target=arm-elf --prefix=/ > cygdrive/c/mingw/bin/ --enable-interwork --enable-multilib > > So I thought I should install autogen, okay, downloaded sources with cvs > but the configure script here tells me it couldn't find a working > version of libguile (which I have installed in cygwin) - okay, I > downloaded the sources of libguile as well and wanted to build them > myself but I don't know how... > > has anyone built a gnu toolchain before and can help me how to get this > accomplished in cygwin - if that's possible at all? Or should I better > get a virtual Linux system up and running? Thanks for hints, tips or > suggestions! roN
That page is _old_. Google "summon-arm-toolchain", and look until you find the GIT link. Then get the latest, read the comments, and see what you can see. Certainly on a linux box it's just the bee's knees. -- Tim Wescott Control system and signal processing consulting www.wescottdesign.com
On 12/22/2011 7:38 PM, igbo.embedded wrote:
> On Thu, 22 Dec 2011 13:38:01 -0800, cerr wrote: > >> Hi There, >> >> I'm trying to get a gnu toolchain for ARM Cortex-M3 established, so far >> unsuccesful. >> I got instructions from http://www.gnuarm.com/ [on the bottom] - I >> setup cygwin and installed all the required things - so I thought... > > Cygwin?/Windows? Ouch. > This is situation where it pays to run Linux. Under Debian I can use > the emdebian pre-compiled cross development tools > > After setting up /etc/apt/sources.list, it becomes no more complicated > than > > apt-get update > > apt-get install gcc-4.4-arm-linux > apt-get install gdb-arm-linux-gnueabi >
Ok, linux is better then sex. [1] Can someone please answer the question ??? don [1] Linux is user friendly, its just particular about who its friends are.[2] Linux is user friendly, Linux users are particular about who their friends are.
On 22/12/2011 21:38, cerr wrote:
> Hi There, > > I'm trying to get a gnu toolchain for ARM Cortex-M3 established, so > far unsuccesful. > I got instructions from http://www.gnuarm.com/ [on the bottom] - I > setup cygwin and installed all the required things - so I thought... > However, at step 3 building the compiler I get: > cd /usr/src/binutils-2.22.51-1 && autogen Makefile.def > /usr/bin/sh: autogen: command not found > make: *** [/usr/src/binutils-2.22.51-1/Makefile.in] Error 127 > > this after configuring with these options: > $ /usr/src/binutils-2.22.51-1/configure --target=arm-elf --prefix=/ > cygdrive/c/mingw/bin/ --enable-interwork --enable-multilib >
I think you are making your life unnecessarily hard. Use a native Windows GCC build like Yagarto.de, or the free "lite" version of the CodeSourcery tools (now Mentor Embedded). Regards, Richard. + http://www.FreeRTOS.org Designed for Microcontrollers. More than 7000 downloads per month.
On Thu, 22 Dec 2011 20:52:45 -0700, hamilton wrote:

> On 12/22/2011 7:38 PM, igbo.embedded wrote: >> On Thu, 22 Dec 2011 13:38:01 -0800, cerr wrote: >> >>> Hi There, >>> >>> I'm trying to get a gnu toolchain for ARM Cortex-M3 established, so >>> far unsuccesful. >>> I got instructions from http://www.gnuarm.com/ [on the bottom] - I >>> setup cygwin and installed all the required things - so I thought... >> >> Cygwin?/Windows? Ouch. >> This is situation where it pays to run Linux. Under Debian I can use >> the emdebian pre-compiled cross development tools >> >> After setting up /etc/apt/sources.list, it becomes no more complicated >> than >> >> apt-get update >> >> apt-get install gcc-4.4-arm-linux >> apt-get install gdb-arm-linux-gnueabi >> >> > Ok, linux is better then sex. [1] > > Can someone please answer the question ??? > > don > > [1] Linux is user friendly, its just particular about who its friends > are.[2] > > Linux is user friendly, Linux users are particular about who their > friends are.
You might be able to do that from Cygwin, or at least get all the source that way. -- My liberal friends think I'm a conservative kook. My conservative friends think I'm a liberal kook. Why am I not happy that they have found common ground? Tim Wescott, Communications, Control, Circuits & Software http://www.wescottdesign.com
On 12/22/11 21:38, cerr wrote:
> Hi There, > > I'm trying to get a gnu toolchain for ARM Cortex-M3 established, so > far unsuccesful. > I got instructions from http://www.gnuarm.com/ [on the bottom] - I > setup cygwin and installed all the required things - so I thought... > However, at step 3 building the compiler I get: > cd /usr/src/binutils-2.22.51-1&& autogen Makefile.def > /usr/bin/sh: autogen: command not found > make: *** [/usr/src/binutils-2.22.51-1/Makefile.in] Error 127 > > this after configuring with these options: > $ /usr/src/binutils-2.22.51-1/configure --target=arm-elf --prefix=/ > cygdrive/c/mingw/bin/ --enable-interwork --enable-multilib > > So I thought I should install autogen, okay, downloaded sources with > cvs but the configure script here tells me it couldn't find a working > version of libguile (which I have installed in cygwin) - okay, I > downloaded the sources of libguile as well and wanted to build them > myself but I don't know how... > > has anyone built a gnu toolchain before and can help me how to get > this accomplished in cygwin - if that's possible at all? Or should I > better get a virtual Linux system up and running? > Thanks for hints, tips or suggestions! > roN
Not sure if this answers the question, but doesn't cygwin have binaries for autogen and most of the gnu packages in the distribution ?. Just run install again and select from the list to update. Unless you really want to build from source for the experience, it just makes more work. This doesn't guarantee success though. Spent quite a bit of time this year experimenting with cross cortex toolchain builds to run on linux / solaris and found loads of issues. Almost like a series of hurdles to overcome :-). To start, the build process does seem to assume quite a bit of the gnu infrastructure in place. For 4.6.1, for example, there are non gnu math libraries which must be installed first and be at the required rev level, otherwise gcc won't build at all. For solaris, they had to be built from source and include stuff like the -m32 gcc switch, otherwise you get 64 bit by default and elf format error messages half way through the gcc build. None of this is difficult, but can be very time consuming if you are starting from scratch. Initially starting on a solaris 10 sparc host, eventually gave up, backtracked to linux to get a process together for a clean build, then applied that back to the solaris build. Of the linuxen tried, suse 11 was the most sorted in terms of in place packages and their rev levels and was able to get a clean build there with not too much effort. The binutils package seems to build anywhere without issues, but gcc and newlib are much more fussy. I was fortunate enough to have quite a bit of free time available this year, but if you are in a hurry, a prebuilt toolchain might be a better plan... Regards, Chris Regards, Chris so straightforward at all...
On 12/24/11 13:48, ChrisQ wrote:

Checking notes: list of gnu and other packages installed
to support toolchain builds:

autoconf, automake, binutils, bison, bzip2, flex, gcc, texinfo,
gmp, libgcc, libiconv, m4, make, gmp, mpfr, perl, ppl

Not all these may be required, but make, flex, bison, texinfo, m4
definately are and the gmp, mpfr and ppl libraries are required
for later gcc revsions. The catch being, of course, that later
Cortex such as m0 are only supported by later gcc versions :-).

Another point is that gcc tarballs may incorrectly unpack with
anything other than latest gnu tar, so you need to add that
to the above list. No messages from tar, but gcc build fails
with cryptic error messages...

Regards,

Chris
Last time I tried this I also was unable to get Guile to
build under Windows. Decided life is too short and got the
excellent CodeRed version, which was excellent.

If you really must build a Windows version you may
have better luck with building it under Linux (gets
a bit confusing, careful with definitions of the 3
platforms involved in this exercise)...

Hope that helps,
Best Regards, Dave

The 2024 Embedded Online Conference