Update buidlroot to version 2016.08.1

This commit is contained in:
2016-11-16 22:07:29 +01:00
parent 807ab03547
commit a1061efbc2
3636 changed files with 59539 additions and 25783 deletions

View File

@@ -1,125 +0,0 @@
http://gcc.gnu.org/ml/gcc-patches/2008-10/msg00269.html
On glibc the libc.so carries a copy of the math function copysignl() but
on uClibc math functions like copysignl() live in libm. Since libgcc_s
contains unresolved symbols, any attempt to link against libgcc_s
without explicitely specifying -lm fails, resulting in a broken
bootstrap of the compiler.
Forward port to gcc 4.5.1 by Gustavo Zacarias <gustavo@zacarias.com.ar>
diff -Nura gcc-4.5.1.orig/gcc/config/t-slibgcc-elf-ver gcc-4.5.1/gcc/config/t-slibgcc-elf-ver
--- gcc-4.5.1.orig/gcc/config/t-slibgcc-elf-ver 2010-11-03 14:35:08.644904042 -0300
+++ gcc-4.5.1/gcc/config/t-slibgcc-elf-ver 2010-11-03 14:35:56.332904024 -0300
@@ -27,7 +27,7 @@
SHLIB_OBJS = @shlib_objs@
SHLIB_DIR = @multilib_dir@
SHLIB_SLIBDIR_QUAL = @shlib_slibdir_qual@
-SHLIB_LC = -lc
+SHLIB_LC = @libgcc_libm@ -lc
SHLIB_MAKE_SOLINK = $(LN_S) $(SHLIB_SONAME) $(SHLIB_DIR)/$(SHLIB_SOLINK)
SHLIB_INSTALL_SOLINK = $(LN_S) $(SHLIB_SONAME) \
$$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK)
diff -Nura gcc-4.5.1.orig/libgcc/Makefile.in gcc-4.5.1/libgcc/Makefile.in
--- gcc-4.5.1.orig/libgcc/Makefile.in 2010-11-03 14:32:44.272904042 -0300
+++ gcc-4.5.1/libgcc/Makefile.in 2010-11-03 14:37:03.893904042 -0300
@@ -39,6 +39,7 @@
decimal_float = @decimal_float@
enable_decimal_float = @enable_decimal_float@
fixed_point = @fixed_point@
+LIBGCC_LIBM = @LIBGCC_LIBM@
host_noncanonical = @host_noncanonical@
@@ -798,9 +799,10 @@
@multilib_dir@,$(MULTIDIR),$(subst \
@shlib_objs@,$(objects),$(subst \
@shlib_base_name@,libgcc_s,$(subst \
+ @libgcc_libm@,$(LIBGCC_LIBM),$(subst \
@shlib_map_file@,$(mapfile),$(subst \
@shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(subst \
- @shlib_slibdir@,$(shlib_slibdir),$(SHLIB_LINK))))))))
+ @shlib_slibdir@,$(shlib_slibdir),$(SHLIB_LINK)))))))))
libunwind$(SHLIB_EXT): $(libunwind-s-objects) $(extra-parts)
# @multilib_flags@ is still needed because this may use
diff -Nura gcc-4.5.1.orig/libgcc/configure gcc-4.5.1/libgcc/configure
--- gcc-4.5.1.orig/libgcc/configure 2010-11-03 14:32:44.283904042 -0300
+++ gcc-4.5.1/libgcc/configure 2010-11-03 14:39:48.685904042 -0300
@@ -557,6 +557,7 @@
extra_parts
tmake_file
set_use_emutls
+LIBGCC_LIBM
set_have_cc_tls
vis_hide
fixed_point
@@ -3847,6 +3848,37 @@
set_use_emutls="-DUSE_EMUTLS"
fi
+# On powerpc libgcc_s references copysignl which is a libm function but
+# glibc apparently also provides it via libc as opposed to uClibc where
+# it lives in libm.
+echo "$as_me:$LINENO: checking for library containing copysignl" >&5
+echo $ECHO_N "checking for library containing copysignl... $ECHO_C" >&6
+if test "${libgcc_cv_copysignl_lib+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ echo '#include <features.h>' > conftest.c
+ echo 'int the_libc = __UCLIBC__ + __powerpc__;' >> conftest.c
+ libgcc_cv_copysignl_lib="-lc"
+ if { ac_try='${CC-cc} -S conftest.c -o conftest.s 1>&5'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }
+ then
+ libgcc_cv_copysignl_lib="-lm"
+ fi
+ rm -f conftest.*
+
+fi
+echo "$as_me:$LINENO: result: $libgcc_cv_copysignl_lib" >&5
+echo "${ECHO_T}$libgcc_cv_copysignl_lib" >&6
+
+case /${libgcc_cv_copysignl_lib}/ in
+ /-lm/) LIBGCC_LIBM="$LIBGCC_LIBM -lm" ;;
+ *) LIBGCC_LIBM= ;;
+esac
# Conditionalize the makefile for this target machine.
tmake_file_=
diff -Nura gcc-4.5.1.orig/libgcc/configure.ac gcc-4.5.1/libgcc/configure.ac
--- gcc-4.5.1.orig/libgcc/configure.ac 2010-11-03 14:32:44.735904042 -0300
+++ gcc-4.5.1/libgcc/configure.ac 2010-11-03 14:42:11.278904045 -0300
@@ -238,6 +238,27 @@
fi
AC_SUBST(set_have_cc_tls)
+# On powerpc libgcc_s references copysignl which is a libm function but
+# glibc apparently also provides it via libc as opposed to uClibc where
+# it lives in libm.
+AC_CACHE_CHECK
+ libgcc_cv_copysignl_lib,
+ echo '#include <features.h>' > conftest.c
+ echo 'int the_libc = __UCLIBC__ + __powerpc__;' >> conftest.c
+ libgcc_cv_copysignl_lib="-lc"
+ if AC_TRY_COMMAND(${CC-cc} -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD)
+ then
+ libgcc_cv_copysignl_lib="-lm"
+ fi
+ rm -f conftest.*
+ ])
+
+case /${libgcc_cv_copysignl_lib}/ in
+ /-lm/) LIBGCC_LIBM="$LIBGCC_LIBM -lm" ;;
+ *) LIBGCC_LIBM= ;;
+esac
+AC_SUBST(LIBGCC_LIBM)
+
# See if we have emulated thread-local storage.
GCC_CHECK_EMUTLS
set_use_emutls=

View File

@@ -1,13 +0,0 @@
Index: gcc-4.3.0/libstdc++-v3/include/c_global/cstdio
===================================================================
--- gcc-4.3.0/libstdc++-v3/include/c_global/cstdio (revision 129202)
+++ gcc-4.3.0/libstdc++-v3/include/c_global/cstdio (working copy)
@@ -144,7 +144,7 @@
_GLIBCXX_END_NAMESPACE
-#if _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99 || defined __UCLIBC__
#undef snprintf
#undef vfscanf

View File

@@ -1,49 +0,0 @@
Index: gcc-4.2/libmudflap/mf-hooks2.c
===================================================================
--- gcc-4.2/libmudflap/mf-hooks2.c (revision 119834)
+++ gcc-4.2/libmudflap/mf-hooks2.c (working copy)
@@ -427,7 +427,7 @@
{
TRACE ("%s\n", __PRETTY_FUNCTION__);
MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
- bzero (s, n);
+ memset (s, 0, n);
}
@@ -437,7 +437,7 @@
TRACE ("%s\n", __PRETTY_FUNCTION__);
MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
- bcopy (src, dest, n);
+ memmove (dest, src, n);
}
@@ -447,7 +447,7 @@
TRACE ("%s\n", __PRETTY_FUNCTION__);
MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
- return bcmp (s1, s2, n);
+ return n == 0 ? 0 : memcmp (s1, s2, n);
}
@@ -456,7 +456,7 @@
size_t n = strlen (s);
TRACE ("%s\n", __PRETTY_FUNCTION__);
MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
- return index (s, c);
+ return strchr (s, c);
}
@@ -465,7 +465,7 @@
size_t n = strlen (s);
TRACE ("%s\n", __PRETTY_FUNCTION__);
MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
- return rindex (s, c);
+ return strrchr (s, c);
}
/* XXX: stpcpy, memccpy */

View File

@@ -1,38 +0,0 @@
[PATCH] add the correct symbols to libgcc for uclibc arm softfloat
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
---
gcc/config/arm/linux-elf.h | 2 +-
gcc/config/arm/t-linux | 6 +++++-
2 files changed, 6 insertions(+), 2 deletions(-)
Index: gcc-4.4.0/gcc/config/arm/t-linux
===================================================================
--- gcc-4.4.0.orig/gcc/config/arm/t-linux
+++ gcc-4.4.0/gcc/config/arm/t-linux
@@ -4,7 +4,11 @@
LIB1ASMSRC = arm/lib1funcs.asm
LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \
- _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
# MULTILIB_OPTIONS = mhard-float/msoft-float
# MULTILIB_DIRNAMES = hard-float soft-float
Index: gcc-4.4.0/gcc/config/arm/linux-elf.h
===================================================================
--- gcc-4.4.0.orig/gcc/config/arm/linux-elf.h
+++ gcc-4.4.0/gcc/config/arm/linux-elf.h
@@ -60,7 +60,7 @@
%{shared:-lc} \
%{!shared:%{profile:-lc_p}%{!profile:-lc}}"
-#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
+#define LIBGCC_SPEC "-lgcc"
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"

View File

@@ -1,345 +0,0 @@
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43440
--- gcc-4.4.4.orig/gcc/config/arm/aout.h
+++ gcc-4.4.4/gcc/config/arm/aout.h
@@ -163,34 +163,49 @@
{"mvdx12", 39}, \
{"mvdx13", 40}, \
{"mvdx14", 41}, \
- {"mvdx15", 42}, \
- {"d0", 63}, {"q0", 63}, \
- {"d1", 65}, \
- {"d2", 67}, {"q1", 67}, \
- {"d3", 69}, \
- {"d4", 71}, {"q2", 71}, \
- {"d5", 73}, \
- {"d6", 75}, {"q3", 75}, \
- {"d7", 77}, \
- {"d8", 79}, {"q4", 79}, \
- {"d9", 81}, \
- {"d10", 83}, {"q5", 83}, \
- {"d11", 85}, \
- {"d12", 87}, {"q6", 87}, \
- {"d13", 89}, \
- {"d14", 91}, {"q7", 91}, \
- {"d15", 93}, \
- {"q8", 95}, \
- {"q9", 99}, \
- {"q10", 103}, \
- {"q11", 107}, \
- {"q12", 111}, \
- {"q13", 115}, \
- {"q14", 119}, \
- {"q15", 123} \
+ {"mvdx15", 42} \
}
#endif
+#ifndef OVERLAPPING_REGISTER_NAMES
+#define OVERLAPPING_REGISTER_NAMES \
+{ \
+ {"d0", 63, 2}, \
+ {"d1", 65, 2}, \
+ {"d2", 67, 2}, \
+ {"d3", 69, 2}, \
+ {"d4", 71, 2}, \
+ {"d5", 73, 2}, \
+ {"d6", 75, 2}, \
+ {"d7", 77, 2}, \
+ {"d8", 79, 2}, \
+ {"d9", 81, 2}, \
+ {"d10", 83, 2}, \
+ {"d11", 85, 2}, \
+ {"d12", 87, 2}, \
+ {"d13", 89, 2}, \
+ {"d14", 91, 2}, \
+ {"d15", 93, 2}, \
+ {"q0", 63, 4}, \
+ {"q1", 67, 4}, \
+ {"q2", 71, 4}, \
+ {"q3", 75, 4}, \
+ {"q4", 79, 4}, \
+ {"q5", 83, 4}, \
+ {"q6", 87, 4}, \
+ {"q7", 91, 4}, \
+ {"q8", 95, 4}, \
+ {"q9", 99, 4}, \
+ {"q10", 103, 4}, \
+ {"q11", 107, 4}, \
+ {"q12", 111, 4}, \
+ {"q13", 115, 4}, \
+ {"q14", 119, 4}, \
+ {"q15", 123, 4} \
+}
+#endif
+
+
#ifndef NO_DOLLAR_IN_LABEL
#define NO_DOLLAR_IN_LABEL 1
#endif
--- gcc-4.4.4.orig/gcc/output.h
+++ gcc-4.4.4/gcc/output.h
@@ -169,6 +169,11 @@
Prefixes such as % are optional. */
extern int decode_reg_name (const char *);
+/* Similar to decode_reg_name, but takes an extra parameter that is a
+ pointer to the number of (internal) registers described by the
+ external name. */
+extern int decode_reg_name_and_count (const char *, int *);
+
extern void assemble_alias (tree, tree);
extern void default_assemble_visibility (tree, int);
--- gcc-4.4.4.orig/gcc/reginfo.c
+++ gcc-4.4.4/gcc/reginfo.c
@@ -800,39 +800,44 @@
fix_register (const char *name, int fixed, int call_used)
{
int i;
+ int reg, nregs;
/* Decode the name and update the primary form of
the register info. */
-
- if ((i = decode_reg_name (name)) >= 0)
+ if ((reg = decode_reg_name_and_count (name, &nregs)) >= 0)
{
- if ((i == STACK_POINTER_REGNUM
+ gcc_assert (nregs >= 1);
+ for (i = reg; i < reg + nregs; i++)
+ {
+ if ((i == STACK_POINTER_REGNUM
#ifdef HARD_FRAME_POINTER_REGNUM
- || i == HARD_FRAME_POINTER_REGNUM
+ || i == HARD_FRAME_POINTER_REGNUM
#else
- || i == FRAME_POINTER_REGNUM
+ || i == FRAME_POINTER_REGNUM
#endif
- )
- && (fixed == 0 || call_used == 0))
- {
- static const char * const what_option[2][2] = {
- { "call-saved", "call-used" },
- { "no-such-option", "fixed" }};
+ )
+ && (fixed == 0 || call_used == 0))
+ {
+ static const char * const what_option[2][2] = {
+ { "call-saved", "call-used" },
+ { "no-such-option", "fixed" }};
- error ("can't use '%s' as a %s register", name,
- what_option[fixed][call_used]);
- }
- else
- {
- fixed_regs[i] = fixed;
- call_used_regs[i] = call_used;
+ error ("can't use '%s' as a %s register", name,
+ what_option[fixed][call_used]);
+ }
+ else
+ {
+ fixed_regs[i] = fixed;
+ call_used_regs[i] = call_used;
#ifdef CALL_REALLY_USED_REGISTERS
- if (fixed == 0)
- call_really_used_regs[i] = call_used;
+ if (fixed == 0)
+ call_really_used_regs[i] = call_used;
#endif
- }
- }
- else
+ }
+ }
+ }
+ else
+
{
warning (0, "unknown register name: %s", name);
}
--- gcc-4.4.4.orig/gcc/stmt.c
+++ gcc-4.4.4/gcc/stmt.c
@@ -681,13 +681,14 @@
for (tail = clobbers; tail; tail = TREE_CHAIN (tail))
{
const char *regname;
+ int nregs;
if (TREE_VALUE (tail) == error_mark_node)
return;
regname = TREE_STRING_POINTER (TREE_VALUE (tail));
- i = decode_reg_name (regname);
- if (i >= 0 || i == -4)
+ i = decode_reg_name_and_count (regname, &nregs);
+ if (i == -4)
++nclobbers;
else if (i == -2)
error ("unknown register name %qs in %<asm%>", regname);
@@ -695,14 +696,21 @@
/* Mark clobbered registers. */
if (i >= 0)
{
- /* Clobbering the PIC register is an error. */
- if (i == (int) PIC_OFFSET_TABLE_REGNUM)
- {
- error ("PIC register %qs clobbered in %<asm%>", regname);
- return;
- }
+ int reg;
- SET_HARD_REG_BIT (clobbered_regs, i);
+ for (reg = i; reg < i + nregs; reg++)
+ {
+ ++nclobbers;
+
+ /* Clobbering the PIC register is an error. */
+ if (reg == (int) PIC_OFFSET_TABLE_REGNUM)
+ {
+ error ("PIC register clobbered by %qs in %<asm%>", regname);
+ return;
+ }
+
+ SET_HARD_REG_BIT (clobbered_regs, reg);
+ }
}
}
@@ -1012,8 +1020,9 @@
for (tail = clobbers; tail; tail = TREE_CHAIN (tail))
{
const char *regname = TREE_STRING_POINTER (TREE_VALUE (tail));
- int j = decode_reg_name (regname);
- rtx clobbered_reg;
+ int reg, nregs;
+ int j = decode_reg_name_and_count (regname, &nregs);
+ rtx clobbered_reg;
if (j < 0)
{
@@ -1033,31 +1042,40 @@
/* Ignore unknown register, error already signaled. */
continue;
}
-
- /* Use QImode since that's guaranteed to clobber just one reg. */
- clobbered_reg = gen_rtx_REG (QImode, j);
-
- /* Do sanity check for overlap between clobbers and respectively
- input and outputs that hasn't been handled. Such overlap
- should have been detected and reported above. */
- if (!clobber_conflict_found)
- {
- int opno;
-
- /* We test the old body (obody) contents to avoid tripping
- over the under-construction body. */
- for (opno = 0; opno < noutputs; opno++)
- if (reg_overlap_mentioned_p (clobbered_reg, output_rtx[opno]))
- internal_error ("asm clobber conflict with output operand");
-
- for (opno = 0; opno < ninputs - ninout; opno++)
- if (reg_overlap_mentioned_p (clobbered_reg,
- ASM_OPERANDS_INPUT (obody, opno)))
- internal_error ("asm clobber conflict with input operand");
+
+ for (reg = j; reg < j + nregs; reg++)
+ {
+ /* Use QImode since that's guaranteed to clobber just
+ * one reg. */
+ clobbered_reg = gen_rtx_REG (QImode, reg);
+
+ /* Do sanity check for overlap between clobbers and
+ respectively input and outputs that hasn't been
+ handled. Such overlap should have been detected and
+ reported above. */
+ if (!clobber_conflict_found)
+ {
+ int opno;
+
+ /* We test the old body (obody) contents to avoid
+ tripping over the under-construction body. */
+ for (opno = 0; opno < noutputs; opno++)
+ if (reg_overlap_mentioned_p (clobbered_reg,
+ output_rtx[opno]))
+ internal_error
+ ("asm clobber conflict with output operand");
+
+ for (opno = 0; opno < ninputs - ninout; opno++)
+ if (reg_overlap_mentioned_p (clobbered_reg,
+ ASM_OPERANDS_INPUT (obody,
+ opno)))
+ internal_error
+ ("asm clobber conflict with input operand");
+ }
+
+ XVECEXP (body, 0, i++)
+ = gen_rtx_CLOBBER (VOIDmode, clobbered_reg);
}
-
- XVECEXP (body, 0, i++)
- = gen_rtx_CLOBBER (VOIDmode, clobbered_reg);
}
emit_insn (body);
--- gcc-4.4.4.orig/gcc/varasm.c
+++ gcc-4.4.4/gcc/varasm.c
@@ -1031,8 +1031,11 @@
Prefixes such as % are optional. */
int
-decode_reg_name (const char *asmspec)
+decode_reg_name_and_count (const char *asmspec, int *pnregs)
{
+ /* Presume just one register is clobbered. */
+ *pnregs = 1;
+
if (asmspec != 0)
{
int i;
@@ -1058,6 +1061,25 @@
&& ! strcmp (asmspec, strip_reg_name (reg_names[i])))
return i;
+#ifdef OVERLAPPING_REGISTER_NAMES
+ {
+ static const struct
+ {
+ const char *const name;
+ const int number;
+ const int nregs;
+ } table[] = OVERLAPPING_REGISTER_NAMES;
+
+ for (i = 0; i < (int) ARRAY_SIZE (table); i++)
+ if (table[i].name[0]
+ && ! strcmp (asmspec, table[i].name))
+ {
+ *pnregs = table[i].nregs;
+ return table[i].number;
+ }
+ }
+#endif /* OVERLAPPING_REGISTER_NAMES */
+
#ifdef ADDITIONAL_REGISTER_NAMES
{
static const struct { const char *const name; const int number; } table[]
@@ -1081,6 +1103,15 @@
return -1;
}
+
+int
+decode_reg_name (const char *name)
+{
+ int count;
+ return decode_reg_name_and_count (name, &count);
+}
+
+
/* Return true if DECL's initializer is suitable for a BSS section. */

View File

@@ -0,0 +1,25 @@
From c037df1be41f8daf4d581d7ffa4ec8cfa640bccf Mon Sep 17 00:00:00 2001
From: glisse <glisse@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Fri, 25 Apr 2014 08:03:08 +0000
Subject: [PATCH] 2014-04-25 Marc Glisse <marc.glisse@inria.fr>
PR target/43538
* mt-gnu: Don't reset CXXFLAGS_FOR_TARGET.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@209784 138bc75d-0d04-0410-961f-82ee72b054a4
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
---
config/mt-gnu | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/config/mt-gnu b/config/mt-gnu
index 15bf417..5c696f5 100644
--- a/config/mt-gnu
+++ b/config/mt-gnu
@@ -1 +1 @@
-CXXFLAGS_FOR_TARGET = $(CXXFLAGS) -D_GNU_SOURCE
+CXXFLAGS_FOR_TARGET += -D_GNU_SOURCE
--
2.1.4

View File

@@ -478,7 +478,7 @@ Index: b/gcc/config/mips/linux.h
+#define MUSL_DYNAMIC_LINKER_E "%{EL:el}"
+#endif
+#undef MUSL_DYNAMIC_LINKER
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-mips" MUSL_DYNAMIC_LINKER_E ".so.1"
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-mips" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1"
Index: b/gcc/config/rs6000/linux64.h
===================================================================
--- a/gcc/config/rs6000/linux64.h

View File

@@ -0,0 +1,153 @@
From 1e5f1089dec3af328fd03125d6778f666d0bd4e4 Mon Sep 17 00:00:00 2001
From: edlinger <edlinger@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Thu, 25 Feb 2016 15:33:50 +0000
Subject: [PATCH 1/1] 2016-02-25 Bernd Edlinger <bernd.edlinger@hotmail.de>
Backported from mainline
2016-02-19 Jakub Jelinek <jakub@redhat.com>
Bernd Edlinger <bernd.edlinger@hotmail.de>
* Make-lang.in: Invoke gperf with -L C++.
* cfns.gperf: Remove prototypes for hash and libc_name_p
inlines.
* cfns.h: Regenerated.
* except.c (nothrow_libfn_p): Adjust.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-5-branch@233720 138bc75d-0d04-0410-961f-82ee72b054a4
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
---
gcc/cp/Make-lang.in | 2 +-
gcc/cp/cfns.gperf | 10 ++--------
gcc/cp/cfns.h | 41 ++++++++++++++---------------------------
gcc/cp/except.c | 3 ++-
5 files changed, 31 insertions(+), 37 deletions(-)
diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
index e98beb1..b09fb02 100644
--- a/gcc/cp/Make-lang.in
+++ b/gcc/cp/Make-lang.in
@@ -111,7 +111,7 @@ else
# deleting the $(srcdir)/cp/cfns.h file.
$(srcdir)/cp/cfns.h:
endif
- gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L ANSI-C \
+ gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L C++ \
$(srcdir)/cp/cfns.gperf --output-file $(srcdir)/cp/cfns.h
#
diff --git a/gcc/cp/cfns.gperf b/gcc/cp/cfns.gperf
index 68acd3d..214ecf6 100644
--- a/gcc/cp/cfns.gperf
+++ b/gcc/cp/cfns.gperf
@@ -1,3 +1,5 @@
+%language=C++
+%define class-name libc_name
%{
/* Copyright (C) 2000-2015 Free Software Foundation, Inc.
@@ -16,14 +18,6 @@ for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
-#ifdef __GNUC__
-__inline
-#endif
-static unsigned int hash (const char *, unsigned int);
-#ifdef __GNUC__
-__inline
-#endif
-const char * libc_name_p (const char *, unsigned int);
%}
%%
# The standard C library functions, for feeding to gperf; the result is used
diff --git a/gcc/cp/cfns.h b/gcc/cp/cfns.h
index 1c6665d..596f413 100644
--- a/gcc/cp/cfns.h
+++ b/gcc/cp/cfns.h
@@ -1,5 +1,5 @@
-/* ANSI-C code produced by gperf version 3.0.3 */
-/* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L ANSI-C cfns.gperf */
+/* C++ code produced by gperf version 3.0.4 */
+/* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L C++ --output-file cfns.h cfns.gperf */
#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
&& ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
@@ -28,7 +28,7 @@
#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
#endif
-#line 1 "cfns.gperf"
+#line 3 "cfns.gperf"
/* Copyright (C) 2000-2015 Free Software Foundation, Inc.
@@ -47,25 +47,18 @@ for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
-#ifdef __GNUC__
-__inline
-#endif
-static unsigned int hash (const char *, unsigned int);
-#ifdef __GNUC__
-__inline
-#endif
-const char * libc_name_p (const char *, unsigned int);
/* maximum key range = 391, duplicates = 0 */
-#ifdef __GNUC__
-__inline
-#else
-#ifdef __cplusplus
-inline
-#endif
-#endif
-static unsigned int
-hash (register const char *str, register unsigned int len)
+class libc_name
+{
+private:
+ static inline unsigned int hash (const char *str, unsigned int len);
+public:
+ static const char *libc_name_p (const char *str, unsigned int len);
+};
+
+inline unsigned int
+libc_name::hash (register const char *str, register unsigned int len)
{
static const unsigned short asso_values[] =
{
@@ -122,14 +115,8 @@ hash (register const char *str, register unsigned int len)
return hval + asso_values[(unsigned char)str[len - 1]];
}
-#ifdef __GNUC__
-__inline
-#ifdef __GNUC_STDC_INLINE__
-__attribute__ ((__gnu_inline__))
-#endif
-#endif
const char *
-libc_name_p (register const char *str, register unsigned int len)
+libc_name::libc_name_p (register const char *str, register unsigned int len)
{
enum
{
diff --git a/gcc/cp/except.c b/gcc/cp/except.c
index 3ff1ce6..2f2e396 100644
--- a/gcc/cp/except.c
+++ b/gcc/cp/except.c
@@ -1040,7 +1040,8 @@ nothrow_libfn_p (const_tree fn)
unless the system headers are playing rename tricks, and if
they are, we don't want to be confused by them. */
id = DECL_NAME (fn);
- return !!libc_name_p (IDENTIFIER_POINTER (id), IDENTIFIER_LENGTH (id));
+ return !!libc_name::libc_name_p (IDENTIFIER_POINTER (id),
+ IDENTIFIER_LENGTH (id));
}
/* Returns nonzero if an exception of type FROM will be caught by a
--
1.7.1

View File

@@ -0,0 +1,25 @@
From c037df1be41f8daf4d581d7ffa4ec8cfa640bccf Mon Sep 17 00:00:00 2001
From: glisse <glisse@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Fri, 25 Apr 2014 08:03:08 +0000
Subject: [PATCH] 2014-04-25 Marc Glisse <marc.glisse@inria.fr>
PR target/43538
* mt-gnu: Don't reset CXXFLAGS_FOR_TARGET.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@209784 138bc75d-0d04-0410-961f-82ee72b054a4
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
---
config/mt-gnu | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/config/mt-gnu b/config/mt-gnu
index 15bf417..5c696f5 100644
--- a/config/mt-gnu
+++ b/config/mt-gnu
@@ -1 +1 @@
-CXXFLAGS_FOR_TARGET = $(CXXFLAGS) -D_GNU_SOURCE
+CXXFLAGS_FOR_TARGET += -D_GNU_SOURCE
--
2.1.4

View File

@@ -0,0 +1,174 @@
From 70c2cb98fb129b4766b5da0f945dc41fd568c77a Mon Sep 17 00:00:00 2001
From: Max Filippov <jcmvbkbc@gmail.com>
Date: Sat, 22 Aug 2015 08:44:26 +0300
Subject: [PATCH] xtensa: add uclinux support
2015-10-03 Max Filippov <jcmvbkbc@gmail.com>
gcc/
* config.gcc (xtensa*-*-uclinux*): New configuration.
* config/xtensa/uclinux.h: New file.
* config/xtensa/uclinux.opt: New file.
libgcc/
* config.host (xtensa*-*-uclinux*): New configuration.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
---
Backported from: r228450
gcc/config.gcc | 5 ++++
gcc/config/xtensa/uclinux.h | 69 +++++++++++++++++++++++++++++++++++++++++++
gcc/config/xtensa/uclinux.opt | 32 ++++++++++++++++++++
libgcc/config.host | 5 ++++
4 files changed, 111 insertions(+)
create mode 100644 gcc/config/xtensa/uclinux.h
create mode 100644 gcc/config/xtensa/uclinux.opt
diff --git a/gcc/config.gcc b/gcc/config.gcc
index c52f5a8..56797bd 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -2995,6 +2995,11 @@ xtensa*-*-linux*)
tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h xtensa/linux.h"
tmake_file="${tmake_file} xtensa/t-xtensa"
;;
+xtensa*-*-uclinux*)
+ tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h xtensa/uclinux.h"
+ tmake_file="${tmake_file} xtensa/t-xtensa"
+ extra_options="${extra_options} xtensa/uclinux.opt"
+ ;;
am33_2.0-*-linux*)
tm_file="mn10300/mn10300.h dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h mn10300/linux.h"
gas=yes gnu_ld=yes
diff --git a/gcc/config/xtensa/uclinux.h b/gcc/config/xtensa/uclinux.h
new file mode 100644
index 0000000..4606020
--- /dev/null
+++ b/gcc/config/xtensa/uclinux.h
@@ -0,0 +1,69 @@
+/* Xtensa uClinux configuration.
+ Derived from the configuration for GCC for Intel i386 running Linux.
+ Copyright (C) 2001-2015 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#undef TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS() \
+ do \
+ { \
+ GNU_USER_TARGET_OS_CPP_BUILTINS (); \
+ builtin_define ("__uClinux__"); \
+ } \
+ while (0)
+
+#undef SUBTARGET_CPP_SPEC
+#define SUBTARGET_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
+
+#undef SIZE_TYPE
+#define SIZE_TYPE "unsigned int"
+
+#undef PTRDIFF_TYPE
+#define PTRDIFF_TYPE "int"
+
+#undef WCHAR_TYPE
+#define WCHAR_TYPE "long int"
+
+#undef WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE 32
+
+#undef ASM_SPEC
+#define ASM_SPEC \
+ "%{mtext-section-literals:--text-section-literals} \
+ %{mno-text-section-literals:--no-text-section-literals} \
+ %{mtarget-align:--target-align} \
+ %{mno-target-align:--no-target-align} \
+ %{mlongcalls:--longcalls} \
+ %{mno-longcalls:--no-longcalls} \
+ %{mauto-litpools:--auto-litpools} \
+ %{mno-auto-litpools:--no-auto-litpools}"
+
+#undef LINK_SPEC
+#define LINK_SPEC "%{!no-elf2flt:%{!elf2flt*:-elf2flt}}"
+
+#undef LOCAL_LABEL_PREFIX
+#define LOCAL_LABEL_PREFIX "."
+
+/* Always enable "-fpic" for Xtensa Linux. */
+#define XTENSA_ALWAYS_PIC 1
+
+#undef TARGET_LIBC_HAS_FUNCTION
+#define TARGET_LIBC_HAS_FUNCTION no_c99_libc_has_function
+
+#undef DBX_REGISTER_NUMBER
+
diff --git a/gcc/config/xtensa/uclinux.opt b/gcc/config/xtensa/uclinux.opt
new file mode 100644
index 0000000..95ef777
--- /dev/null
+++ b/gcc/config/xtensa/uclinux.opt
@@ -0,0 +1,32 @@
+; Xtensa uClinux options.
+
+; Copyright (C) 2015 Free Software Foundation, Inc.
+;
+; This file is part of GCC.
+;
+; GCC is free software; you can redistribute it and/or modify it under
+; the terms of the GNU General Public License as published by the Free
+; Software Foundation; either version 3, or (at your option) any later
+; version.
+;
+; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+; WARRANTY; without even the implied warranty of MERCHANTABILITY or
+; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+; for more details.
+;
+; You should have received a copy of the GNU General Public License
+; along with GCC; see the file COPYING3. If not see
+; <http://www.gnu.org/licenses/>.
+
+; See the GCC internals manual (options.texi) for a description of
+; this file's format.
+
+; Please try to keep this file in ASCII collating order.
+
+elf2flt
+Driver
+
+elf2flt=
+Driver JoinedOrMissing
+
+; This comment is to ensure we retain the blank line above.
diff --git a/libgcc/config.host b/libgcc/config.host
index 2c64756..2ee92c1 100644
--- a/libgcc/config.host
+++ b/libgcc/config.host
@@ -1295,6 +1295,11 @@ xtensa*-*-linux*)
tmake_file="$tmake_file xtensa/t-xtensa xtensa/t-linux t-slibgcc-libgcc"
md_unwind_header=xtensa/linux-unwind.h
;;
+xtensa*-*-uclinux*)
+ tmake_file="$tmake_file xtensa/t-xtensa xtensa/t-linux t-slibgcc-libgcc"
+ md_unwind_header=xtensa/linux-unwind.h
+ extra_parts="$extra_parts crtbeginS.o crtbeginT.o crtendS.o"
+ ;;
am33_2.0-*-linux*)
# Don't need crtbeginT.o from *-*-linux* default.
extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
--
1.8.1.4

View File

@@ -0,0 +1,15 @@
remove unused header, which breaks the toolchain building
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
diff -Nur gcc-4.8.5.orig/libgcc/config/m68k/linux-atomic.c gcc-4.8.5/libgcc/config/m68k/linux-atomic.c
--- gcc-4.8.5.orig/libgcc/config/m68k/linux-atomic.c 2013-02-04 20:06:20.000000000 +0100
+++ gcc-4.8.5/libgcc/config/m68k/linux-atomic.c 2016-03-19 00:18:12.000000000 +0100
@@ -33,7 +33,6 @@
using the kernel helper defined below. There is no support for
64-bit operations yet. */
-#include <asm/unistd.h>
#include <stdbool.h>
#ifndef __NR_atomic_cmpxchg_32

View File

@@ -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-4.8.5.orig/libgcc/config.host gcc-4.8.5/libgcc/config.host
--- gcc-4.8.5.orig/libgcc/config.host 2014-03-20 17:12:30.000000000 +0100
+++ gcc-4.8.5/libgcc/config.host 2016-04-27 15:04:01.521171537 +0200
@@ -689,7 +689,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

View File

@@ -332,7 +332,7 @@ Index: b/gcc/config/mips/linux.h
+#define MUSL_DYNAMIC_LINKER_E "%{EL:el}"
+#endif
+#undef MUSL_DYNAMIC_LINKER
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-mips" MUSL_DYNAMIC_LINKER_E ".so.1"
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-mips" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1"
Index: b/gcc/config/rs6000/linux64.h
===================================================================
--- a/gcc/config/rs6000/linux64.h

View File

@@ -0,0 +1,14 @@
disable split-stack for non-thread builds
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
diff -Nur gcc-4.8.5.orig/libgcc/config/t-stack gcc-4.8.5/libgcc/config/t-stack
--- gcc-4.8.5.orig/libgcc/config/t-stack 2010-10-01 21:31:49.000000000 +0200
+++ gcc-4.8.5/libgcc/config/t-stack 2016-03-07 05:28:12.000000000 +0100
@@ -1,4 +1,6 @@
# Makefile fragment to provide generic support for -fsplit-stack.
# This should be used in config.host for any host which supports
# -fsplit-stack.
+ifeq ($(enable_threads),yes)
LIB2ADD_ST += $(srcdir)/generic-morestack.c $(srcdir)/generic-morestack-thread.c
+endif

View File

@@ -0,0 +1,19 @@
Enable POSIX threads for uClinux targets
Reported upstream:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71721
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
diff -Nur gcc-4.8.5.orig/gcc/config.gcc gcc-4.8.5/gcc/config.gcc
--- gcc-4.8.5.orig/gcc/config.gcc 2015-05-21 22:57:29.000000000 +0200
+++ gcc-4.8.5/gcc/config.gcc 2016-07-02 20:35:24.107644834 +0200
@@ -741,6 +741,9 @@
*-*-uclinux*)
extra_options="$extra_options gnu-user.opt"
use_gcc_stdint=wrap
+ case ${enable_threads} in
+ "" | yes | posix) thread_file='posix' ;;
+ esac
tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC SINGLE_LIBC"
;;
*-*-rdos*)

View File

@@ -1,255 +0,0 @@
Allow C99-depending features of libstdc++ with uClibc
The libstdc++ code is fairly restrictive on how it checks for C99
compatibility: it requires *complete* C99 support to enable certain
features. For example, uClibc provides a good number of C99 features,
but not C99 complex number support. For this reason, libstdc++
completely disables many the standard C++ methods that can in fact
work because uClibc provides the necessary functions.
This patch is similar and highly inspired from
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58393, but implemented in
a way that doesn't involve changing the configure.ac script, as
autoreconfiguring gcc is complicated. It simply relies on the fact
that uClibc defines the __UCLIBC__ definition.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
[Gustavo: update for 4.9.3]
diff -Nura gcc-4.9.3.orig/libstdc++-v3/config/locale/generic/c_locale.h gcc-4.9.3/libstdc++-v3/config/locale/generic/c_locale.h
--- gcc-4.9.3.orig/libstdc++-v3/config/locale/generic/c_locale.h 2014-01-02 19:30:10.000000000 -0300
+++ gcc-4.9.3/libstdc++-v3/config/locale/generic/c_locale.h 2015-06-27 06:46:04.420022179 -0300
@@ -70,7 +70,7 @@
__builtin_va_list __args;
__builtin_va_start(__args, __fmt);
-#ifdef _GLIBCXX_USE_C99
+#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
const int __ret = __builtin_vsnprintf(__out, __size, __fmt, __args);
#else
const int __ret = __builtin_vsprintf(__out, __fmt, __args);
diff -Nura gcc-4.9.3.orig/libstdc++-v3/config/locale/gnu/c_locale.h gcc-4.9.3/libstdc++-v3/config/locale/gnu/c_locale.h
--- gcc-4.9.3.orig/libstdc++-v3/config/locale/gnu/c_locale.h 2014-01-02 19:30:10.000000000 -0300
+++ gcc-4.9.3/libstdc++-v3/config/locale/gnu/c_locale.h 2015-06-27 06:46:04.465023743 -0300
@@ -88,7 +88,7 @@
__builtin_va_list __args;
__builtin_va_start(__args, __fmt);
-#ifdef _GLIBCXX_USE_C99
+#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
const int __ret = __builtin_vsnprintf(__out, __size, __fmt, __args);
#else
const int __ret = __builtin_vsprintf(__out, __fmt, __args);
diff -Nura gcc-4.9.3.orig/libstdc++-v3/include/bits/basic_string.h gcc-4.9.3/libstdc++-v3/include/bits/basic_string.h
--- gcc-4.9.3.orig/libstdc++-v3/include/bits/basic_string.h 2015-05-28 13:27:46.000000000 -0300
+++ gcc-4.9.3/libstdc++-v3/include/bits/basic_string.h 2015-06-27 06:49:04.741284648 -0300
@@ -2844,7 +2844,7 @@
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace
-#if __cplusplus >= 201103L && defined(_GLIBCXX_USE_C99)
+#if __cplusplus >= 201103L && (defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__))
#include <ext/string_conversions.h>
diff -Nura gcc-4.9.3.orig/libstdc++-v3/include/bits/locale_facets_nonio.tcc gcc-4.9.3/libstdc++-v3/include/bits/locale_facets_nonio.tcc
--- gcc-4.9.3.orig/libstdc++-v3/include/bits/locale_facets_nonio.tcc 2014-01-02 19:30:10.000000000 -0300
+++ gcc-4.9.3/libstdc++-v3/include/bits/locale_facets_nonio.tcc 2015-06-27 06:46:04.466023777 -0300
@@ -572,7 +572,7 @@
{
const locale __loc = __io.getloc();
const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
-#ifdef _GLIBCXX_USE_C99
+#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
// First try a buffer perhaps big enough.
int __cs_size = 64;
char* __cs = static_cast<char*>(__builtin_alloca(__cs_size));
diff -Nura gcc-4.9.3.orig/libstdc++-v3/include/bits/locale_facets.tcc gcc-4.9.3/libstdc++-v3/include/bits/locale_facets.tcc
--- gcc-4.9.3.orig/libstdc++-v3/include/bits/locale_facets.tcc 2014-01-02 19:30:10.000000000 -0300
+++ gcc-4.9.3/libstdc++-v3/include/bits/locale_facets.tcc 2015-06-27 06:46:04.466023777 -0300
@@ -987,7 +987,7 @@
char __fbuf[16];
__num_base::_S_format_float(__io, __fbuf, __mod);
-#ifdef _GLIBCXX_USE_C99
+#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
// First try a buffer perhaps big enough (most probably sufficient
// for non-ios_base::fixed outputs)
int __cs_size = __max_digits * 3;
diff -Nura gcc-4.9.3.orig/libstdc++-v3/include/c_compatibility/math.h gcc-4.9.3/libstdc++-v3/include/c_compatibility/math.h
--- gcc-4.9.3.orig/libstdc++-v3/include/c_compatibility/math.h 2014-01-02 19:30:10.000000000 -0300
+++ gcc-4.9.3/libstdc++-v3/include/c_compatibility/math.h 2015-06-27 06:46:04.466023777 -0300
@@ -56,7 +56,7 @@
using std::floor;
using std::fmod;
-#if _GLIBCXX_USE_C99
+#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
using std::fpclassify;
using std::isfinite;
using std::isinf;
diff -Nura gcc-4.9.3.orig/libstdc++-v3/include/c_compatibility/wchar.h gcc-4.9.3/libstdc++-v3/include/c_compatibility/wchar.h
--- gcc-4.9.3.orig/libstdc++-v3/include/c_compatibility/wchar.h 2014-01-02 19:30:10.000000000 -0300
+++ gcc-4.9.3/libstdc++-v3/include/c_compatibility/wchar.h 2015-06-27 06:46:04.466023777 -0300
@@ -103,7 +103,7 @@
using std::wmemset;
using std::wcsftime;
-#if _GLIBCXX_USE_C99
+#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
using std::wcstold;
using std::wcstoll;
using std::wcstoull;
diff -Nura gcc-4.9.3.orig/libstdc++-v3/include/c_global/cstdio gcc-4.9.3/libstdc++-v3/include/c_global/cstdio
--- gcc-4.9.3.orig/libstdc++-v3/include/c_global/cstdio 2014-01-23 18:17:15.000000000 -0300
+++ gcc-4.9.3/libstdc++-v3/include/c_global/cstdio 2015-06-27 06:46:04.481024298 -0300
@@ -146,7 +146,7 @@
using ::vsprintf;
} // namespace
-#if _GLIBCXX_USE_C99
+#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
#undef snprintf
#undef vfscanf
diff -Nura gcc-4.9.3.orig/libstdc++-v3/include/c_global/cstdlib gcc-4.9.3/libstdc++-v3/include/c_global/cstdlib
--- gcc-4.9.3.orig/libstdc++-v3/include/c_global/cstdlib 2014-01-02 19:30:10.000000000 -0300
+++ gcc-4.9.3/libstdc++-v3/include/c_global/cstdlib 2015-06-27 06:46:04.466023777 -0300
@@ -182,7 +182,7 @@
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace
-#if _GLIBCXX_USE_C99
+#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
#undef _Exit
#undef llabs
diff -Nura gcc-4.9.3.orig/libstdc++-v3/include/c_global/cwchar gcc-4.9.3/libstdc++-v3/include/c_global/cwchar
--- gcc-4.9.3.orig/libstdc++-v3/include/c_global/cwchar 2014-01-02 19:30:10.000000000 -0300
+++ gcc-4.9.3/libstdc++-v3/include/c_global/cwchar 2015-06-27 06:46:04.466023777 -0300
@@ -232,7 +232,7 @@
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace
-#if _GLIBCXX_USE_C99
+#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
#undef wcstold
#undef wcstoll
@@ -289,7 +289,7 @@
using std::vwscanf;
#endif
-#if _GLIBCXX_USE_C99
+#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
using std::wcstold;
using std::wcstoll;
using std::wcstoull;
diff -Nura gcc-4.9.3.orig/libstdc++-v3/include/c_std/cstdio gcc-4.9.3/libstdc++-v3/include/c_std/cstdio
--- gcc-4.9.3.orig/libstdc++-v3/include/c_std/cstdio 2014-01-02 19:30:10.000000000 -0300
+++ gcc-4.9.3/libstdc++-v3/include/c_std/cstdio 2015-06-27 06:46:04.480024263 -0300
@@ -144,7 +144,7 @@
using ::vsprintf;
} // namespace std
-#if _GLIBCXX_USE_C99
+#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
#undef snprintf
#undef vfscanf
diff -Nura gcc-4.9.3.orig/libstdc++-v3/include/c_std/cstdlib gcc-4.9.3/libstdc++-v3/include/c_std/cstdlib
--- gcc-4.9.3.orig/libstdc++-v3/include/c_std/cstdlib 2014-01-02 19:30:10.000000000 -0300
+++ gcc-4.9.3/libstdc++-v3/include/c_std/cstdlib 2015-06-27 06:46:04.480024263 -0300
@@ -180,7 +180,7 @@
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace
-#if _GLIBCXX_USE_C99
+#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
#undef _Exit
#undef llabs
diff -Nura gcc-4.9.3.orig/libstdc++-v3/include/c_std/cwchar gcc-4.9.3/libstdc++-v3/include/c_std/cwchar
--- gcc-4.9.3.orig/libstdc++-v3/include/c_std/cwchar 2014-01-02 19:30:10.000000000 -0300
+++ gcc-4.9.3/libstdc++-v3/include/c_std/cwchar 2015-06-27 06:46:04.480024263 -0300
@@ -228,7 +228,7 @@
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace
-#if _GLIBCXX_USE_C99
+#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
#undef wcstold
#undef wcstoll
diff -Nura gcc-4.9.3.orig/libstdc++-v3/include/ext/vstring.h gcc-4.9.3/libstdc++-v3/include/ext/vstring.h
--- gcc-4.9.3.orig/libstdc++-v3/include/ext/vstring.h 2014-01-02 19:30:10.000000000 -0300
+++ gcc-4.9.3/libstdc++-v3/include/ext/vstring.h 2015-06-27 06:46:04.480024263 -0300
@@ -2680,7 +2680,7 @@
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace
-#if ((__cplusplus >= 201103L) && defined(_GLIBCXX_USE_C99))
+#if ((__cplusplus >= 201103L) && (defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)))
#include <ext/string_conversions.h>
diff -Nura gcc-4.9.3.orig/libstdc++-v3/include/tr1/cstdio gcc-4.9.3/libstdc++-v3/include/tr1/cstdio
--- gcc-4.9.3.orig/libstdc++-v3/include/tr1/cstdio 2014-01-02 19:30:10.000000000 -0300
+++ gcc-4.9.3/libstdc++-v3/include/tr1/cstdio 2015-06-27 06:46:04.480024263 -0300
@@ -33,7 +33,7 @@
#include <cstdio>
-#if _GLIBCXX_USE_C99
+#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
namespace std _GLIBCXX_VISIBILITY(default)
{
diff -Nura gcc-4.9.3.orig/libstdc++-v3/include/tr1/cstdlib gcc-4.9.3/libstdc++-v3/include/tr1/cstdlib
--- gcc-4.9.3.orig/libstdc++-v3/include/tr1/cstdlib 2014-01-02 19:30:10.000000000 -0300
+++ gcc-4.9.3/libstdc++-v3/include/tr1/cstdlib 2015-06-27 06:46:04.480024263 -0300
@@ -35,7 +35,7 @@
#if _GLIBCXX_HOSTED
-#if _GLIBCXX_USE_C99
+#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
namespace std _GLIBCXX_VISIBILITY(default)
{
diff -Nura gcc-4.9.3.orig/libstdc++-v3/include/tr1/cwchar gcc-4.9.3/libstdc++-v3/include/tr1/cwchar
--- gcc-4.9.3.orig/libstdc++-v3/include/tr1/cwchar 2014-01-02 19:30:10.000000000 -0300
+++ gcc-4.9.3/libstdc++-v3/include/tr1/cwchar 2015-06-27 06:46:04.480024263 -0300
@@ -52,7 +52,7 @@
using std::vwscanf;
#endif
-#if _GLIBCXX_USE_C99
+#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
using std::wcstold;
using std::wcstoll;
using std::wcstoull;
diff -Nura gcc-4.9.3.orig/libstdc++-v3/include/tr1/stdlib.h gcc-4.9.3/libstdc++-v3/include/tr1/stdlib.h
--- gcc-4.9.3.orig/libstdc++-v3/include/tr1/stdlib.h 2014-01-02 19:30:10.000000000 -0300
+++ gcc-4.9.3/libstdc++-v3/include/tr1/stdlib.h 2015-06-27 06:46:04.481024298 -0300
@@ -33,7 +33,7 @@
#if _GLIBCXX_HOSTED
-#if _GLIBCXX_USE_C99
+#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
using std::tr1::atoll;
using std::tr1::strtoll;
diff -Nura gcc-4.9.3.orig/libstdc++-v3/src/c++11/debug.cc gcc-4.9.3/libstdc++-v3/src/c++11/debug.cc
--- gcc-4.9.3.orig/libstdc++-v3/src/c++11/debug.cc 2014-01-02 19:30:10.000000000 -0300
+++ gcc-4.9.3/libstdc++-v3/src/c++11/debug.cc 2015-06-27 06:46:04.481024298 -0300
@@ -788,7 +788,7 @@
int __n __attribute__ ((__unused__)),
const char* __fmt, _Tp __s) const throw ()
{
-#ifdef _GLIBCXX_USE_C99
+#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
std::snprintf(__buf, __n, __fmt, __s);
#else
std::sprintf(__buf, __fmt, __s);

View File

@@ -1,12 +0,0 @@
Upstream status: In progress
--- a/libgcc/config/nios2/linux-atomic.c
+++ b/libgcc/config/nios2/linux-atomic.c
@@ -20,7 +20,6 @@
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
-#include <asm/unistd.h>
#define EFAULT 14
#define EBUSY 16
#define ENOSYS 38

View File

@@ -14,19 +14,19 @@ Forward port to gcc 4.5.1 by Gustavo Zacarias <gustavo@zacarias.com.ar>
libgcc/configure.ac | 21 +++++++++++++++++++++
3 files changed, 56 insertions(+), 1 deletion(-)
Index: gcc-4.8.0/libgcc/Makefile.in
Index: b/libgcc/Makefile.in
===================================================================
--- gcc-4.8.0.orig/libgcc/Makefile.in 2013-02-04 20:06:20.000000000 +0100
+++ gcc-4.8.0/libgcc/Makefile.in 2013-03-24 09:12:43.000000000 +0100
@@ -41,6 +41,7 @@
decimal_float = @decimal_float@
--- a/libgcc/Makefile.in
+++ b/libgcc/Makefile.in
@@ -42,6 +42,7 @@
enable_vtable_verify = @enable_vtable_verify@
enable_decimal_float = @enable_decimal_float@
fixed_point = @fixed_point@
+LIBGCC_LIBM = @LIBGCC_LIBM@
host_noncanonical = @host_noncanonical@
target_noncanonical = @target_noncanonical@
@@ -927,9 +928,10 @@
@@ -943,9 +944,10 @@
@multilib_dir@,$(MULTIDIR),$(subst \
@shlib_objs@,$(objects) libgcc.a,$(subst \
@shlib_base_name@,libgcc_s,$(subst \
@@ -38,10 +38,10 @@ Index: gcc-4.8.0/libgcc/Makefile.in
libunwind$(SHLIB_EXT): $(libunwind-s-objects) $(extra-parts)
# @multilib_flags@ is still needed because this may use
Index: gcc-4.8.0/libgcc/configure
Index: b/libgcc/configure
===================================================================
--- gcc-4.8.0.orig/libgcc/configure 2012-11-05 00:08:42.000000000 +0100
+++ gcc-4.8.0/libgcc/configure 2013-03-24 09:12:43.000000000 +0100
--- a/libgcc/configure
+++ b/libgcc/configure
@@ -564,6 +564,7 @@
tmake_file
sfp_machine_header
@@ -50,7 +50,7 @@ Index: gcc-4.8.0/libgcc/configure
set_have_cc_tls
vis_hide
fixed_point
@@ -4481,6 +4482,37 @@
@@ -4535,6 +4536,37 @@
fi
fi
@@ -88,11 +88,11 @@ Index: gcc-4.8.0/libgcc/configure
# Conditionalize the makefile for this target machine.
tmake_file_=
Index: gcc-4.8.0/libgcc/configure.ac
Index: b/libgcc/configure.ac
===================================================================
--- gcc-4.8.0.orig/libgcc/configure.ac 2012-10-15 15:10:30.000000000 +0200
+++ gcc-4.8.0/libgcc/configure.ac 2013-03-24 09:12:43.000000000 +0100
@@ -326,6 +326,27 @@
--- a/libgcc/configure.ac
+++ b/libgcc/configure.ac
@@ -357,6 +357,27 @@
fi
AC_SUBST(set_have_cc_tls)

View File

@@ -16,11 +16,11 @@ Changes to ChangeLog are dropped.
gcc/config/xtensa/xtensa.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
index eb039ba..7296e36 100644
Index: b/gcc/config/xtensa/xtensa.c
===================================================================
--- a/gcc/config/xtensa/xtensa.c
+++ b/gcc/config/xtensa/xtensa.c
@@ -1461,8 +1461,9 @@ init_alignment_context (struct alignment_context *ac, rtx mem)
@@ -1436,8 +1436,9 @@
if (ac->shift != NULL_RTX)
{
/* Shift is the byte count, but we need the bitcount. */
@@ -32,6 +32,3 @@ index eb039ba..7296e36 100644
NULL_RTX, 1, OPTAB_DIRECT);
ac->modemask = expand_simple_binop (SImode, ASHIFT,
GEN_INT (GET_MODE_MASK (mode)),
--
1.8.1.4

View File

@@ -11,19 +11,16 @@ Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
gcc/config.gcc | 2 +-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 4a7cbd2..9cc765e 100644
Index: b/gcc/config.gcc
===================================================================
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -439,7 +439,7 @@ powerpc*-*-*)
cpu_type=rs6000
@@ -441,7 +441,7 @@
extra_headers="ppc-asm.h altivec.h spe.h ppu_intrinsics.h paired.h spu2vmx.h vec_types.h si2vmx.h htmintrin.h htmxlintrin.h"
need_64bit_hwint=yes
case x$with_cpu in
- xpowerpc64|xdefault64|x6[23]0|x970|xG5|xpower[345678]|xpower6x|xrs64a|xcell|xa2|xe500mc64|xe5500|Xe6500)
+ xpowerpc64|xdefault64|x6[23]0|x970|xG5|xpower[345678]|xpower6x|xrs64a|xcell|xa2|xe500mc64|xe5500|xe6500)
cpu_is_64bit=yes
;;
esac
--
2.6.2

View File

@@ -0,0 +1,25 @@
From c037df1be41f8daf4d581d7ffa4ec8cfa640bccf Mon Sep 17 00:00:00 2001
From: glisse <glisse@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Fri, 25 Apr 2014 08:03:08 +0000
Subject: [PATCH] 2014-04-25 Marc Glisse <marc.glisse@inria.fr>
PR target/43538
* mt-gnu: Don't reset CXXFLAGS_FOR_TARGET.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@209784 138bc75d-0d04-0410-961f-82ee72b054a4
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
---
config/mt-gnu | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/config/mt-gnu b/config/mt-gnu
index 15bf417..5c696f5 100644
--- a/config/mt-gnu
+++ b/config/mt-gnu
@@ -1 +1 @@
-CXXFLAGS_FOR_TARGET = $(CXXFLAGS) -D_GNU_SOURCE
+CXXFLAGS_FOR_TARGET += -D_GNU_SOURCE
--
2.1.4

View File

@@ -0,0 +1,37 @@
From 3c536954a67a883630f4a7513a27f02a892c3dcb Mon Sep 17 00:00:00 2001
From: Evgeniy Stepanov <eugeni.stepanov@gmail.com>
Date: Tue, 21 Oct 2014 21:08:13 +0000
Subject: [PATCH] [sanitizer] Fix build with _FILE_OFFSET_BITS=64.
Sanitizer source is not affected by _FILE_OFFSET_BITS in general,
but this one file must be built with 32-bit off_t. More details in the code.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@220328 91177308-0d34-0410-b5e6-96231b3b80d8
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
---
lib/sanitizer_common/sanitizer_platform_limits_posix.cc | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
index bbc1108..fc09522 100644
--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
@@ -13,7 +13,15 @@
#include "sanitizer_platform.h"
#if SANITIZER_LINUX || SANITIZER_MAC
+// Tests in this file assume that off_t-dependent data structures match the
+// libc ABI. For example, struct dirent here is what readdir() function (as
+// exported from libc) returns, and not the user-facing "dirent", which
+// depends on _FILE_OFFSET_BITS setting.
+// To get this "true" dirent definition, we undefine _FILE_OFFSET_BITS below.
+#ifdef _FILE_OFFSET_BITS
+#undef _FILE_OFFSET_BITS
+#endif
#include "sanitizer_internal_defs.h"
#include "sanitizer_platform_limits_posix.h"
--
2.1.4

View File

@@ -33,11 +33,11 @@ Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
gcc/config/microblaze/microblaze.md | 11 +++++++++
5 files changed, 52 insertions(+), 7 deletions(-)
diff --git a/gcc/common/config/microblaze/microblaze-common.c b/gcc/common/config/microblaze/microblaze-common.c
index 5835acc..85e6a53 100644
Index: b/gcc/common/config/microblaze/microblaze-common.c
===================================================================
--- a/gcc/common/config/microblaze/microblaze-common.c
+++ b/gcc/common/config/microblaze/microblaze-common.c
@@ -39,7 +39,4 @@ static const struct default_options microblaze_option_optimization_table[] =
@@ -37,7 +37,4 @@
#undef TARGET_OPTION_OPTIMIZATION_TABLE
#define TARGET_OPTION_OPTIMIZATION_TABLE microblaze_option_optimization_table
@@ -45,11 +45,11 @@ index 5835acc..85e6a53 100644
-#define TARGET_EXCEPT_UNWIND_INFO sjlj_except_unwind_info
-
struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
diff --git a/gcc/config/microblaze/microblaze-protos.h b/gcc/config/microblaze/microblaze-protos.h
index c30ec72..260f4e4 100644
Index: b/gcc/config/microblaze/microblaze-protos.h
===================================================================
--- a/gcc/config/microblaze/microblaze-protos.h
+++ b/gcc/config/microblaze/microblaze-protos.h
@@ -56,6 +56,7 @@ extern bool microblaze_tls_referenced_p (rtx);
@@ -54,6 +54,7 @@
extern int symbol_mentioned_p (rtx);
extern int label_mentioned_p (rtx);
extern bool microblaze_cannot_force_const_mem (enum machine_mode, rtx);
@@ -57,11 +57,11 @@ index c30ec72..260f4e4 100644
#endif /* RTX_CODE */
/* Declare functions in microblaze-c.c. */
diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c
index fe61fce..15166d3 100644
Index: b/gcc/config/microblaze/microblaze.c
===================================================================
--- a/gcc/config/microblaze/microblaze.c
+++ b/gcc/config/microblaze/microblaze.c
@@ -1999,6 +1999,11 @@ microblaze_must_save_register (int regno)
@@ -1906,6 +1906,11 @@
if (frame_pointer_needed && (regno == HARD_FRAME_POINTER_REGNUM))
return 1;
@@ -73,7 +73,7 @@ index fe61fce..15166d3 100644
if (!crtl->is_leaf)
{
if (regno == MB_ABI_SUB_RETURN_ADDR_REGNUM)
@@ -2026,6 +2031,13 @@ microblaze_must_save_register (int regno)
@@ -1933,6 +1938,13 @@
return 1;
}
@@ -87,7 +87,7 @@ index fe61fce..15166d3 100644
return 0;
}
@@ -3131,6 +3143,12 @@ microblaze_expand_epilogue (void)
@@ -2962,6 +2974,12 @@
emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx, fsiz_rtx));
}
@@ -100,7 +100,7 @@ index fe61fce..15166d3 100644
emit_jump_insn (gen_return_internal (gen_rtx_REG (Pmode, GP_REG_FIRST +
MB_ABI_SUB_RETURN_ADDR_REGNUM)));
}
@@ -3427,10 +3445,13 @@ microblaze_return_addr (int count, rtx frame ATTRIBUTE_UNUSED)
@@ -3256,10 +3274,13 @@
if (count != 0)
return NULL_RTX;
@@ -118,11 +118,11 @@ index fe61fce..15166d3 100644
}
/* Queue an .ident string in the queue of top-level asm statements.
diff --git a/gcc/config/microblaze/microblaze.h b/gcc/config/microblaze/microblaze.h
index 4072283..5e9f49c 100644
Index: b/gcc/config/microblaze/microblaze.h
===================================================================
--- a/gcc/config/microblaze/microblaze.h
+++ b/gcc/config/microblaze/microblaze.h
@@ -184,6 +184,21 @@ extern enum pipeline_type microblaze_pipe;
@@ -184,6 +184,21 @@
#define INCOMING_RETURN_ADDR_RTX \
gen_rtx_REG (VOIDmode, GP_REG_FIRST + MB_ABI_SUB_RETURN_ADDR_REGNUM)
@@ -144,11 +144,11 @@ index 4072283..5e9f49c 100644
/* Use DWARF 2 debugging information by default. */
#define DWARF2_DEBUGGING_INFO
#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md
index ed6131a..dc2405f 100644
Index: b/gcc/config/microblaze/microblaze.md
===================================================================
--- a/gcc/config/microblaze/microblaze.md
+++ b/gcc/config/microblaze/microblaze.md
@@ -2327,4 +2327,15 @@
@@ -2261,4 +2261,15 @@
(set_attr "mode" "SI")
(set_attr "length" "4")])
@@ -164,6 +164,3 @@ index ed6131a..dc2405f 100644
+
(include "sync.md")
+
--
1.8.3.2

View File

@@ -14,6 +14,7 @@ autoreconfiguring gcc is complicated. It simply relies on the fact
that uClibc defines the __UCLIBC__ definition.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
[Gustavo: update for 4.9.3]
Index: b/libstdc++-v3/config/locale/generic/c_locale.h
===================================================================
@@ -45,28 +46,15 @@ Index: b/libstdc++-v3/include/bits/basic_string.h
===================================================================
--- a/libstdc++-v3/include/bits/basic_string.h
+++ b/libstdc++-v3/include/bits/basic_string.h
@@ -2811,7 +2811,7 @@
@@ -2843,7 +2843,7 @@
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace
-#if ((__cplusplus >= 201103L) && defined(_GLIBCXX_USE_C99) \
+#if ((__cplusplus >= 201103L) && (defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)) \
&& !defined(_GLIBCXX_HAVE_BROKEN_VSWPRINTF))
-#if __cplusplus >= 201103L && defined(_GLIBCXX_USE_C99)
+#if __cplusplus >= 201103L && (defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__))
#include <ext/string_conversions.h>
Index: b/libstdc++-v3/include/bits/locale_facets.tcc
===================================================================
--- a/libstdc++-v3/include/bits/locale_facets.tcc
+++ b/libstdc++-v3/include/bits/locale_facets.tcc
@@ -987,7 +987,7 @@
char __fbuf[16];
__num_base::_S_format_float(__io, __fbuf, __mod);
-#ifdef _GLIBCXX_USE_C99
+#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
// First try a buffer perhaps big enough (most probably sufficient
// for non-ios_base::fixed outputs)
int __cs_size = __max_digits * 3;
Index: b/libstdc++-v3/include/bits/locale_facets_nonio.tcc
===================================================================
--- a/libstdc++-v3/include/bits/locale_facets_nonio.tcc
@@ -80,6 +68,19 @@ Index: b/libstdc++-v3/include/bits/locale_facets_nonio.tcc
// First try a buffer perhaps big enough.
int __cs_size = 64;
char* __cs = static_cast<char*>(__builtin_alloca(__cs_size));
Index: b/libstdc++-v3/include/bits/locale_facets.tcc
===================================================================
--- a/libstdc++-v3/include/bits/locale_facets.tcc
+++ b/libstdc++-v3/include/bits/locale_facets.tcc
@@ -987,7 +987,7 @@
char __fbuf[16];
__num_base::_S_format_float(__io, __fbuf, __mod);
-#ifdef _GLIBCXX_USE_C99
+#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
// First try a buffer perhaps big enough (most probably sufficient
// for non-ios_base::fixed outputs)
int __cs_size = __max_digits * 3;
Index: b/libstdc++-v3/include/c_compatibility/math.h
===================================================================
--- a/libstdc++-v3/include/c_compatibility/math.h
@@ -106,6 +107,19 @@ Index: b/libstdc++-v3/include/c_compatibility/wchar.h
using std::wcstold;
using std::wcstoll;
using std::wcstoull;
Index: b/libstdc++-v3/include/c_global/cstdio
===================================================================
--- a/libstdc++-v3/include/c_global/cstdio
+++ b/libstdc++-v3/include/c_global/cstdio
@@ -146,7 +146,7 @@
using ::vsprintf;
} // namespace
-#if _GLIBCXX_USE_C99
+#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
#undef snprintf
#undef vfscanf
Index: b/libstdc++-v3/include/c_global/cstdlib
===================================================================
--- a/libstdc++-v3/include/c_global/cstdlib
@@ -145,7 +159,7 @@ Index: b/libstdc++-v3/include/c_std/cstdio
===================================================================
--- a/libstdc++-v3/include/c_std/cstdio
+++ b/libstdc++-v3/include/c_std/cstdio
@@ -139,7 +139,7 @@
@@ -144,7 +144,7 @@
using ::vsprintf;
} // namespace std
@@ -184,7 +198,7 @@ Index: b/libstdc++-v3/include/ext/vstring.h
===================================================================
--- a/libstdc++-v3/include/ext/vstring.h
+++ b/libstdc++-v3/include/ext/vstring.h
@@ -2571,7 +2571,7 @@
@@ -2680,7 +2680,7 @@
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace
@@ -249,7 +263,7 @@ Index: b/libstdc++-v3/src/c++11/debug.cc
===================================================================
--- a/libstdc++-v3/src/c++11/debug.cc
+++ b/libstdc++-v3/src/c++11/debug.cc
@@ -787,7 +787,7 @@
@@ -788,7 +788,7 @@
int __n __attribute__ ((__unused__)),
const char* __fmt, _Tp __s) const throw ()
{
@@ -258,16 +272,3 @@ Index: b/libstdc++-v3/src/c++11/debug.cc
std::snprintf(__buf, __n, __fmt, __s);
#else
std::sprintf(__buf, __fmt, __s);
Index: b/libstdc++-v3/include/c_global/cstdio
===================================================================
--- a/libstdc++-v3/include/c_global/cstdio
+++ b/libstdc++-v3/include/c_global/cstdio
@@ -138,7 +138,7 @@
using ::vsprintf;
} // namespace
-#if _GLIBCXX_USE_C99
+#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
#undef snprintf
#undef vfscanf

View File

@@ -48,8 +48,8 @@ Changes to ChangeLogs and documentation are dropped.
gcc/config/xtensa/xtensa.opt | 4 ++++
7 files changed, 54 insertions(+), 20 deletions(-)
diff --git a/gcc/config/xtensa/constraints.md b/gcc/config/xtensa/constraints.md
index 30f4c1f..773d4f9 100644
Index: b/gcc/config/xtensa/constraints.md
===================================================================
--- a/gcc/config/xtensa/constraints.md
+++ b/gcc/config/xtensa/constraints.md
@@ -111,6 +111,11 @@
@@ -64,11 +64,11 @@ index 30f4c1f..773d4f9 100644
;; Memory constraints. Do not use define_memory_constraint here. Doing so
;; causes reload to force some constants into the constant pool, but since
;; the Xtensa constant pool can only be accessed with L32R instructions, it
diff --git a/gcc/config/xtensa/elf.h b/gcc/config/xtensa/elf.h
index e59bede..12056f7 100644
Index: b/gcc/config/xtensa/elf.h
===================================================================
--- a/gcc/config/xtensa/elf.h
+++ b/gcc/config/xtensa/elf.h
@@ -48,7 +48,9 @@ along with GCC; see the file COPYING3. If not see
@@ -48,7 +48,9 @@
%{mtarget-align:--target-align} \
%{mno-target-align:--no-target-align} \
%{mlongcalls:--longcalls} \
@@ -79,11 +79,11 @@ index e59bede..12056f7 100644
#undef LIB_SPEC
#define LIB_SPEC "-lc -lsim -lc -lhandlers-sim -lhal"
diff --git a/gcc/config/xtensa/linux.h b/gcc/config/xtensa/linux.h
index 675aacf..5b0243a 100644
Index: b/gcc/config/xtensa/linux.h
===================================================================
--- a/gcc/config/xtensa/linux.h
+++ b/gcc/config/xtensa/linux.h
@@ -42,7 +42,9 @@ along with GCC; see the file COPYING3. If not see
@@ -42,7 +42,9 @@
%{mtarget-align:--target-align} \
%{mno-target-align:--no-target-align} \
%{mlongcalls:--longcalls} \
@@ -94,8 +94,8 @@ index 675aacf..5b0243a 100644
#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
diff --git a/gcc/config/xtensa/predicates.md b/gcc/config/xtensa/predicates.md
index e02209e..d7dfa11 100644
Index: b/gcc/config/xtensa/predicates.md
===================================================================
--- a/gcc/config/xtensa/predicates.md
+++ b/gcc/config/xtensa/predicates.md
@@ -142,7 +142,8 @@
@@ -108,11 +108,11 @@ index e02209e..d7dfa11 100644
&& GET_MODE_SIZE (mode) % UNITS_PER_WORD == 0")))))
;; Accept the floating point constant 1 in the appropriate mode.
diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
index eb039ba..206ff80 100644
Index: b/gcc/config/xtensa/xtensa.c
===================================================================
--- a/gcc/config/xtensa/xtensa.c
+++ b/gcc/config/xtensa/xtensa.c
@@ -501,6 +501,9 @@ xtensa_valid_move (machine_mode mode, rtx *operands)
@@ -477,6 +477,9 @@
{
int dst_regnum = xt_true_regnum (operands[0]);
@@ -121,8 +121,8 @@ index eb039ba..206ff80 100644
+
/* The stack pointer can only be assigned with a MOVSP opcode. */
if (dst_regnum == STACK_POINTER_REGNUM)
return !TARGET_WINDOWED_ABI
@@ -1069,7 +1072,7 @@ xtensa_emit_move_sequence (rtx *operands, machine_mode mode)
return (mode == SImode
@@ -1044,7 +1047,7 @@
return 1;
}
@@ -131,7 +131,7 @@ index eb039ba..206ff80 100644
{
src = force_const_mem (SImode, src);
operands[1] = src;
@@ -2449,6 +2452,20 @@ print_operand (FILE *file, rtx x, int letter)
@@ -2428,6 +2431,20 @@
}
break;
@@ -152,11 +152,11 @@ index eb039ba..206ff80 100644
default:
if (GET_CODE (x) == REG || GET_CODE (x) == SUBREG)
fprintf (file, "%s", reg_names[xt_true_regnum (x)]);
diff --git a/gcc/config/xtensa/xtensa.md b/gcc/config/xtensa/xtensa.md
index 6d84384..0e673a3 100644
Index: b/gcc/config/xtensa/xtensa.md
===================================================================
--- a/gcc/config/xtensa/xtensa.md
+++ b/gcc/config/xtensa/xtensa.md
@@ -761,8 +761,8 @@
@@ -799,8 +799,8 @@
})
(define_insn "movsi_internal"
@@ -167,7 +167,7 @@ index 6d84384..0e673a3 100644
"xtensa_valid_move (SImode, operands)"
"@
movi.n\t%0, %x1
@@ -774,15 +774,16 @@
@@ -812,15 +812,16 @@
mov\t%0, %1
movsp\t%0, %1
movi\t%0, %x1
@@ -186,7 +186,7 @@ index 6d84384..0e673a3 100644
;; 16-bit Integer moves
@@ -796,21 +797,22 @@
@@ -834,21 +835,22 @@
})
(define_insn "movhi_internal"
@@ -213,7 +213,7 @@ index 6d84384..0e673a3 100644
;; 8-bit Integer moves
@@ -881,7 +883,7 @@
@@ -919,7 +921,7 @@
(match_operand:SF 1 "general_operand" ""))]
""
{
@@ -222,7 +222,7 @@ index 6d84384..0e673a3 100644
operands[1] = force_const_mem (SFmode, operands[1]);
if ((!register_operand (operands[0], SFmode)
@@ -896,8 +898,8 @@
@@ -934,8 +936,8 @@
})
(define_insn "movsf_internal"
@@ -233,7 +233,7 @@ index 6d84384..0e673a3 100644
"((register_operand (operands[0], SFmode)
|| register_operand (operands[1], SFmode))
&& !(FP_REG_P (xt_true_regnum (operands[0]))
@@ -912,13 +914,14 @@
@@ -950,13 +952,14 @@
mov\t%0, %1
wfr\t%0, %1
rfr\t%0, %1
@@ -250,7 +250,7 @@ index 6d84384..0e673a3 100644
(define_insn "*lsiu"
[(set (match_operand:SF 0 "register_operand" "=f")
@@ -991,7 +994,7 @@
@@ -997,7 +1000,7 @@
(match_operand:DF 1 "general_operand" ""))]
""
{
@@ -259,7 +259,7 @@ index 6d84384..0e673a3 100644
operands[1] = force_const_mem (DFmode, operands[1]);
if (!register_operand (operands[0], DFmode)
@@ -1002,8 +1005,8 @@
@@ -1008,8 +1011,8 @@
})
(define_insn_and_split "movdf_internal"
@@ -270,11 +270,11 @@ index 6d84384..0e673a3 100644
"register_operand (operands[0], DFmode)
|| register_operand (operands[1], DFmode)"
"#"
diff --git a/gcc/config/xtensa/xtensa.opt b/gcc/config/xtensa/xtensa.opt
index 2fd6cee..21c6e96 100644
Index: b/gcc/config/xtensa/xtensa.opt
===================================================================
--- a/gcc/config/xtensa/xtensa.opt
+++ b/gcc/config/xtensa/xtensa.opt
@@ -38,6 +38,10 @@ mtext-section-literals
@@ -38,6 +38,10 @@
Target
Intersperse literal pools with code in the text section
@@ -285,6 +285,3 @@ index 2fd6cee..21c6e96 100644
mserialize-volatile
Target Report Mask(SERIALIZE_VOLATILE)
-mno-serialize-volatile Do not serialize volatile memory references with MEMW instructions
--
1.8.1.4

View File

@@ -0,0 +1,169 @@
From 70c2cb98fb129b4766b5da0f945dc41fd568c77a Mon Sep 17 00:00:00 2001
From: Max Filippov <jcmvbkbc@gmail.com>
Date: Sat, 22 Aug 2015 08:44:26 +0300
Subject: [PATCH] xtensa: add uclinux support
2015-10-03 Max Filippov <jcmvbkbc@gmail.com>
gcc/
* config.gcc (xtensa*-*-uclinux*): New configuration.
* config/xtensa/uclinux.h: New file.
* config/xtensa/uclinux.opt: New file.
libgcc/
* config.host (xtensa*-*-uclinux*): New configuration.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
---
Backported from: r228450
gcc/config.gcc | 5 ++++
gcc/config/xtensa/uclinux.h | 69 +++++++++++++++++++++++++++++++++++++++++++
gcc/config/xtensa/uclinux.opt | 32 ++++++++++++++++++++
libgcc/config.host | 5 ++++
4 files changed, 111 insertions(+)
create mode 100644 gcc/config/xtensa/uclinux.h
create mode 100644 gcc/config/xtensa/uclinux.opt
Index: b/gcc/config.gcc
===================================================================
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -2871,6 +2871,11 @@
tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h xtensa/linux.h"
tmake_file="${tmake_file} xtensa/t-xtensa"
;;
+xtensa*-*-uclinux*)
+ tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h xtensa/uclinux.h"
+ tmake_file="${tmake_file} xtensa/t-xtensa"
+ extra_options="${extra_options} xtensa/uclinux.opt"
+ ;;
am33_2.0-*-linux*)
tm_file="mn10300/mn10300.h dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h mn10300/linux.h"
gas=yes gnu_ld=yes
Index: b/gcc/config/xtensa/uclinux.h
===================================================================
--- /dev/null
+++ b/gcc/config/xtensa/uclinux.h
@@ -0,0 +1,69 @@
+/* Xtensa uClinux configuration.
+ Derived from the configuration for GCC for Intel i386 running Linux.
+ Copyright (C) 2001-2015 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#undef TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS() \
+ do \
+ { \
+ GNU_USER_TARGET_OS_CPP_BUILTINS (); \
+ builtin_define ("__uClinux__"); \
+ } \
+ while (0)
+
+#undef SUBTARGET_CPP_SPEC
+#define SUBTARGET_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
+
+#undef SIZE_TYPE
+#define SIZE_TYPE "unsigned int"
+
+#undef PTRDIFF_TYPE
+#define PTRDIFF_TYPE "int"
+
+#undef WCHAR_TYPE
+#define WCHAR_TYPE "long int"
+
+#undef WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE 32
+
+#undef ASM_SPEC
+#define ASM_SPEC \
+ "%{mtext-section-literals:--text-section-literals} \
+ %{mno-text-section-literals:--no-text-section-literals} \
+ %{mtarget-align:--target-align} \
+ %{mno-target-align:--no-target-align} \
+ %{mlongcalls:--longcalls} \
+ %{mno-longcalls:--no-longcalls} \
+ %{mauto-litpools:--auto-litpools} \
+ %{mno-auto-litpools:--no-auto-litpools}"
+
+#undef LINK_SPEC
+#define LINK_SPEC "%{!no-elf2flt:%{!elf2flt*:-elf2flt}}"
+
+#undef LOCAL_LABEL_PREFIX
+#define LOCAL_LABEL_PREFIX "."
+
+/* Always enable "-fpic" for Xtensa Linux. */
+#define XTENSA_ALWAYS_PIC 1
+
+#undef TARGET_LIBC_HAS_FUNCTION
+#define TARGET_LIBC_HAS_FUNCTION no_c99_libc_has_function
+
+#undef DBX_REGISTER_NUMBER
+
Index: b/gcc/config/xtensa/uclinux.opt
===================================================================
--- /dev/null
+++ b/gcc/config/xtensa/uclinux.opt
@@ -0,0 +1,32 @@
+; Xtensa uClinux options.
+
+; Copyright (C) 2015 Free Software Foundation, Inc.
+;
+; This file is part of GCC.
+;
+; GCC is free software; you can redistribute it and/or modify it under
+; the terms of the GNU General Public License as published by the Free
+; Software Foundation; either version 3, or (at your option) any later
+; version.
+;
+; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+; WARRANTY; without even the implied warranty of MERCHANTABILITY or
+; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+; for more details.
+;
+; You should have received a copy of the GNU General Public License
+; along with GCC; see the file COPYING3. If not see
+; <http://www.gnu.org/licenses/>.
+
+; See the GCC internals manual (options.texi) for a description of
+; this file's format.
+
+; Please try to keep this file in ASCII collating order.
+
+elf2flt
+Driver
+
+elf2flt=
+Driver JoinedOrMissing
+
+; This comment is to ensure we retain the blank line above.
Index: b/libgcc/config.host
===================================================================
--- a/libgcc/config.host
+++ b/libgcc/config.host
@@ -1213,6 +1213,11 @@
tmake_file="$tmake_file xtensa/t-xtensa xtensa/t-linux t-slibgcc-libgcc"
md_unwind_header=xtensa/linux-unwind.h
;;
+xtensa*-*-uclinux*)
+ tmake_file="$tmake_file xtensa/t-xtensa xtensa/t-linux t-slibgcc-libgcc"
+ md_unwind_header=xtensa/linux-unwind.h
+ extra_parts="$extra_parts crtbeginS.o crtbeginT.o crtendS.o"
+ ;;
am33_2.0-*-linux*)
# Don't need crtbeginT.o from *-*-linux* default.
extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"

View File

@@ -0,0 +1,49 @@
From b0ea54f3f995754881e0ea6651133aa7b58eeaa2 Mon Sep 17 00:00:00 2001
From: cltang <cltang@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Tue, 22 Sep 2015 12:23:20 +0000
Subject: [PATCH] nios2_legitimize_address 2015-09-22 Chung-Lin Tang
<cltang@codesourcery.com>
Backport from mainline
2015-09-22 Chung-Lin Tang <cltang@codesourcery.com>
* config/nios2/nios2.c (nios2_legitimize_address): When handling
'reg + reloc' cases, allow first operand to be non-REG, and use
force_reg() to enforce address pattern.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-5-branch@228013 138bc75d-0d04-0410-961f-82ee72b054a4
Fixes:
http://autobuild.buildroot.net/results/901/90186d1fe134b804c0101554296b1235dc0ccbb0
[backported to 4.9.3]
Signed-off-by: Romain Naour <romain.naour@gmail.com>
---
gcc/config/nios2/nios2.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gcc/config/nios2/nios2.c b/gcc/config/nios2/nios2.c
index 047b615..41dd6f9 100644
--- a/gcc/config/nios2/nios2.c
+++ b/gcc/config/nios2/nios2.c
@@ -1786,15 +1786,15 @@ nios2_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
Which will be output as '%tls_le(var+48)(r23)' in assembly. */
if (GET_CODE (x) == PLUS
- && GET_CODE (XEXP (x, 0)) == REG
&& GET_CODE (XEXP (x, 1)) == CONST)
{
- rtx unspec, offset, reg = XEXP (x, 0);
+ rtx unspec, offset;
split_const (XEXP (x, 1), &unspec, &offset);
if (GET_CODE (unspec) == UNSPEC
&& !nios2_large_offset_p (XINT (unspec, 1))
&& offset != const0_rtx)
{
+ rtx reg = force_reg (Pmode, XEXP (x, 0));
unspec = copy_rtx (unspec);
XVECEXP (unspec, 0, 0)
= plus_constant (Pmode, XVECEXP (unspec, 0, 0), INTVAL (offset));
--
2.5.0

View File

@@ -0,0 +1,15 @@
remove unused header, which breaks the toolchain building
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
diff -Nur gcc-4.9.3.orig/libgcc/config/m68k/linux-atomic.c gcc-4.9.3/libgcc/config/m68k/linux-atomic.c
--- gcc-4.9.3.orig/libgcc/config/m68k/linux-atomic.c 2014-01-02 23:25:22.000000000 +0100
+++ gcc-4.9.3/libgcc/config/m68k/linux-atomic.c 2016-03-18 22:24:40.000000000 +0100
@@ -33,7 +33,6 @@
using the kernel helper defined below. There is no support for
64-bit operations yet. */
-#include <asm/unistd.h>
#include <stdbool.h>
#ifndef __NR_atomic_cmpxchg_32

View File

@@ -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-4.9.3.orig/libgcc/config.host gcc-4.9.3/libgcc/config.host
--- gcc-4.9.3.orig/libgcc/config.host 2014-03-27 16:40:31.000000000 +0100
+++ gcc-4.9.3/libgcc/config.host 2016-04-05 16:20:53.422809885 +0200
@@ -750,7 +750,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

View File

@@ -60,7 +60,7 @@ Index: b/gcc/config.gcc
*)
tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC"
;;
@@ -2322,6 +2325,10 @@
@@ -2338,6 +2341,10 @@
powerpc*-*-linux*paired*)
tm_file="${tm_file} rs6000/750cl.h" ;;
esac
@@ -308,7 +308,7 @@ Index: b/gcc/config/microblaze/linux.h
===================================================================
--- a/gcc/config/microblaze/linux.h
+++ b/gcc/config/microblaze/linux.h
@@ -25,7 +25,23 @@
@@ -28,7 +28,23 @@
#undef TLS_NEEDS_GOT
#define TLS_NEEDS_GOT 1
@@ -337,7 +337,7 @@ Index: b/gcc/config/rs6000/linux64.h
===================================================================
--- a/gcc/config/rs6000/linux64.h
+++ b/gcc/config/rs6000/linux64.h
@@ -375,17 +375,23 @@
@@ -371,17 +371,23 @@
#endif
#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
@@ -452,7 +452,7 @@ Index: b/gcc/configure
===================================================================
--- a/gcc/configure
+++ b/gcc/configure
@@ -27449,6 +27453,9 @@
@@ -27601,6 +27601,9 @@
gcc_cv_target_dl_iterate_phdr=no
fi
;;
@@ -466,7 +466,7 @@ Index: b/gcc/configure.ac
===================================================================
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -5108,6 +5112,9 @@
@@ -5173,6 +5173,9 @@
gcc_cv_target_dl_iterate_phdr=no
fi
;;
@@ -588,7 +588,7 @@ Index: b/libstdc++-v3/configure.host
===================================================================
--- a/libstdc++-v3/configure.host
+++ b/libstdc++-v3/configure.host
@@ -264,6 +264,13 @@
@@ -266,6 +266,13 @@
os_include_dir="os/bsd/freebsd"
;;
gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
@@ -602,7 +602,7 @@ Index: b/libstdc++-v3/configure.host
if [ "$uclibc" = "yes" ]; then
os_include_dir="os/uclibc"
elif [ "$bionic" = "yes" ]; then
@@ -272,6 +279,9 @@
@@ -274,6 +281,9 @@
os_include_dir="os/gnu-linux"
fi
;;
@@ -637,4 +637,4 @@ Index: b/gcc/config/mips/linux.h
+#define MUSL_DYNAMIC_LINKER_E "%{EL:el}"
+#endif
+#undef MUSL_DYNAMIC_LINKER
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-mips" MUSL_DYNAMIC_LINKER_E ".so.1"
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-mips" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1"

View File

@@ -0,0 +1,21 @@
Add dynamic linker support for uClibc
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
diff -Nur gcc-4.9.3.orig/gcc/config/microblaze/linux.h gcc-4.9.3/gcc/config/microblaze/linux.h
--- gcc-4.9.3.orig/gcc/config/microblaze/linux.h 2016-06-04 21:21:09.430646655 +0200
+++ gcc-4.9.3/gcc/config/microblaze/linux.h 2016-06-04 21:21:44.596003509 +0200
@@ -36,10 +36,13 @@
#undef MUSL_DYNAMIC_LINKER
#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-microblaze" MUSL_DYNAMIC_LINKER_E ".so.1"
+#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
#if DEFAULT_LIBC == LIBC_MUSL
#define DYNAMIC_LINKER MUSL_DYNAMIC_LINKER
+#elif DEFAULT_LIBC == LIBC_UCLIBC
+#define DYNAMIC_LINKER UCLIBC_DYNAMIC_LINKER
#else
#define DYNAMIC_LINKER GLIBC_DYNAMIC_LINKER
#endif

View File

@@ -0,0 +1,14 @@
disable split-stack for non-thread builds
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
diff -Nur gcc-4.9.3.orig/libgcc/config/t-stack gcc-4.9.3/libgcc/config/t-stack
--- gcc-4.9.3.orig/libgcc/config/t-stack 2010-10-01 21:31:49.000000000 +0200
+++ gcc-4.9.3/libgcc/config/t-stack 2016-03-07 01:34:32.000000000 +0100
@@ -1,4 +1,6 @@
# Makefile fragment to provide generic support for -fsplit-stack.
# This should be used in config.host for any host which supports
# -fsplit-stack.
+ifeq ($(enable_threads),yes)
LIB2ADD_ST += $(srcdir)/generic-morestack.c $(srcdir)/generic-morestack-thread.c
+endif

View File

@@ -0,0 +1,20 @@
Enable POSIX threads for uClinux targets
Reported upstream:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71721
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
Index: b/gcc/config.gcc
===================================================================
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -810,6 +810,9 @@
*-*-uclinux*)
extra_options="$extra_options gnu-user.opt"
use_gcc_stdint=wrap
+ case ${enable_threads} in
+ "" | yes | posix) thread_file='posix' ;;
+ esac
tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC SINGLE_LIBC"
;;
*-*-rdos*)

View File

@@ -1,8 +1,8 @@
Index: gcc-4.8.0/gcc/config/arm/linux-elf.h
Index: b/gcc/config/arm/linux-elf.h
===================================================================
--- gcc-4.8.0.orig/gcc/config/arm/linux-elf.h 2013-01-10 21:38:27.000000000 +0100
+++ gcc-4.8.0/gcc/config/arm/linux-elf.h 2013-03-23 17:40:00.000000000 +0100
@@ -55,7 +55,7 @@
--- 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}}"
@@ -11,10 +11,10 @@ Index: gcc-4.8.0/gcc/config/arm/linux-elf.h
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
Index: gcc-4.8.0/libgcc/config/arm/t-linux
Index: b/libgcc/config/arm/t-linux
===================================================================
--- gcc-4.8.0.orig/libgcc/config/arm/t-linux 2012-03-22 16:14:46.000000000 +0100
+++ gcc-4.8.0/libgcc/config/arm/t-linux 2013-03-23 17:40:54.000000000 +0100
--- 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 \

View File

@@ -0,0 +1,174 @@
From 70c2cb98fb129b4766b5da0f945dc41fd568c77a Mon Sep 17 00:00:00 2001
From: Max Filippov <jcmvbkbc@gmail.com>
Date: Sat, 22 Aug 2015 08:44:26 +0300
Subject: [PATCH] xtensa: add uclinux support
2015-10-03 Max Filippov <jcmvbkbc@gmail.com>
gcc/
* config.gcc (xtensa*-*-uclinux*): New configuration.
* config/xtensa/uclinux.h: New file.
* config/xtensa/uclinux.opt: New file.
libgcc/
* config.host (xtensa*-*-uclinux*): New configuration.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
---
Backported from: r228450
gcc/config.gcc | 5 ++++
gcc/config/xtensa/uclinux.h | 69 +++++++++++++++++++++++++++++++++++++++++++
gcc/config/xtensa/uclinux.opt | 32 ++++++++++++++++++++
libgcc/config.host | 5 ++++
4 files changed, 111 insertions(+)
create mode 100644 gcc/config/xtensa/uclinux.h
create mode 100644 gcc/config/xtensa/uclinux.opt
diff --git a/gcc/config.gcc b/gcc/config.gcc
index c52f5a8..56797bd 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -2995,6 +2995,11 @@ xtensa*-*-linux*)
tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h xtensa/linux.h"
tmake_file="${tmake_file} xtensa/t-xtensa"
;;
+xtensa*-*-uclinux*)
+ tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h xtensa/uclinux.h"
+ tmake_file="${tmake_file} xtensa/t-xtensa"
+ extra_options="${extra_options} xtensa/uclinux.opt"
+ ;;
am33_2.0-*-linux*)
tm_file="mn10300/mn10300.h dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h mn10300/linux.h"
gas=yes gnu_ld=yes
diff --git a/gcc/config/xtensa/uclinux.h b/gcc/config/xtensa/uclinux.h
new file mode 100644
index 0000000..4606020
--- /dev/null
+++ b/gcc/config/xtensa/uclinux.h
@@ -0,0 +1,69 @@
+/* Xtensa uClinux configuration.
+ Derived from the configuration for GCC for Intel i386 running Linux.
+ Copyright (C) 2001-2015 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#undef TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS() \
+ do \
+ { \
+ GNU_USER_TARGET_OS_CPP_BUILTINS (); \
+ builtin_define ("__uClinux__"); \
+ } \
+ while (0)
+
+#undef SUBTARGET_CPP_SPEC
+#define SUBTARGET_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
+
+#undef SIZE_TYPE
+#define SIZE_TYPE "unsigned int"
+
+#undef PTRDIFF_TYPE
+#define PTRDIFF_TYPE "int"
+
+#undef WCHAR_TYPE
+#define WCHAR_TYPE "long int"
+
+#undef WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE 32
+
+#undef ASM_SPEC
+#define ASM_SPEC \
+ "%{mtext-section-literals:--text-section-literals} \
+ %{mno-text-section-literals:--no-text-section-literals} \
+ %{mtarget-align:--target-align} \
+ %{mno-target-align:--no-target-align} \
+ %{mlongcalls:--longcalls} \
+ %{mno-longcalls:--no-longcalls} \
+ %{mauto-litpools:--auto-litpools} \
+ %{mno-auto-litpools:--no-auto-litpools}"
+
+#undef LINK_SPEC
+#define LINK_SPEC "%{!no-elf2flt:%{!elf2flt*:-elf2flt}}"
+
+#undef LOCAL_LABEL_PREFIX
+#define LOCAL_LABEL_PREFIX "."
+
+/* Always enable "-fpic" for Xtensa Linux. */
+#define XTENSA_ALWAYS_PIC 1
+
+#undef TARGET_LIBC_HAS_FUNCTION
+#define TARGET_LIBC_HAS_FUNCTION no_c99_libc_has_function
+
+#undef DBX_REGISTER_NUMBER
+
diff --git a/gcc/config/xtensa/uclinux.opt b/gcc/config/xtensa/uclinux.opt
new file mode 100644
index 0000000..95ef777
--- /dev/null
+++ b/gcc/config/xtensa/uclinux.opt
@@ -0,0 +1,32 @@
+; Xtensa uClinux options.
+
+; Copyright (C) 2015 Free Software Foundation, Inc.
+;
+; This file is part of GCC.
+;
+; GCC is free software; you can redistribute it and/or modify it under
+; the terms of the GNU General Public License as published by the Free
+; Software Foundation; either version 3, or (at your option) any later
+; version.
+;
+; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+; WARRANTY; without even the implied warranty of MERCHANTABILITY or
+; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+; for more details.
+;
+; You should have received a copy of the GNU General Public License
+; along with GCC; see the file COPYING3. If not see
+; <http://www.gnu.org/licenses/>.
+
+; See the GCC internals manual (options.texi) for a description of
+; this file's format.
+
+; Please try to keep this file in ASCII collating order.
+
+elf2flt
+Driver
+
+elf2flt=
+Driver JoinedOrMissing
+
+; This comment is to ensure we retain the blank line above.
diff --git a/libgcc/config.host b/libgcc/config.host
index 2c64756..2ee92c1 100644
--- a/libgcc/config.host
+++ b/libgcc/config.host
@@ -1295,6 +1295,11 @@ xtensa*-*-linux*)
tmake_file="$tmake_file xtensa/t-xtensa xtensa/t-linux t-slibgcc-libgcc"
md_unwind_header=xtensa/linux-unwind.h
;;
+xtensa*-*-uclinux*)
+ tmake_file="$tmake_file xtensa/t-xtensa xtensa/t-linux t-slibgcc-libgcc"
+ md_unwind_header=xtensa/linux-unwind.h
+ extra_parts="$extra_parts crtbeginS.o crtbeginT.o crtendS.o"
+ ;;
am33_2.0-*-linux*)
# Don't need crtbeginT.o from *-*-linux* default.
extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
--
1.8.1.4

View File

@@ -0,0 +1,15 @@
remove unused header, which breaks the toolchain building
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
diff -Nur gcc-5.3.0.orig/libgcc/config/m68k/linux-atomic.c gcc-5.3.0/libgcc/config/m68k/linux-atomic.c
--- gcc-5.3.0.orig/libgcc/config/m68k/linux-atomic.c 2015-01-05 13:33:28.000000000 +0100
+++ gcc-5.3.0/libgcc/config/m68k/linux-atomic.c 2016-03-19 09:25:07.000000000 +0100
@@ -33,7 +33,6 @@
using the kernel helper defined below. There is no support for
64-bit operations yet. */
-#include <asm/unistd.h>
#include <stdbool.h>
#ifndef __NR_atomic_cmpxchg_32

View File

@@ -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

View File

@@ -0,0 +1,24 @@
Add dynamic linker support for uClibc
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
diff -Nur gcc-5.3.0.orig/gcc/config/microblaze/linux.h gcc-5.3.0/gcc/config/microblaze/linux.h
--- gcc-5.3.0.orig/gcc/config/microblaze/linux.h 2015-05-28 16:08:19.000000000 +0200
+++ gcc-5.3.0/gcc/config/microblaze/linux.h 2016-05-13 09:21:01.579262885 +0200
@@ -28,7 +28,15 @@
#undef TLS_NEEDS_GOT
#define TLS_NEEDS_GOT 1
-#define DYNAMIC_LINKER "/lib/ld.so.1"
+#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
+#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
+
+#if DEFAULT_LIBC == LIBC_UCLIBC
+#define DYNAMIC_LINKER UCLIBC_DYNAMIC_LINKER
+#else
+#define DYNAMIC_LINKER GLIBC_DYNAMIC_LINKER
+#endif
+
#undef SUBTARGET_EXTRA_SPECS
#define SUBTARGET_EXTRA_SPECS \
{ "dynamic_linker", DYNAMIC_LINKER }

View File

@@ -0,0 +1,14 @@
disable split-stack for non-thread builds
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
diff -Nur gcc-5.3.0.orig/libgcc/config/t-stack gcc-5.3.0/libgcc/config/t-stack
--- gcc-5.3.0.orig/libgcc/config/t-stack 2010-10-01 21:31:49.000000000 +0200
+++ gcc-5.3.0/libgcc/config/t-stack 2016-03-07 03:25:32.000000000 +0100
@@ -1,4 +1,6 @@
# Makefile fragment to provide generic support for -fsplit-stack.
# This should be used in config.host for any host which supports
# -fsplit-stack.
+ifeq ($(enable_threads),yes)
LIB2ADD_ST += $(srcdir)/generic-morestack.c $(srcdir)/generic-morestack-thread.c
+endif

View File

@@ -0,0 +1,19 @@
Enable POSIX threads for uClinux targets
Reported upstream:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71721
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
diff -Nur gcc-5.4.0.orig/gcc/config.gcc gcc-5.4.0/gcc/config.gcc
--- gcc-5.4.0.orig/gcc/config.gcc 2015-09-10 16:17:53.000000000 +0200
+++ gcc-5.4.0/gcc/config.gcc 2016-07-01 21:26:02.772958441 +0200
@@ -808,6 +808,9 @@
*-*-uclinux*)
extra_options="$extra_options gnu-user.opt"
use_gcc_stdint=wrap
+ case ${enable_threads} in
+ "" | yes | posix) thread_file='posix' ;;
+ esac
tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC SINGLE_LIBC"
;;
*-*-rdos*)

View File

@@ -1,6 +1,8 @@
--- gcc/gcc/config/--- gcc/contrib/regression/objs-gcc.sh
+++ gcc/contrib/regression/objs-gcc.sh
@@ -105,6 +105,10 @@
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

View File

@@ -1,7 +1,9 @@
--- gcc-4.0.0/boehm-gc/include/gc.h-orig 2005-04-28 22:28:57.000000000 -0500
+++ gcc-4.0.0/boehm-gc/include/gc.h 2005-04-28 22:30:38.000000000 -0500
@@ -500,7 +500,7 @@
#ifdef __linux__
Index: b/boehm-gc/include/gc.h
===================================================================
--- a/boehm-gc/include/gc.h
+++ b/boehm-gc/include/gc.h
@@ -503,7 +503,7 @@
#if defined(__linux__) || defined(__GLIBC__)
# include <features.h>
# if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
- && !defined(__ia64__)

View File

@@ -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.

View File

@@ -1,9 +1,10 @@
http://sourceware.org/ml/crossgcc/2008-05/msg00009.html
diff -Nura gcc-4.5.1.orig/gcc/config/arm/linux-eabi.h gcc-4.5.1/gcc/config/arm/linux-eabi.h
--- gcc-4.5.1.orig/gcc/config/arm/linux-eabi.h 2009-10-30 17:03:09.000000000 -0300
+++ gcc-4.5.1/gcc/config/arm/linux-eabi.h 2010-11-02 15:38:25.792208500 -0300
@@ -44,7 +44,7 @@
Index: b/gcc/config/arm/linux-eabi.h
===================================================================
--- a/gcc/config/arm/linux-eabi.h
+++ b/gcc/config/arm/linux-eabi.h
@@ -45,7 +45,7 @@
The ARM10TDMI core is the default for armv5t, so set
SUBTARGET_CPU_DEFAULT to achieve this. */
#undef SUBTARGET_CPU_DEFAULT

View File

@@ -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)

View File

@@ -0,0 +1,15 @@
remove unused header, which breaks the toolchain building
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
diff -Nur gcc-5.3.0.orig/libgcc/config/m68k/linux-atomic.c gcc-5.3.0/libgcc/config/m68k/linux-atomic.c
--- gcc-5.3.0.orig/libgcc/config/m68k/linux-atomic.c 2015-01-05 13:33:28.000000000 +0100
+++ gcc-5.3.0/libgcc/config/m68k/linux-atomic.c 2016-03-19 09:25:07.000000000 +0100
@@ -33,7 +33,6 @@
using the kernel helper defined below. There is no support for
64-bit operations yet. */
-#include <asm/unistd.h>
#include <stdbool.h>
#ifndef __NR_atomic_cmpxchg_32

View File

@@ -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-6.1.0.orig/libgcc/config.host gcc-6.1.0/libgcc/config.host
--- gcc-6.1.0.orig/libgcc/config.host 2016-02-26 21:02:28.000000000 +0100
+++ gcc-6.1.0/libgcc/config.host 2016-04-29 09:18:40.377989160 +0200
@@ -812,7 +812,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

View File

@@ -0,0 +1,74 @@
From ae9c3e354440c4a0f105a9eabfb2f77be085ebc1 Mon Sep 17 00:00:00 2001
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Date: Thu, 18 Aug 2016 17:59:16 +0200
Subject: [PATCH] libgcc/mkmap-symver: support skip_underscore
Some platforms, such as Blackfin, have a special prefix for assembly
symbols as opposed to C symbols. For this reason, a function named
"foo()" in C will in fact be visible as a symbol called "_foo" in the
ELF binary.
The current linker version script logic in libgcc doesn't take into
account this situation properly. The Blackfin specific
libgcc/config/bfin/libgcc-glibc.ver has an additional "_" in front of
every symbol so that it matches the output of "nm" (which gets parsed to
produce the final linker version script). But due to this additional
"_", ld no longer matches with the symbols since "ld" does the matching
with the original symbol name, not the one prefixed with "_".
Due to this, none of the symbols in libgcc/config/bfin/libgcc-glibc.ver
are actually matched with symbols in libgcc. This causes all libgcc
symbols to be left as "LOCAL", which causes lots of "undefined
reference" whenever some C or C++ code that calls a function of libgcc
is compiled.
To address this, this commit introduces a "skip_underscore" variable to
the mkmap-symver script. It tells mkmap-symver to ignore the leading
underscore from the "nm" output.
Note that this new argument is different from the existing
"leading_underscore" argument, which *adds* an additional underscore to
the generated linker version script.
Having this functionality paves the way to using the generic linker
version information for Blackfin, instead of using a custom one.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
libgcc/ChangeLog | 5 +++++
libgcc/mkmap-symver.awk | 6 +++++-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index 6559564..129e43f 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,3 +1,8 @@
+2016-08-19 Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+
+ PR gcc/74748
+ * libgcc/mkmap-symver.awk: add support for skip_underscore
+
2016-04-27 Release Manager
* GCC 6.1.0 released.
diff --git a/libgcc/mkmap-symver.awk b/libgcc/mkmap-symver.awk
index 266832a..30bb179 100644
--- a/libgcc/mkmap-symver.awk
+++ b/libgcc/mkmap-symver.awk
@@ -47,7 +47,11 @@ state == "nm" && ($1 == "U" || $2 == "U") {
state == "nm" && NF == 3 {
split ($3, s, "@")
- def[s[1]] = 1;
+ if (skip_underscore)
+ symname = substr(s[1], 2);
+ else
+ symname = s[1];
+ def[symname] = 1;
sawsymbol = 1;
next;
}
--
2.7.4

View File

@@ -0,0 +1,73 @@
From 9d9f97ca5d1ceba66677bf406c9b31027dc1f22e Mon Sep 17 00:00:00 2001
From: Waldemar Brodkorb <wbx@openadk.org>
Date: Fri, 19 Aug 2016 13:54:46 +0200
Subject: [PATCH] libgcc: fix DWARF compilation with FDPIC targets
The build of unwind-dw2-fde-dip.c currently fails for FDPIC targets with
the following error:
libgcc/unwind-dw2-fde-dip.c:167:31: error: storage size of 'load_base' isn't known
struct elf32_fdpic_loadaddr load_base;
This patch addresses that by defining load_base with the appropriate
type on FDPIC targets. It has been tested on FRV and Blackfin.
Fixes PR gcc/68468.
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
libgcc/ChangeLog | 5 +++++
libgcc/unwind-dw2-fde-dip.c | 8 ++++++--
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index 36c0194..2e78d20 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,3 +1,8 @@
+2016-08-19 Waldemar Brodkorb <wbx@openadk.org>
+
+ PR gcc/68468
+ * libgcc/unwind-dw2-fde-dip.c: fix build on FDPIC targets.
+
2016-08-19 Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
PR gcc/74748
diff --git a/libgcc/unwind-dw2-fde-dip.c b/libgcc/unwind-dw2-fde-dip.c
index f7a1c3f..801bce8 100644
--- a/libgcc/unwind-dw2-fde-dip.c
+++ b/libgcc/unwind-dw2-fde-dip.c
@@ -124,7 +124,11 @@ static struct frame_hdr_cache_element
{
_Unwind_Ptr pc_low;
_Unwind_Ptr pc_high;
+#if defined __FRV_FDPIC__ || defined __BFIN_FDPIC__
+ struct elf32_fdpic_loadaddr load_base;
+#else
_Unwind_Ptr load_base;
+#endif
const ElfW(Phdr) *p_eh_frame_hdr;
const ElfW(Phdr) *p_dynamic;
struct frame_hdr_cache_element *link;
@@ -163,7 +167,7 @@ _Unwind_IteratePhdrCallback (struct dl_phdr_info *info, size_t size, void *ptr)
struct unw_eh_callback_data *data = (struct unw_eh_callback_data *) ptr;
const ElfW(Phdr) *phdr, *p_eh_frame_hdr, *p_dynamic;
long n, match;
-#ifdef __FRV_FDPIC__
+#if defined __FRV_FDPIC__ || defined __BFIN_FDPIC__
struct elf32_fdpic_loadaddr load_base;
#else
_Unwind_Ptr load_base;
@@ -347,7 +351,7 @@ _Unwind_IteratePhdrCallback (struct dl_phdr_info *info, size_t size, void *ptr)
break;
}
}
-# elif defined __FRV_FDPIC__ && defined __linux__
+# elif (defined __FRV_FDPIC__ || defined __BFIN_FDPIC__) && defined __linux__
data->dbase = load_base.got_value;
# else
# error What is DW_EH_PE_datarel base on this platform?
--
2.7.4

View File

@@ -0,0 +1,19 @@
Enable POSIX threads for uClinux targets
Reported upstream:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71721
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
diff -Nur gcc-6.1.0.orig/gcc/config.gcc gcc-6.1.0/gcc/config.gcc
--- gcc-6.1.0.orig/gcc/config.gcc 2016-04-11 12:14:59.000000000 +0200
+++ gcc-6.1.0/gcc/config.gcc 2016-07-02 20:04:25.732169982 +0200
@@ -833,6 +833,9 @@
*-*-uclinux*)
extra_options="$extra_options gnu-user.opt"
use_gcc_stdint=wrap
+ case ${enable_threads} in
+ "" | yes | posix) thread_file='posix' ;;
+ esac
tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC SINGLE_LIBC"
;;
*-*-rdos*)

View File

@@ -13,38 +13,14 @@ choice
help
Select the version of gcc you wish to use.
config BR2_GCC_VERSION_4_5_X
bool "gcc 4.5.x"
depends on BR2_DEPRECATED_SINCE_2015_05
# Broken or unsupported architectures
depends on !BR2_microblaze && !BR2_aarch64 && !BR2_arc \
&& !BR2_powerpc64le && !BR2_nios2
# Broken or unsupported ARM cores
depends on !BR2_cortex_a7 && !BR2_cortex_a12 && \
!BR2_cortex_a15 && !BR2_fa526 && !BR2_pj4
# Broken or unsupported PPC cores
depends on !BR2_powerpc_e5500 && !BR2_powerpc_e6500 && \
!BR2_powerpc_power8
# SPARC -mcpu=leon3 appeared in gcc 4.8.x
depends on !BR2_sparc_leon3
# Broken or unsupported X86 cores
depends on !BR2_x86_corei7 && !BR2_x86_jaguar && !BR2_x86_steamroller
# ARM EABIhf support appeared in gcc 4.6
depends on !BR2_ARM_EABIHF
# Unsupported for MIPS R6
depends on !BR2_mips_32r6 && !BR2_mips_64r6
# musl patches only for gcc 4.7+
depends on !BR2_TOOLCHAIN_BUILDROOT_MUSL
select BR2_GCC_NEEDS_MPC
select BR2_TOOLCHAIN_GCC_AT_LEAST_4_5
config BR2_GCC_VERSION_4_7_X
bool "gcc 4.7.x"
depends on BR2_DEPRECATED_SINCE_2016_05
# Broken or unsupported architectures
depends on !BR2_microblaze && !BR2_aarch64 && !BR2_arc \
&& !BR2_powerpc64le && !BR2_nios2
&& !BR2_powerpc64le && !BR2_nios2 && !BR2_bfin
# Broken or unsupported ARM cores
depends on !BR2_cortex_a12 && !BR2_pj4
depends on !BR2_cortex_a12 && !BR2_pj4 && !BR2_cortex_a17
# Broken or unsupported PPC cores
depends on !BR2_powerpc_e5500 && !BR2_powerpc_e6500 && \
!BR2_powerpc_power8
@@ -61,9 +37,9 @@ choice
bool "gcc 4.8.x"
# Broken or unsupported architectures
depends on !BR2_microblaze && !BR2_arc \
&& !BR2_powerpc64le && !BR2_nios2
&& !BR2_powerpc64le && !BR2_nios2 && !BR2_bfin
# Broken or unsupported ARM cores
depends on !BR2_cortex_a12
depends on !BR2_cortex_a12 && !BR2_cortex_a17
# Broken or unsupported PPC cores
depends on !BR2_powerpc_power8
# gcc-4.8.x + binutils-2.25 is broken for MIPS
@@ -85,7 +61,9 @@ choice
config BR2_GCC_VERSION_4_9_X
bool "gcc 4.9.x"
# Broken or unsupported architectures
depends on !BR2_arc
depends on !BR2_arc && !BR2_bfin
# Broken or unsupported ARM cores
depends on !BR2_cortex_a17
# Unsupported for MIPS R6
depends on !BR2_mips_32r6 && !BR2_mips_64r6
# PR60102 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60102
@@ -96,25 +74,40 @@ choice
config BR2_GCC_VERSION_5_X
bool "gcc 5.x"
# Broken or unsupported architectures
depends on !BR2_arc
depends on !BR2_arc && !BR2_bfin
select BR2_GCC_NEEDS_MPC
select BR2_GCC_SUPPORTS_GRAPHITE
select BR2_TOOLCHAIN_GCC_AT_LEAST_5
config BR2_GCC_VERSION_6_X
bool "gcc 6.x"
# Broken or unsupported architectures
depends on !BR2_arc
select BR2_GCC_NEEDS_MPC
select BR2_GCC_SUPPORTS_GRAPHITE
select BR2_TOOLCHAIN_GCC_AT_LEAST_6
endchoice
# Indicates if GCC for architecture supports --with-{arch,cpu,..} to
# set default CFLAGS, otherwise values will be used by toolchain
# wrapper.
config BR2_GCC_ARCH_HAS_CONFIGURABLE_DEFAULTS
bool
default y if !BR2_bfin
config BR2_GCC_SUPPORTS_FINEGRAINEDMTUNE
bool
default y
config BR2_GCC_VERSION
string
default "4.5.4" if BR2_GCC_VERSION_4_5_X
default "4.7.4" if BR2_GCC_VERSION_4_7_X
default "4.8.5" if BR2_GCC_VERSION_4_8_X
default "4.9.3" if BR2_GCC_VERSION_4_9_X
default "5.3.0" if BR2_GCC_VERSION_5_X
default "arc-2015.12" if BR2_GCC_VERSION_4_8_ARC
default "4.9.4" if BR2_GCC_VERSION_4_9_X
default "5.4.0" if BR2_GCC_VERSION_5_X
default "6.1.0" if BR2_GCC_VERSION_6_X
default "arc-2016.09-eng010" if BR2_GCC_VERSION_4_8_ARC
config BR2_EXTRA_GCC_CONFIG_OPTIONS
string "Additional gcc options"
@@ -132,8 +125,16 @@ config BR2_TOOLCHAIN_BUILDROOT_CXX
C++ language and you want C++ libraries to be installed on
your target system.
comment "Fortran support needs a toolchain w/ wchar"
depends on BR2_TOOLCHAIN_HAS_LIBQUADMATH
depends on !BR2_USE_WCHAR # libquadmath
config BR2_TOOLCHAIN_BUILDROOT_FORTRAN
bool "Enable Fortran support"
# on architecture building libquadmath, wchar is required
depends on !BR2_TOOLCHAIN_HAS_LIBQUADMATH || \
(BR2_TOOLCHAIN_HAS_LIBQUADMATH && BR2_USE_WCHAR)
select BR2_TOOLCHAIN_HAS_FORTRAN
help
Enable this option if you want your toolchain to support the
Fortran language and you want Fortran libraries to be
@@ -142,7 +143,7 @@ config BR2_TOOLCHAIN_BUILDROOT_FORTRAN
config BR2_GCC_ENABLE_TLS
bool "Enable compiler tls support" if BR2_TOOLCHAIN_BUILDROOT_UCLIBC
default y
depends on BR2_PTHREADS_NATIVE || BR2_TOOLCHAIN_BUILDROOT_EGLIBC || BR2_TOOLCHAIN_BUILDROOT_GLIBC
depends on BR2_PTHREADS_NATIVE || BR2_TOOLCHAIN_BUILDROOT_GLIBC
help
Enable the compiler to generate code for accessing
thread local storage variables
@@ -165,8 +166,7 @@ config BR2_GCC_ENABLE_LIBMUDFLAP
# There are architectures, or specific configurations for
# which mudflap is not supported.
depends on !BR2_ARM_INSTRUCTIONS_THUMB && !BR2_powerpc_SPE
depends on !BR2_GCC_VERSION_4_9_X
depends on !BR2_GCC_VERSION_5_X
depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
help
libmudflap is a gcc library used for the mudflap pointer
debugging functionality. It is only needed if you intend to

View File

@@ -1,244 +0,0 @@
From afe990251bd9b3a063f03da31a3b8d139d033bc3 Mon Sep 17 00:00:00 2001
From: ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Sat, 1 Jun 2013 00:20:49 +0000
Subject: [PATCH] PR other/56780
* libiberty/configure.ac: Move test for --enable-install-libiberty
outside of the 'with_target_subdir' test so that it actually gets
run. Add output messages to show the test result.
* libiberty/configure: Regenerate.
* libiberty/Makefile.in (install_to_libdir): Place the
installation of the libiberty library in the same guard as that
used for the headers to prevent it being installed unless
requested via --enable-install-libiberty.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@199570 138bc75d-0d04-0410-961f-82ee72b054a4
libiberty: fix --enable-install-libiberty flag [PR 56780]
Commit 199570 fixed the --disable-install-libiberty behavior, but it also
added a bug where the enable path never works because the initial clear
of target_header_dir wasn't deleted. So we end up initializing properly
at the top only to reset it at the end all the time.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@206367 138bc75d-0d04-0410-961f-82ee72b054a4
[Romain
squash the two upstream commits
Remove the ChangeLog]
Signed-off-by: Romain Naour <romain.naour@openwide.fr>
---
libiberty/Makefile.in | 24 ++++++++++-----------
libiberty/configure | 57 +++++++++++++++++++++++++++-----------------------
libiberty/configure.ac | 47 ++++++++++++++++++++++-------------------
3 files changed, 68 insertions(+), 60 deletions(-)
diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in
index f6a3ebd..75ff82d 100644
--- a/libiberty/Makefile.in
+++ b/libiberty/Makefile.in
@@ -355,19 +355,19 @@ install-strip: install
# since it will be passed the multilib flags.
MULTIOSDIR = `$(CC) $(CFLAGS) -print-multi-os-directory`
install_to_libdir: all
- ${mkinstalldirs} $(DESTDIR)$(libdir)/$(MULTIOSDIR)
- $(INSTALL_DATA) $(TARGETLIB) $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB)n
- ( cd $(DESTDIR)$(libdir)/$(MULTIOSDIR) ; chmod 644 $(TARGETLIB)n ;$(RANLIB) $(TARGETLIB)n )
- mv -f $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB)n $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB)
if test -n "${target_header_dir}"; then \
- case "${target_header_dir}" in \
- /*) thd=${target_header_dir};; \
- *) thd=${includedir}/${target_header_dir};; \
- esac; \
- ${mkinstalldirs} $(DESTDIR)$${thd}; \
- for h in ${INSTALLED_HEADERS}; do \
- ${INSTALL_DATA} $$h $(DESTDIR)$${thd}; \
- done; \
+ ${mkinstalldirs} $(DESTDIR)$(libdir)/$(MULTIOSDIR); \
+ $(INSTALL_DATA) $(TARGETLIB) $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB)n; \
+ ( cd $(DESTDIR)$(libdir)/$(MULTIOSDIR) ; chmod 644 $(TARGETLIB)n ;$(RANLIB) $(TARGETLIB)n ); \
+ mv -f $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB)n $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB); \
+ case "${target_header_dir}" in \
+ /*) thd=${target_header_dir};; \
+ *) thd=${includedir}/${target_header_dir};; \
+ esac; \
+ ${mkinstalldirs} $(DESTDIR)$${thd}; \
+ for h in ${INSTALLED_HEADERS}; do \
+ ${INSTALL_DATA} $$h $(DESTDIR)$${thd}; \
+ done; \
fi
@$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install
diff --git a/libiberty/configure b/libiberty/configure
index 5367027..4feb95a 100755
--- a/libiberty/configure
+++ b/libiberty/configure
@@ -675,8 +675,8 @@ with_cross_host
with_newlib
enable_maintainer_mode
enable_multilib
-enable_largefile
enable_install_libiberty
+enable_largefile
'
ac_precious_vars='build_alias
host_alias
@@ -1303,8 +1303,8 @@ Optional Features:
enable make rules and dependencies not useful
(and sometimes confusing) to the casual installer
--enable-multilib build many library versions (default)
+ --enable-install-libiberty Install headers and library for end users
--disable-largefile omit support for large files
- --enable-install-libiberty Install headers for end users
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@@ -2784,6 +2784,35 @@ if test $cross_compiling = no && test $multilib = yes \
cross_compiling=maybe
fi
+# We may wish to install the target headers somewhere.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to install libiberty headers and static library" >&5
+$as_echo_n "checking whether to install libiberty headers and static library... " >&6; }
+
+# Check whether --enable-install-libiberty was given.
+if test "${enable_install_libiberty+set}" = set; then :
+ enableval=$enable_install_libiberty; enable_install_libiberty=$enableval
+else
+ enable_install_libiberty=no
+fi
+
+# Option parsed, now set things appropriately.
+case x"$enable_install_libiberty" in
+ xyes|x)
+ target_header_dir=libiberty
+ ;;
+ xno)
+ target_header_dir=
+ ;;
+ *)
+ # This could be sanity-checked in various ways...
+ target_header_dir="${enable_install_libiberty}"
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_install_libiberty" >&5
+$as_echo "$enable_install_libiberty" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: target_header_dir = $target_header_dir" >&5
+$as_echo "$as_me: target_header_dir = $target_header_dir" >&6;}
+
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
@@ -5476,7 +5505,6 @@ fi
setobjs=
CHECK=
-target_header_dir=
if test -n "${with_target_subdir}"; then
# We are being configured as a target library. AC_REPLACE_FUNCS
@@ -5759,29 +5787,6 @@ _ACEOF
esac
- # We may wish to install the target headers somewhere.
- # Check whether --enable-install-libiberty was given.
-if test "${enable_install_libiberty+set}" = set; then :
- enableval=$enable_install_libiberty; enable_install_libiberty=$enableval
-else
- enable_install_libiberty=no
-fi
-
- # Option parsed, now set things appropriately.
- case x"$enable_install_libiberty" in
- xyes|x)
- target_header_dir=libiberty
- ;;
- xno)
- target_header_dir=
- ;;
- *)
- # This could be sanity-checked in various ways...
- target_header_dir="${enable_install_libiberty}"
- ;;
- esac
-
-
else
# Not a target library, so we set things up to run the test suite.
diff --git a/libiberty/configure.ac b/libiberty/configure.ac
index c763894..f17e6b6 100644
--- a/libiberty/configure.ac
+++ b/libiberty/configure.ac
@@ -128,6 +128,31 @@ if test $cross_compiling = no && test $multilib = yes \
cross_compiling=maybe
fi
+# We may wish to install the target headers somewhere.
+AC_MSG_CHECKING([whether to install libiberty headers and static library])
+dnl install-libiberty is disabled by default
+
+AC_ARG_ENABLE(install-libiberty,
+[ --enable-install-libiberty Install headers and library for end users],
+enable_install_libiberty=$enableval,
+enable_install_libiberty=no)dnl
+
+# Option parsed, now set things appropriately.
+case x"$enable_install_libiberty" in
+ xyes|x)
+ target_header_dir=libiberty
+ ;;
+ xno)
+ target_header_dir=
+ ;;
+ *)
+ # This could be sanity-checked in various ways...
+ target_header_dir="${enable_install_libiberty}"
+ ;;
+esac
+AC_MSG_RESULT($enable_install_libiberty)
+AC_MSG_NOTICE([target_header_dir = $target_header_dir])
+
GCC_NO_EXECUTABLES
AC_PROG_CC
AC_SYS_LARGEFILE
@@ -380,7 +405,6 @@ fi
setobjs=
CHECK=
-target_header_dir=
if test -n "${with_target_subdir}"; then
# We are being configured as a target library. AC_REPLACE_FUNCS
@@ -492,27 +516,6 @@ if test -n "${with_target_subdir}"; then
esac
- # We may wish to install the target headers somewhere.
- AC_ARG_ENABLE(install-libiberty,
- [ --enable-install-libiberty Install headers for end users],
- enable_install_libiberty=$enableval,
- enable_install_libiberty=no)dnl
-
- # Option parsed, now set things appropriately.
- case x"$enable_install_libiberty" in
- xyes|x)
- target_header_dir=libiberty
- ;;
- xno)
- target_header_dir=
- ;;
- *)
- # This could be sanity-checked in various ways...
- target_header_dir="${enable_install_libiberty}"
- ;;
- esac
-
-
else
# Not a target library, so we set things up to run the test suite.
--
1.9.3

View File

@@ -1,103 +0,0 @@
From b55922d45fd16f5e8fc7c3885da42b2b9b37754d Mon Sep 17 00:00:00 2001
From: Claudiu Zissulescu <claziss@synopsys.com>
Date: Mon, 18 Jan 2016 16:43:18 +0100
Subject: [PATCH] UPDATE: Fix handling complex PIC moves.
fwprop is putting in the REG_EQUIV notes which are involving the
constant pic unspecs. Then, loop may use those notes for
optimizations rezulting in complex patterns that are not supported by
the current implementation. The following piece of code tries to
convert the complex instruction in simpler ones.
The fix is done in development tree: [arc-4.8-dev b55922d]
and will be a part of the next release of ARC GNU tools.
Once that new release happens this patch must be removed.
gcc/
2016-01-18 Claudiu Zissulescu <claziss@synopsys.com>
* config/arc/arc.c (arc_legitimize_pic_address): Handle MINUS
operations when doing PIC moves. Make this function static.
(arc_legitimate_pc_offset_p): Use
arc_raw_symbolic_reference_mentioned_p.
* config/arc/arc-protos.h (arc_legitimize_pic_address): Remove.
gcc/config/arc/arc-protos.h | 1 -
gcc/config/arc/arc.c | 33 +++++++++++++++++++--------------
2 files changed, 19 insertions(+), 15 deletions(-)
* config/arc/arc.c (arc_legitimize_pic_address): Handle complex
diff --git a/gcc/config/arc/arc-protos.h b/gcc/config/arc/arc-protos.h
index 464e0ab..5986e06 100644
--- a/gcc/config/arc/arc-protos.h
+++ b/gcc/config/arc/arc-protos.h
@@ -53,7 +53,6 @@ extern unsigned int arc_compute_frame_size ();
extern bool arc_ccfsm_branch_deleted_p (void);
extern void arc_ccfsm_record_branch_deleted (void);
-extern rtx arc_legitimize_pic_address (rtx, rtx);
void arc_asm_output_aligned_decl_local (FILE *, tree, const char *,
unsigned HOST_WIDE_INT,
unsigned HOST_WIDE_INT,
diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c
index a89c8ee..f7cae9f 100644
--- a/gcc/config/arc/arc.c
+++ b/gcc/config/arc/arc.c
@@ -5243,19 +5243,7 @@ arc_legitimate_pc_offset_p (rtx addr)
if (GET_CODE (addr) != CONST)
return false;
addr = XEXP (addr, 0);
- if (GET_CODE (addr) == PLUS)
- {
- if (GET_CODE (XEXP (addr, 1)) != CONST_INT)
- return false;
- addr = XEXP (addr, 0);
- }
- return (GET_CODE (addr) == UNSPEC
- && XVECLEN (addr, 0) == 1
- && (XINT (addr, 1) == ARC_UNSPEC_GOT
- || XINT (addr, 1) == ARC_UNSPEC_GOTOFFPC
- || XINT (addr, 1) == UNSPEC_TLS_GD
- || XINT (addr, 1) == UNSPEC_TLS_IE)
- && GET_CODE (XVECEXP (addr, 0, 0)) == SYMBOL_REF);
+ return flag_pic && !arc_raw_symbolic_reference_mentioned_p (addr, false);
}
/* Return true if ADDR is a valid pic address.
@@ -5522,7 +5510,7 @@ arc_legitimize_tls_address (rtx addr, enum tls_model model)
The return value is the legitimated address.
If OLDX is non-zero, it is the target to assign the address to first. */
-rtx
+static rtx
arc_legitimize_pic_address (rtx orig, rtx oldx)
{
rtx addr = orig;
@@ -5569,6 +5557,23 @@ arc_legitimize_pic_address (rtx orig, rtx oldx)
/* Check that the unspec is one of the ones we generate? */
return orig;
}
+ else if (GET_CODE (addr) == MINUS)
+ {
+ /* The same story with fwprop. */
+ rtx op0 = XEXP (addr, 0);
+ rtx op1 = XEXP (addr, 1);
+ gcc_assert (oldx);
+ gcc_assert (GET_CODE (op1) == UNSPEC);
+
+ emit_move_insn (oldx,
+ gen_rtx_CONST (SImode,
+ arc_legitimize_pic_address (op1,
+ NULL_RTX)));
+ emit_insn (gen_rtx_SET (VOIDmode, oldx,
+ gen_rtx_MINUS (SImode, op0, oldx)));
+ return oldx;
+
+ }
else if (GET_CODE (addr) != PLUS)
{
/* fwprop is putting in the REG_EQUIV notes which are
--
2.5.0

View File

@@ -1,83 +0,0 @@
From f00b0f17d6889d811468c2c77508fbea8bfc377d Mon Sep 17 00:00:00 2001
From: Claudiu Zissulescu <claziss@synopsys.com>
Date: Tue, 19 Jan 2016 14:40:16 +0100
Subject: [PATCH] UPDATE1: Fix handling complex PIC moves.
The arc_legitimate_pc_offset_p condition is too lax. Updated it.
The fix is done in development tree: [arc-4.8-dev f00b0f1]
and will be a part of the next release of ARC GNU tools.
Once that new release happens this patch must be removed.
gcc/
2016-01-18 Claudiu Zissulescu <claziss@synopsys.com>
* config/arc/arc.c (arc_needs_pcl_p ): New function
(arc_legitimate_pc_offset_p): Use arc_needs_pcl_p.
---
gcc/config/arc/arc.c | 42 ++++++++++++++++++++++++++++++++++++++++--
1 file changed, 40 insertions(+), 2 deletions(-)
diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c
index f7cae9f..18d88a3 100644
--- a/gcc/config/arc/arc.c
+++ b/gcc/config/arc/arc.c
@@ -5234,6 +5234,45 @@ arc_rtx_costs (rtx x, int code, int outer_code, int opno ATTRIBUTE_UNUSED,
}
}
+/* Helper used by arc_legitimate_pc_offset_p. */
+
+static bool
+arc_needs_pcl_p (rtx x)
+{
+ register const char *fmt;
+ register int i, j;
+
+ if ((GET_CODE (x) == UNSPEC)
+ && (XVECLEN (x, 0) == 1)
+ && (GET_CODE (XVECEXP (x, 0, 0)) == SYMBOL_REF))
+ switch (XINT (x, 1))
+ {
+ case ARC_UNSPEC_GOT:
+ case ARC_UNSPEC_GOTOFFPC:
+ case UNSPEC_TLS_GD:
+ case UNSPEC_TLS_IE:
+ return true;
+ default:
+ break;
+ }
+
+ fmt = GET_RTX_FORMAT (GET_CODE (x));
+ for (i = GET_RTX_LENGTH (GET_CODE (x)) - 1; i >= 0; i--)
+ {
+ if (fmt[i] == 'e')
+ {
+ if (arc_needs_pcl_p (XEXP (x, i)))
+ return true;
+ }
+ else if (fmt[i] == 'E')
+ for (j = XVECLEN (x, i) - 1; j >= 0; j--)
+ if (arc_needs_pcl_p (XVECEXP (x, i, j)))
+ return true;
+ }
+
+ return false;
+}
+
/* Return true if ADDR is an address that needs to be expressed as an
explicit sum of pcl + offset. */
@@ -5242,8 +5281,7 @@ arc_legitimate_pc_offset_p (rtx addr)
{
if (GET_CODE (addr) != CONST)
return false;
- addr = XEXP (addr, 0);
- return flag_pic && !arc_raw_symbolic_reference_mentioned_p (addr, false);
+ return arc_needs_pcl_p (addr);
}
/* Return true if ADDR is a valid pic address.
--
2.5.0

View File

@@ -1,100 +0,0 @@
From 09463827001a7b8094f4b9460514370a1876d908 Mon Sep 17 00:00:00 2001
From: Claudiu Zissulescu <claziss@synopsys.com>
Date: Wed, 20 Jan 2016 16:32:40 +0100
Subject: [PATCH] Don't allow mcompact-casesi for ARCv2
The compact casesi is not working for arcv2 processors family as it
makes use of the add_s rx,rx,pcl instruction which is only valid for
arc6xx and arc700 processors. Also not having this instruction makes
no much sens to change the compact-casesi pattern to use normal add
instructions as it nullifies the advantage of short instruction use.
The default casesi pattern betters suits the arcv2 architecture.
The fix is done in development tree: [arc-4.8-dev 0946382]
and will be a part of the next release of ARC GNU tools.
Once that new release happens this patch must be removed.
gcc/
2016-01-20 Claudiu Zissulescu <claziss@synopsys.com>
* common/config/arc/arc-common.c (arc_option_optimization_table):
Remove mcompact-casesi option.
* config/arc/arc.c (arc_override_options): Use compact-casesi only
for arcv1.
* config/arc/arc.md (casesi_load): Use short instructions.
---
gcc/common/config/arc/arc-common.c | 1 -
gcc/config/arc/arc.c | 9 +++++----
gcc/config/arc/arc.md | 10 ++++++++--
3 files changed, 13 insertions(+), 7 deletions(-)
* config/arc/arc.c (arc_legitimize_pic_address): Handle MINUS
diff --git a/gcc/common/config/arc/arc-common.c b/gcc/common/config/arc/arc-common.c
index e2e36fa..310bc80 100644
--- a/gcc/common/config/arc/arc-common.c
+++ b/gcc/common/config/arc/arc-common.c
@@ -58,7 +58,6 @@ static const struct default_options arc_option_optimization_table[] =
{ OPT_LEVELS_ALL, OPT_mbbit_peephole, NULL, 1 },
{ OPT_LEVELS_SIZE, OPT_mq_class, NULL, 1 },
{ OPT_LEVELS_SIZE, OPT_mcase_vector_pcrel, NULL, 1 },
- { OPT_LEVELS_SIZE, OPT_mcompact_casesi, NULL, 1 },
{ OPT_LEVELS_NONE, 0, NULL, 0 }
};
diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c
index 18d88a3..f828398 100644
--- a/gcc/config/arc/arc.c
+++ b/gcc/config/arc/arc.c
@@ -1151,6 +1151,11 @@ arc_override_options (void)
if (arc_size_opt_level == 3)
optimize_size = 1;
+ if (TARGET_V2)
+ TARGET_COMPACT_CASESI = 0;
+ else if (optimize_size == 1)
+ TARGET_COMPACT_CASESI = 1;
+
if (flag_pic)
target_flags |= MASK_NO_SDATA_SET;
@@ -1163,10 +1168,6 @@ arc_override_options (void)
if (!TARGET_Q_CLASS)
TARGET_COMPACT_CASESI = 0;
- /* For the time being don't support COMPACT_CASESI for ARCv2. */
- if (TARGET_V2)
- TARGET_COMPACT_CASESI = 0;
-
if (TARGET_COMPACT_CASESI)
TARGET_CASE_VECTOR_PC_RELATIVE = 1;
diff --git a/gcc/config/arc/arc.md b/gcc/config/arc/arc.md
index bc4ac38..ba7c8bc 100644
--- a/gcc/config/arc/arc.md
+++ b/gcc/config/arc/arc.md
@@ -3837,14 +3837,20 @@
switch (GET_MODE (diff_vec))
{
case SImode:
- return \"ld.as %0,[%1,%2]%&\";
+ if ((which_alternative == 0) && TARGET_CODE_DENSITY)
+ return \"ld_s.as %0,[%1,%2]%&\";
+ else
+ return \"ld.as %0,[%1,%2]%&\";
case HImode:
if (ADDR_DIFF_VEC_FLAGS (diff_vec).offset_unsigned)
return \"ldw.as %0,[%1,%2]\";
return \"ldw.x.as %0,[%1,%2]\";
case QImode:
if (ADDR_DIFF_VEC_FLAGS (diff_vec).offset_unsigned)
- return \"ldb%? %0,[%1,%2]%&\";
+ if (which_alternative == 0)
+ return \"ldb_s %0,[%1,%2]%&\";
+ else
+ return \"ldb %0,[%1,%2]%&\";
return \"ldb.x %0,[%1,%2]\";
default:
gcc_unreachable ();
--
2.5.0

View File

@@ -0,0 +1,13 @@
Index: b/boehm-gc/include/gc.h
===================================================================
--- a/boehm-gc/include/gc.h
+++ b/boehm-gc/include/gc.h
@@ -503,7 +503,7 @@
#if defined(__linux__) || defined(__GLIBC__)
# include <features.h>
# if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
- && !defined(__ia64__)
+ && !defined(__ia64__) && !defined(__UCLIBC__)
# ifndef GC_HAVE_BUILTIN_BACKTRACE
# define GC_HAVE_BUILTIN_BACKTRACE
# endif

View File

@@ -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)

View File

@@ -0,0 +1,19 @@
Enable POSIX threads for uClinux targets
Reported upstream:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71721
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
diff -Nur gcc-6.1.0.orig/gcc/config.gcc gcc-6.1.0/gcc/config.gcc
--- gcc-6.1.0.orig/gcc/config.gcc 2016-04-11 12:14:59.000000000 +0200
+++ gcc-6.1.0/gcc/config.gcc 2016-07-02 20:04:25.732169982 +0200
@@ -833,6 +833,9 @@
*-*-uclinux*)
extra_options="$extra_options gnu-user.opt"
use_gcc_stdint=wrap
+ case ${enable_threads} in
+ "" | yes | posix) thread_file='posix' ;;
+ esac
tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC SINGLE_LIBC"
;;
*-*-rdos*)

View File

@@ -74,6 +74,10 @@ HOST_GCC_FINAL_CONF_OPTS += "--with-multilib-list=m4a,m4a-nofpu"
HOST_GCC_FINAL_GCC_LIB_DIR = $(HOST_DIR)/usr/$(GNU_TARGET_NAME)/lib/!m4*
endif
ifeq ($(BR2_bfin),y)
HOST_GCC_FINAL_CONF_OPTS += --disable-symvers
endif
# Disable shared libs like libstdc++ if we do static since it confuses linking
ifeq ($(BR2_STATIC_LIBS),y)
HOST_GCC_FINAL_CONF_OPTS += --disable-shared
@@ -113,9 +117,9 @@ HOST_GCC_FINAL_POST_BUILD_HOOKS += TOOLCHAIN_BUILD_WRAPPER
# -cc symlink to the wrapper is not created.
HOST_GCC_FINAL_POST_INSTALL_HOOKS += HOST_GCC_INSTALL_WRAPPER_AND_SIMPLE_SYMLINKS
# In gcc 4.7.x, the ARM EABIhf library loader path for (e)glibc was not
# In gcc 4.7.x, the ARM EABIhf library loader path for glibc was not
# correct, so we create a symbolic link to make things work
# properly. eglibc installs the library loader as ld-linux-armhf.so.3,
# properly. glibc installs the library loader as ld-linux-armhf.so.3,
# but gcc creates binaries that reference ld-linux.so.3.
ifeq ($(BR2_arm)$(BR2_ARM_EABIHF)$(BR2_GCC_VERSION_4_7_X)$(BR2_TOOLCHAIN_USES_GLIBC),yyyy)
define HOST_GCC_FINAL_LD_LINUX_LINK
@@ -125,6 +129,15 @@ endef
HOST_GCC_FINAL_POST_INSTALL_HOOKS += HOST_GCC_FINAL_LD_LINUX_LINK
endif
# coldfire is not working without removing these object files from libgcc.a
ifeq ($(BR2_m68k_cf),y)
define HOST_GCC_FINAL_M68K_LIBGCC_FIXUP
find $(STAGING_DIR) -name libgcc.a -print | \
while read t; do $(GNU_TARGET_NAME)-ar dv "$t" _ctors.o; done
endef
HOST_GCC_FINAL_POST_INSTALL_HOOKS += HOST_GCC_FINAL_M68K_LIBGCC_FIXUP
endif
# Cannot use the HOST_GCC_FINAL_USR_LIBS mechanism below, because we want
# libgcc_s to be installed in /lib and not /usr/lib.
define HOST_GCC_FINAL_INSTALL_LIBGCC
@@ -154,6 +167,10 @@ endif
ifeq ($(BR2_TOOLCHAIN_BUILDROOT_FORTRAN),y)
HOST_GCC_FINAL_USR_LIBS += libgfortran
# fortran needs quadmath on x86 and x86_64
ifeq ($(BR2_TOOLCHAIN_HAS_LIBQUADMATH),y)
HOST_GCC_FINAL_USR_LIBS += libquadmath
endif
endif
ifeq ($(BR2_GCC_ENABLE_OPENMP),y)
@@ -195,8 +212,4 @@ endef
HOST_GCC_FINAL_POST_INSTALL_HOOKS += HOST_GCC_FINAL_INSTALL_USR_LIBS
endif
ifeq ($(BR2_xtensa),y)
HOST_GCC_FINAL_CONF_OPTS += --enable-cxx-flags="$(TARGET_ABI)"
endif
$(eval $(host-autotools-package))

View File

@@ -4,9 +4,12 @@ sha512 78696b287d46aacd6f150920da376ea32f58ad9f0dafd2d3b7fa6dbdd8dd7afe659108d1
sha512 dfcb737073191e628231031a3571ec77ee760a59377630f4a6e4fdfa66f9ddad39fde47e3f0f227eb43cdf90e0d34cde5abdc9ac892c1e111a911062a66c9189 gcc-4.7.4.tar.bz2
# From ftp://gcc.gnu.org/pub/gcc/releases/gcc-4.8.5/sha512.sum
sha512 47fdfeca0c0a624cdec9c4ae47137d056c918d5c386d4b96985bb3c8172aba377cb66cbcc30e80832fd244a7d98f562c20198056915c70cfef0977545073a8ea gcc-4.8.5.tar.bz2
# From ftp://gcc.gnu.org/pub/gcc/releases/gcc-4.9.3/sha512.sum
sha512 9ac57377a6975fc7adac704ec81355262b9f537def6955576753b87715470a20ee6a2a3144a79cc8fcba3443f7b44c7337d79d704b522d053f54f79aa6b442df gcc-4.9.3.tar.bz2
# From ftp://gcc.gnu.org/pub/gcc/releases/gcc-5.3.0/sha512.sum
sha512 d619847383405fd389f5a2d7225f97fedb01f81478dbb8339047ccba7561a5c20045ab500a8744bffd19ea51892ce09fc37f862f2cfcb42de0f0f8cd8f8da37a gcc-5.3.0.tar.bz2
# No hash for the ARC variant, comes from the github-helper:
none xxx gcc-arc-2015.12.tar.gz
# From ftp://gcc.gnu.org/pub/gcc/releases/gcc-4.9.4/sha512.sum
sha512 93abb78e16277454f41a8e9810f41f66c0fdffdc539a762ff6b67d3037f78db971378683fd2ebf707d1d51c059fad2161fe42d110c330027f40214b7db0f3efe gcc-4.9.4.tar.bz2
# From ftp://gcc.gnu.org/pub/gcc/releases/gcc-5.4.0/sha512.sum
sha512 2941cc950c8f2409a314df497631f9b0266211aa74746c1839c46e04f1c7c299afe2528d1ef16ea39def408a644ba48f97519ec7a7dd37d260c3e9423514265b gcc-5.4.0.tar.bz2
# From ftp://gcc.gnu.org/pub/gcc/releases/gcc-6.1.0/sha512.sum
sha512 eeed3e2018b8c012aabce419e8d718fde701e5c3c179b4486c61ba46e5736eecc8fccdd18b01fcd973a42c6ad3116dbbe2ee247fe3757d622d373f93ebaf8d2e gcc-6.1.0.tar.bz2
# Locally calculated (fetched from Github)
sha512 a788737022c178a1e7704e4ecd3438937f2239bf27fd487db2b00e4bb5c6604535842e4d6798f120488bdbf0b226fa9c94f4b8aede4ce9d20b0add6bcec82927 gcc-arc-2016.09-eng010.tar.gz

View File

@@ -41,10 +41,18 @@ endef
endif
endif
# gcc is a special package, not named gcc, but gcc-initial and
# gcc-final, but patches are nonetheless stored in package/gcc in the
# tree, and potentially in BR2_GLOBAL_PATCH_DIR directories as well.
define HOST_GCC_APPLY_PATCHES
if test -d package/gcc/$(GCC_VERSION); then \
$(APPLY_PATCHES) $(@D) package/gcc/$(GCC_VERSION) \*.patch ; \
fi;
for patchdir in \
package/gcc/$(GCC_VERSION) \
$(addsuffix /gcc/$(GCC_VERSION),$(call qstrip,$(BR2_GLOBAL_PATCH_DIR))) \
$(addsuffix /gcc,$(call qstrip,$(BR2_GLOBAL_PATCH_DIR))) ; do \
if test -d $${patchdir}; then \
$(APPLY_PATCHES) $(@D) $${patchdir} \*.patch || exit 1; \
fi; \
done
$(HOST_GCC_APPLY_POWERPC_PATCH)
endef
@@ -97,22 +105,6 @@ HOST_GCC_COMMON_CONF_ENV = \
GCC_COMMON_TARGET_CFLAGS = $(TARGET_CFLAGS)
GCC_COMMON_TARGET_CXXFLAGS = $(TARGET_CXXFLAGS)
# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43810
# Workaround until it's fixed in 4.5.4 or later
ifeq ($(ARCH),powerpc)
ifeq ($(findstring x4.5.,x$(GCC_VERSION)),x4.5.)
GCC_COMMON_TARGET_CFLAGS = $(filter-out -Os,$(GCC_COMMON_TARGET_CFLAGS))
GCC_COMMON_TARGET_CXXFLAGS = $(filter-out -Os,$(GCC_COMMON_TARGET_CXXFLAGS))
endif
endif
# Xtensa libgcc can't be built with -mauto-litpools
# because of the trick used to generate .init/.fini sections.
ifeq ($(BR2_xtensa),y)
GCC_COMMON_TARGET_CFLAGS = $(filter-out -mauto-litpools,$(TARGET_CFLAGS))
GCC_COMMON_TARGET_CXXFLAGS = $(filter-out -mauto-litpools,$(TARGET_CXXFLAGS))
endif
# Propagate options used for target software building to GCC target libs
HOST_GCC_COMMON_CONF_ENV += CFLAGS_FOR_TARGET="$(GCC_COMMON_TARGET_CFLAGS)"
HOST_GCC_COMMON_CONF_ENV += CXXFLAGS_FOR_TARGET="$(GCC_COMMON_TARGET_CXXFLAGS)"
@@ -122,8 +114,10 @@ ifeq ($(BR2_sparc_v8)$(BR2_sparc_leon3),y)
HOST_GCC_COMMON_CONF_OPTS += --disable-libitm
endif
# gcc 4.6.x quadmath requires wchar
ifneq ($(BR2_TOOLCHAIN_BUILDROOT_WCHAR),y)
# quadmath support requires wchar
ifeq ($(BR2_USE_WCHAR)$(BR2_TOOLCHAIN_HAS_LIBQUADMATH),yy)
HOST_GCC_COMMON_CONF_OPTS += --enable-libquadmath
else
HOST_GCC_COMMON_CONF_OPTS += --disable-libquadmath
endif
@@ -199,6 +193,7 @@ HOST_GCC_COMMON_CONF_OPTS += --disable-decimal-float
endif
# Determine arch/tune/abi/cpu options
ifeq ($(BR2_GCC_ARCH_HAS_CONFIGURABLE_DEFAULTS),y)
ifneq ($(call qstrip,$(BR2_GCC_TARGET_ARCH)),)
HOST_GCC_COMMON_CONF_OPTS += --with-arch=$(BR2_GCC_TARGET_ARCH)
endif
@@ -227,6 +222,7 @@ GCC_TARGET_MODE = $(call qstrip,$(BR2_GCC_TARGET_MODE))
ifneq ($(GCC_TARGET_MODE),)
HOST_GCC_COMMON_CONF_OPTS += --with-mode=$(GCC_TARGET_MODE)
endif
endif # BR2_GCC_ARCH_HAS_CONFIGURABLE_DEFAULTS
# Enable proper double/long double for SPE ABI
ifeq ($(BR2_powerpc_SPE),y)
@@ -236,6 +232,37 @@ HOST_GCC_COMMON_CONF_OPTS += \
endif
HOST_GCC_COMMON_TOOLCHAIN_WRAPPER_ARGS += -DBR_CROSS_PATH_SUFFIX='".br_real"'
ifeq ($(BR2_GCC_ARCH_HAS_CONFIGURABLE_DEFAULTS),)
ifeq ($(call qstrip,$(BR2_GCC_TARGET_CPU_REVISION)),)
HOST_GCC_COMMON_WRAPPER_TARGET_CPU := $(call qstrip,$(BR2_GCC_TARGET_CPU))
else
HOST_GCC_COMMON_WRAPPER_TARGET_CPU := $(call qstrip,$(BR2_GCC_TARGET_CPU)-$(BR2_GCC_TARGET_CPU_REVISION))
endif
HOST_GCC_COMMON_WRAPPER_TARGET_ARCH := $(call qstrip,$(BR2_GCC_TARGET_ARCH))
HOST_GCC_COMMON_WRAPPER_TARGET_ABI := $(call qstrip,$(BR2_GCC_TARGET_ABI))
HOST_GCC_COMMON_WRAPPER_TARGET_FPU := $(call qstrip,$(BR2_GCC_TARGET_FPU))
HOST_GCC_COMMON_WRAPPER_TARGET_FLOAT_ABI := $(call qstrip,$(BR2_GCC_TARGET_FLOAT_ABI))
HOST_GCC_COMMON_WRAPPER_TARGET_MODE := $(call qstrip,$(BR2_GCC_TARGET_MODE))
ifneq ($(HOST_GCC_COMMON_WRAPPER_TARGET_ARCH),)
HOST_GCC_COMMON_TOOLCHAIN_WRAPPER_ARGS += -DBR_ARCH='"$(HOST_GCC_COMMON_WRAPPER_TARGET_ARCH)"'
endif
ifneq ($(HOST_GCC_COMMON_WRAPPER_TARGET_CPU),)
HOST_GCC_COMMON_TOOLCHAIN_WRAPPER_ARGS += -DBR_CPU='"$(HOST_GCC_COMMON_WRAPPER_TARGET_CPU)"'
endif
ifneq ($(HOST_GCC_COMMON_WRAPPER_TARGET_ABI),)
HOST_GCC_COMMON_TOOLCHAIN_WRAPPER_ARGS += -DBR_ABI='"$(HOST_GCC_COMMON_WRAPPER_TARGET_ABI)"'
endif
ifneq ($(HOST_GCC_COMMON_WRAPPER_TARGET_FPU),)
HOST_GCC_COMMON_TOOLCHAIN_WRAPPER_ARGS += -DBR_FPU='"$(HOST_GCC_COMMON_WRAPPER_TARGET_FPU)"'
endif
ifneq ($(HOST_GCC_COMMON_WRAPPER_TARGET_FLOATABI_),)
HOST_GCC_COMMON_TOOLCHAIN_WRAPPER_ARGS += -DBR_FLOAT_ABI='"$(HOST_GCC_COMMON_WRAPPER_TARGET_FLOATABI_)"'
endif
ifneq ($(HOST_GCC_COMMON_WRAPPER_TARGET_MODE),)
HOST_GCC_COMMON_TOOLCHAIN_WRAPPER_ARGS += -DBR_MODE='"$(HOST_GCC_COMMON_WRAPPER_TARGET_MODE)"'
endif
endif # !BR2_GCC_ARCH_HAS_CONFIGURABLE_DEFAULTS
# For gcc-initial, we need to tell gcc that the C library will be
# providing the ssp support, as it can't guess it since the C library
@@ -249,13 +276,19 @@ HOST_GCC_COMMON_MAKE_OPTS = \
ifeq ($(BR2_CCACHE),y)
HOST_GCC_COMMON_CCACHE_HASH_FILES += $(DL_DIR)/$(GCC_SOURCE)
# Cfr. PATCH_BASE_DIRS in .stamp_patched, but we catch both versioned and
# unversioned patches unconditionally
# Cfr. PATCH_BASE_DIRS in .stamp_patched, but we catch both versioned
# and unversioned patches unconditionally. Moreover, to facilitate the
# addition of gcc patches in BR2_GLOBAL_PATCH_DIR, we allow them to be
# stored in a sub-directory called 'gcc' even if it's not technically
# the name of the package.
HOST_GCC_COMMON_CCACHE_HASH_FILES += \
$(sort $(wildcard \
package/gcc/$(GCC_VERSION)/*.patch \
$(addsuffix $((PKG)_RAWNAME)/$(GCC_VERSION)/*.patch,$(call qstrip,$(BR2_GLOBAL_PATCH_DIR))) \
$(addsuffix $((PKG)_RAWNAME)/*.patch,$(call qstrip,$(BR2_GLOBAL_PATCH_DIR)))))
$(addsuffix /$($(PKG)_RAWNAME)/$(GCC_VERSION)/*.patch,$(call qstrip,$(BR2_GLOBAL_PATCH_DIR))) \
$(addsuffix /$($(PKG)_RAWNAME)/*.patch,$(call qstrip,$(BR2_GLOBAL_PATCH_DIR))) \
$(addsuffix /gcc/$(GCC_VERSION)/*.patch,$(call qstrip,$(BR2_GLOBAL_PATCH_DIR))) \
$(addsuffix /gcc/*.patch,$(call qstrip,$(BR2_GLOBAL_PATCH_DIR)))))
ifeq ($(BR2_xtensa),y)
HOST_GCC_COMMON_CCACHE_HASH_FILES += $(HOST_GCC_XTENSA_OVERLAY_TAR)
endif
@@ -281,6 +314,8 @@ endif # BR2_CCACHE
# used. However, we should not add the toolchain wrapper for them, and they
# match the *cc-* pattern. Therefore, an additional case is added for *-ar,
# *-ranlib and *-nm.
# According to gfortran manpage, it supports all options supported by gcc, so
# add gfortran to the list of the program called via the Buildroot wrapper.
# Avoid that a .br_real is symlinked a second time.
# Also create <arch>-linux-<tool> symlinks.
define HOST_GCC_INSTALL_WRAPPER_AND_SIMPLE_SYMLINKS
@@ -292,7 +327,7 @@ define HOST_GCC_INSTALL_WRAPPER_AND_SIMPLE_SYMLINKS
*-ar|*-ranlib|*-nm) \
ln -snf $$i $(ARCH)-linux$${i##$(GNU_TARGET_NAME)}; \
;; \
*cc|*cc-*|*++|*++-*|*cpp) \
*cc|*cc-*|*++|*++-*|*cpp|*-gfortran) \
rm -f $$i.br_real; \
mv $$i $$i.br_real; \
ln -sf toolchain-wrapper $$i; \