From deaa4b8ded066f0b32b4d6be28756d2d7d68d7d6 Mon Sep 17 00:00:00 2001 From: kozyilmaz Date: Wed, 24 Aug 2016 11:33:24 +0300 Subject: [PATCH] xgcc: Update gcc 5 to 5.4.0 patches synced with buildroot trunk and: 110-xtensa-implement-trap-pattern.patch (copied to 5.4.0 patches) 130-build_gcc-5_with_gcc-6.patch (upstreamed in 5.4.0, dropped) 370-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch (copied to 5.4.0 patches) 380-gcc-plugin-POSIX-include-sys-select-h.patch (copied to 5.4.0 patches) 910-nios2-bad-multilib-default.patch (copied to 5.4.0 patches) --- config/cc/gcc.in | 6 +- .../5.3.0/130-build_gcc-5_with_gcc-6.patch | 151 --------------- .../{5.3.0 => 5.4.0}/100-uclibc-conf.patch | 0 .../110-xtensa-implement-trap-pattern.patch | 0 ...ix-typo-for-powerpc-e6500-cpu_is_64b.patch | 0 .../301-missing-execinfo_h.patch | 0 ...d-undefined-extern-var-refs-nor-fpic.patch | 0 ...cc-plugin-POSIX-include-sys-select-h.patch | 0 .../810-arm-softfloat-libgcc.patch | 0 .../830-arm_unbreak_armv4t.patch | 0 ...0-microblaze-enable-dwarf-eh-support.patch | 0 .../850-libstdcxx-uclibc-c99.patch | 0 .../gcc/{5.3.0 => 5.4.0}/860-cilk-wchar.patch | 0 ...870-xtensa-add-mauto-litpools-option.patch | 0 ...xtensa-reimplement-register-spilling.patch | 0 ...d-dw2-fde-dip-instead-of-unwind-dw2-.patch | 0 .../873-xtensa-fix-_Unwind_GetCFA.patch | 0 .../874-xtensa-add-uclinux-support.patch | 174 ++++++++++++++++++ patches/gcc/5.4.0/890-fix-m68k-compile.patch | 15 ++ patches/gcc/5.4.0/891-fix-m68k-uclinux.patch | 18 ++ patches/gcc/5.4.0/892-microblaze-uclibc.patch | 24 +++ .../900-libitm-fixes-for-musl-support.patch | 0 ...-fixincludes-update-for-musl-support.patch | 0 .../902-unwind-fix-for-musl.patch | 0 ...libgfortran-gthr-workaround-for-musl.patch | 0 .../904-musl-libc-config.patch | 0 .../905-add-musl-support-to-gcc.patch | 0 .../906-mips-musl-support.patch | 0 .../907-x86-musl-support.patch | 0 .../908-arm-musl-support.patch | 0 .../909-aarch64-musl-support.patch | 0 .../910-nios2-bad-multilib-default.patch | 0 ...libgcc-disable-split-stack-nothreads.patch | 14 ++ .../5.4.0/940-uclinux-enable-threads.patch | 19 ++ 34 files changed, 267 insertions(+), 154 deletions(-) delete mode 100644 patches/gcc/5.3.0/130-build_gcc-5_with_gcc-6.patch rename patches/gcc/{5.3.0 => 5.4.0}/100-uclibc-conf.patch (100%) rename patches/gcc/{5.3.0 => 5.4.0}/110-xtensa-implement-trap-pattern.patch (100%) rename patches/gcc/{5.3.0 => 5.4.0}/120-gcc-config.gcc-fix-typo-for-powerpc-e6500-cpu_is_64b.patch (100%) rename patches/gcc/{5.3.0 => 5.4.0}/301-missing-execinfo_h.patch (100%) rename patches/gcc/{5.3.0 => 5.4.0}/370-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch (100%) rename patches/gcc/{5.3.0 => 5.4.0}/380-gcc-plugin-POSIX-include-sys-select-h.patch (100%) rename patches/gcc/{5.3.0 => 5.4.0}/810-arm-softfloat-libgcc.patch (100%) rename patches/gcc/{5.3.0 => 5.4.0}/830-arm_unbreak_armv4t.patch (100%) rename patches/gcc/{5.3.0 => 5.4.0}/840-microblaze-enable-dwarf-eh-support.patch (100%) rename patches/gcc/{5.3.0 => 5.4.0}/850-libstdcxx-uclibc-c99.patch (100%) rename patches/gcc/{5.3.0 => 5.4.0}/860-cilk-wchar.patch (100%) rename patches/gcc/{5.3.0 => 5.4.0}/870-xtensa-add-mauto-litpools-option.patch (100%) rename patches/gcc/{5.3.0 => 5.4.0}/871-xtensa-reimplement-register-spilling.patch (100%) rename patches/gcc/{5.3.0 => 5.4.0}/872-xtensa-use-unwind-dw2-fde-dip-instead-of-unwind-dw2-.patch (100%) rename patches/gcc/{5.3.0 => 5.4.0}/873-xtensa-fix-_Unwind_GetCFA.patch (100%) create mode 100644 patches/gcc/5.4.0/874-xtensa-add-uclinux-support.patch create mode 100644 patches/gcc/5.4.0/890-fix-m68k-compile.patch create mode 100644 patches/gcc/5.4.0/891-fix-m68k-uclinux.patch create mode 100644 patches/gcc/5.4.0/892-microblaze-uclibc.patch rename patches/gcc/{5.3.0 => 5.4.0}/900-libitm-fixes-for-musl-support.patch (100%) rename patches/gcc/{5.3.0 => 5.4.0}/901-fixincludes-update-for-musl-support.patch (100%) rename patches/gcc/{5.3.0 => 5.4.0}/902-unwind-fix-for-musl.patch (100%) rename patches/gcc/{5.3.0 => 5.4.0}/903-libstdc++-libgfortran-gthr-workaround-for-musl.patch (100%) rename patches/gcc/{5.3.0 => 5.4.0}/904-musl-libc-config.patch (100%) rename patches/gcc/{5.3.0 => 5.4.0}/905-add-musl-support-to-gcc.patch (100%) rename patches/gcc/{5.3.0 => 5.4.0}/906-mips-musl-support.patch (100%) rename patches/gcc/{5.3.0 => 5.4.0}/907-x86-musl-support.patch (100%) rename patches/gcc/{5.3.0 => 5.4.0}/908-arm-musl-support.patch (100%) rename patches/gcc/{5.3.0 => 5.4.0}/909-aarch64-musl-support.patch (100%) rename patches/gcc/{5.3.0 => 5.4.0}/910-nios2-bad-multilib-default.patch (100%) create mode 100644 patches/gcc/5.4.0/930-libgcc-disable-split-stack-nothreads.patch create mode 100644 patches/gcc/5.4.0/940-uclinux-enable-threads.patch diff --git a/config/cc/gcc.in b/config/cc/gcc.in index 1fcdb722..7894ec98 100644 --- a/config/cc/gcc.in +++ b/config/cc/gcc.in @@ -72,9 +72,9 @@ choice # Don't remove next line # CT_INSERT_VERSION_BELOW -config CC_GCC_V_5_3_0 +config CC_GCC_V_5_4_0 bool - prompt "5.3.0" + prompt "5.4.0" select CC_GCC_5 config CC_GCC_V_linaro_5_2 @@ -261,7 +261,7 @@ config CC_GCC_VERSION string # Don't remove next line # CT_INSERT_VERSION_STRING_BELOW - default "5.3.0" if CC_GCC_V_5_3_0 + default "5.4.0" if CC_GCC_V_5_4_0 default "linaro-5.2-2015.11-2" if CC_GCC_V_linaro_5_2 default "linaro-4.9-2015.06" if CC_GCC_V_linaro_4_9 default "4.9.3" if CC_GCC_V_4_9_3 diff --git a/patches/gcc/5.3.0/130-build_gcc-5_with_gcc-6.patch b/patches/gcc/5.3.0/130-build_gcc-5_with_gcc-6.patch deleted file mode 100644 index fbab9eb7..00000000 --- a/patches/gcc/5.3.0/130-build_gcc-5_with_gcc-6.patch +++ /dev/null @@ -1,151 +0,0 @@ -From 1e5f1089dec3af328fd03125d6778f666d0bd4e4 Mon Sep 17 00:00:00 2001 -From: edlinger -Date: Thu, 25 Feb 2016 15:33:50 +0000 -Subject: [PATCH 1/1] 2016-02-25 Bernd Edlinger - - Backported from mainline - 2016-02-19 Jakub Jelinek - Bernd Edlinger - - * 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 ---- - 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 - . */ --#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 ." - #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 - . */ --#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 diff --git a/patches/gcc/5.3.0/100-uclibc-conf.patch b/patches/gcc/5.4.0/100-uclibc-conf.patch similarity index 100% rename from patches/gcc/5.3.0/100-uclibc-conf.patch rename to patches/gcc/5.4.0/100-uclibc-conf.patch diff --git a/patches/gcc/5.3.0/110-xtensa-implement-trap-pattern.patch b/patches/gcc/5.4.0/110-xtensa-implement-trap-pattern.patch similarity index 100% rename from patches/gcc/5.3.0/110-xtensa-implement-trap-pattern.patch rename to patches/gcc/5.4.0/110-xtensa-implement-trap-pattern.patch diff --git a/patches/gcc/5.3.0/120-gcc-config.gcc-fix-typo-for-powerpc-e6500-cpu_is_64b.patch b/patches/gcc/5.4.0/120-gcc-config.gcc-fix-typo-for-powerpc-e6500-cpu_is_64b.patch similarity index 100% rename from patches/gcc/5.3.0/120-gcc-config.gcc-fix-typo-for-powerpc-e6500-cpu_is_64b.patch rename to patches/gcc/5.4.0/120-gcc-config.gcc-fix-typo-for-powerpc-e6500-cpu_is_64b.patch diff --git a/patches/gcc/5.3.0/301-missing-execinfo_h.patch b/patches/gcc/5.4.0/301-missing-execinfo_h.patch similarity index 100% rename from patches/gcc/5.3.0/301-missing-execinfo_h.patch rename to patches/gcc/5.4.0/301-missing-execinfo_h.patch diff --git a/patches/gcc/5.3.0/370-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch b/patches/gcc/5.4.0/370-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch similarity index 100% rename from patches/gcc/5.3.0/370-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch rename to patches/gcc/5.4.0/370-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch diff --git a/patches/gcc/5.3.0/380-gcc-plugin-POSIX-include-sys-select-h.patch b/patches/gcc/5.4.0/380-gcc-plugin-POSIX-include-sys-select-h.patch similarity index 100% rename from patches/gcc/5.3.0/380-gcc-plugin-POSIX-include-sys-select-h.patch rename to patches/gcc/5.4.0/380-gcc-plugin-POSIX-include-sys-select-h.patch diff --git a/patches/gcc/5.3.0/810-arm-softfloat-libgcc.patch b/patches/gcc/5.4.0/810-arm-softfloat-libgcc.patch similarity index 100% rename from patches/gcc/5.3.0/810-arm-softfloat-libgcc.patch rename to patches/gcc/5.4.0/810-arm-softfloat-libgcc.patch diff --git a/patches/gcc/5.3.0/830-arm_unbreak_armv4t.patch b/patches/gcc/5.4.0/830-arm_unbreak_armv4t.patch similarity index 100% rename from patches/gcc/5.3.0/830-arm_unbreak_armv4t.patch rename to patches/gcc/5.4.0/830-arm_unbreak_armv4t.patch diff --git a/patches/gcc/5.3.0/840-microblaze-enable-dwarf-eh-support.patch b/patches/gcc/5.4.0/840-microblaze-enable-dwarf-eh-support.patch similarity index 100% rename from patches/gcc/5.3.0/840-microblaze-enable-dwarf-eh-support.patch rename to patches/gcc/5.4.0/840-microblaze-enable-dwarf-eh-support.patch diff --git a/patches/gcc/5.3.0/850-libstdcxx-uclibc-c99.patch b/patches/gcc/5.4.0/850-libstdcxx-uclibc-c99.patch similarity index 100% rename from patches/gcc/5.3.0/850-libstdcxx-uclibc-c99.patch rename to patches/gcc/5.4.0/850-libstdcxx-uclibc-c99.patch diff --git a/patches/gcc/5.3.0/860-cilk-wchar.patch b/patches/gcc/5.4.0/860-cilk-wchar.patch similarity index 100% rename from patches/gcc/5.3.0/860-cilk-wchar.patch rename to patches/gcc/5.4.0/860-cilk-wchar.patch diff --git a/patches/gcc/5.3.0/870-xtensa-add-mauto-litpools-option.patch b/patches/gcc/5.4.0/870-xtensa-add-mauto-litpools-option.patch similarity index 100% rename from patches/gcc/5.3.0/870-xtensa-add-mauto-litpools-option.patch rename to patches/gcc/5.4.0/870-xtensa-add-mauto-litpools-option.patch diff --git a/patches/gcc/5.3.0/871-xtensa-reimplement-register-spilling.patch b/patches/gcc/5.4.0/871-xtensa-reimplement-register-spilling.patch similarity index 100% rename from patches/gcc/5.3.0/871-xtensa-reimplement-register-spilling.patch rename to patches/gcc/5.4.0/871-xtensa-reimplement-register-spilling.patch diff --git a/patches/gcc/5.3.0/872-xtensa-use-unwind-dw2-fde-dip-instead-of-unwind-dw2-.patch b/patches/gcc/5.4.0/872-xtensa-use-unwind-dw2-fde-dip-instead-of-unwind-dw2-.patch similarity index 100% rename from patches/gcc/5.3.0/872-xtensa-use-unwind-dw2-fde-dip-instead-of-unwind-dw2-.patch rename to patches/gcc/5.4.0/872-xtensa-use-unwind-dw2-fde-dip-instead-of-unwind-dw2-.patch diff --git a/patches/gcc/5.3.0/873-xtensa-fix-_Unwind_GetCFA.patch b/patches/gcc/5.4.0/873-xtensa-fix-_Unwind_GetCFA.patch similarity index 100% rename from patches/gcc/5.3.0/873-xtensa-fix-_Unwind_GetCFA.patch rename to patches/gcc/5.4.0/873-xtensa-fix-_Unwind_GetCFA.patch diff --git a/patches/gcc/5.4.0/874-xtensa-add-uclinux-support.patch b/patches/gcc/5.4.0/874-xtensa-add-uclinux-support.patch new file mode 100644 index 00000000..23db3d86 --- /dev/null +++ b/patches/gcc/5.4.0/874-xtensa-add-uclinux-support.patch @@ -0,0 +1,174 @@ +From 70c2cb98fb129b4766b5da0f945dc41fd568c77a Mon Sep 17 00:00:00 2001 +From: Max Filippov +Date: Sat, 22 Aug 2015 08:44:26 +0300 +Subject: [PATCH] xtensa: add uclinux support + +2015-10-03 Max Filippov +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 +--- +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 ++. */ ++ ++#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 ++; . ++ ++; 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 + diff --git a/patches/gcc/5.4.0/890-fix-m68k-compile.patch b/patches/gcc/5.4.0/890-fix-m68k-compile.patch new file mode 100644 index 00000000..6e63de0c --- /dev/null +++ b/patches/gcc/5.4.0/890-fix-m68k-compile.patch @@ -0,0 +1,15 @@ +remove unused header, which breaks the toolchain building + +Signed-off-by: Waldemar Brodkorb + +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 + #include + + #ifndef __NR_atomic_cmpxchg_32 diff --git a/patches/gcc/5.4.0/891-fix-m68k-uclinux.patch b/patches/gcc/5.4.0/891-fix-m68k-uclinux.patch new file mode 100644 index 00000000..4e186bd3 --- /dev/null +++ b/patches/gcc/5.4.0/891-fix-m68k-uclinux.patch @@ -0,0 +1,18 @@ +avoids internal compiler error while compiling linux-atomic.c +See here: +https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53833 + +Signed-off-by: Waldemar Brodkorb + +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 diff --git a/patches/gcc/5.4.0/892-microblaze-uclibc.patch b/patches/gcc/5.4.0/892-microblaze-uclibc.patch new file mode 100644 index 00000000..a8eb5a69 --- /dev/null +++ b/patches/gcc/5.4.0/892-microblaze-uclibc.patch @@ -0,0 +1,24 @@ +Add dynamic linker support for uClibc + +Signed-off-by: Waldemar Brodkorb + +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 } diff --git a/patches/gcc/5.3.0/900-libitm-fixes-for-musl-support.patch b/patches/gcc/5.4.0/900-libitm-fixes-for-musl-support.patch similarity index 100% rename from patches/gcc/5.3.0/900-libitm-fixes-for-musl-support.patch rename to patches/gcc/5.4.0/900-libitm-fixes-for-musl-support.patch diff --git a/patches/gcc/5.3.0/901-fixincludes-update-for-musl-support.patch b/patches/gcc/5.4.0/901-fixincludes-update-for-musl-support.patch similarity index 100% rename from patches/gcc/5.3.0/901-fixincludes-update-for-musl-support.patch rename to patches/gcc/5.4.0/901-fixincludes-update-for-musl-support.patch diff --git a/patches/gcc/5.3.0/902-unwind-fix-for-musl.patch b/patches/gcc/5.4.0/902-unwind-fix-for-musl.patch similarity index 100% rename from patches/gcc/5.3.0/902-unwind-fix-for-musl.patch rename to patches/gcc/5.4.0/902-unwind-fix-for-musl.patch diff --git a/patches/gcc/5.3.0/903-libstdc++-libgfortran-gthr-workaround-for-musl.patch b/patches/gcc/5.4.0/903-libstdc++-libgfortran-gthr-workaround-for-musl.patch similarity index 100% rename from patches/gcc/5.3.0/903-libstdc++-libgfortran-gthr-workaround-for-musl.patch rename to patches/gcc/5.4.0/903-libstdc++-libgfortran-gthr-workaround-for-musl.patch diff --git a/patches/gcc/5.3.0/904-musl-libc-config.patch b/patches/gcc/5.4.0/904-musl-libc-config.patch similarity index 100% rename from patches/gcc/5.3.0/904-musl-libc-config.patch rename to patches/gcc/5.4.0/904-musl-libc-config.patch diff --git a/patches/gcc/5.3.0/905-add-musl-support-to-gcc.patch b/patches/gcc/5.4.0/905-add-musl-support-to-gcc.patch similarity index 100% rename from patches/gcc/5.3.0/905-add-musl-support-to-gcc.patch rename to patches/gcc/5.4.0/905-add-musl-support-to-gcc.patch diff --git a/patches/gcc/5.3.0/906-mips-musl-support.patch b/patches/gcc/5.4.0/906-mips-musl-support.patch similarity index 100% rename from patches/gcc/5.3.0/906-mips-musl-support.patch rename to patches/gcc/5.4.0/906-mips-musl-support.patch diff --git a/patches/gcc/5.3.0/907-x86-musl-support.patch b/patches/gcc/5.4.0/907-x86-musl-support.patch similarity index 100% rename from patches/gcc/5.3.0/907-x86-musl-support.patch rename to patches/gcc/5.4.0/907-x86-musl-support.patch diff --git a/patches/gcc/5.3.0/908-arm-musl-support.patch b/patches/gcc/5.4.0/908-arm-musl-support.patch similarity index 100% rename from patches/gcc/5.3.0/908-arm-musl-support.patch rename to patches/gcc/5.4.0/908-arm-musl-support.patch diff --git a/patches/gcc/5.3.0/909-aarch64-musl-support.patch b/patches/gcc/5.4.0/909-aarch64-musl-support.patch similarity index 100% rename from patches/gcc/5.3.0/909-aarch64-musl-support.patch rename to patches/gcc/5.4.0/909-aarch64-musl-support.patch diff --git a/patches/gcc/5.3.0/910-nios2-bad-multilib-default.patch b/patches/gcc/5.4.0/910-nios2-bad-multilib-default.patch similarity index 100% rename from patches/gcc/5.3.0/910-nios2-bad-multilib-default.patch rename to patches/gcc/5.4.0/910-nios2-bad-multilib-default.patch diff --git a/patches/gcc/5.4.0/930-libgcc-disable-split-stack-nothreads.patch b/patches/gcc/5.4.0/930-libgcc-disable-split-stack-nothreads.patch new file mode 100644 index 00000000..07f9a739 --- /dev/null +++ b/patches/gcc/5.4.0/930-libgcc-disable-split-stack-nothreads.patch @@ -0,0 +1,14 @@ +disable split-stack for non-thread builds + +Signed-off-by: Waldemar Brodkorb + +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 diff --git a/patches/gcc/5.4.0/940-uclinux-enable-threads.patch b/patches/gcc/5.4.0/940-uclinux-enable-threads.patch new file mode 100644 index 00000000..490a55b4 --- /dev/null +++ b/patches/gcc/5.4.0/940-uclinux-enable-threads.patch @@ -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 + +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*)