Various build fixes.
authorCarl Hetherington <cth@carlh.net>
Tue, 18 Jul 2017 21:28:46 +0000 (22:28 +0100)
committerCarl Hetherington <cth@carlh.net>
Tue, 18 Jul 2017 21:28:46 +0000 (22:28 +0100)
binutils1.patch [new file with mode: 0644]
binutils2.patch [new file with mode: 0644]
build_binutils_linux.sh
build_gcc_core.sh
gcc1.patch [new file with mode: 0644]

diff --git a/binutils1.patch b/binutils1.patch
new file mode 100644 (file)
index 0000000..9f1c448
--- /dev/null
@@ -0,0 +1,49 @@
+A patch from bug #752071 to fix build already sent to upstream.
+--- a/bfd/bfd-in.h
++++ b/bfd/bfd-in.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        \
+@@ -519,7 +519,7 @@
+ #define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
+-#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE)
++#define bfd_set_cacheable(abfd,bool) ((abfd)->cacheable = bool)
+ extern bfd_boolean bfd_cache_close
+   (bfd *abfd);
+--- a/bfd/bfd-in2.h
++++ b/bfd/bfd-in2.h
+@@ -301,9 +301,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        \
+@@ -526,7 +526,7 @@
+ #define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
+-#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE)
++#define bfd_set_cacheable(abfd,bool) ((abfd)->cacheable = bool)
+ extern bfd_boolean bfd_cache_close
+   (bfd *abfd);
diff --git a/binutils2.patch b/binutils2.patch
new file mode 100644 (file)
index 0000000..bae0803
--- /dev/null
@@ -0,0 +1,12 @@
+diff -Naur gas/config/tc-i386.c gas/config/tc-i386.c
+--- a/gas/config/tc-i386.c     2013-11-26 12:37:33.000000000 +0100
++++ b/gas/config/tc-i386.c     2015-05-22 11:42:24.647713050 +0200
+@@ -6140,7 +6140,7 @@
+             op.bitfield.regmem = 0;
+             if ((dest + 1) >= i.operands
+                 || (op.bitfield.reg32 != 1
+-                    && !op.bitfield.reg64 != 1
++                    && !!op.bitfield.reg64
+                     && !operand_type_equal (&op, &regxmm)
+                     && !operand_type_equal (&op, &regymm)
+                     && !operand_type_equal (&op, &regzmm)
index f97bb712ff329ecdc71b51fb0028a3711f392674..bc1cdd3ba02ac05aa53fc772c0239475d87c5d48 100644 (file)
@@ -6,9 +6,11 @@ tar xjf Archives/binutils-2.23.2.tar.bz2
 cd binutils-2.23.2
 sed -i -e 's/@colophon/@@colophon/' \
        -e 's/doc@cygnus.com/doc@@cygnus.com/' bfd/doc/bfd.texinfo
+patch -p1 < ../binutils1.patch
+patch -p1 < ../binutils2.patch
 cd ..
-mkdir -p binutils-build-$MINGW_TARGET
-cd binutils-build-$MINGW_TARGET
+mkdir -p binutils-linux-build-$MINGW_TARGET
+cd binutils-linux-build-$MINGW_TARGET
 ../binutils-2.23.2/configure --with-sysroot=$MINGW_PREFIX --prefix=$MINGW_PREFIX --disable-multilib -target=$MINGW_TARGET --enable-targets=$MINGW_TARGET 
 make $MINGW_PARALLEL
 sudo make install
index fe5107cb6a03c2285b93ade18f9febe131537681..b8ce18ae7924cf8ca2eba7668a36874cf8bbed25 100644 (file)
@@ -1,6 +1,9 @@
 #!/bin/bash -e
 
 tar xjf Archives/gcc-$MINGW_GCC_VERSION.tar.bz2
+cd gcc-$MINGW_GCC_VERSION
+patch -p1 < ../gcc1.patch
+cd ..
 mkdir -p gcc-build-$MINGW_TARGET
 cd gcc-build-$MINGW_TARGET
 ../gcc-$MINGW_GCC_VERSION/configure --with-sysroot=$MINGW_PREFIX --prefix=$MINGW_PREFIX --disable-multilib --target=$MINGW_TARGET --with-gnu-ld --with-gnu-as --enable-fully-dynamic-string
diff --git a/gcc1.patch b/gcc1.patch
new file mode 100644 (file)
index 0000000..7fdd4b6
--- /dev/null
@@ -0,0 +1,30 @@
+diff --git a/gcc/cp/cfns.gperf b/gcc/cp/cfns.gperf
+index 68acd3d..953262f 100644
+--- a/gcc/cp/cfns.gperf
++++ b/gcc/cp/cfns.gperf
+@@ -22,6 +22,9 @@ __inline
+ 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);
+ %}
+diff --git a/gcc/cp/cfns.h b/gcc/cp/cfns.h
+index 1c6665d..6d00c0e 100644
+--- a/gcc/cp/cfns.h
++++ b/gcc/cp/cfns.h
+@@ -53,6 +53,9 @@ __inline
+ 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 */
+-- 
+2.4.4