Build the Linux avr-gcc 4.3.3 toolchain in FemtoOS

Go To Last Post
20 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Guyzz

Quote:
Skip to the below url , as it contains a newer buildscript.

http://www.avrfreaks.net/index.p...

I have toyed a little around with the avr-gcc 4.3.2 toolchain , that is based on the WinAVR patches and included in FemtoOS 0.87.

I have adapted it to build under Ubuntu 8.04 , and have attached a zipfile with the modifications.

The Readme.txt

Quote:

This toolchain is build using the excellent toolchain script included in femtoos.

http://www.femtoos.org/

The version tested & used here is FemtoOS_0.87.zip

Download the femtoos archive here http://sourceforge.net/project/s...

I had to do a a little bit of modifications to the script , in order to get it to build under Ubuntu 8.04

And had to apply the makeinfo patch to binutils 2.18.

Steps to build :

1: Install all the packages mentioned in pre-reqs.txt

2: unzip FemtoOS_0.87.zip

3: Copy the binutils-makeinfo patch from the patch directory of this archive , to the same directory of FemtoOS_0.87

4: Copy the install_toolchain-ubuntu from the Install_Scripts directory of this archive to
the same directory of FemtoOS_0.87
5: Make sure the install_toolchain-ubuntu script is executable by doing a : chmod +x install_toolchain-ubuntu

6: Maybe edit the PREFIX variable around line 106 , to a prefix of your liking.
It default installs the toolchain in PREFIX=FemtoOS_0.87/IDE/proc.
If you change it to the default of /usr/local/avr , the script must be run with the sudo command , in order to
have write access to the install dir.

7: Change directory back to the main femtoos directory : FemtoOS_0.87

8: Build the toolchain by executing (remember sudo in front , if you install to /usr/local/avr).
Install_scripts/install_toolchain-ubuntu

or

sudo Install_scripts/install_toolchain-ubuntu

All credit goes to the author of femtoos , and the avr-gcc etc .. teams (Eric , Jörg et all)

You could actually try to build some of the femtoos apps , they look nice.

/Bingo

I must admit i haven't tried to compile an avr program yet :oops: :oops:

I just had it to build correctly.

But i have had several PM's asking for a 4.3.x toolchain for Linux , and seen several requests here.

As always .. there are no guarantees

Ohh ... unpack the attached archive on a linux box with unzip

/Bingo

Attachment(s): 

Last Edited: Sun. Feb 8, 2009 - 03:22 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Supported mcu's


avr-gcc --target-help

Known MCU names:
  avr1 avr2 avr3 avr31 avr35 avr4 avr5 avr51 avr6 avrxmega1 avrxmega2
  avrxmega3 avrxmega4 avrxmega5 avrxmega6 avrxmega7 at90s1200 attiny11
  attiny12 attiny15 attiny28 at90s2313 at90s2323 at90s2333 at90s2343
  attiny22 attiny26 at90s4433 at90s4414 at90s4434 at90s8515 at90s8535
  at90c8534 at86rf401 attiny13 attiny2313 attiny261 attiny461 attiny861
  attiny24 attiny44 attiny84 attiny25 attiny45 attiny85 attiny43u attiny48
  attiny88 atmega103 at43usb320 at43usb355 at76c711 at90usb82 at90usb162
  attiny167 atmega48 atmega48p atmega8 atmega88 atmega88p atmega8515
  atmega8535 atmega8hva at90pwm1 at90pwm2 at90pwm2b at90pwm3 at90pwm3b
  atmega16 atmega161 atmega162 atmega163 atmega164p atmega165 atmega165p
  atmega168 atmega168p atmega169 atmega169p atmega32 atmega323 atmega324p
  atmega325 atmega325p atmega328p atmega329 atmega329p atmega3250
  atmega3250p atmega3290 atmega3290p atmega406 atmega64 atmega640
  atmega644 atmega644p atmega128 atmega1280 atmega1281 atmega1284p
  atmega645 atmega649 atmega6450 atmega6490 atmega16hva at90can32
  at90can64 at90can128 at90pwm216 at90pwm316 atmega32c1 atmega32m1
  atmega32u4 at90usb646 at90usb647 at90usb1286 at90usb1287 at94k
  atmega2560 atmega2561 atxmega64a1 atxmega128a1

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have just released Femto OS v0.88. I contains a new toolchain builder. It builds:
- binutils 2.19
- gcc 4.3.3
- gmp 4.2.4
- mpfr 2.4.0
- dude 5.5
including all available patches and some non-official (but essential!). It automatically produces logfiles now and does not flood your screen any more. Tested on:
- Gentoo (Profiles 2007/2008)
- Ubuntu (fully updated)
- Mac (OSX 10.5.6)
- Windows (cygwin: 2000, XP)

Please note that that cygwin does not distribute the packages reliably, so testing is hard, and results differ.

The toolchain can be downloaded via my website:
http://www.femtoos.org/
choose: code - download.

If you experience problems or are successful on a new platform , please let me know, so i can improve the script. Mail me and please include a zipped log directory. Have fun!

Ruud Vlaming

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Nice work Ruud :-)

I guess this is the best AVR-GCC 4.3.x toolchain builder for Linux.

I will test The toolchain , as soon as i get the time :-)

Btw. isn't the makeinfo patch needed for binutils 2.19 ?? (I mean have they corrected it in there ??)

And i needed to do a :


sudo apt-get install gawk libtool

Before i succeded in installing (ubuntu 7.04) with all the packages installed that i normally need for building 4.2.2 (and mentioned in your Readme), but it was caught allready at the start of the install script. Nice detection :wink: :wink:

The build went fine , so i guess the makeinfo patch wasn't needed :-)

@Ruud : I just miss avarice & insight/gdb
Those should build "right out of the box" wo. any patches at all (at least on linux) , have a look at the 4.22 buildscript.

/Bingo

Last Edited: Sun. Feb 8, 2009 - 05:56 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Supported MCU's in the FemtoOS 0.88 build


~/avr/FemtoOS/FemtoOS_0.88/IDE/proc/bin$ ./avr-gcc --target-help 

Known MCU names:
  avr1 avr2 avr25 avr3 avr31 avr35 avr4 avr5 avr51 avr6 avrxmega1
  avrxmega2 avrxmega3 avrxmega4 avrxmega5 avrxmega6 avrxmega7 at90s1200
  attiny11 attiny12 attiny15 attiny28 at90s2313 at90s2323 at90s2333
  at90s2343 attiny22 attiny26 at90s4414 at90s4433 at90s4434 at90s8515
  at90c8534 at90s8535 attiny13 attiny13a attiny2313 attiny24 attiny44
  attiny84 attiny25 attiny45 attiny85 attiny261 attiny461 attiny861
  attiny43u attiny48 attiny88 at86rf401 at43usb355 at76c711 atmega103
  at43usb320 attiny167 at90usb82 at90usb162 atmega8 atmega48 atmega48p
  atmega88 atmega88p atmega8515 atmega8535 atmega8hva at90pwm1 at90pwm2
  at90pwm2b at90pwm3 at90pwm3b atmega16 atmega161 atmega162 atmega163
  atmega164p atmega165 atmega165p atmega168 atmega168p atmega169
  atmega169p atmega32 atmega323 atmega324p atmega325 atmega325p atmega3250
  atmega3250p atmega328p atmega329 atmega329p atmega3290 atmega3290p
  atmega406 atmega64 atmega640 atmega644 atmega644p atmega645 atmega649
  atmega6450 atmega6490 atmega16hva at90can32 at90can64 at90pwm216
  at90pwm316 atmega16u4 atmega32c1 atmega32m1 atmega32u4 atmega32u6
  at90usb646 at90usb647 at94k atmega128 atmega1280 atmega1281 atmega1284p
  at90can128 at90usb1286 at90usb1287 atmega2560 atmega2561 atxmega64a3
  atxmega64a1 atxmega128a3 atxmega256a3 atxmega256a3b atxmega128a1

/Bingo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Bingo600 wrote:
Nice work Ruud :-)
I guess this is the best AVR-GCC 4.3.x toolchain builder for Linux.

Thanks! Btw, the installer now has an option to choose your installation
location, so you are not bound to the Femto OS directory.

Bingo600 wrote:
The build went fine , so i guess the makeinfo patch wasn't needed :-)

Thank you for testing. And indeed, i don't think we need that patch any more.

Bingo600 wrote:

@Ruud : I just miss avarice & insight/gdb
Those should build "right out of the box" wo. any patches at all (at least on linux) , have a look at the 4.22 buildscript.

Yeah, well, i do not use those tools, but others do. I will see if i can include them in my next release. My toolchain builder was actually not meant to be a general tool, but merely a tool to get the Femto OS up and running, but it has got a little out of hand i guess ;-)

Ruud.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
My toolchain builder was actually not meant to be a general tool, but merely a tool to get the Femto OS up and running, but it has got a little out of hand i guess ;-)

But it turned out so nicely :-)

/Bingo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey Guys

Hope you can help me with this:

make[2]: Entering directory `/home/AVR/FemtoOS_0.88/download/binutils-2.19-build/opcodes'
make  all-recursive
make[3]: Entering directory `/home/AVR/FemtoOS_0.88/download/binutils-2.19-build/opcodes'
Making all in po
make[4]: Entering directory `/home/AVR/FemtoOS_0.88/download/binutils-2.19-build/opcodes/po'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/home/AVR/FemtoOS_0.88/download/binutils-2.19-build/opcodes/po'
make[4]: Entering directory `/home/AVR/FemtoOS_0.88/download/binutils-2.19-build/opcodes'
/bin/bash ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../binutils-2.19/opcodes -I. -I. -I../../binutils-2.19/opcodes -I../bfd -I../../binutils-2.19/opcodes/../include -I../../binutils-2.19/opcodes/../bfd     -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror -g -O2 -c -o dis-buf.lo ../../binutils-2.19/opcodes/dis-buf.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../../binutils-2.19/opcodes -I. -I. -I../../binutils-2.19/opcodes -I../bfd -I../../binutils-2.19/opcodes/../include -I../../binutils-2.19/opcodes/../bfd -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror -g -O2 -c ../../binutils-2.19/opcodes/dis-buf.c -o dis-buf.o
/bin/bash ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../binutils-2.19/opcodes -I. -I. -I../../binutils-2.19/opcodes -I../bfd -I../../binutils-2.19/opcodes/../include -I../../binutils-2.19/opcodes/../bfd     -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror -g -O2 -c  -DARCH_avr ../../binutils-2.19/opcodes/disassemble.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../../binutils-2.19/opcodes -I. -I. -I../../binutils-2.19/opcodes -I../bfd -I../../binutils-2.19/opcodes/../include -I../../binutils-2.19/opcodes/../bfd -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror -g -O2 -c -DARCH_avr ../../binutils-2.19/opcodes/disassemble.c -o disassemble.o
/bin/bash ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../binutils-2.19/opcodes -I. -I. -I../../binutils-2.19/opcodes -I../bfd -I../../binutils-2.19/opcodes/../include -I../../binutils-2.19/opcodes/../bfd     -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror -g -O2 -c -o dis-init.lo ../../binutils-2.19/opcodes/dis-init.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../../binutils-2.19/opcodes -I. -I. -I../../binutils-2.19/opcodes -I../bfd -I../../binutils-2.19/opcodes/../include -I../../binutils-2.19/opcodes/../bfd -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror -g -O2 -c ../../binutils-2.19/opcodes/dis-init.c -o dis-init.o
/bin/bash ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../binutils-2.19/opcodes -I. -I. -I../../binutils-2.19/opcodes -I../bfd -I../../binutils-2.19/opcodes/../include -I../../binutils-2.19/opcodes/../bfd     -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror -g -O2 -c -o avr-dis.lo ../../binutils-2.19/opcodes/avr-dis.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../../binutils-2.19/opcodes -I. -I. -I../../binutils-2.19/opcodes -I../bfd -I../../binutils-2.19/opcodes/../include -I../../binutils-2.19/opcodes/../bfd -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror -g -O2 -c ../../binutils-2.19/opcodes/avr-dis.c -o avr-dis.o
cc1: warnings being treated as errors
../../binutils-2.19/opcodes/avr-dis.c: In function 'avr_operand':
../../binutils-2.19/opcodes/avr-dis.c:112: error: format not a string literal and no format arguments
../../binutils-2.19/opcodes/avr-dis.c:162: error: format not a string literal and no format arguments
../../binutils-2.19/opcodes/avr-dis.c:171: error: format not a string literal and no format arguments
../../binutils-2.19/opcodes/avr-dis.c:182: error: format not a string literal and no format arguments
make[4]: *** [avr-dis.lo] Error 1
make[4]: Leaving directory `/home/AVR/FemtoOS_0.88/download/binutils-2.19-build/opcodes'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/AVR/FemtoOS_0.88/download/binutils-2.19-build/opcodes'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/AVR/FemtoOS_0.88/download/binutils-2.19-build/opcodes'
make[1]: *** [all-opcodes] Error 2
make[1]: Leaving directory `/home/AVR/FemtoOS_0.88/download/binutils-2.19-build'
make: *** [all] Error 2

===> Results of this script:
- tools: succes
- download: succes
- patches: succes
- bin-utils: failure
- gcc: skipped
- avr-libc: skipped
- avr-dude: skipped
See /home/AVR/FemtoOS_0.88/log/install_090225_215732.log for more details.

I'm running on an Ubuntu 8.10
As you can see it will not compile the binutils. What can I do?

Please help
/Thomas

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'd say this is the problem :

Quote:
cc1: warnings being treated as errors

It comes from this option being enabled

-Werror

The ppl@Ubuntu , went crazy and enabled a lot of new warnings in 8.10 by default , and this is causing the (warnings) witch is treated as errors.

Try to add this to the build line for binutils

--disable-werror CFLAGS="-Wno-format-security "

Right after the

--with-dwarf2 

The buildline looks like this , and is on line 585 for FemtoOs 0.88

 ../binutils-$UTILS_VERSIE/configure --prefix=$PREFIX --target=avr --disable-nls --with-gnu-ld --with-gnu-as --enable-install-libbfd --with-dwarf2  >>$LogFile 2>&1

/Bingo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks Bingo

It worked perfect! :P

But a little further down the lane there was another error with the GCC installation.

===> compiling and installing gcc 4.3.3
configure: error: cannot find install-sh or install.sh in ../gcc-4.3.3 ../gcc-4.3.3/.. ../gcc-4.3.3/../..
make: *** No targets specified and no makefile found.  Stop.

I can see there is a install-sh in the mpfr folder. How do I tell the install toolchain where to locate the file?

Thanks
/Thomas

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You need to post more of the error lines.

But to me it seems like it looks in the gcc-4.3.3 dir for an install-sh , are you sure it is mpfr it is complaining about ??

Edit: Uhmmm ... I haven't had any problems on 8.04 or 8.10 (w. above modification).

But i just did the "Build" as a normal user wo. any parameters on the comandline (i know you can specify an alternate "prefix" aka. install dir)

Are you sure the file install-sh is executable ??

/Bingo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I had a problem with the selected gcc mirror that would not download completely. I changed to another one which is OK but the script assumed the incomplete download was complete and skipped it. I deleted all the download files and tried again and all seemed to download but still got error message that download was incomplete, try again when net less busy. Log showed no error and all files OK. Finally, saw in readme to try the clean function after errors and now OK.

However, unlike typical GNU style builds, I don't see all the stuff scrolling by but just the "progress" meter. I don't see an option to enable "verbose" mode with no meter, which I kind of like.

Otherwise, seems like a good script for building the latest tools. But I also agree it needs insight and avaice included to be the same a winavr (I understand it was not indented for this).

Builds and compiles my project on Fedora8.

Thanks,
-gene

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

One more comment. I changed the wget option -nc to -N so that timestamp and size decide whether to download. This seems to fix the problem of partial downloads not downloading the next time. And when script option --clean is used and cookie file download-success.res in /download is deleted, most files are not downloaded again and an error is not flagged that prevents the build. However, some files such as avr-dude and mpfr (small and quick) do download again after a --clean.
-gene

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sorry, one (really two) more questions: The "sticky" post on this subject also has a build script. It contains serveral patches to binutils from freebsd. I don't see these in the femtoos scripts I don't think. Are they really needed?

Also, the femtoos script builds "avr-gcc-4.3.3" but the gcc patches used are for gcc-4.3.2 which is the latest in winavr (soureforge) which I assume is the "master" project for avr-gcc. I guess since there are no patch conflicts that this is OK?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

gd.smth wrote:
I had a problem with the selected gcc mirror that would not download completely. I changed to another one which is OK but the script assumed the incomplete download was complete and skipped it. I deleted all the download files and tried again and all seemed to download but still got error message that download was incomplete, try again when net less busy. Log showed no error and all files OK. Finally, saw in readme to try the clean function after errors and now OK.

Thats a bit odd, but not impossible. If wget tries to connect but is not able you may get that, even if the file is already there. Btw my wget on gentoo does not try to connect if the file is present, but wget on osx does.

gd.smth wrote:
However, unlike typical GNU style builds, I don't see all the stuff scrolling by but just the "progress" meter. I don't see an option to enable "verbose" mode with no meter, which I kind of like.

Every thing that scrolls by is captured and pushed to a log file. The progress meter is made to be able to view the main steps of the script. Furthermore, I often run this script over a network connection and all the data slows the receiving pc down. But an option would be better and I agree it is not GNU like.

gd.smth wrote:
Builds and compiles my project on Fedora8.

I'll put that on the list :-)

gd.smth wrote:
Sorry, one (really two) more questions: The "sticky" post on this subject also has a build script. It contains serveral patches to binutils from freebsd. I don't see these in the femtoos scripts I don't think. Are they really needed?

I have not yet looked into that, and i have no freebsd at hand, so i cannot test. Testing is needed before i can see anything sensable about that. Maybe next release.

gd.smth wrote:
Also, the femtoos script builds "avr-gcc-4.3.3" but the gcc patches used are for gcc-4.3.2 which is the latest in winavr (soureforge) which I assume is the "master" project for avr-gcc. I guess since there are no patch conflicts that this is OK?

At the time i wrote the script there where no patches released for 4.3.2 yet, so there was not much choice. And indeed, there are no conflicts and this is OK.

gd.smth wrote:
One more comment. I changed the wget option -nc to -N so that timestamp and size decide whether to download. This seems to fix the problem of partial downloads not downloading the next time. And when script option --clean is used and cookie file download-success.res in /download is deleted, most files are not downloaded again and an error is not flagged that prevents the build. However, some files such as avr-dude and mpfr (small and quick) do download again after a --clean.

W'll have to see if it cross platform stable (usually options tend to behave differently on different platforms.) I thought about it too, but then every file forces a connect, wether present or not. This increases problems on busy mirros. Actually, at the time of writing i was already thinking of an other solution, and that is the inclusion of md5 sums of every file. Then we can be really sure we have the original file in perfect shape.

Ruud

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

@Ruud & gene

The "sticky" buildscript uses the patches from Jörg's FreeBSD port of avr-gcc.

The patches are like Erics patches for WinAVR ,but are made by Jörg , and kept in the FreeBSD repository.

But ... NEVER... mix the patches , unless you are absolutely sure what you do.

So yes ... there are two ports of avr-gcc , and afaik Ruud is the only one who made a Linux port , based on the WinAVR port.

Ps: Ruud , you don't need a FreeBSD to build the FreeBSD port , it compiles fine on a Linux.

/Bingo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi

I got following output, please suggest me with the initial compile options on ubuntu 12.10

tool chain test :

===> making paths / cleaning
===> testing tools
OK: aclocal version: 1.11.3
OK: ar version: 2.22
OK: autoconf version: 2.68
OK: autoheader version: 2.68
OK: automake version: 1.11.3
OK: bison version: 2.5
OK: flex version: 2.5.35
OK: gawk version: 3.1.8
OK: gcc version: 4.6.3
OK: g++ version: 4.6.3
OK: install version: 8.13
OK: libtool version: 2.4.2
OK: make version: 3.81
OK: makeinfo version: 4.13
OK: openssl version: 1.0.1
OK: patch version: 2.6.1
WARNING: perl version could not be detected. (Needed: >= 5.8.8)
OK: touch version: 8.13
OK: wget version: 1.13.4
===> Test done.

===> Results of this script:
- tools: warning
- download: skipped
- patches: skipped
- bin-utils: skipped
- gcc: skipped
- avr-libc: skipped
- avr-dude: skipped
------------------------------------

naveen@studio:~/Desktop/FemtoOS_0.922/IDE$ sudo ./script/compile Bare atmega8 system
text data bss dec hex device project
FAIL 0 0 0 0 atmega8 Bare

Thanks
Naveen

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Maybe something like:

sudo apt-get install perl

To install the perl interpreter

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi
Perl installed already, somehow it is not tracing

naveen@studio:~$ perl -v

This is perl 5, version 14, subversion 2 (v5.14.2) built for i686-linux-gnu-thread-multi-64int

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Can I ask WHY you feel the need to build the toolchain for Linux? Atmel already did it for you:

http://www.atmel.com/tools/ATMEL...

What's more that copy of 4.7.2 is not built from the publically available mainline source but from a branch that Atmel maintain (and publish) that has far more new device support than the mainline.

They supply a .tar.gz, I generally just un-tar it into /usr/local/avr and add /usr/local/avr/bin to PATH.