Skip to content

Commit

Permalink
Add gcc-linaro 7.1-2017.05
Browse files Browse the repository at this point in the history
Signed-off-by: Alexey Neyman <stilor@att.net>
  • Loading branch information
stilor committed Jul 17, 2017
1 parent ec430d2 commit 3e47aa1
Show file tree
Hide file tree
Showing 23 changed files with 1,529 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/gcc-linaro/7.1-2017.05/100-uclibc-conf.patch
@@ -0,0 +1,15 @@
Index: b/contrib/regression/objs-gcc.sh
===================================================================
--- a/contrib/regression/objs-gcc.sh
+++ b/contrib/regression/objs-gcc.sh
@@ -106,6 +106,10 @@
then
make all-gdb all-dejagnu all-ld || exit 1
make install-gdb install-dejagnu install-ld || exit 1
+elif [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-uclibc ]
+ then
+ make all-gdb all-dejagnu all-ld || exit 1
+ make install-gdb install-dejagnu install-ld || exit 1
elif [ $H_REAL_TARGET = $H_REAL_HOST ] ; then
make bootstrap || exit 1
make install || exit 1
@@ -0,0 +1,14 @@
--- gcc-6.2.0/libtool-ldflags 2016-12-20 11:13:12.669668125 -0800
+++ gcc-6.2.0/libtool-ldflags 2016-12-20 11:28:34.894826286 -0800
@@ -36,6 +36,11 @@
for arg
do
case $arg in
+ -framework)
+ # libtool handles this option. It should not be prefixed with
+ # -Xcompiler, as that would split it from the argument that
+ # follows.
+ ;;
-f*|--*|-static-lib*|-shared-lib*|-B*)
# Libtool does not ascribe any special meaning options
# that begin with -f or with a double-dash. So, it will
13 changes: 13 additions & 0 deletions packages/gcc-linaro/7.1-2017.05/111-alpha-bad-eh_frame.patch
@@ -0,0 +1,13 @@
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80037

diff --git a/libgcc/config/alpha/t-alpha b/libgcc/config/alpha/t-alpha
index 0b6ffb1..0c2f840 100644
--- a/libgcc/config/alpha/t-alpha
+++ b/libgcc/config/alpha/t-alpha
@@ -1,2 +1,6 @@
# This is a support routine for longlong.h, used by libgcc2.c.
LIB2ADD += $(srcdir)/config/alpha/qrnnd.S
+
+# When GAS-generated unwind tables are created, they get created
+# after the __FRAME_END__ terminator, which causes an ld error.
+CRTSTUFF_T_CFLAGS = -fno-unwind-tables
@@ -0,0 +1,160 @@
diff -urN gcc-5.3.0.orig/config/gcc-plugin.m4 gcc-5.3.0/config/gcc-plugin.m4
--- gcc-5.3.0.orig/config/gcc-plugin.m4 2015-12-19 14:39:04.120734900 +0000
+++ gcc-5.3.0/config/gcc-plugin.m4 2015-12-20 01:28:45.381965300 +0000
@@ -20,6 +20,9 @@

pluginlibs=

+ PICFLAG="-fPIC"
+ UNDEFINEDPREAMBLE="extern int X;"
+ UNDEFINEDCODE="return X == 0;"
case "${host}" in
*-*-darwin*)
if test x$build = x$host; then
@@ -30,6 +33,11 @@
export_sym_check=
fi
;;
+ *-*-mingw*|*-*-cygwin*|*-*-msys*)
+ PICFLAG=""
+ UNDEFINEDPREAMBLE=""
+ UNDEFINEDCODE=""
+ ;;
*)
if test x$build = x$host; then
export_sym_check="objdump${exeext} -T"
@@ -81,17 +89,17 @@
case "${host}" in
*-*-darwin*)
CFLAGS=`echo $CFLAGS | sed s/-mdynamic-no-pic//g`
- CFLAGS="$CFLAGS -fPIC"
+ CFLAGS="$CFLAGS ${PICFLAG}"
LDFLAGS="$LDFLAGS -shared -undefined dynamic_lookup"
;;
*)
- CFLAGS="$CFLAGS -fPIC"
- LDFLAGS="$LDFLAGS -fPIC -shared"
+ CFLAGS="$CFLAGS ${PICFLAG}"
+ LDFLAGS="$LDFLAGS ${PICFLAG} -shared"
;;
esac
- AC_MSG_CHECKING([for -fPIC -shared])
+ AC_MSG_CHECKING([for ${PICFLAG} -shared])
AC_TRY_LINK(
- [extern int X;],[return X == 0;],
+ [${UNDEFINEDPREAMBLE}],[${UNDEFINEDCODE}],
[AC_MSG_RESULT([yes]); have_pic_shared=yes],
[AC_MSG_RESULT([no]); have_pic_shared=no])
if test x"$have_pic_shared" != x"yes" -o x"$ac_cv_search_dlopen" = x"no"; then
diff -urN gcc-5.3.0.orig/gcc/configure gcc-5.3.0/gcc/configure
--- gcc-5.3.0.orig/gcc/configure 2015-12-19 14:40:16.893975900 +0000
+++ gcc-5.3.0/gcc/configure 2015-12-20 01:28:45.472476700 +0000
@@ -28386,6 +28386,9 @@

pluginlibs=

+ PICFLAG="-fPIC"
+ UNDEFINEDPREAMBLE="extern int X;"
+ UNDEFINEDCODE="return X == 0;"
case "${host}" in
*-*-darwin*)
if test x$build = x$host; then
@@ -28396,6 +28399,11 @@
export_sym_check=
fi
;;
+ *-*-mingw*|*-*-cygwin*|*-*-msys*)
+ PICFLAG=""
+ UNDEFINEDPREAMBLE=""
+ UNDEFINEDCODE=""
+ ;;
*)
if test x$build = x$host; then
export_sym_check="objdump${exeext} -T"
@@ -28508,23 +28516,23 @@
case "${host}" in
*-*-darwin*)
CFLAGS=`echo $CFLAGS | sed s/-mdynamic-no-pic//g`
- CFLAGS="$CFLAGS -fPIC"
+ CFLAGS="$CFLAGS ${PICFLAG}"
LDFLAGS="$LDFLAGS -shared -undefined dynamic_lookup"
;;
*)
- CFLAGS="$CFLAGS -fPIC"
- LDFLAGS="$LDFLAGS -fPIC -shared"
+ CFLAGS="$CFLAGS ${PICFLAG}"
+ LDFLAGS="$LDFLAGS ${PICFLAG} -shared"
;;
esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -fPIC -shared" >&5
-$as_echo_n "checking for -fPIC -shared... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${PICFLAG} -shared" >&5
+$as_echo_n "checking for ${PICFLAG} -shared... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-extern int X;
+${UNDEFINEDPREAMBLE}
int
main ()
{
-return X == 0;
+${UNDEFINEDCODE}
;
return 0;
}
diff -urN gcc-5.3.0.orig/libcc1/configure gcc-5.3.0/libcc1/configure
--- gcc-5.3.0.orig/libcc1/configure 2015-12-19 14:40:20.855979000 +0000
+++ gcc-5.3.0/libcc1/configure 2015-12-20 01:28:45.504980900 +0000
@@ -14500,6 +14500,9 @@

pluginlibs=

+ PICFLAG="-fPIC"
+ UNDEFINEDPREAMBLE="extern int X;"
+ UNDEFINEDCODE="return X == 0;"
case "${host}" in
*-*-darwin*)
if test x$build = x$host; then
@@ -14510,6 +14513,11 @@
export_sym_check=
fi
;;
+ *-*-mingw*|*-*-cygwin*|*-*-msys*)
+ PICFLAG=""
+ UNDEFINEDPREAMBLE=""
+ UNDEFINEDCODE=""
+ ;;
*)
if test x$build = x$host; then
export_sym_check="objdump${exeext} -T"
@@ -14622,23 +14630,23 @@
case "${host}" in
*-*-darwin*)
CFLAGS=`echo $CFLAGS | sed s/-mdynamic-no-pic//g`
- CFLAGS="$CFLAGS -fPIC"
+ CFLAGS="$CFLAGS ${PICFLAG}"
LDFLAGS="$LDFLAGS -shared -undefined dynamic_lookup"
;;
*)
- CFLAGS="$CFLAGS -fPIC"
- LDFLAGS="$LDFLAGS -fPIC -shared"
+ CFLAGS="$CFLAGS ${PICFLAG}"
+ LDFLAGS="$LDFLAGS ${PICFLAG} -shared"
;;
esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -fPIC -shared" >&5
-$as_echo_n "checking for -fPIC -shared... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${PICFLAG} -shared" >&5
+$as_echo_n "checking for ${PICFLAG} -shared... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-extern int X;
+${UNDEFINEDPREAMBLE}
int
main ()
{
-return X == 0;
+${UNDEFINEDCODE}
;
return 0;
}
@@ -0,0 +1,11 @@
diff -urN gcc-5.3.0.orig/libcc1/connection.cc gcc-5.3.0/libcc1/connection.cc
--- gcc-5.3.0.orig/libcc1/connection.cc 2015-12-19 14:40:20.860479600 +0000
+++ gcc-5.3.0/libcc1/connection.cc 2015-12-20 01:31:04.346611500 +0000
@@ -21,6 +21,7 @@
#include <string>
#include <unistd.h>
#include <sys/types.h>
+#include <sys/select.h>
#include <string.h>
#include <errno.h>
#include "marshall.hh"
30 changes: 30 additions & 0 deletions packages/gcc-linaro/7.1-2017.05/810-arm-softfloat-libgcc.patch
@@ -0,0 +1,30 @@
Index: b/gcc/config/arm/linux-elf.h
===================================================================
--- a/gcc/config/arm/linux-elf.h
+++ b/gcc/config/arm/linux-elf.h
@@ -60,7 +60,7 @@
%{shared:-lc} \
%{!shared:%{profile:-lc_p}%{!profile:-lc}}"

-#define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc"
+#define LIBGCC_SPEC "-lgcc"

#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"

Index: b/libgcc/config/arm/t-linux
===================================================================
--- a/libgcc/config/arm/t-linux
+++ b/libgcc/config/arm/t-linux
@@ -1,6 +1,11 @@
LIB1ASMSRC = arm/lib1funcs.S
LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \
- _ctzsi2 _arm_addsubdf3 _arm_addsubsf3
+ _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 \
+ _arm_addsubdf3 _arm_addsubsf3 \
+ _arm_negdf2 _arm_muldivdf3 _arm_cmpdf2 _arm_unorddf2 \
+ _arm_fixdfsi _arm_fixunsdfsi _arm_truncdfsf2 \
+ _arm_negsf2 _arm_muldivsf3 _arm_cmpsf2 _arm_unordsf2 \
+ _arm_fixsfsi _arm_fixunssfsi

# Just for these, we omit the frame pointer since it makes such a big
# difference.
56 changes: 56 additions & 0 deletions packages/gcc-linaro/7.1-2017.05/860-cilk-wchar.patch
@@ -0,0 +1,56 @@
[PATCH] cilk: fix build without wchar

When building against uClibc with wchar support disabled, WCHAR_MIN and
WCHAR_MAX are not defined leading to compilation errors.

Fix it by only including the wchar code if available.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
libcilkrts/include/cilk/reducer_min_max.h | 8 ++++++++
1 file changed, 8 insertions(+)

Index: b/libcilkrts/include/cilk/reducer_min_max.h
===================================================================
--- a/libcilkrts/include/cilk/reducer_min_max.h
+++ b/libcilkrts/include/cilk/reducer_min_max.h
@@ -3154,7 +3154,9 @@
CILK_C_REDUCER_MAX_INSTANCE(char, char, CHAR_MIN)
CILK_C_REDUCER_MAX_INSTANCE(unsigned char, uchar, 0)
CILK_C_REDUCER_MAX_INSTANCE(signed char, schar, SCHAR_MIN)
+#ifdef WCHAR_MIN
CILK_C_REDUCER_MAX_INSTANCE(wchar_t, wchar_t, WCHAR_MIN)
+#endif
CILK_C_REDUCER_MAX_INSTANCE(short, short, SHRT_MIN)
CILK_C_REDUCER_MAX_INSTANCE(unsigned short, ushort, 0)
CILK_C_REDUCER_MAX_INSTANCE(int, int, INT_MIN)
@@ -3306,7 +3308,9 @@
CILK_C_REDUCER_MAX_INDEX_INSTANCE(char, char, CHAR_MIN)
CILK_C_REDUCER_MAX_INDEX_INSTANCE(unsigned char, uchar, 0)
CILK_C_REDUCER_MAX_INDEX_INSTANCE(signed char, schar, SCHAR_MIN)
+#ifdef WCHAR_MIN
CILK_C_REDUCER_MAX_INDEX_INSTANCE(wchar_t, wchar_t, WCHAR_MIN)
+#endif
CILK_C_REDUCER_MAX_INDEX_INSTANCE(short, short, SHRT_MIN)
CILK_C_REDUCER_MAX_INDEX_INSTANCE(unsigned short, ushort, 0)
CILK_C_REDUCER_MAX_INDEX_INSTANCE(int, int, INT_MIN)
@@ -3432,7 +3436,9 @@
CILK_C_REDUCER_MIN_INSTANCE(char, char, CHAR_MAX)
CILK_C_REDUCER_MIN_INSTANCE(unsigned char, uchar, CHAR_MAX)
CILK_C_REDUCER_MIN_INSTANCE(signed char, schar, SCHAR_MAX)
+#ifdef WCHAR_MAX
CILK_C_REDUCER_MIN_INSTANCE(wchar_t, wchar_t, WCHAR_MAX)
+#endif
CILK_C_REDUCER_MIN_INSTANCE(short, short, SHRT_MAX)
CILK_C_REDUCER_MIN_INSTANCE(unsigned short, ushort, USHRT_MAX)
CILK_C_REDUCER_MIN_INSTANCE(int, int, INT_MAX)
@@ -3584,7 +3590,9 @@
CILK_C_REDUCER_MIN_INDEX_INSTANCE(char, char, CHAR_MAX)
CILK_C_REDUCER_MIN_INDEX_INSTANCE(unsigned char, uchar, CHAR_MAX)
CILK_C_REDUCER_MIN_INDEX_INSTANCE(signed char, schar, SCHAR_MAX)
+#ifdef WCHAR_MAX
CILK_C_REDUCER_MIN_INDEX_INSTANCE(wchar_t, wchar_t, WCHAR_MAX)
+#endif
CILK_C_REDUCER_MIN_INDEX_INSTANCE(short, short, SHRT_MAX)
CILK_C_REDUCER_MIN_INDEX_INSTANCE(unsigned short, ushort, USHRT_MAX)
CILK_C_REDUCER_MIN_INDEX_INSTANCE(int, int, INT_MAX)
@@ -0,0 +1,74 @@
From 06689e5973647f5c65d1984b164f2531f5418d7a Mon Sep 17 00:00:00 2001
From: Max Filippov <jcmvbkbc@gmail.com>
Date: Sun, 28 May 2017 19:56:56 -0700
Subject: [PATCH] gcc: xtensa: fix fprintf format specifiers

HOST_WIDE_INT may not be long as assumed in print_operand and
xtensa_emit_call. Use HOST_WIDE_INT_PRINT_DEC/HOST_WIDE_INT_PRINT_HEX
format strings instead of %ld/0x%lx. This fixes incorrect assembly code
generation by the compiler running on armhf host.

2017-05-28 Max Filippov <jcmvbkbc@gmail.com>
gcc/
* config/xtensa/xtensa.c (xtensa_emit_call): Use
HOST_WIDE_INT_PRINT_HEX instead of 0x%lx format string.
(print_operand): Use HOST_WIDE_INT_PRINT_DEC instead of %ld
format string.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
---
gcc/config/xtensa/xtensa.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
index 0181dde..25e4a28 100644
--- a/gcc/config/xtensa/xtensa.c
+++ b/gcc/config/xtensa/xtensa.c
@@ -1780,7 +1780,8 @@ xtensa_emit_call (int callop, rtx *operands)
rtx tgt = operands[callop];

if (GET_CODE (tgt) == CONST_INT)
- sprintf (result, "call%d\t0x%lx", WINDOW_SIZE, INTVAL (tgt));
+ sprintf (result, "call%d\t" HOST_WIDE_INT_PRINT_HEX,
+ WINDOW_SIZE, INTVAL (tgt));
else if (register_operand (tgt, VOIDmode))
sprintf (result, "callx%d\t%%%d", WINDOW_SIZE, callop);
else
@@ -2351,14 +2352,14 @@ print_operand (FILE *file, rtx x, int letter)

case 'L':
if (GET_CODE (x) == CONST_INT)
- fprintf (file, "%ld", (32 - INTVAL (x)) & 0x1f);
+ fprintf (file, HOST_WIDE_INT_PRINT_DEC, (32 - INTVAL (x)) & 0x1f);
else
output_operand_lossage ("invalid %%L value");
break;

case 'R':
if (GET_CODE (x) == CONST_INT)
- fprintf (file, "%ld", INTVAL (x) & 0x1f);
+ fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x) & 0x1f);
else
output_operand_lossage ("invalid %%R value");
break;
@@ -2372,7 +2373,7 @@ print_operand (FILE *file, rtx x, int letter)

case 'd':
if (GET_CODE (x) == CONST_INT)
- fprintf (file, "%ld", INTVAL (x));
+ fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x));
else
output_operand_lossage ("invalid %%d value");
break;
@@ -2437,7 +2438,7 @@ print_operand (FILE *file, rtx x, int letter)
else if (GET_CODE (x) == MEM)
output_address (GET_MODE (x), XEXP (x, 0));
else if (GET_CODE (x) == CONST_INT)
- fprintf (file, "%ld", INTVAL (x));
+ fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x));
else
output_addr_const (file, x);
}
--
2.1.4

18 changes: 18 additions & 0 deletions packages/gcc-linaro/7.1-2017.05/891-fix-m68k-uclinux.patch
@@ -0,0 +1,18 @@
avoids internal compiler error while compiling linux-atomic.c
See here:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53833

Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>

diff -Nur gcc-5.3.0.orig/libgcc/config.host gcc-5.3.0/libgcc/config.host
--- gcc-5.3.0.orig/libgcc/config.host 2015-10-01 14:01:18.000000000 +0200
+++ gcc-5.3.0/libgcc/config.host 2016-04-26 21:30:25.353691745 +0200
@@ -794,7 +794,7 @@
m68k*-*-openbsd*)
;;
m68k-*-uclinux*) # Motorola m68k/ColdFire running uClinux with uClibc
- tmake_file="$tmake_file m68k/t-floatlib m68k/t-linux"
+ tmake_file="$tmake_file m68k/t-floatlib"
md_unwind_header=m68k/linux-unwind.h
;;
m68k-*-linux*) # Motorola m68k's running GNU/Linux

0 comments on commit 3e47aa1

Please sign in to comment.