Compare commits

...

5 Commits

Author SHA1 Message Date
Яницкий Вадим 11a9b412b3 Merge pull request #1 from 0x0d/master
Build fix for GCC 5
2015-10-17 12:43:18 +05:00
INVENT 127dbc6822 Build fix for GCC 5 2015-10-01 18:45:53 +03:00
axilirator 3ebe0472ee Improved readme 2015-07-16 18:02:53 +06:00
axilirator a409a92923 Markdown for README 2015-07-16 17:48:46 +06:00
axilirator 31a520d085 Downgrade versions, texinfo patch 2015-07-16 17:47:18 +06:00
8 changed files with 202 additions and 21 deletions

16
README
View File

@ -1,18 +1,20 @@
=== GNU ARM TOOLCHAIN INSTALLER ===
=== FOR OSMOCOM-BB ===
GNU ARM TOOLCHAIN INSTALLER
===========================
=== FOR OSMOCOM-BB
This latest version works with:
* gcc-4.5.2.tar.bz2
* binutils-2.21.1a.tar.bz2
* newlib-1.19.0.tar.gz
* texinfo-4.13a
This version of the installer was tested with Ubuntu. Debian should work also. But there is at one point in the download.sh script an aptitude command. You can just ignore this with other systems, but nevertheless, you need to install this library.
To install
=== INSTALL
1. Download the latest installer gnu-arm-installer-v0.1.tar.gz and then extract by typing:
Make sure that you already have installed following packages: build-essential libgmp3-dev libmpfr-dev libx11-6 libx11-dev flex bison libncurses5 libncurses5-dbg libncurses5-dev libncursesw5 libncursesw5-dbg libncursesw5-dev zlibc zlib1g-dev libmpfr4 libmpc-dev.
1. Download the latest installer:
git clone https://github.com/axilirator/gnu-arm-installer.git
cd gnu-arm-installer
@ -26,4 +28,6 @@ License:
GPL v3 (http://www.gnu.org/copyleft/gpl.html)
This script was originally written by Waipot Ngamsaad from mcuprogramming.com:
svn checkout http://hobbycode.googlecode.com/svn/trunk/gnu-arm-installer gnu-arm-installer
svn checkout http://hobbycode.googlecode.com/svn/trunk/gnu-arm-installer gnu-arm-installer
Patch written by Marcello Pogliani <pogliamarci@hotmail.it>.

View File

@ -5,8 +5,8 @@ SRCDIR=$ROOT/src
BUILDDIR=$ROOT/build
PREFIX=$ROOT/install
GCC_SRC=gcc-4.8.2.tar.bz2
GCC_VERSION=4.8.2
GCC_SRC=gcc-4.5.2.tar.bz2
GCC_VERSION=4.5.2
GCC_DIR=gcc-$GCC_VERSION
BINUTILS_SRC=binutils-2.21.1a.tar.bz2
@ -17,13 +17,11 @@ NEWLIB_SRC=newlib-1.19.0.tar.gz
NEWLIB_VERSION=1.19.0
NEWLIB_DIR=newlib-$NEWLIB_VERSION
TARGET_TRIPLET=arm-none-eabi
#INSIGHT_SRC=insight-6.8-1.tar.bz2
#INSIGHT_VERSION=6.8-1
#INSIGHT_DIR=insight-$INSIGHT_VERSION
echo "I will build an $TARGET_TRIPLET cross-compiler:
echo "I will build an arm-elf cross-compiler:
Prefix: $PREFIX
Sources: $SRCDIR
@ -62,6 +60,9 @@ unpack_source $(basename $GCC_SRC)
unpack_source $(basename $BINUTILS_SRC)
unpack_source $(basename $NEWLIB_SRC)
#unpack_source $(basename $INSIGHT_SRC)
# Patch for texinfo5. Adapted from Marcello Pogliani
patch -p1 < ../gcc-texinfo5.patch
patch -p1 < ../fix-gcc5-build.patch
)
# Set the PATH to include the binaries we're going to build.
@ -82,7 +83,7 @@ cd $SRCDIR/$BINUTILS_DIR
mkdir -p $BUILDDIR/$BINUTILS_DIR
cd $BUILDDIR/$BINUTILS_DIR
$SRCDIR/$BINUTILS_DIR/configure --target=$TARGET_TRIPLET --prefix=$PREFIX \
$SRCDIR/$BINUTILS_DIR/configure --target=arm-elf --prefix=$PREFIX \
--enable-interwork --enable-threads=posix --enable-multilib --with-float=soft --disable-werror \
&& make all install
@ -92,7 +93,7 @@ $SRCDIR/$BINUTILS_DIR/configure --target=$TARGET_TRIPLET --prefix=$PREFIX \
# Stage 2: Patch the GCC multilib rules, then build the gcc compiler only
#
(
MULTILIB_CONFIG=$SRCDIR/$GCC_DIR/gcc/config/arm/t-$TARGET_TRIPLET
MULTILIB_CONFIG=$SRCDIR/$GCC_DIR/gcc/config/arm/t-arm-elf
echo "
@ -104,7 +105,7 @@ MULTILIB_DIRNAMES += normal interwork
mkdir -p $BUILDDIR/$GCC_DIR
cd $BUILDDIR/$GCC_DIR
$SRCDIR/$GCC_DIR/configure --target=$TARGET_TRIPLET --prefix=$PREFIX \
$SRCDIR/$GCC_DIR/configure --target=arm-elf --prefix=$PREFIX \
--enable-interwork --enable-multilib --with-float=soft --disable-werror \
--enable-languages="c,c++" --with-newlib \
--with-headers=$SRCDIR/$NEWLIB_DIR/newlib/libc/include \
@ -127,7 +128,7 @@ cd $SRCDIR/$NEWLIB_DIR
mkdir -p $BUILDDIR/$NEWLIB_DIR
cd $BUILDDIR/$NEWLIB_DIR
$SRCDIR/$NEWLIB_DIR/configure --target=$TARGET_TRIPLET --prefix=$PREFIX \
$SRCDIR/$NEWLIB_DIR/configure --target=arm-elf --prefix=$PREFIX \
--enable-interwork --enable-multilib --with-float=soft --disable-werror \
&& make all install
@ -154,7 +155,7 @@ make all install
#cd $BUILDDIR/$INSIGHT_DIR
#$SRCDIR/$INSIGHT_DIR/configure --target=$TARGET_TRIPLET --prefix=$PREFIX \
#$SRCDIR/$INSIGHT_DIR/configure --target=arm-elf --prefix=$PREFIX \
# --enable-interwork --enable-multilib --with-float=soft --disable-werror \
# && make all install
@ -164,6 +165,6 @@ make all install
export PATH=$OLD_PATH
echo "
Build complete! Add $PREFIX/bin to your PATH to make $TARGET_TRIPLET-gcc and friends
Build complete! Add $PREFIX/bin to your PATH to make arm-elf-gcc and friends
accessible directly.
"

View File

@ -1,7 +1,6 @@
sudo apt-get install libmpfr-dev texinfo
rm -rf src
mkdir src/ install/ build/
rm src/*
wget http://ftp.gnu.org/gnu/gcc/gcc-4.8.2/gcc-4.8.2.tar.bz2 -O src/gcc-4.8.2.tar.bz2
wget http://ftp.gnu.org/gnu/gcc/gcc-4.5.2/gcc-4.5.2.tar.bz2 -O src/gcc-4.5.2.tar.bz2
wget http://ftp.gnu.org/gnu/binutils/binutils-2.21.1a.tar.bz2 -O src/binutils-2.21.1a.tar.bz2
wget ftp://sources.redhat.com/pub/newlib/newlib-1.19.0.tar.gz -O src/newlib-1.19.0.tar.gz
wget ftp://sources.redhat.com/pub/newlib/newlib-1.19.0.tar.gz -O src/newlib-1.19.0.tar.gz

22
fix-gcc5-build.patch Normal file
View File

@ -0,0 +1,22 @@
--- src/gcc-4.5.2/gcc/cp/cfns.h.orig 2015-02-13 08:27:46.000000000 +0200
+++ src/gcc-4.5.2/gcc/cp/cfns.h 2015-02-13 10:23:53.000000000 +0200
@@ -53,6 +53,9 @@
static unsigned int hash (const char *, unsigned int);
#ifdef __GNUC__
__inline
+#ifdef __GNUC_STDC_INLINE__
+__attribute__ ((__gnu_inline__))
+#endif
#endif
const char * libc_name_p (const char *, unsigned int);
/* maximum key range = 391, duplicates = 0 */
@@ -96,7 +99,7 @@
400, 400, 400, 400, 400, 400, 400, 400, 400, 400,
400, 400, 400, 400, 400, 400, 400
};
- register int hval = len;
+ register int hval = (int)len;
switch (hval)
{

108
gcc-texinfo5.patch Normal file
View File

@ -0,0 +1,108 @@
diff -rupN src/gcc-4.5.2/gcc/config/arm/t-arm-elf src/gcc-4.5.2.new/gcc/config/arm/t-arm-elf
--- src/gcc-4.5.2/gcc/config/arm/t-arm-elf 2009-08-06 16:27:45.000000000 +0200
+++ src/gcc-4.5.2.new/gcc/config/arm/t-arm-elf 2015-01-28 20:17:14.871648910 +0100
@@ -120,3 +120,15 @@ $(T)crtn.o: $(srcdir)/config/arm/crtn.as
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/arm/crtn.asm
+
+
+MULTILIB_OPTIONS += mno-thumb-interwork/mthumb-interwork
+MULTILIB_DIRNAMES += normal interwork
+
+
+
+
+MULTILIB_OPTIONS += mno-thumb-interwork/mthumb-interwork
+MULTILIB_DIRNAMES += normal interwork
+
+
diff -rupN src/gcc-4.5.2/gcc/doc/cppopts.texi src/gcc-4.5.2.new/gcc/doc/cppopts.texi
--- src/gcc-4.5.2/gcc/doc/cppopts.texi 2010-04-02 21:54:46.000000000 +0200
+++ src/gcc-4.5.2.new/gcc/doc/cppopts.texi 2015-01-28 20:17:14.919648912 +0100
@@ -760,7 +760,7 @@ Replacement: [ ] @{ @}
Enable special code to work around file systems which only permit very
short file names, such as MS-DOS@.
-@itemx --help
+@item --help
@itemx --target-help
@opindex help
@opindex target-help
diff -rupN src/gcc-4.5.2/gcc/doc/generic.texi src/gcc-4.5.2.new/gcc/doc/generic.texi
--- src/gcc-4.5.2/gcc/doc/generic.texi 2010-07-06 22:23:53.000000000 +0200
+++ src/gcc-4.5.2.new/gcc/doc/generic.texi 2015-01-28 20:17:14.923648912 +0100
@@ -1407,13 +1407,13 @@ generate these expressions anyhow, if it
not matter. The type of the operands and that of the result are
always of @code{BOOLEAN_TYPE} or @code{INTEGER_TYPE}.
-@itemx POINTER_PLUS_EXPR
+@item POINTER_PLUS_EXPR
This node represents pointer arithmetic. The first operand is always
a pointer/reference type. The second operand is always an unsigned
integer type compatible with sizetype. This is the only binary
arithmetic operand that can operate on pointer types.
-@itemx PLUS_EXPR
+@item PLUS_EXPR
@itemx MINUS_EXPR
@itemx MULT_EXPR
These nodes represent various binary arithmetic operations.
diff -rupN src/gcc-4.5.2/gcc/doc/invoke.texi src/gcc-4.5.2.new/gcc/doc/invoke.texi
--- src/gcc-4.5.2/gcc/doc/invoke.texi 2010-09-08 19:36:40.000000000 +0200
+++ src/gcc-4.5.2.new/gcc/doc/invoke.texi 2015-01-28 20:17:14.915648912 +0100
@@ -4875,11 +4875,11 @@ Dump after duplicating the computed goto
@option{-fdump-rtl-ce3} enable dumping after the three
if conversion passes.
-@itemx -fdump-rtl-cprop_hardreg
+@item -fdump-rtl-cprop_hardreg
@opindex fdump-rtl-cprop_hardreg
Dump after hard register copy propagation.
-@itemx -fdump-rtl-csa
+@item -fdump-rtl-csa
@opindex fdump-rtl-csa
Dump after combining stack adjustments.
@@ -4890,11 +4890,11 @@ Dump after combining stack adjustments.
@option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
the two common sub-expression elimination passes.
-@itemx -fdump-rtl-dce
+@item -fdump-rtl-dce
@opindex fdump-rtl-dce
Dump after the standalone dead code elimination passes.
-@itemx -fdump-rtl-dbr
+@item -fdump-rtl-dbr
@opindex fdump-rtl-dbr
Dump after delayed branch scheduling.
@@ -4939,7 +4939,7 @@ Dump after the initialization of the reg
@opindex fdump-rtl-initvals
Dump after the computation of the initial value sets.
-@itemx -fdump-rtl-into_cfglayout
+@item -fdump-rtl-into_cfglayout
@opindex fdump-rtl-into_cfglayout
Dump after converting to cfglayout mode.
@@ -4969,7 +4969,7 @@ Dump after removing redundant mode switc
@opindex fdump-rtl-rnreg
Dump after register renumbering.
-@itemx -fdump-rtl-outof_cfglayout
+@item -fdump-rtl-outof_cfglayout
@opindex fdump-rtl-outof_cfglayout
Dump after converting from cfglayout mode.
@@ -4981,7 +4981,7 @@ Dump after the peephole pass.
@opindex fdump-rtl-postreload
Dump after post-reload optimizations.
-@itemx -fdump-rtl-pro_and_epilogue
+@item -fdump-rtl-pro_and_epilogue
@opindex fdump-rtl-pro_and_epilogue
Dump after generating the function pro and epilogues.

View File

@ -0,0 +1,11 @@
--- /tmp/gnu-arm-build.2.sh 2011-09-07 13:32:31.000000000 +0200
+++ gnu-arm-build.2.sh 2015-01-28 19:50:06.527599084 +0100
@@ -60,6 +60,8 @@
unpack_source $(basename $BINUTILS_SRC)
unpack_source $(basename $NEWLIB_SRC)
#unpack_source $(basename $INSIGHT_SRC)
+# Patch for texinfo5. Adapted from Marcello Pogliani
+patch -p1 < ../gcc-texinfo5.patch
)
# Set the PATH to include the binaries we're going to build.

36
readme.md Normal file
View File

@ -0,0 +1,36 @@
GNU ARM TOOLCHAIN INSTALLER
===========================
<h5 align="right">FOR OSMOCOM-BB</h5>
This latest version works with:
* gcc-4.5.2.tar.bz2
* binutils-2.21.1a.tar.bz2
* newlib-1.19.0.tar.gz
This version of the installer was tested with Ubuntu. Debian should work also. But there is at one point in the download.sh script an aptitude command. You can just ignore this with other systems, but nevertheless, you need to install this library.
<h3>Installation</h3>
Make sure that you already have installed following packages: <i>build-essential libgmp3-dev libmpfr-dev libx11-6 libx11-dev flex bison libncurses5 libncurses5-dbg libncurses5-dev libncursesw5 libncursesw5-dbg libncursesw5-dev zlibc zlib1g-dev libmpfr4 libmpc-dev</i>.
1. Download the latest installer:
```bash
git clone https://github.com/axilirator/gnu-arm-installer.git
cd gnu-arm-installer
```
2. Run this scripts:
```bash
./download.sh
./build.sh
```
The installer will extract and compile all of the source files automatically. If it is successful, you will get the toolchain in install/ directory.
License:
GPL v3 (http://www.gnu.org/copyleft/gpl.html)
This script was originally written by Waipot Ngamsaad from mcuprogramming.com:
svn checkout http://hobbycode.googlecode.com/svn/trunk/gnu-arm-installer gnu-arm-installer
Patch written by Marcello Pogliani <pogliamarci@hotmail.it>.