Skip to content

Commit

Permalink
Update to gcc 8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
salkinium committed Sep 6, 2018
1 parent cab9a39 commit 54cccb2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN apt-get update \
libmpc-dev \
libmpfr-dev \
libgmp-dev \
libmpfr4 \
libmpfr6 \
texinfo \
doxygen \
flex \
Expand Down
15 changes: 8 additions & 7 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,38 @@ mkdir ${SRC}
mkdir ${BUILD}
mkdir ${INSTALL}
root=$(pwd)
cores=4

# Get sources
wget -q "https://raw.githubusercontent.com/osx-cross/homebrew-avr/master/avr-binutils-size.patch" &
wget -qO- "http://ftp.gnu.org/gnu/binutils/binutils-2.30.tar.bz2" | tar xj --directory ${SRC} &
wget -qO- "https://gcc.gnu.org/pub/gcc/releases/gcc-7.3.0/gcc-7.3.0.tar.xz" | tar xJ --directory ${SRC} &
wget -qO- "https://ftp.gnu.org/gnu/binutils/binutils-2.31.1.tar.bz2" | tar xj --directory ${SRC} &
wget -qO- "https://ftp.gnu.org/gnu/gcc/gcc-8.2.0/gcc-8.2.0.tar.xz" | tar xJ --directory ${SRC} &
wget -qO- "https://download.savannah.gnu.org/releases/avr-libc/avr-libc-2.0.0.tar.bz2" | tar xj --directory ${SRC} &
wait

# Build binutils first
cd ${SRC}/binutils-2.30
cd ${SRC}/binutils-2.31.1
# patch size file
patch -g 0 -f -p0 -i ../../avr-binutils-size.patch
mkdir build && cd build
# configure and make
../configure --prefix=${root}/${INSTALL}/avr-binutils/ --target=avr --disable-nls --disable-werror
make -j16
make -j${cores}
make install

# prepend path of newly compiled avr-gcc
export PATH=${root}/${INSTALL}/avr-binutils/bin:$PATH

cd ${root}
cd ${SRC}/gcc-7.3.0
cd ${SRC}/gcc-8.2.0
mkdir build && cd build
../configure --target=avr --prefix=${root}/${INSTALL}/avr-gcc/ \
--with-ld=${root}/${INSTALL}/avr-binutils/bin/avr-ld \
--with-as=${root}/${INSTALL}/avr-binutils/bin/avr-as \
--enable-languages=c,c++ --with-dwarf2 \
--disable-nls --disable-libssp --disable-shared \
--disable-threads --disable-libgomp --disable-bootstrap
make -j16
make -j${cores}
make install

# prepend path of newly compiled avr-gcc
Expand All @@ -48,7 +49,7 @@ cd ${root}
cd ${SRC}/avr-libc-2.0.0
build=`./config.guess`
./configure --build=${build} --prefix=${root}/${INSTALL}/avr-gcc --host=avr
make install -j16
make install -j${cores}

cd ${root}
rm -r build src avr-binutils-size.patch

0 comments on commit 54cccb2

Please sign in to comment.