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
This commit is contained in:
parent
6f47979bdd
commit
9d7a3b2aac
|
@ -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
|
|
@ -0,0 +1,2 @@
|
||||||
|
|
||||||
|
include ../make/Makefile
|
|
@ -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)
|
|
@ -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
|
|
@ -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
|
Loading…
Reference in New Issue