Giter VIP home page Giter VIP logo

avr32-toolchain's Introduction

AVR32 Toolchain Builder

This is a early implementation of a Makefile for an AVR32 toolchain builder for Mac OS X & Linux, and it has not been extensively tested. That said the patches are taken directly from Atmel, and basic testing is done with some more complicated builds (i.e.: eLua in float and integer mode) to ensure that that at least these work after toolchain modifications.

Note: If you have previously built a toolchain of another version, out of the same builder directory, make sure to do the following first before building with newer sources:

make clean

Requirements (OS X)

You will need to have GCC, make and binutils on your machine to compile all of this. You can get all of these on Mac OS X, by just installing the Apple Developer Tools. You should be able to download free versions of 3.x from the ADC website, install from the OS X install disc that came with your machine, or download XCode 4 from the App Store (now free again for all registered users).

You will also need gmp, mpfr and mpc first. I recommend installing these from homebrew for now. I’ll add these to the Makefile once I have a consistent configuration that can be used for both Linux & OS X.

With homebrew you can install those dependencies like this:

brew install mpfr gmp libmpc texinfo

If you would like to build dfu-programmer, also install libusb:

brew install libusb-compat

Requirements (Ubuntu)

These instructions should now also work on Ubuntu Linux, provided the following packages have been installed prior to attempting the build:

sudo apt-get install curl flex bison libgmp3-dev libmpfr-dev autoconf build-essential libncurses5-dev libmpc-dev texinfo

If you would like to build dfu-programmer, also install libusb:

sudo apt-get install libusb-dev

Main Build Instructions

Next build the toolchain:

make install-cross

You should be able to also specify a specific install/prefix location by building using the following type of invokation:

PREFIX=$HOME/avr32-tools make install-cross

If you do this, make sure you have permissions to create a directory at this location and/or to create directories within this location if the directory already exists.

NOTE: If you’re running Mac OS X Lion or XCode 4.1 you may find that you’re unable to bootstrap GCC. To work around this until the issue is fixed in Apple’s distribution of llvm-gcc, use the following command instead of the above to build.

CC=gcc-4.2 make install-cross

This should build the compiler, newlib, gdb, etc.. and install them all into a directory called arm-cs-tools in your home directory. If you want to install to another location, feel free to change the export lines and to adjust the definitions at the top of the Makefile.

Keep in mind that the Makefile does install at the end of each build.

Once you’re done, the makefile should notify you of the install location, which will be based on the git revision if you cloned the repository or the current date if you grabbed a tarball and/or you don’t have the git binary. The message should look like the following:

====== INSTALLATION NOTE ======
Your tools have now been installed at the following prefix:
/Users/jsnyder/avr32-tools-bd2485b

Please be sure to add something similar to the following to your .bash_profile, .zshrc, etc:
export PATH=/Users/jsnyder/avr32-tools-bd2485b/bin:$PATH

If it uses the date instead the the git short revision will bve replaced with a date number like: 20110726.

If you also would like dfu-programmer installed intalled (make sure you have previously installed libusb as described in requirements):

make install-dfu

Special Thanks

Special thanks to Rob Emanuele for the basis of this Makefile: http://elua-development.2368040.n2.nabble.com/Building-GCC-for-Cortex-td2421927.html

avr32-toolchain's People

Contributors

denravonska avatar jsnyder avatar kblomqvist avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

avr32-toolchain's Issues

Incorrect strcmp generated for UC3C

I have been debugging an issue where I keep getting unaligned memory access exceptions when attempting do do strcmp on a buffer and a constant. After checking the generated assembler I saw this:

8002d3cc :
8002d3cc: 19 0a ld.w r10,r12++
8002d3ce: 17 09 ld.w r9,r11++
...

This assumes that the variables are always word aligned. The Atmel assembler file seems to provide two different versions depending on if the target supports unaligned words or not. Which one it picks depends on what the __AVR32_HAS_UNALIGNED_WORD__ is set to, and it's only enabled on AP* MCUs.

This is how the strcmp version from Atmel Studio looks like:

800079f8 :
800079f8: f9 eb 10 0a or r10,r12,r11
800079fc: e2 1a 00 03 andl r10,0x3,COH
80007a00: c3 41 brne 80007a68 <strcmp+0x70>
...

This one correctly checks if the two variables are word aligned. If they are the fast comparison is made, otherwise it falls back to a byte-by-byte comparison.

For some reason __AVR32_HAS_UNALIGNED_WORD__ is enabled when strcmp.S is built using this toolchain. Explicitly compiling newlib using the -march=ucr3fp fixes the issue for me but I don't think that's how Atmel compiles their version.

Any ideas?

Edit: strcmp.S can be found in newlib-1.16.0/newlib/libc/machine/avr32/strcmp.S

Make fails on 10.9.4 due to no gcc (clang only)

Running CC=gcc-4.2 make install-cross fails on my Mavericks build with errors about redefinitions of functions is not supported in C99 mode.
This is due to clang defaulting to C99 mode when building, and Mavericks doesn't come with gcc any more - it's all clang now:
gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.3.0
Thread model: posix

So to fix this, I ran make with the following parameters:
CC='gcc-4.2 -std=gnu89' make install-cross

ANL mirror is no more

Hello,
You might want to update your makefile mirror url since ANL has taken down their mirror.
Ali

Build fails if $(CURDIR) contains spaces

I moved the entire build environment to a new folder named "No Backup" (ignored by Time Machine) and then I tried again to run the build.

It failed, and it left another folder called "No", so I guess the SUPP_PREFIX needs some quotes to protect the space.

Liviu

python: can't open file 'STAMP_test.py': [Errno 2] No such file or directory

Hey, I have some problem when runned STAMP.
I installed STAMP on the Ubuntu and runned the command: python STAMP_test.py –v.
I got the error: python: can't open file 'STAMP_test.py': [Errno 2] No such file or directory.
I am a newbie in python and it is somewhat difficult to solve this problem. Please! Help me to solve it. Best wishes to you!

unknown parsing error

Hi! Thanks for you to open my request! I have installed STAMP on Ubuntu. Running the STAMP on Ubuntu, I got follow warning:
Failed to load module "canberra-gtk-module"
/usr/lib/python2.7/dist-packages/matplotlib/cbook/deprecation.py:106: MatplotlibDeprecationWarning: The mpl_toolkits.axes_grid module was deprecated in version 2.1. Use mpl_toolkits.axes_grid1 and mpl_toolkits.axisartist provies the same functionality instead.
warnings.warn(message, mplDeprecation, stacklevel=1)
And loading the files on the STAMP by file-load data, and load the profile file and group metadata file. I got the error: unknown pasing error.
Please help me to understand the problem and solve it, thank you!

Mac OS X 10.6.7 build

on my machine the build fails quite early, in binutils.

I confess that I have the dependencies installed in /brew/local instead of /usr/local, and I patched the Makefile to include this path while building gcc and g++, but I thought binutils does not use these dependencies.

the missing definitions (like BFD_RELOC_AVR32_DIFF32) seem to be related to some missing patches over binutils.

any idea?

Liviu

/bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../../binutils-2.20.1/bfd -I. -I../../../binutils-2.20.1/bfd -I../../../binutils-2.20.1/bfd/../include -DBINDIR='"/Users/ilg/avr32-tools/bin"' -W -Wall -Wstrict-prototypes -Wmissing-prototypes -g -O2 -MT elf32.lo -MD -MP -MF .deps/elf32.Tpo -c -o elf32.lo ../../../binutils-2.20.1/bfd/elf32.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../../../binutils-2.20.1/bfd -I. -I../../../binutils-2.20.1/bfd -I../../../binutils-2.20.1/bfd/../include -DBINDIR="/Users/ilg/avr32-tools/bin" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -g -O2 -MT elf32-avr32.lo -MD -MP -MF .deps/elf32-avr32.Tpo -c ../../../binutils-2.20.1/bfd/elf32-avr32.c -o elf32-avr32.o
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../../../binutils-2.20.1/bfd -I. -I../../../binutils-2.20.1/bfd -I../../../binutils-2.20.1/bfd/../include -DBINDIR="/Users/ilg/avr32-tools/bin" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -g -O2 -MT elf32.lo -MD -MP -MF .deps/elf32.Tpo -c ../../../binutils-2.20.1/bfd/elf32.c -o elf32.o
../../../binutils-2.20.1/bfd/elf32-avr32.c:168: error: ‘BFD_RELOC_AVR32_DIFF32’ undeclared here (not in a function)
../../../binutils-2.20.1/bfd/elf32-avr32.c:169: error: ‘BFD_RELOC_AVR32_DIFF16’ undeclared here (not in a function)
../../../binutils-2.20.1/bfd/elf32-avr32.c:170: error: ‘BFD_RELOC_AVR32_DIFF8’ undeclared here (not in a function)
../../../binutils-2.20.1/bfd/elf32-avr32.c:171: error: ‘BFD_RELOC_AVR32_GOT32’ undeclared here (not in a function)
../../../binutils-2.20.1/bfd/elf32-avr32.c:172: error: ‘BFD_RELOC_AVR32_GOT16’ undeclared here (not in a function)
../../../binutils-2.20.1/bfd/elf32-avr32.c:173: error: ‘BFD_RELOC_AVR32_GOT8’ undeclared here (not in a function)
../../../binutils-2.20.1/bfd/elf32-avr32.c:175: error: ‘BFD_RELOC_AVR32_21S’ undeclared here (not in a function)
../../../binutils-2.20.1/bfd/elf32-avr32.c:176: error: ‘BFD_RELOC_AVR32_16U’ undeclared here (not in a function)
../../../binutils-2.20.1/bfd/elf32-avr32.c:177: error: ‘BFD_RELOC_AVR32_16S’ undeclared here (not in a function)
../../../binutils-2.20.1/bfd/elf32-avr32.c:178: error: ‘BFD_RELOC_AVR32_SUB5’ undeclared here (not in a function)
../../../binutils-2.20.1/bfd/elf32-avr32.c:179: error: ‘BFD_RELOC_AVR32_8S_EXT’ undeclared here (not in a function)
../../../binutils-2.20.1/bfd/elf32-avr32.c:180: error: ‘BFD_RELOC_AVR32_8S’ undeclared here (not in a function)
../../../binutils-2.20.1/bfd/elf32-avr32.c:182: error: ‘BFD_RELOC_AVR32_22H_PCREL’ undeclared here (not in a function)
../../../binutils-2.20.1/bfd/elf32-avr32.c:183: error: ‘BFD_RELOC_AVR32_18W_PCREL’ undeclared here (not in a function)
../../../binutils-2.20.1/bfd/elf32-avr32.c:184: error: ‘BFD_RELOC_AVR32_16B_PCREL’ undeclared here (not in a function)
../../../binutils-2.20.1/bfd/elf32-avr32.c:185: error: ‘BFD_RELOC_AVR32_16N_PCREL’ undeclared here (not in a function)
../../../binutils-2.20.1/bfd/elf32-avr32.c:186: error: ‘BFD_RELOC_AVR32_11H_PCREL’ undeclared here (not in a function)
../../../binutils-2.20.1/bfd/elf32-avr32.c:187: error: ‘BFD_RELOC_AVR32_10UW_PCREL’ undeclared here (not in a function)
../../../binutils-2.20.1/bfd/elf32-avr32.c:188: error: ‘BFD_RELOC_AVR32_9H_PCREL’ undeclared here (not in a function)
../../../binutils-2.20.1/bfd/elf32-avr32.c:189: error: ‘BFD_RELOC_AVR32_9UW_PCREL’ undeclared here (not in a function)
../../../binutils-2.20.1/bfd/elf32-avr32.c:194: error: ‘BFD_RELOC_AVR32_GOTPC’ undeclared here (not in a function)
../../../binutils-2.20.1/bfd/elf32-avr32.c:195: error: ‘BFD_RELOC_AVR32_GOTCALL’ undeclared here (not in a function)
../../../binutils-2.20.1/bfd/elf32-avr32.c:196: error: ‘BFD_RELOC_AVR32_LDA_GOT’ undeclared here (not in a function)
../../../binutils-2.20.1/bfd/elf32-avr32.c:197: error: ‘BFD_RELOC_AVR32_GOT21S’ undeclared here (not in a function)
../../../binutils-2.20.1/bfd/elf32-avr32.c:198: error: ‘BFD_RELOC_AVR32_GOT18SW’ undeclared here (not in a function)
../../../binutils-2.20.1/bfd/elf32-avr32.c:199: error: ‘BFD_RELOC_AVR32_GOT16S’ undeclared here (not in a function)
../../../binutils-2.20.1/bfd/elf32-avr32.c:202: error: ‘BFD_RELOC_AVR32_32_CPENT’ undeclared here (not in a function)
../../../binutils-2.20.1/bfd/elf32-avr32.c:203: error: ‘BFD_RELOC_AVR32_CPCALL’ undeclared here (not in a function)
../../../binutils-2.20.1/bfd/elf32-avr32.c:204: error: ‘BFD_RELOC_AVR32_16_CP’ undeclared here (not in a function)
../../../binutils-2.20.1/bfd/elf32-avr32.c:205: error: ‘BFD_RELOC_AVR32_9W_CP’ undeclared here (not in a function)
../../../binutils-2.20.1/bfd/elf32-avr32.c:207: error: ‘BFD_RELOC_AVR32_ALIGN’ undeclared here (not in a function)
../../../binutils-2.20.1/bfd/elf32-avr32.c:209: error: ‘BFD_RELOC_AVR32_15S’ undeclared here (not in a function)
mv -f .deps/verilog.Tpo .deps/verilog.Plo
/bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../../binutils-2.20.1/bfd -I. -I../../../binutils-2.20.1/bfd -I../../../binutils-2.20.1/bfd/../include -DBINDIR='"/Users/ilg/avr32-tools/bin"' -W -Wall -Wstrict-prototypes -Wmissing-prototypes -g -O2 -MT elf.lo -MD -MP -MF .deps/elf.Tpo -c -o elf.lo ../../../binutils-2.20.1/bfd/elf.c
In file included from ../../../binutils-2.20.1/bfd/elf32-avr32.c:3915:
./elf32-target.h:635: error: ‘bfd_arch_avr32’ undeclared here (not in a function)
./elf32-target.h:635: error: initializer element is not constant
./elf32-target.h:635: error: (near initialization for ‘elf32_bed.arch’)
make[5]: *** [elf32-avr32.lo] Error 1
make[5]: *** Waiting for unfinished jobs....
mv -f .deps/merge.Tpo .deps/merge.Plo
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../../../binutils-2.20.1/bfd -I. -I../../../binutils-2.20.1/bfd -I../../../binutils-2.20.1/bfd/../include -DBINDIR="/Users/ilg/avr32-tools/bin" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -g -O2 -MT elf.lo -MD -MP -MF .deps/elf.Tpo -c ../../../binutils-2.20.1/bfd/elf.c -o elf.o
mv -f .deps/dwarf2.Tpo .deps/dwarf2.Plo
mv -f .deps/elf32.Tpo .deps/elf32.Plo
mv -f .deps/elf.Tpo .deps/elf.Plo
make[4]: *** [all-recursive] Error 1
make[3]: *** [all] Error 2
make[2]: *** [all-bfd] Error 2
make[1]: *** [all] Error 2
make: *** [stamps/build-binutils] Error 2
ilg-mbp:jsnyder-avr32-toolchain-b7f5274 ilg$

MD5 checksums are ignored

MD5 checksums currently seem to be ignored whether correct or not. This was noted on gh-9 when a solution to updated patchset was submitted.

binutils sometimes fails to build from clean start, other times not

Somewhat at random, builds fail with the following set of errors:

elf32-avr32.c:168: error: ‘BFD_RELOC_AVR32_DIFF32’ undeclared here (not in a function)
elf32-avr32.c:169: error: ‘BFD_RELOC_AVR32_DIFF16’ undeclared here (not in a function)
elf32-avr32.c:170: error: ‘BFD_RELOC_AVR32_DIFF8’ undeclared here (not in a function)
elf32-avr32.c:171: error: ‘BFD_RELOC_AVR32_GOT32’ undeclared here (not in a function)
elf32-avr32.c:172: error: ‘BFD_RELOC_AVR32_GOT16’ undeclared here (not in a function)
elf32-avr32.c:173: error: ‘BFD_RELOC_AVR32_GOT8’ undeclared here (not in a function)
elf32-avr32.c:175: error: ‘BFD_RELOC_AVR32_21S’ undeclared here (not in a function)
elf32-avr32.c:176: error: ‘BFD_RELOC_AVR32_16U’ undeclared here (not in a function)
elf32-avr32.c:177: error: ‘BFD_RELOC_AVR32_16S’ undeclared here (not in a function)
elf32-avr32.c:178: error: ‘BFD_RELOC_AVR32_SUB5’ undeclared here (not in a function)
elf32-avr32.c:179: error: ‘BFD_RELOC_AVR32_8S_EXT’ undeclared here (not in a function)
elf32-avr32.c:180: error: ‘BFD_RELOC_AVR32_8S’ undeclared here (not in a function)
elf32-avr32.c:182: error: ‘BFD_RELOC_AVR32_22H_PCREL’ undeclared here (not in a function)
elf32-avr32.c:183: error: ‘BFD_RELOC_AVR32_18W_PCREL’ undeclared here (not in a function)
elf32-avr32.c:184: error: ‘BFD_RELOC_AVR32_16B_PCREL’ undeclared here (not in a function)
elf32-avr32.c:185: error: ‘BFD_RELOC_AVR32_16N_PCREL’ undeclared here (not in a function)
elf32-avr32.c:186: error: ‘BFD_RELOC_AVR32_11H_PCREL’ undeclared here (not in a function)
elf32-avr32.c:187: error: ‘BFD_RELOC_AVR32_10UW_PCREL’ undeclared here (not in a function)
elf32-avr32.c:188: error: ‘BFD_RELOC_AVR32_9H_PCREL’ undeclared here (not in a function)
elf32-avr32.c:189: error: ‘BFD_RELOC_AVR32_9UW_PCREL’ undeclared here (not in a function)
elf32-avr32.c:194: error: ‘BFD_RELOC_AVR32_GOTPC’ undeclared here (not in a function)
elf32-avr32.c:195: error: ‘BFD_RELOC_AVR32_GOTCALL’ undeclared here (not in a function)
elf32-avr32.c:196: error: ‘BFD_RELOC_AVR32_LDA_GOT’ undeclared here (not in a function)
elf32-avr32.c:197: error: ‘BFD_RELOC_AVR32_GOT21S’ undeclared here (not in a function)
elf32-avr32.c:198: error: ‘BFD_RELOC_AVR32_GOT18SW’ undeclared here (not in a function)
elf32-avr32.c:199: error: ‘BFD_RELOC_AVR32_GOT16S’ undeclared here (not in a function)
elf32-avr32.c:202: error: ‘BFD_RELOC_AVR32_32_CPENT’ undeclared here (not in a function)
elf32-avr32.c:203: error: ‘BFD_RELOC_AVR32_CPCALL’ undeclared here (not in a function)
elf32-avr32.c:204: error: ‘BFD_RELOC_AVR32_16_CP’ undeclared here (not in a function)
elf32-avr32.c:205: error: ‘BFD_RELOC_AVR32_9W_CP’ undeclared here (not in a function)
elf32-avr32.c:207: error: ‘BFD_RELOC_AVR32_ALIGN’ undeclared here (not in a function)
elf32-avr32.c:209: error: ‘BFD_RELOC_AVR32_15S’ undeclared here (not in a function)
In file included from elf32-avr32.c:3915:
elf32-target.h:635: error: ‘bfd_arch_avr32’ undeclared here (not in a function)
elf32-target.h:635: error: initializer element is not constant
elf32-target.h:635: error: (near initialization for ‘elf32_bed.arch’)
make[5]: *** [elf32-avr32.lo] Error 1
make[4]: *** [all-recursive] Error 1
make[3]: *** [all] Error 2
make[2]: *** [all-bfd] Error 2
make[1]: *** [all] Error 2
make: *** [stamps/build-binutils] Error 2```

A workaround appears to be attempting the build again (even after a make clean).

I haven't yet figured out why it sometimes fails and other times builds.

Update to latest toolchain version

There is a new release available of the AVR toolchain. The version is now 3.4.1. But i cannot find the source files on atmels homepage. 👎
Does anybody here have insight in where atmel puts these releases?

build fails if PREFIX is changed without updating the PATH

I tried to change the PREFIX and the build failed, not finding avr32-cc: and other newly built programs.

Adding the PREFIX/bin to the environment PATH before starting the build fixed the problem, so I assume somewhere there reference to PREFIX is missing.

Liviu

excerpt from the build:
...
touch stmp-targ-include
Making all in libc
Making all in argz
avr32-cc -B/Users/ilg/work/AVR32/jsnyder-avr32-toolchain-af9fff3/build/newlib/avr32/newlib/ -isystem /Users/ilg/work/AVR32/jsnyder-avr32-toolchain-af9fff3/build/newlib/avr32/newlib/targ-include -isystem /Users/ilg/work/AVR32/jsnyder-avr32-toolchain-af9fff3/newlib-1.16.0/newlib/libc/include -DPACKAGE_NAME="newlib" -DPACKAGE_TARNAME="newlib" -DPACKAGE_VERSION="1.16.0" -DPACKAGE_STRING="newlib\ 1.16.0" -DPACKAGE_BUGREPORT="" -I. -I../../../../../../newlib-1.16.0/newlib/libc/argz -Os -DPREFER_SIZE_OVER_SPEED -ffunction-sections -fdata-sections -D__NO_SYSCALLS__ -DHAVE_SYSTEM -DSMALL_MEMORY -DHAVE_GETTIMEOFDAY -fno-builtin -ffunction-sections -fdata-sections -DPREFER_SIZE_OVER_SPEED -D__OPTIMIZE_SIZE__ -g -Os -fomit-frame-pointer -fno-unroll-loops -D__BUFSIZ__=128 -DSMALL_MEMORY -c -o lib_a-dummy.o test -f 'dummy.c' || echo '../../../../../../newlib-1.16.0/newlib/libc/argz/'dummy.c
avr32-cc -B/Users/ilg/work/AVR32/jsnyder-avr32-toolchain-af9fff3/build/newlib/avr32/newlib/ -isystem /Users/ilg/work/AVR32/jsnyder-avr32-toolchain-af9fff3/build/newlib/avr32/newlib/targ-include -isystem /Users/ilg/work/AVR32/jsnyder-avr32-toolchain-af9fff3/newlib-1.16.0/newlib/libc/include -DPACKAGE_NAME="newlib" -DPACKAGE_TARNAME="newlib" -DPACKAGE_VERSION="1.16.0" -DPACKAGE_STRING="newlib\ 1.16.0" -DPACKAGE_BUGREPORT="" -I. -I../../../../../../newlib-1.16.0/newlib/libc/argz -Os -DPREFER_SIZE_OVER_SPEED -ffunction-sections -fdata-sections -D__NO_SYSCALLS__ -DHAVE_SYSTEM -DSMALL_MEMORY -DHAVE_GETTIMEOFDAY -fno-builtin -ffunction-sections -fdata-sections -DPREFER_SIZE_OVER_SPEED -D__OPTIMIZE_SIZE__ -g -Os -fomit-frame-pointer -fno-unroll-loops -D__BUFSIZ__=128 -DSMALL_MEMORY -c -o lib_a-argz_add.o test -f 'argz_add.c' || echo '../../../../../../newlib-1.16.0/newlib/libc/argz/'argz_add.c
avr32-cc -B/Users/ilg/work/AVR32/jsnyder-avr32-toolchain-af9fff3/build/newlib/avr32/newlib/ -isystem /Users/ilg/work/AVR32/jsnyder-avr32-toolchain-af9fff3/build/newlib/avr32/newlib/targ-include -isystem /Users/ilg/work/AVR32/jsnyder-avr32-toolchain-af9fff3/newlib-1.16.0/newlib/libc/include -DPACKAGE_NAME="newlib" -DPACKAGE_TARNAME="newlib" -DPACKAGE_VERSION="1.16.0" -DPACKAGE_STRING="newlib\ 1.16.0" -DPACKAGE_BUGREPORT="" -I. -I../../../../../../newlib-1.16.0/newlib/libc/argz -Os -DPREFER_SIZE_OVER_SPEED -ffunction-sections -fdata-sections -D__NO_SYSCALLS__ -DHAVE_SYSTEM -DSMALL_MEMORY -DHAVE_GETTIMEOFDAY -fno-builtin -ffunction-sections -fdata-sections -DPREFER_SIZE_OVER_SPEED -D__OPTIMIZE_SIZE__ -g -Os -fomit-frame-pointer -fno-unroll-loops -D__BUFSIZ__=128 -DSMALL_MEMORY -c -o lib_a-argz_add_sep.o test -f 'argz_add_sep.c' || echo '../../../../../../newlib-1.16.0/newlib/libc/argz/'argz_add_sep.c
avr32-cc -B/Users/ilg/work/AVR32/jsnyder-avr32-toolchain-af9fff3/build/newlib/avr32/newlib/ -isystem /Users/ilg/work/AVR32/jsnyder-avr32-toolchain-af9fff3/build/newlib/avr32/newlib/targ-include -isystem /Users/ilg/work/AVR32/jsnyder-avr32-toolchain-af9fff3/newlib-1.16.0/newlib/libc/include -DPACKAGE_NAME="newlib" -DPACKAGE_TARNAME="newlib" -DPACKAGE_VERSION="1.16.0" -DPACKAGE_STRING="newlib\ 1.16.0" -DPACKAGE_BUGREPORT="" -I. -I../../../../../../newlib-1.16.0/newlib/libc/argz -Os -DPREFER_SIZE_OVER_SPEED -ffunction-sections -fdata-sections -D__NO_SYSCALLS__ -DHAVE_SYSTEM -DSMALL_MEMORY -DHAVE_GETTIMEOFDAY -fno-builtin -ffunction-sections -fdata-sections -DPREFER_SIZE_OVER_SPEED -D__OPTIMIZE_SIZE__ -g -Os -fomit-frame-pointer -fno-unroll-loops -D__BUFSIZ__=128 -DSMALL_MEMORY -c -o lib_a-argz_append.o test -f 'argz_append.c' || echo '../../../../../../newlib-1.16.0/newlib/libc/argz/'argz_append.c
avr32-cc -B/Users/ilg/work/AVR32/jsnyder-avr32-toolchain-af9fff3/build/newlib/avr32/newlib/ -isystem /Users/ilg/work/AVR32/jsnyder-avr32-toolchain-af9fff3/build/newlib/avr32/newlib/targ-include -isystem /Users/ilg/work/AVR32/jsnyder-avr32-toolchain-af9fff3/newlib-1.16.0/newlib/libc/include -DPACKAGE_NAME="newlib" -DPACKAGE_TARNAME="newlib" -DPACKAGE_VERSION="1.16.0" -DPACKAGE_STRING="newlib\ 1.16.0" -DPACKAGE_BUGREPORT="" -I. -I../../../../../../newlib-1.16.0/newlib/libc/argz -Os -DPREFER_SIZE_OVER_SPEED -ffunction-sections -fdata-sections -D__NO_SYSCALLS__ -DHAVE_SYSTEM -DSMALL_MEMORY -DHAVE_GETTIMEOFDAY -fno-builtin -ffunction-sections -fdata-sections -DPREFER_SIZE_OVER_SPEED -D__OPTIMIZE_SIZE__ -g -Os -fomit-frame-pointer -fno-unroll-loops -D__BUFSIZ__=128 -DSMALL_MEMORY -c -o lib_a-argz_count.o test -f 'argz_count.c' || echo '../../../../../../newlib-1.16.0/newlib/libc/argz/'argz_count.c
/bin/sh: avr32-cc: command not found
make[6]: *** [lib_a-dummy.o] Error 127
make[6]: *** Waiting for unfinished jobs....
/bin/sh: avr32-cc: command not found
make[6]: *** [lib_a-argz_add.o] Error 127
/bin/sh: avr32-cc: command not found
/bin/sh: avr32-cc: command not found
make[6]: *** [lib_a-argz_add_sep.o] Error 127
make[6]: *** [lib_a-argz_append.o] Error 127
/bin/sh: avr32-cc: command not found
make[6]: *** [lib_a-argz_count.o] Error 127

dfu-programmer build experience

After successfully building the toolchain, I needed a solution to program the AVR32, and so I reached dfu-programmer. I have now a functional solution, but it required some work.

The first test I did used the MacPorts package. Unfortunately it is based on 0.5.2, and this version has a bug, not being able to ignore the trampoline code (after manually removing the first 0x2000 bytes, the tool has no problem to program the flash).

The bug was known, documented and fixed in 0.5.4, so I gave this version a try, doing the build myself.

Everything went fine, the build completed without problems and the resulting program was functional, even when the trampoline code was present.

The only problem I can mention is the reference to libusb, missing in the Apple distribution. Running the build after adding MacPorts to the PATH fixed the reference.

At the end I also tried to build the dfu-programmer with your Makefile, but in my environment this seems not possible. My avr32 build environment includes a reference to Homebrew, installed in /brew/local, and does not include any reference to MacPorts, installed in /opt/local. Although installing libusb in Homebrew was no problem at all, I did not find a way to configure the dfu-programmer build to reference the /brew/local folder, and I would like to avoid including MacPorts in the build too.

So, in case you decide to continue work on the Makefile and include the part to build dfu-programmer, we'll probably need to patch the configuration script, to allow linking to a separate folder Homebrew installation.

Liviu

Build g++ configuration proposal

Since the projects I need to build witth this toolchain are all C++, I tried to also build the g++, currently not implemented by the Makefile.

I did it more like a copy/paste experiment, based on the gcc code, and less based on any knowledge.

However, the configure parameters I used have no logic behind, I just added those from the gross-g++ over those of build-gcc.

Could you review these configuration details and update the Makefile accordingly, in order to also build the g++?

Thank you,

Liviu

p.s. BTW, why does the Makefile need to build gcc and g++ separately?

.PHONY: prep-g++
prep-g++ stamps/prep-g++: stamps/patch-gcc
[ -d stamps ] || mkdir stamps;
touch stamps/prep-g++;

.PHONY: build-g++
build-g++ stamps/build-g++: stamps/install-binutils stamps/prep-newlib stamps/prep-g++
mkdir -p build/g++ && cd build/g++ &&
pushd ../../gcc-$(GCC_VERSION) ;
make clean ;
popd ;
../../gcc-$(GCC_VERSION)/configure --prefix=$(PREFIX)
--target=$(TARGET) $(DEPENDENCIES) --enable-languages="c++" --with-gnu-ld
--with-gnu-as --with-newlib --disable-nls --disable-libssp
--with-newlib --with-dwarf2 --enable-sjlj-exceptions
--enable-version-specific-runtime-libs --disable-libstdcxx-pch
--disable-shared
--without-headers
--disable-threads --disable-libmudflap --disable-libgomp
--disable-libunwind-exceptions --disable-libffi --enable-extra-sgxxlite-multilibs
--with-build-time-tools=$(PREFIX)/$(TARGET)/bin
--enable-cxx-flags=$(CFLAGS_FOR_TARGET)
--with-sysroot=$(PREFIX)/$(TARGET)
--with-build-sysroot=$(PREFIX)/$(TARGET)
--with-build-time-tools=$(PREFIX)/$(TARGET)/bin
CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)
LDFLAGS_FOR_TARGET="--sysroot=$(PREFIX)/$(TARGET)"
CPPFLAGS_FOR_TARGET="--sysroot=$(PREFIX)/$(TARGET)"
--with-bugurl=$(BUG_URL) &&
$(MAKE) -j$(PROCS)
[ -d stamps ] || mkdir stamps
touch stamps/build-g++;

.PHONY: install-g++
install-g++ stamps/install-g++: stamps/build-g++
cd build/g++ &&
$(MAKE) installdirs install-target &&
$(MAKE) -C gcc install-common install-cpp install- install-driver install-headers install-man
[ -d stamps ] || mkdir stamps
touch stamps/install-g++;

Suggestion: add $(DEPENDENCIES) when building gcc/g++

In order to accommodate different location for the dependencies (for personal reasons I prefer to completely isolate Homebrew from the rest of the system, so I installed it in /brew/local instead of /usr/local), I added the following definition to the Makefile

DEPENDENCY_DIR = /usr/local

DEPENDENCY_DIR = /brew/local
DEPENDENCIES = --with-mpc=$(DEPENDENCY_DIR) --with-mpfr=$(DEPENDENCY_DIR) --with-gmp=$(DEPENDENCY_DIR)

and when building gcc I used

../../gcc-$(GCC_VERSION)/configure --prefix=$(PREFIX)       \
--target=$(TARGET) $(DEPENDENCIES) --enable-languages="c" --with-gnu-ld     \
...

(similarly for g++).

It would be useful to have something like this included in the Makefile, to simplify customisation when using different environments. (same for the ARM build)

Thank you,

Liviu

Suggestion: accommodate multiple simultaneous toolchain versions

In order to be able to maintain older versions of my projects, I sometimes need to keep older versions of the toolchains around.

The way I do this is to append the current date to the folder name of the toolchain.

For example, for the avr32 toolchain I used avr32-tools-20110702 instead of avr32-tools.

I also prefer to organise all my cross compiling toolchains in a folder named Cross.

Since my Cross compiling toolchains are not alone, my development environment also includes multiple Eclipse instances (located in a folder call Eclipses), so I keep everything in $HOME/Developer.

The patch I applied to your Makefile is:

PREFIX = $(HOME)/avr32-tools/

TODAY = date "+%Y%m%d"
PREFIX = $(HOME)/Developer/Cross/avr32-tools-$(TODAY)/

If you think such a more structured folder hierarchy is useful, I would be happy to see it used in your Makefile too (same for the ARM build).

Thank you,

Liviu

issues installing ubuntu 13.x

command running PREFIX=~/avrtools make install-cross

errors:

config.status: creating po/Makefile.in
config.status: executing depfiles commands
config.status: executing libtool commands
config.status: executing default-1 commands
config.status: executing bfd_stdint.h commands
config.status: executing default commands
make[4]: Leaving directory `/home/netcom/Documents/firmware/avr32-toolchain/binutils-2.23.1/bfd/po'
make[4]: Entering directory `/home/netcom/Documents/firmware/avr32-toolchain/binutils-2.23.1/bfd/po'
make[4]: Nothing to be done for `info'.
make[4]: Leaving directory `/home/netcom/Documents/firmware/avr32-toolchain/binutils-2.23.1/bfd/po'
make[4]: Entering directory `/home/netcom/Documents/firmware/avr32-toolchain/binutils-2.23.1/bfd'
make[4]: Nothing to be done for `info-am'.
make[4]: Leaving directory `/home/netcom/Documents/firmware/avr32-toolchain/binutils-2.23.1/bfd'
make[3]: *** [info-recursive] Error 1
make[3]: Leaving directory `/home/netcom/Documents/firmware/avr32-toolchain/binutils-2.23.1/bfd'
make[2]: *** [all-bfd] Error 2
make[2]: Leaving directory `/home/netcom/Documents/firmware/avr32-toolchain/binutils-2.23.1'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/netcom/Documents/firmware/avr32-toolchain/binutils-2.23.1'
make: *** [stamps/build-binutils] Error 2

Stamps do not work

Make still does things that have been already done. For example

make install-final-gcc

starts building the final-gcc despite the build-final-gcc stamp. I doubt that the phony target and the stamp file can be chained like this

.PHONY: install-final-gcc
install-final-gcc stamps/install-final-gcc: stamps/build-final-gcc
    # ...

maybe it should be like this

.PHONY: install-final-gcc
install-final-gcc: stamps/install-final-gcc
stamps/install-final-gcc: stamps/build-final-gcc
    # ...

See for example http://www.technovelty.org/linux/tips/make-stamp.html

Error building on Ubuntu Bionic Beaver

When trying to build on Ubuntu 18.04 it fails on binutils when building gas with the error:

make[5]: *** No rule to make target 'tc-avr32.o', needed by 'as-new'. Stop.

Add libusb-dev into requirements

I think that libusb-dev should be added to requirements because the building process of dfu-programmer needs it.

sudo apt-get install curl flex bison libgmp3-dev libmpfr-dev \
autoconf build-essential libncurses5-dev libmpc-dev texinfo libusb-dev

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.