Skip to content

Commit 5016dc8

Browse files
committed
Update to avr-gcc 9.1
1 parent 54cccb2 commit 5016dc8

File tree

2 files changed

+20
-13
lines changed

2 files changed

+20
-13
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Build AVR GNU GCC Toolchain from source
22

3-
[![CircleCI](https://circleci.com/gh/salkinium/docker-avr-gcc-7.svg?style=svg)](https://circleci.com/gh/salkinium/docker-avr-gcc-7)
3+
[![CircleCI](https://circleci.com/gh/salkinium/docker-avr-gcc.svg?style=svg)](https://circleci.com/gh/salkinium/docker-avr-gcc)
44

55
This work is based on the work of
66
[@strongly-typed](https://github.com/strongly-typed/build-atmel-avr-gnu-toolchain).
@@ -16,13 +16,13 @@ There is a Docker image with all prerequisites for building. Start it with:
1616
Inside the Docker container get this repository
1717

1818
```sh
19-
git clone https://github.com/salkinium/docker-avr-gcc-7.git
19+
git clone https://github.com/salkinium/docker-avr-gcc.git
2020
```
2121

2222
Run the build.sh script
2323

2424
```sh
25-
cd docker-avr-gcc-7
25+
cd docker-avr-gcc
2626
time bash build.sh
2727
```
2828

@@ -33,4 +33,4 @@ The toolchain will be in `avr-gcc`.
3333
There is a CircleCI job defined in `.circleci/config.yml` which builds the
3434
toolchain using the Docker container. For tagged commits, a Github release
3535
will be created with the toolchain put into a downloadable `.tar.bz2` at
36-
[Releases](https://github.com/salkinium/docker-avr-gcc-7/releases).
36+
[Releases](https://github.com/salkinium/docker-avr-gcc/releases).

build.sh

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,22 @@ mkdir ${BUILD}
99
mkdir ${INSTALL}
1010
root=$(pwd)
1111
cores=4
12+
VERSION_BINUTILS="2.32"
13+
VERSION_GCC="9.1.0"
14+
VERSION_LIBC="2.0.0"
1215

1316
# Get sources
14-
wget -q "https://raw.githubusercontent.com/osx-cross/homebrew-avr/master/avr-binutils-size.patch" &
15-
wget -qO- "https://ftp.gnu.org/gnu/binutils/binutils-2.31.1.tar.bz2" | tar xj --directory ${SRC} &
16-
wget -qO- "https://ftp.gnu.org/gnu/gcc/gcc-8.2.0/gcc-8.2.0.tar.xz" | tar xJ --directory ${SRC} &
17-
wget -qO- "https://download.savannah.gnu.org/releases/avr-libc/avr-libc-2.0.0.tar.bz2" | tar xj --directory ${SRC} &
17+
wget -q "https://dl.bintray.com/osx-cross/avr-patches/avr-binutils-${VERSION_BINUTILS}-size.patch" &
18+
wget -q "https://dl.bintray.com/osx-cross/avr-patches/avr-libc-${VERSION_LIBC}-atmega168pb.patch" &
19+
wget -qO- "https://ftp.gnu.org/gnu/binutils/binutils-${VERSION_BINUTILS}.tar.bz2" | tar xj --directory ${SRC} &
20+
wget -qO- "https://ftp.gnu.org/gnu/gcc/gcc-${VERSION_GCC}/gcc-${VERSION_GCC}.tar.xz" | tar xJ --directory ${SRC} &
21+
wget -qO- "https://download.savannah.gnu.org/releases/avr-libc/avr-libc-${VERSION_LIBC}.tar.bz2" | tar xj --directory ${SRC} &
1822
wait
1923

2024
# Build binutils first
21-
cd ${SRC}/binutils-2.31.1
25+
cd ${SRC}/binutils-${VERSION_BINUTILS}
2226
# patch size file
23-
patch -g 0 -f -p0 -i ../../avr-binutils-size.patch
27+
patch -g 0 -f -p0 -i ../../avr-binutils-${VERSION_BINUTILS}-size.patch
2428
mkdir build && cd build
2529
# configure and make
2630
../configure --prefix=${root}/${INSTALL}/avr-binutils/ --target=avr --disable-nls --disable-werror
@@ -31,7 +35,7 @@ make install
3135
export PATH=${root}/${INSTALL}/avr-binutils/bin:$PATH
3236

3337
cd ${root}
34-
cd ${SRC}/gcc-8.2.0
38+
cd ${SRC}/gcc-${VERSION_GCC}
3539
mkdir build && cd build
3640
../configure --target=avr --prefix=${root}/${INSTALL}/avr-gcc/ \
3741
--with-ld=${root}/${INSTALL}/avr-binutils/bin/avr-ld \
@@ -46,10 +50,13 @@ make install
4650
export PATH=${root}/${INSTALL}/avr-gcc/bin:$PATH
4751

4852
cd ${root}
49-
cd ${SRC}/avr-libc-2.0.0
53+
cd ${SRC}/avr-libc-${VERSION_LIBC}
54+
patch -g 0 -f -p0 -i ../../avr-libc-${VERSION_LIBC}-atmega168pb.patch
5055
build=`./config.guess`
5156
./configure --build=${build} --prefix=${root}/${INSTALL}/avr-gcc --host=avr
5257
make install -j${cores}
5358

5459
cd ${root}
55-
rm -r build src avr-binutils-size.patch
60+
rm -r build src
61+
rm avr-binutils-${VERSION_BINUTILS}-size.patch
62+
rm avr-libc-${VERSION_LIBC}-atmega168pb.patch

0 commit comments

Comments
 (0)