Download samples (sources) Download samples (binary) Buy the build scripts
All software related to build of cross-compiler is licensed under GNU GPLv3.
Full source-code plus full instructions are provided below. You can buy scripts I wrote to simply save your time.
They automatically create both versions (hard-float and soft-float) of the GCC for Windows and apply all required patches.
But this is not required, all needed information you will find while reading.
If you have an open-source project or want to develop one on Windows and run it to Raspberry Pi, let me know about it. Simply send me a link, short info with purpose and your role in that project and I will provide you the compiler binaries for FREE.
You can verify your versions following this hint.
You might also require:
In Jan-2015 it was impossible to build from sources newer version of the Raspberry cross-compiler at all. I spot and found solutions to several severe problems discussed below. It was a really long and boring process, as each time I had to revert my virtual machines and start compilation from the last checkpoint, what sometimes could take hours. Summaryizing at the end, the whole compilation took me more than a week.
Just a general rule - follow strictly the orignal Mikhail Kupchik's tutorial and apply all my patches after sources extraction, but before any compilation steps.Or if you think it's too hard, complex or boring - buy my scripts that will do it all for you!
--- a/bfd/bfd-in.h
+++ b/bfd/bfd-in.h
@ -287,9 +287,9 @
#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
-#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE)
-#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE)
-#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE)
+#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE))
+#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)))
+#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)))
/* Find the address one past the end of SEC. */
#define bfd_get_section_limit(bfd, sec) \
(((bfd)->direction != write_direction && (sec)->rawsize != 0 \
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@ -294,9 +294,9 @
#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
-#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE)
-#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE)
-#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE)
+#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE))
+#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)))
+#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)))
/* Find the address one past the end of SEC. */
#define bfd_get_section_limit(bfd, sec) \
(((bfd)->direction != write_direction && (sec)->rawsize != 0 \
--- a/bfd/elf.c
+++ b/bfd/elf.c
@ -848,11 +848,11 @ _bfd_elf_make_section_from_shdr (bfd *abfd,
newsect->filepos = hdr->sh_offset;
if (! bfd_set_section_vma (abfd, newsect, hdr->sh_addr)
- || ! bfd_set_section_size (abfd, newsect, hdr->sh_size)
- || ! bfd_set_section_alignment (abfd, newsect,
- bfd_log2 (hdr->sh_addralign)))
+ || ! bfd_set_section_size (abfd, newsect, hdr->sh_size))
return FALSE;
+ bfd_set_section_alignment (abfd, newsect, bfd_log2 (hdr->sh_addralign));
+
flags = SEC_NO_FLAGS;
if (hdr->sh_type != SHT_NOBITS)
flags |= SEC_HAS_CONTENTS;
$ cat ../binutils_2.24--compilation-error-fix.diff | patch -p1
--- a/gcc/ira-int.h
+++ b/gcc/ira-int.h
@ -1138,8 +1138,13 @
ira_allocno_object_iter_cond (ira_allocno_object_iterator *i, ira_allocno_t a,
ira_object_t *o)
{
- *o = ALLOCNO_OBJECT (a, i->n);
- return i->n++ < ALLOCNO_NUM_OBJECTS (a);
+ int n = i->n++;
+ if (n < ALLOCNO_NUM_OBJECTS (a))
+ {
+ *o = ALLOCNO_OBJECT (a, n);
+ return true;
+ }
+ return false;
}
/* Loop over all objects associated with allocno A. In each
$ cat ../gcc_4.6.3--segmentation-fault-compiling-ira.diff | patch -p1
--- a/configure
+++ b/configure
@ -5347,7 +5347,7 @
ac_prog_version=`$MAKE --version 2>&1 | sed -n 's/^.*GNU Make[^0-9]*\([0-9][0-9.]*\).*$/\1/p'`
case $ac_prog_version in
'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
- 3.79* | 3.[89]*)
+ 3.79* | 3.[89]* | 4.*)
ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
*) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
--- a/configure
+++ b/configure
@ -5535,6 +5535,9 @
{ $as_echo "$as_me:$LINENO: checking version of $SED" >&5
$as_echo_n "checking version of $SED... " >&6; }
ac_prog_version=`$SED --version 2>&1 | sed -n 's/^.*GNU sed version \([0-9]*\.[0-9.]*\).*$/\1/p'`
+ if test -z "$ac_prog_version"; then
+ ac_prog_version=`$SED --version 2>&1 | sed -n 's/^.*(GNU sed).* \([0-9][0-9.]*\).*$/\1/p'`
+ fi
case $ac_prog_version in
'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
3.0[2-9]*|3.[1-9]*|[4-9]*)
--- a/configure
+++ b/configure
@ -5473,7 +5473,10 @
$as_echo_n "checking version of $MAKEINFO... " >&6; }
ac_prog_version=`$MAKEINFO --version 2>&1 | sed -n 's/^.*GNU texinfo.* \([0-9][0-9.]*\).*$/\1/p'`
+ if test -z "$ac_prog_version"; then
+ ac_prog_version=`$MAKEINFO --version 2>&1 | sed -n 's/^.*(GNU texinfo).* \([0-9][0-9.]*\).*$/\1/p'`
+ fi
case $ac_prog_version in
'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
- 4.*)
+ 4.* | 5.*)
ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
*) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
--- a/configure.in
+++ b/configure.in
@ -1063,7 +1063,7 @
critic_missing="$critic_missing gcc")
AC_CHECK_PROG_VER(MAKE, gnumake gmake make, --version,
[GNU Make[^0-9]*\([0-9][0-9.]*\)],
- [3.79* | 3.[89]*], critic_missing="$critic_missing make")
+ [3.79* | 3.[89]* | 4.*], critic_missing="$critic_missing make")
AC_CHECK_PROG_VER(MSGFMT, gnumsgfmt gmsgfmt msgfmt, --version,
[GNU gettext.* \([0-9]*\.[0-9.]*\)],
--- a/ports/sysdeps/arm/preconfigure
+++ b/ports/sysdeps/arm/preconfigure
@ -2,7 +2,7 @
arm*)
base_machine=arm
case $config_os in
- linux-gnueabi)
+ linux-gnueabi*)
machine=arm/eabi/$machine
if [ "${CFLAGS+set}" != "set" ]; then
CFLAGS="-g -O2"
$ cat ../eglibc--configure-make4.diff | patch -p1
--- a/Makeconfig
+++ b/Makeconfig
@ -968,7 +968,7 @ $(common-objpfx)gnu/option-groups.stmp: \
all-subdirs = csu assert ctype locale intl catgets math setjmp signal \
stdlib stdio-common libio malloc string wcsmbs time dirent \
grp pwd posix io termios resource misc socket sysvipc gmon \
- gnulib iconv iconvdata wctype manual shadow gshadow po argp \
+ gnulib iconv iconvdata wctype shadow gshadow po argp \
crypt nss localedata timezone rt conform debug \
$(add-on-subdirs) $(dlfcn) $(binfmt-subdir)
--- a/sunrpc/rpc_clntout.c
+++ b/sunrpc/rpc_clntout.c
@ -31,7 +31,7 @
*/
#include <stdio.h>
#include <string.h>
-#include <rpc/types.h>
+#include "rpc/types.h"
#include "rpc_parse.h"
#include "rpc_util.h"
#include "proto.h"
$ cat ../eglibc_2.13--rpc-fix.diff | patch -p1
/Last update: 08-02-2015/