Change in docker-playground[master]: Check in GCC 4.8.2 based cross compiler for ARM EABI target

fixeria gerrit-no-reply at lists.osmocom.org
Sun Mar 28 17:26:46 UTC 2021


fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/docker-playground/+/23518 )


Change subject: Check in GCC 4.8.2 based cross compiler for ARM EABI target
......................................................................

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
---
A arm-none-eabi-gcc-4.8.2/Dockerfile
A arm-none-eabi-gcc-4.8.2/Makefile
A arm-none-eabi-gcc-4.8.2/patches/gcc-fix-inline.patch
A arm-none-eabi-gcc-4.8.2/patches/gcc-fix-texi.patch
A arm-none-eabi-gcc-4.8.2/patches/gcc-multilib-config.patch
5 files changed, 132 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/docker-playground refs/changes/18/23518/1

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 at 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
+- at tab General: @tex press@@gnu.org @end tex
++ at tab General:
++ at tex
++press@@gnu.org
++ at end tex
+ @item Free Software Foundation
+- at tab Orders:  @tex sales@@gnu.org @end tex
++ at tab Orders:
++ at tex
++sales@@gnu.org
++ at 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

-- 
To view, visit https://gerrit.osmocom.org/c/docker-playground/+/23518
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: Ide93843836f059a3750e92a973d0a6d9cf9a5638
Gerrit-Change-Number: 23518
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210328/884461f2/attachment.htm>


More information about the gerrit-log mailing list