Skip to content

Instantly share code, notes, and snippets.

@tgarc
Last active Jul 14, 2019
Embed
What would you like to do?
Patch GCC ARM Embedded Toolchain for big-endian targets (simply git apply be8.patch in top directory)
From 9ba6f4c25c50ce80c9195c45df7fab9d1e1c8152 Mon Sep 17 00:00:00 2001
From: "tdos.apone" <toemossgarcia@gmail.com>
Date: Thu, 10 Dec 2015 11:03:09 -0600
Subject: [PATCH 1/2] initial big-endian attempt
---
build-toolchain.sh | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/build-toolchain.sh b/build-toolchain.sh
index 55d508d..d8aef12 100755
--- a/build-toolchain.sh
+++ b/build-toolchain.sh
@@ -299,6 +299,7 @@ $SRCDIR/$GCC/configure --target=$TARGET \
--disable-tls \
--with-newlib \
--without-headers \
+ --with-endian=big \
--with-gnu-as \
--with-gnu-ld \
--with-python-dir=share/gcc-arm-none-eabi \
@@ -323,7 +324,7 @@ popd
echo Task [III-2] /$HOST_NATIVE/newlib/
saveenv
prepend_path PATH $INSTALLDIR_NATIVE/bin
-saveenvvar CFLAGS_FOR_TARGET '-g -O2 -ffunction-sections -fdata-sections'
+saveenvvar CFLAGS_FOR_TARGET '-g -O2 -ffunction-sections -fdata-sections -mbig-endian'
rm -rf $BUILDDIR_NATIVE/newlib && mkdir -p $BUILDDIR_NATIVE/newlib
pushd $BUILDDIR_NATIVE/newlib
@@ -362,7 +363,7 @@ restoreenv
echo Task [III-3] /$HOST_NATIVE/newlib-nano/
saveenv
prepend_path PATH $INSTALLDIR_NATIVE/bin
-saveenvvar CFLAGS_FOR_TARGET '-g -Os -ffunction-sections -fdata-sections'
+saveenvvar CFLAGS_FOR_TARGET '-g -Os -ffunction-sections -fdata-sections -mbig-endian'
rm -rf $BUILDDIR_NATIVE/newlib-nano && mkdir -p $BUILDDIR_NATIVE/newlib-nano
pushd $BUILDDIR_NATIVE/newlib-nano
@@ -415,6 +416,7 @@ $SRCDIR/$GCC/configure --target=$TARGET \
--disable-shared \
--disable-threads \
--disable-tls \
+ --with-endian=big \
--with-gnu-as \
--with-gnu-ld \
--with-newlib \
@@ -477,6 +479,7 @@ $SRCDIR/$GCC/configure --target=$TARGET \
--disable-shared \
--disable-threads \
--disable-tls \
+ --with-endian=big \
--with-gnu-as \
--with-gnu-ld \
--with-newlib \
@@ -759,6 +762,7 @@ $SRCDIR/$GCC/configure --build=$BUILD --host=$HOST_MINGW --target=$TARGET \
--disable-shared \
--disable-threads \
--disable-tls \
+ --with-endian=big \
--with-gnu-as \
--with-gnu-ld \
--with-headers=yes \
--
2.6.4
From 8c16ea71a21a8f836c6b1f9c1c36469d06224893 Mon Sep 17 00:00:00 2001
From: "tdos.apone" <toemossgarcia@gmail.com>
Date: Thu, 10 Dec 2015 12:37:29 -0600
Subject: [PATCH 2/2] arm-none-eabi->armeb-none-eabi
---
build-common.sh | 6 +--
build-toolchain.sh | 124 ++++++++++++++++++++++++++---------------------------
2 files changed, 65 insertions(+), 65 deletions(-)
diff --git a/build-common.sh b/build-common.sh
index 21e3f97..6b11084 100755
--- a/build-common.sh
+++ b/build-common.sh
@@ -250,9 +250,9 @@ SRCDIR=$ROOT/src
BUILDDIR_NATIVE=$ROOT/build-native
BUILDDIR_MINGW=$ROOT/build-mingw
INSTALLDIR_NATIVE=$ROOT/install-native
-INSTALLDIR_NATIVE_DOC=$ROOT/install-native/share/doc/gcc-arm-none-eabi
+INSTALLDIR_NATIVE_DOC=$ROOT/install-native/share/doc/gcc-armeb-none-eabi
INSTALLDIR_MINGW=$ROOT/install-mingw
-INSTALLDIR_MINGW_DOC=$ROOT/install-mingw/share/doc/gcc-arm-none-eabi
+INSTALLDIR_MINGW_DOC=$ROOT/install-mingw/share/doc/gcc-armeb-none-eabi
PACKAGEDIR=$ROOT/pkg
@@ -313,7 +313,7 @@ GCC_VER_NAME=`echo $GCC_VER | cut -d'.' -f1,2 | sed -e 's/\./_/g'`
GCC_VER_SHORT=`echo $GCC_VER_NAME | sed -e 's/_/\./g'`
HOST_MINGW=i686-w64-mingw32
HOST_MINGW_TOOL=i686-w64-mingw32
-TARGET=arm-none-eabi
+TARGET=armeb-none-eabi
ENV_CFLAGS=
ENV_CPPFLAGS=
ENV_LDFLAGS=
diff --git a/build-toolchain.sh b/build-toolchain.sh
index d8aef12..4de3a5e 100755
--- a/build-toolchain.sh
+++ b/build-toolchain.sh
@@ -252,7 +252,7 @@ $SRCDIR/$BINUTILS/configure \
--disable-werror \
--enable-interwork \
--enable-plugins \
- --with-sysroot=$INSTALLDIR_NATIVE/arm-none-eabi \
+ --with-sysroot=$INSTALLDIR_NATIVE/armeb-none-eabi \
"--with-pkgversion=$PKGVERSION"
if [ "x$DEBUG_BUILD_OPTIONS" != "x" ] ; then
@@ -302,8 +302,8 @@ $SRCDIR/$GCC/configure --target=$TARGET \
--with-endian=big \
--with-gnu-as \
--with-gnu-ld \
- --with-python-dir=share/gcc-arm-none-eabi \
- --with-sysroot=$INSTALLDIR_NATIVE/arm-none-eabi \
+ --with-python-dir=share/gcc-armeb-none-eabi \
+ --with-sysroot=$INSTALLDIR_NATIVE/armeb-none-eabi \
${GCC_CONFIG_OPTS} \
"${GCC_CONFIG_OPTS_LCPP}" \
"--with-pkgversion=$PKGVERSION" \
@@ -316,7 +316,7 @@ make install-gcc
popd
pushd $INSTALLDIR_NATIVE
-rm -rf bin/arm-none-eabi-gccbug
+rm -rf bin/armeb-none-eabi-gccbug
rm -rf ./lib/libiberty.a
rm -rf include
popd
@@ -348,13 +348,13 @@ make install
if [ "x$skip_manual" != "xyes" ]; then
make pdf
mkdir -p $INSTALLDIR_NATIVE_DOC/pdf
-cp $BUILDDIR_NATIVE/newlib/arm-none-eabi/newlib/libc/libc.pdf $INSTALLDIR_NATIVE_DOC/pdf/libc.pdf
-cp $BUILDDIR_NATIVE/newlib/arm-none-eabi/newlib/libm/libm.pdf $INSTALLDIR_NATIVE_DOC/pdf/libm.pdf
+cp $BUILDDIR_NATIVE/newlib/armeb-none-eabi/newlib/libc/libc.pdf $INSTALLDIR_NATIVE_DOC/pdf/libc.pdf
+cp $BUILDDIR_NATIVE/newlib/armeb-none-eabi/newlib/libm/libm.pdf $INSTALLDIR_NATIVE_DOC/pdf/libm.pdf
make html
mkdir -p $INSTALLDIR_NATIVE_DOC/html
-copy_dir $BUILDDIR_NATIVE/newlib/arm-none-eabi/newlib/libc/libc.html $INSTALLDIR_NATIVE_DOC/html/libc
-copy_dir $BUILDDIR_NATIVE/newlib/arm-none-eabi/newlib/libm/libm.html $INSTALLDIR_NATIVE_DOC/html/libm
+copy_dir $BUILDDIR_NATIVE/newlib/armeb-none-eabi/newlib/libc/libc.html $INSTALLDIR_NATIVE_DOC/html/libc
+copy_dir $BUILDDIR_NATIVE/newlib/armeb-none-eabi/newlib/libm/libm.html $INSTALLDIR_NATIVE_DOC/html/libm
fi
popd
@@ -390,8 +390,8 @@ popd
restoreenv
echo Task [III-4] /$HOST_NATIVE/gcc-final/
-rm -f $INSTALLDIR_NATIVE/arm-none-eabi/usr
-ln -s . $INSTALLDIR_NATIVE/arm-none-eabi/usr
+rm -f $INSTALLDIR_NATIVE/armeb-none-eabi/usr
+ln -s . $INSTALLDIR_NATIVE/armeb-none-eabi/usr
rm -rf $BUILDDIR_NATIVE/gcc-final && mkdir -p $BUILDDIR_NATIVE/gcc-final
pushd $BUILDDIR_NATIVE/gcc-final
@@ -421,8 +421,8 @@ $SRCDIR/$GCC/configure --target=$TARGET \
--with-gnu-ld \
--with-newlib \
--with-headers=yes \
- --with-python-dir=share/gcc-arm-none-eabi \
- --with-sysroot=$INSTALLDIR_NATIVE/arm-none-eabi \
+ --with-python-dir=share/gcc-armeb-none-eabi \
+ --with-sysroot=$INSTALLDIR_NATIVE/armeb-none-eabi \
$GCC_CONFIG_OPTS \
"${GCC_CONFIG_OPTS_LCPP}" \
"--with-pkgversion=$PKGVERSION" \
@@ -446,8 +446,8 @@ if [ "x$skip_manual" != "xyes" ]; then
fi
pushd $INSTALLDIR_NATIVE
-rm -rf bin/arm-none-eabi-gccbug
-LIBIBERTY_LIBRARIES=`find $INSTALLDIR_NATIVE/arm-none-eabi/lib -name libiberty.a`
+rm -rf bin/armeb-none-eabi-gccbug
+LIBIBERTY_LIBRARIES=`find $INSTALLDIR_NATIVE/armeb-none-eabi/lib -name libiberty.a`
for libiberty_lib in $LIBIBERTY_LIBRARIES ; do
rm -rf $libiberty_lib
done
@@ -455,12 +455,12 @@ rm -rf ./lib/libiberty.a
rm -rf include
popd
-rm -f $INSTALLDIR_NATIVE/arm-none-eabi/usr
+rm -f $INSTALLDIR_NATIVE/armeb-none-eabi/usr
popd
echo Task [III-5] /$HOST_NATIVE/gcc-size-libstdcxx/
-rm -f $BUILDDIR_NATIVE/target-libs/arm-none-eabi/usr
-ln -s . $BUILDDIR_NATIVE/target-libs/arm-none-eabi/usr
+rm -f $BUILDDIR_NATIVE/target-libs/armeb-none-eabi/usr
+ln -s . $BUILDDIR_NATIVE/target-libs/armeb-none-eabi/usr
rm -rf $BUILDDIR_NATIVE/gcc-size-libstdcxx && mkdir -p $BUILDDIR_NATIVE/gcc-size-libstdcxx
pushd $BUILDDIR_NATIVE/gcc-size-libstdcxx
@@ -484,8 +484,8 @@ $SRCDIR/$GCC/configure --target=$TARGET \
--with-gnu-ld \
--with-newlib \
--with-headers=yes \
- --with-python-dir=share/gcc-arm-none-eabi \
- --with-sysroot=$BUILDDIR_NATIVE/target-libs/arm-none-eabi \
+ --with-python-dir=share/gcc-armeb-none-eabi \
+ --with-sysroot=$BUILDDIR_NATIVE/target-libs/armeb-none-eabi \
$GCC_CONFIG_OPTS \
"${GCC_CONFIG_OPTS_LCPP}" \
"--with-pkgversion=$PKGVERSION" \
@@ -494,15 +494,15 @@ $SRCDIR/$GCC/configure --target=$TARGET \
make -j$JOBS CXXFLAGS_FOR_TARGET="-g -Os -ffunction-sections -fdata-sections -fno-exceptions"
make install
-copy_multi_libs src_prefix="$BUILDDIR_NATIVE/target-libs/arm-none-eabi/lib" \
- dst_prefix="$INSTALLDIR_NATIVE/arm-none-eabi/lib" \
- target_gcc="$BUILDDIR_NATIVE/target-libs/bin/arm-none-eabi-gcc"
+copy_multi_libs src_prefix="$BUILDDIR_NATIVE/target-libs/armeb-none-eabi/lib" \
+ dst_prefix="$INSTALLDIR_NATIVE/armeb-none-eabi/lib" \
+ target_gcc="$BUILDDIR_NATIVE/target-libs/bin/armeb-none-eabi-gcc"
# Copy the nano configured newlib.h file into the location that nano.specs
# expects it to be.
-mkdir -p $INSTALLDIR_NATIVE/arm-none-eabi/include/newlib-nano
-cp -f $BUILDDIR_NATIVE/target-libs/arm-none-eabi/include/newlib.h \
- $INSTALLDIR_NATIVE/arm-none-eabi/include/newlib-nano/newlib.h
+mkdir -p $INSTALLDIR_NATIVE/armeb-none-eabi/include/newlib-nano
+cp -f $BUILDDIR_NATIVE/target-libs/armeb-none-eabi/include/newlib.h \
+ $INSTALLDIR_NATIVE/armeb-none-eabi/include/newlib-nano/newlib.h
popd
@@ -533,10 +533,10 @@ build_gdb()
--disable-gprof \
--with-libexpat \
--with-lzma=no \
- --with-system-gdbinit=$INSTALLDIR_NATIVE/$HOST_NATIVE/arm-none-eabi/lib/gdbinit \
+ --with-system-gdbinit=$INSTALLDIR_NATIVE/$HOST_NATIVE/armeb-none-eabi/lib/gdbinit \
$GDB_CONFIG_OPTS \
$GDB_EXTRA_CONFIG_OPTS \
- '--with-gdb-datadir='\''${prefix}'\''/arm-none-eabi/share/gdb' \
+ '--with-gdb-datadir='\''${prefix}'\''/armeb-none-eabi/share/gdb' \
"--with-pkgversion=$PKGVERSION"
if [ "x$DEBUG_BUILD_OPTIONS" != "x" ] ; then
@@ -591,17 +591,17 @@ find $INSTALLDIR_NATIVE -name '*.la' -exec rm '{}' ';'
echo Task [III-9] /$HOST_NATIVE/strip_host_objects/
if [ "x$DEBUG_BUILD_OPTIONS" = "x" ] ; then
- STRIP_BINARIES=`find $INSTALLDIR_NATIVE/bin/ -name arm-none-eabi-\*`
+ STRIP_BINARIES=`find $INSTALLDIR_NATIVE/bin/ -name armeb-none-eabi-\*`
for bin in $STRIP_BINARIES ; do
strip_binary strip $bin
done
- STRIP_BINARIES=`find $INSTALLDIR_NATIVE/arm-none-eabi/bin/ -maxdepth 1 -mindepth 1 -name \*`
+ STRIP_BINARIES=`find $INSTALLDIR_NATIVE/armeb-none-eabi/bin/ -maxdepth 1 -mindepth 1 -name \*`
for bin in $STRIP_BINARIES ; do
strip_binary strip $bin
done
- STRIP_BINARIES=`find $INSTALLDIR_NATIVE/lib/gcc/arm-none-eabi/$GCC_VER/ -maxdepth 1 -name \* -perm +111 -and ! -type d`
+ STRIP_BINARIES=`find $INSTALLDIR_NATIVE/lib/gcc/armeb-none-eabi/$GCC_VER/ -maxdepth 1 -name \* -perm +111 -and ! -type d`
for bin in $STRIP_BINARIES ; do
strip_binary strip $bin
done
@@ -610,24 +610,24 @@ fi
echo Task [III-10] /$HOST_NATIVE/strip_target_objects/
saveenv
prepend_path PATH $INSTALLDIR_NATIVE/bin
-TARGET_LIBRARIES=`find $INSTALLDIR_NATIVE/arm-none-eabi/lib -name \*.a`
+TARGET_LIBRARIES=`find $INSTALLDIR_NATIVE/armeb-none-eabi/lib -name \*.a`
for target_lib in $TARGET_LIBRARIES ; do
- arm-none-eabi-objcopy -R .comment -R .note -R .debug_info -R .debug_aranges -R .debug_pubnames -R .debug_pubtypes -R .debug_abbrev -R .debug_line -R .debug_str -R .debug_ranges -R .debug_loc $target_lib || true
+ armeb-none-eabi-objcopy -R .comment -R .note -R .debug_info -R .debug_aranges -R .debug_pubnames -R .debug_pubtypes -R .debug_abbrev -R .debug_line -R .debug_str -R .debug_ranges -R .debug_loc $target_lib || true
done
-TARGET_OBJECTS=`find $INSTALLDIR_NATIVE/arm-none-eabi/lib -name \*.o`
+TARGET_OBJECTS=`find $INSTALLDIR_NATIVE/armeb-none-eabi/lib -name \*.o`
for target_obj in $TARGET_OBJECTS ; do
- arm-none-eabi-objcopy -R .comment -R .note -R .debug_info -R .debug_aranges -R .debug_pubnames -R .debug_pubtypes -R .debug_abbrev -R .debug_line -R .debug_str -R .debug_ranges -R .debug_loc $target_obj || true
+ armeb-none-eabi-objcopy -R .comment -R .note -R .debug_info -R .debug_aranges -R .debug_pubnames -R .debug_pubtypes -R .debug_abbrev -R .debug_line -R .debug_str -R .debug_ranges -R .debug_loc $target_obj || true
done
-TARGET_LIBRARIES=`find $INSTALLDIR_NATIVE/lib/gcc/arm-none-eabi/$GCC_VER -name \*.a`
+TARGET_LIBRARIES=`find $INSTALLDIR_NATIVE/lib/gcc/armeb-none-eabi/$GCC_VER -name \*.a`
for target_lib in $TARGET_LIBRARIES ; do
- arm-none-eabi-objcopy -R .comment -R .note -R .debug_info -R .debug_aranges -R .debug_pubnames -R .debug_pubtypes -R .debug_abbrev -R .debug_line -R .debug_str -R .debug_ranges -R .debug_loc $target_lib || true
+ armeb-none-eabi-objcopy -R .comment -R .note -R .debug_info -R .debug_aranges -R .debug_pubnames -R .debug_pubtypes -R .debug_abbrev -R .debug_line -R .debug_str -R .debug_ranges -R .debug_loc $target_lib || true
done
-TARGET_OBJECTS=`find $INSTALLDIR_NATIVE/lib/gcc/arm-none-eabi/$GCC_VER -name \*.o`
+TARGET_OBJECTS=`find $INSTALLDIR_NATIVE/lib/gcc/armeb-none-eabi/$GCC_VER -name \*.o`
for target_obj in $TARGET_OBJECTS ; do
- arm-none-eabi-objcopy -R .comment -R .note -R .debug_info -R .debug_aranges -R .debug_pubnames -R .debug_pubtypes -R .debug_abbrev -R .debug_line -R .debug_str -R .debug_ranges -R .debug_loc $target_obj || true
+ armeb-none-eabi-objcopy -R .comment -R .note -R .debug_info -R .debug_aranges -R .debug_pubnames -R .debug_pubtypes -R .debug_abbrev -R .debug_line -R .debug_str -R .debug_ranges -R .debug_loc $target_obj || true
done
restoreenv
@@ -643,14 +643,14 @@ rm -f $INSTALL_PACKAGE_NAME
cp $ROOT/$RELEASE_FILE $INSTALLDIR_NATIVE_DOC/
cp $ROOT/$README_FILE $INSTALLDIR_NATIVE_DOC/
cp $ROOT/$LICENSE_FILE $INSTALLDIR_NATIVE_DOC/
-copy_dir_clean $SRCDIR/$SAMPLES $INSTALLDIR_NATIVE/share/gcc-arm-none-eabi/$SAMPLES
+copy_dir_clean $SRCDIR/$SAMPLES $INSTALLDIR_NATIVE/share/gcc-armeb-none-eabi/$SAMPLES
ln -s $INSTALLDIR_NATIVE $INSTALL_PACKAGE_NAME
${TAR} cjf $PACKAGEDIR/$PACKAGE_NAME_NATIVE.tar.bz2 \
--owner=0 \
--group=0 \
--exclude=host-$HOST_NATIVE \
--exclude=host-$HOST_MINGW \
- $INSTALL_PACKAGE_NAME/arm-none-eabi \
+ $INSTALL_PACKAGE_NAME/armeb-none-eabi \
$INSTALL_PACKAGE_NAME/bin \
$INSTALL_PACKAGE_NAME/lib \
$INSTALL_PACKAGE_NAME/share
@@ -695,7 +695,7 @@ $SRCDIR/$BINUTILS/configure --build=$BUILD \
--pdfdir=$INSTALLDIR_MINGW_DOC/pdf \
--disable-nls \
--enable-plugins \
- --with-sysroot=$INSTALLDIR_MINGW/arm-none-eabi \
+ --with-sysroot=$INSTALLDIR_MINGW/armeb-none-eabi \
"--with-pkgversion=$PKGVERSION"
if [ "x$DEBUG_BUILD_OPTIONS" != "x" ] ; then
@@ -719,13 +719,13 @@ popd
echo Task [IV-2] /$HOST_MINGW/copy_libs/
if [ "x$skip_manual" != "xyes" ]; then
-copy_dir $BUILDDIR_MINGW/tools-$OBJ_SUFFIX_NATIVE/share/doc/gcc-arm-none-eabi/html $INSTALLDIR_MINGW_DOC/html
-copy_dir $BUILDDIR_MINGW/tools-$OBJ_SUFFIX_NATIVE/share/doc/gcc-arm-none-eabi/pdf $INSTALLDIR_MINGW_DOC/pdf
+copy_dir $BUILDDIR_MINGW/tools-$OBJ_SUFFIX_NATIVE/share/doc/gcc-armeb-none-eabi/html $INSTALLDIR_MINGW_DOC/html
+copy_dir $BUILDDIR_MINGW/tools-$OBJ_SUFFIX_NATIVE/share/doc/gcc-armeb-none-eabi/pdf $INSTALLDIR_MINGW_DOC/pdf
fi
-copy_dir $BUILDDIR_MINGW/tools-$OBJ_SUFFIX_NATIVE/arm-none-eabi/lib $INSTALLDIR_MINGW/arm-none-eabi/lib
-copy_dir $BUILDDIR_MINGW/tools-$OBJ_SUFFIX_NATIVE/arm-none-eabi/include $INSTALLDIR_MINGW/arm-none-eabi/include
-copy_dir $BUILDDIR_MINGW/tools-$OBJ_SUFFIX_NATIVE/arm-none-eabi/include/c++ $INSTALLDIR_MINGW/arm-none-eabi/include/c++
-copy_dir $BUILDDIR_MINGW/tools-$OBJ_SUFFIX_NATIVE/lib/gcc/arm-none-eabi $INSTALLDIR_MINGW/lib/gcc/arm-none-eabi
+copy_dir $BUILDDIR_MINGW/tools-$OBJ_SUFFIX_NATIVE/armeb-none-eabi/lib $INSTALLDIR_MINGW/armeb-none-eabi/lib
+copy_dir $BUILDDIR_MINGW/tools-$OBJ_SUFFIX_NATIVE/armeb-none-eabi/include $INSTALLDIR_MINGW/armeb-none-eabi/include
+copy_dir $BUILDDIR_MINGW/tools-$OBJ_SUFFIX_NATIVE/armeb-none-eabi/include/c++ $INSTALLDIR_MINGW/armeb-none-eabi/include/c++
+copy_dir $BUILDDIR_MINGW/tools-$OBJ_SUFFIX_NATIVE/lib/gcc/armeb-none-eabi $INSTALLDIR_MINGW/lib/gcc/armeb-none-eabi
echo Task [IV-3] /$HOST_MINGW/gcc-final/
saveenv
@@ -737,7 +737,7 @@ saveenvvar CC_FOR_TARGET $TARGET-gcc
saveenvvar GCC_FOR_TARGET $TARGET-gcc
saveenvvar CXX_FOR_TARGET $TARGET-g++
-pushd $INSTALLDIR_MINGW/arm-none-eabi/
+pushd $INSTALLDIR_MINGW/armeb-none-eabi/
rm -f usr
ln -s . usr
popd
@@ -767,8 +767,8 @@ $SRCDIR/$GCC/configure --build=$BUILD --host=$HOST_MINGW --target=$TARGET \
--with-gnu-ld \
--with-headers=yes \
--with-newlib \
- --with-python-dir=share/gcc-arm-none-eabi \
- --with-sysroot=$INSTALLDIR_MINGW/arm-none-eabi \
+ --with-python-dir=share/gcc-armeb-none-eabi \
+ --with-sysroot=$INSTALLDIR_MINGW/armeb-none-eabi \
--with-libiconv-prefix=$BUILDDIR_MINGW/host-libs/usr \
--with-gmp=$BUILDDIR_MINGW/host-libs/usr \
--with-mpfr=$BUILDDIR_MINGW/host-libs/usr \
@@ -794,13 +794,13 @@ fi
popd
pushd $INSTALLDIR_MINGW
-rm -rf bin/arm-none-eabi-gccbug
+rm -rf bin/armeb-none-eabi-gccbug
rm -rf include
popd
-copy_dir $BUILDDIR_MINGW/tools-$OBJ_SUFFIX_NATIVE/lib/gcc/arm-none-eabi $INSTALLDIR_MINGW/lib/gcc/arm-none-eabi
-rm -rf $INSTALLDIR_MINGW/arm-none-eabi/usr
-rm -rf $INSTALLDIR_MINGW/lib/gcc/arm-none-eabi/*/plugin
+copy_dir $BUILDDIR_MINGW/tools-$OBJ_SUFFIX_NATIVE/lib/gcc/armeb-none-eabi $INSTALLDIR_MINGW/lib/gcc/armeb-none-eabi
+rm -rf $INSTALLDIR_MINGW/armeb-none-eabi/usr
+rm -rf $INSTALLDIR_MINGW/lib/gcc/armeb-none-eabi/*/plugin
find $INSTALLDIR_MINGW -executable -and -not -type d -and -not -name \*.exe \
-and -not -name liblto_plugin-0.dll -exec rm -f \{\} \;
restoreenv
@@ -833,8 +833,8 @@ build_mingw_gdb()
$MINGW_GDB_CONF_OPTS \
--with-libexpat=$BUILDDIR_MINGW/host-libs/usr \
--with-libiconv-prefix=$BUILDDIR_MINGW/host-libs/usr \
- --with-system-gdbinit=$INSTALLDIR_MINGW/$HOST_MINGW/arm-none-eabi/lib/gdbinit \
- '--with-gdb-datadir='\''${prefix}'\''/arm-none-eabi/share/gdb' \
+ --with-system-gdbinit=$INSTALLDIR_MINGW/$HOST_MINGW/armeb-none-eabi/lib/gdbinit \
+ '--with-gdb-datadir='\''${prefix}'\''/armeb-none-eabi/share/gdb' \
"--with-pkgversion=$PKGVERSION"
if [ "x$DEBUG_BUILD_OPTIONS" != "x" ] ; then
@@ -867,18 +867,18 @@ rm -rf $INSTALLDIR_MINGW_DOC/man
find $INSTALLDIR_MINGW -name '*.la' -exec rm '{}' ';'
echo Task [IV-6] /$HOST_MINGW/strip_host_objects/
-STRIP_BINARIES=`find $INSTALLDIR_MINGW/bin/ -name arm-none-eabi-\*.exe`
+STRIP_BINARIES=`find $INSTALLDIR_MINGW/bin/ -name armeb-none-eabi-\*.exe`
if [ "x$DEBUG_BUILD_OPTIONS" = "x" ] ; then
for bin in $STRIP_BINARIES ; do
strip_binary $HOST_MINGW_TOOL-strip $bin
done
- STRIP_BINARIES=`find $INSTALLDIR_MINGW/arm-none-eabi/bin/ -maxdepth 1 -mindepth 1 -name \*.exe`
+ STRIP_BINARIES=`find $INSTALLDIR_MINGW/armeb-none-eabi/bin/ -maxdepth 1 -mindepth 1 -name \*.exe`
for bin in $STRIP_BINARIES ; do
strip_binary $HOST_MINGW_TOOL-strip $bin
done
- STRIP_BINARIES=`find $INSTALLDIR_MINGW/lib/gcc/arm-none-eabi/$GCC_VER/ -name \*.exe`
+ STRIP_BINARIES=`find $INSTALLDIR_MINGW/lib/gcc/armeb-none-eabi/$GCC_VER/ -name \*.exe`
for bin in $STRIP_BINARIES ; do
strip_binary $HOST_MINGW_TOOL-strip $bin
done
@@ -891,11 +891,11 @@ rm -f $INSTALL_PACKAGE_NAME
cp $ROOT/$RELEASE_FILE $INSTALLDIR_MINGW_DOC/
cp $ROOT/$README_FILE $INSTALLDIR_MINGW_DOC/
cp $ROOT/$LICENSE_FILE $INSTALLDIR_MINGW_DOC/
-copy_dir_clean $SRCDIR/$SAMPLES $INSTALLDIR_MINGW/share/gcc-arm-none-eabi/$SAMPLES
+copy_dir_clean $SRCDIR/$SAMPLES $INSTALLDIR_MINGW/share/gcc-armeb-none-eabi/$SAMPLES
flip -m $INSTALLDIR_MINGW_DOC/$RELEASE_FILE
flip -m $INSTALLDIR_MINGW_DOC/$README_FILE
flip -m -b $INSTALLDIR_MINGW_DOC/$LICENSE_FILE
-flip -m $INSTALLDIR_MINGW/share/gcc-arm-none-eabi/$SAMPLES_DOS_FILES
+flip -m $INSTALLDIR_MINGW/share/gcc-armeb-none-eabi/$SAMPLES_DOS_FILES
rm -rf $INSTALLDIR_MINGW/include
ln -s $INSTALLDIR_MINGW $INSTALL_PACKAGE_NAME
@@ -912,7 +912,7 @@ makensis -DBaseDir=$INSTALLDIR_MINGW \
-DInstallDirBase="$INSTALLBASE" \
-DInstallDirVer="$GCC_VER_SHORT $RELEASEVER" \
"-XOutFile $SRCDIR/$INSTALLATION/output/$PACKAGE_NAME_MINGW.exe" \
- $SRCDIR/$INSTALLATION/arm-none-eabi-gnu-tools.nsi
+ $SRCDIR/$INSTALLATION/armeb-none-eabi-gnu-tools.nsi
cp -rf $SRCDIR/$INSTALLATION/output/$PACKAGE_NAME_MINGW.exe $PACKAGEDIR/
rm -f $INSTALL_PACKAGE_NAME
--
2.6.4
@tgarc
Copy link
Author

tgarc commented Dec 16, 2015

@saeedM2
Copy link

saeedM2 commented Jun 12, 2018

Hi tgarc,
I'm new to this stuff. How can I apply the patch to "gcc-arm-none-eabi-4_9-2015q3" I've downloaded? If I try to apply the patch:

$ git apply be8.patch
error: build-toolchain.sh: No such file or directory
error: build-common.sh: No such file or directory
error: build-toolchain.sh: No such file or directory

My understanding Is the patch must be applied to some other tool which generates the arm toolchain. Can I use this build tool: https://github.com/ARMinARM/arm-toolchain-build-scripts and apply the patch to it?

@saeedM2
Copy link

saeedM2 commented Jun 12, 2018

ok I tried following the instructions in the link (https://launchpad.net/gcc-arm-embedded/4.9/4.9-2015-q3-update) you posted and I get this error:

&& CONFIG_FILES=po/Makefile.in:po/Make-in
CONFIG_HEADERS= /bin/bash ./config.status
config.status: creating po/Makefile.in
config.status: executing depfiles commands
config.status: executing libtool commands
config.status: executing default-1 commands
config.status: executing bfd_stdint.h commands
config.status: executing default commands
make[3]: Nothing to be done for 'info'.
make[3]: Leaving directory '/home/saeed/toolchain/gcc-arm-none-eabi-4_9-2015q3-20150921/build-native/binutils/bfd/po'
make[3]: Entering directory '/home/saeed/toolchain/gcc-arm-none-eabi-4_9-2015q3-20150921/build-native/binutils/bfd'
make[3]: Nothing to be done for 'info-am'.
make[3]: Leaving directory '/home/saeed/toolchain/gcc-arm-none-eabi-4_9-2015q3-20150921/build-native/binutils/bfd'
Makefile:1654: recipe for target 'info-recursive' failed
make[2]: *** [info-recursive] Error 1
make[2]: Leaving directory '/home/saeed/toolchain/gcc-arm-none-eabi-4_9-2015q3-20150921/build-native/binutils/bfd'
Makefile:2598: recipe for target 'all-bfd' failed
make[1]: *** [all-bfd] Error 2
make[1]: Leaving directory '/home/saeed/toolchain/gcc-arm-none-eabi-4_9-2015q3-20150921/build-native/binutils'
Makefile:829: recipe for target 'all' failed
make: *** [all] Error 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment