aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2021-03-28 19:22:28 +0200
committerlaforge <laforge@osmocom.org>2021-04-07 16:42:46 +0000
commit9d7a3b2aacc9b530cf1c6d9225529351f4e1e197 (patch)
tree0e36128baf10b54478439ec0748036859725acb6
parent6f47979bdd51f851e385c41dcd25bc8a8dcb588a (diff)
Check in GCC 4.8.2 based cross compiler for ARM EABI target
I used this one for building old OsmocomBB branches, which do not compile with modern arm-none-eabi-{gcc,binutils,newlib} toolchain. Change-Id: Ide93843836f059a3750e92a973d0a6d9cf9a5638
-rw-r--r--arm-none-eabi-gcc-4.8.2/Dockerfile79
-rw-r--r--arm-none-eabi-gcc-4.8.2/Makefile2
-rw-r--r--arm-none-eabi-gcc-4.8.2/patches/gcc-fix-inline.patch14
-rw-r--r--arm-none-eabi-gcc-4.8.2/patches/gcc-fix-texi.patch22
-rw-r--r--arm-none-eabi-gcc-4.8.2/patches/gcc-multilib-config.patch15
5 files changed, 132 insertions, 0 deletions
diff --git a/arm-none-eabi-gcc-4.8.2/Dockerfile b/arm-none-eabi-gcc-4.8.2/Dockerfile
new file mode 100644
index 0000000..8794a95
--- /dev/null
+++ b/arm-none-eabi-gcc-4.8.2/Dockerfile
@@ -0,0 +1,79 @@
+FROM debian:stretch
+
+MAINTAINER Vadim Yanitskiy <axilirator@gmail.com>
+
+ENV BINUTILS_SRC=http://ftp.gnu.org/gnu/binutils/binutils-2.21.1a.tar.bz2
+ENV NEWLIB_SRC=https://sourceware.org/pub/newlib/newlib-1.19.0.tar.gz
+ENV GCC_SRC=http://ftp.gnu.org/gnu/gcc/gcc-4.8.2/gcc-4.8.2.tar.bz2
+ENV PREFIX=/usr/local
+
+# Install build tools and dependencies
+RUN apt update && apt install -y \
+ build-essential \
+ libmpfr-dev \
+ libmpc-dev \
+ libgmp3-dev \
+ zlib1g-dev \
+ zlibc \
+ texinfo \
+ bison \
+ flex \
+ curl \
+ patch \
+ file
+
+# Stage 0: Download and patch the source code
+RUN curl -SL ${BINUTILS_SRC} | tar -xj -C /usr/src && \
+ curl -SL ${NEWLIB_SRC} | tar -xz -C /usr/src && \
+ curl -SL ${GCC_SRC} | tar -xj -C /usr/src
+
+COPY patches/ /usr/src/patches
+RUN for patch in /usr/src/patches/gcc-*.patch; do \
+ patch -d /usr/src/gcc-* -p1 < $patch; \
+ done
+
+# Stage 1: Build and install binutils
+RUN mkdir -p /home/build/binutils && cd /home/build/binutils \
+ && /usr/src/binutils-*/configure \
+ CFLAGS="-w" \
+ --prefix=${PREFIX} \
+ --disable-werror \
+ --target=arm-none-eabi \
+ --enable-interwork \
+ --enable-threads=posix \
+ --enable-multilib \
+ --with-float=soft \
+ && make all install
+
+# Stage 2: Build and install GCC (compiler only)
+RUN mkdir -p /home/build/gcc && cd /home/build/gcc \
+ && HDR_PATH=$(realpath /usr/src/newlib-*/newlib/libc/include) \
+ && /usr/src/gcc-*/configure \
+ CFLAGS="-w" \
+ --prefix=${PREFIX} \
+ --disable-shared \
+ --disable-werror \
+ --target=arm-none-eabi \
+ --enable-interwork \
+ --enable-multilib \
+ --with-float=soft \
+ --enable-languages="c,c++" \
+ --with-newlib \
+ --with-headers=$HDR_PATH \
+ --with-system-zlib \
+ && make all-gcc install-gcc
+
+# Stage 3: Build and install newlib
+RUN mkdir -p /home/build/newlib && cd /home/build/newlib \
+ && /usr/src/newlib-*/configure \
+ CFLAGS="-w" \
+ --prefix=${PREFIX} \
+ --disable-werror \
+ --target=arm-none-eabi \
+ --enable-interwork \
+ --enable-multilib \
+ --with-float=soft \
+ && make all install
+
+# Stage 4: Build and install the rest of GCC
+RUN cd /home/build/gcc && make all install
diff --git a/arm-none-eabi-gcc-4.8.2/Makefile b/arm-none-eabi-gcc-4.8.2/Makefile
new file mode 100644
index 0000000..0895788
--- /dev/null
+++ b/arm-none-eabi-gcc-4.8.2/Makefile
@@ -0,0 +1,2 @@
+
+include ../make/Makefile
diff --git a/arm-none-eabi-gcc-4.8.2/patches/gcc-fix-inline.patch b/arm-none-eabi-gcc-4.8.2/patches/gcc-fix-inline.patch
new file mode 100644
index 0000000..5c4307f
--- /dev/null
+++ b/arm-none-eabi-gcc-4.8.2/patches/gcc-fix-inline.patch
@@ -0,0 +1,14 @@
+diff --git a/gcc/cp/cfns.h b/gcc/cp/cfns.h
+index 42dd3cf..ba48bbd 100644
+--- a/gcc/cp/cfns.h
++++ b/gcc/cp/cfns.h
+@@ -124,9 +124,6 @@ hash (register const char *str, register unsigned int len)
+
+ #ifdef __GNUC__
+ __inline
+-#ifdef __GNUC_STDC_INLINE__
+-__attribute__ ((__gnu_inline__))
+-#endif
+ #endif
+ const char *
+ libc_name_p (register const char *str, register unsigned int len)
diff --git a/arm-none-eabi-gcc-4.8.2/patches/gcc-fix-texi.patch b/arm-none-eabi-gcc-4.8.2/patches/gcc-fix-texi.patch
new file mode 100644
index 0000000..c500d08
--- /dev/null
+++ b/arm-none-eabi-gcc-4.8.2/patches/gcc-fix-texi.patch
@@ -0,0 +1,22 @@
+diff --git a/gcc/doc/gcc.texi b/gcc/doc/gcc.texi
+index 02b81cf..5166abf 100644
+--- a/gcc/doc/gcc.texi
++++ b/gcc/doc/gcc.texi
+@@ -85,9 +85,15 @@ Published by:
+ @item GNU Press
+ @tab Website: www.gnupress.org
+ @item a division of the
+-@tab General: @tex press@@gnu.org @end tex
++@tab General:
++@tex
++press@@gnu.org
++@end tex
+ @item Free Software Foundation
+-@tab Orders: @tex sales@@gnu.org @end tex
++@tab Orders:
++@tex
++sales@@gnu.org
++@end tex
+ @item 51 Franklin Street, Fifth Floor
+ @tab Tel 617-542-5942
+ @item Boston, MA 02110-1301 USA
diff --git a/arm-none-eabi-gcc-4.8.2/patches/gcc-multilib-config.patch b/arm-none-eabi-gcc-4.8.2/patches/gcc-multilib-config.patch
new file mode 100644
index 0000000..9e27979
--- /dev/null
+++ b/arm-none-eabi-gcc-4.8.2/patches/gcc-multilib-config.patch
@@ -0,0 +1,15 @@
+diff --git a/gcc/config/arm/t-arm-elf b/gcc/config/arm/t-arm-elf
+index 60747d3..3427939 100644
+--- a/gcc/config/arm/t-arm-elf
++++ b/gcc/config/arm/t-arm-elf
+@@ -56,8 +56,8 @@ MULTILIB_EXCEPTIONS += *mthumb/*mfloat-abi=hard*
+ # MULTILIB_DIRNAMES += fpu soft
+ # MULTILIB_EXCEPTIONS += *mthumb/*mfloat-abi=hard*
+ #
+-# MULTILIB_OPTIONS += mno-thumb-interwork/mthumb-interwork
+-# MULTILIB_DIRNAMES += normal interwork
++MULTILIB_OPTIONS += mno-thumb-interwork/mthumb-interwork
++MULTILIB_DIRNAMES += normal interwork
+ #
+ # MULTILIB_OPTIONS += fno-leading-underscore/fleading-underscore
+ # MULTILIB_DIRNAMES += elf under