diff options
Diffstat (limited to 'toolchain/gcc')
-rw-r--r-- | toolchain/gcc/Makefile | 19 | ||||
-rw-r--r-- | toolchain/gcc/Makefile.inc | 73 | ||||
-rw-r--r-- | toolchain/gcc/patches/10.5.0/revert-sparc.patch | 283 | ||||
-rw-r--r-- | toolchain/gcc/patches/11.4.0/revert.sparc | 283 | ||||
-rw-r--r-- | toolchain/gcc/patches/13.3.0/csky.patch (renamed from toolchain/gcc/patches/13.2.0/csky.patch) | 0 | ||||
-rw-r--r-- | toolchain/gcc/patches/13.3.0/nios2-softfp.patch (renamed from toolchain/gcc/patches/13.2.0/nios2-softfp.patch) | 0 | ||||
-rw-r--r-- | toolchain/gcc/patches/14.2.0/add-crtreloc.frv | 12 | ||||
-rw-r--r-- | toolchain/gcc/patches/14.2.0/csky.patch | 12 | ||||
-rw-r--r-- | toolchain/gcc/patches/14.2.0/libgcc-fdpic-bfin.patch | 12 | ||||
-rw-r--r-- | toolchain/gcc/patches/14.2.0/nios2-softfp.patch | 14 | ||||
-rw-r--r-- | toolchain/gcc/patches/15.1.0/add-crtreloc.frv | 12 | ||||
-rw-r--r-- | toolchain/gcc/patches/15.1.0/csky.patch | 12 | ||||
-rw-r--r-- | toolchain/gcc/patches/15.1.0/libgcc-fdpic-bfin.patch | 12 | ||||
-rw-r--r-- | toolchain/gcc/patches/4.9.3/nds32.patch | 383894 |
14 files changed, 384060 insertions, 578 deletions
diff --git a/toolchain/gcc/Makefile b/toolchain/gcc/Makefile index 175af8aae..51fc1fe8b 100644 --- a/toolchain/gcc/Makefile +++ b/toolchain/gcc/Makefile @@ -132,8 +132,10 @@ GCC_CONFOPTS+= --with-arch=$(ADK_TARGET_GCC_ARCH) endif ifneq ($(ADK_TARGET_FLOAT),) +ifneq ($(ADK_TARGET_ARCH_OR1K),y) GCC_CONFOPTS+= --with-float=$(ADK_TARGET_FLOAT) endif +endif ifneq ($(ADK_TARGET_FPU),) GCC_CONFOPTS+= --with-fpu=$(ADK_TARGET_FPU) @@ -259,6 +261,10 @@ ifneq ($(ADK_TARGET_ABI_RISCV),) GCC_CONFOPTS+= --with-abi=${ADK_TARGET_ABI_RISCV} endif +ifeq ($(ADK_TOOLCHAIN_GCC_NDS32),y) +EXTRA_CXXFLAGS:= --std=c++03 +endif + ifeq (${ADK_MAKE_PARALLEL},y) GCC_MAKEOPTS+= -j${ADK_MAKE_JOBS} endif @@ -286,8 +292,13 @@ GCC_BUILD_DIR_FINAL:= $(WRKBUILD)-final $(GCC_BUILD_DIR_INITIAL)/.configured: ifeq ($(ADK_TARGET_ARCH_XTENSA),y) +ifeq ($(ADK_TARGET_ABI),) tar xf $(ADK_TOPDIR)/target/xtensa/overlay/xtensa_$(ADK_TARGET_CPU_TYPE).tar \ --strip-components=1 -C $(WRKSRC) gcc +else + tar xf $(ADK_TOPDIR)/target/xtensa/overlay/xtensa_$(ADK_TARGET_CPU_TYPE)_$(ADK_TARGET_ABI).tar \ + --strip-components=1 -C $(WRKSRC) gcc +endif endif mkdir -p $(GCC_BUILD_DIR_INITIAL) # these symlinks are very important, do not remove @@ -315,7 +326,7 @@ ifeq ($(ADK_TARGET_CPU_SH_SH4A),y) (cd ${STAGING_TARGET_DIR}/ && ln -sf . m4a) endif endif -ifeq ($(ADK_TARGET_ARCH_M68K),y) +ifeq ($(ADK_TARGET_CPU_CF),y) # Need to get gcc to generate _all_ the multilib variants # (so both MMU and non-mmu M68k and ColdFire). $(SED) 's/M68K_MLIB_CPU +=/#M68K_MLIB_CPU +=/' $(WRKBUILD)/gcc/config/m68k/t-m68k @@ -327,7 +338,7 @@ endif CC='$(HOST_CC)' \ CXX='$(HOST_CXX)' \ CFLAGS="-O0 -g0 -fomit-frame-pointer" \ - CXXFLAGS="-O0 -g0 -fomit-frame-pointer" \ + CXXFLAGS="-O0 -g0 -fomit-frame-pointer $(EXTRA_CXXFLAGS)" \ $(WRKBUILD)/configure \ ${GCC_INITIAL_CONFOPTS} \ ${GCC_CONFOPTS} \ @@ -368,7 +379,7 @@ $(WRKBUILD)/.compiled: cd $(GCC_BUILD_DIR_FINAL); \ PATH='$(TARGET_PATH)' \ CC='$(HOST_CC)' \ - CXX='$(HOST_CXX)' \ + CXX='$(HOST_CXX) $(EXTRA_CXXFLAGS)' \ CFLAGS_FOR_TARGET='$(TARGET_CFLAGS)' \ CXXFLAGS_FOR_TARGET='$(TARGET_CXXFLAGS)' \ $(WRKBUILD)/configure \ @@ -390,7 +401,7 @@ $(WRKBUILD)/.installed: $(WRKBUILD)/.compiled # remove duplicate tools, convert hardlinks to symlinks set -e; \ cd $(TOOLCHAIN_DIR)/usr/$(GNU_TARGET_NAME)/bin; \ - for app in ar as c++ g++ gcc ld ld.gold ld.bfd nm objcopy objdump ranlib strip; do \ + for app in ar as c++ g++ gcc ld ld.bfd nm objcopy objdump ranlib strip; do \ ln -sf ../../bin/$(GNU_TARGET_NAME)-$${app} $${app}; \ done; (cd $(TOOLCHAIN_DIR)/usr/bin && \ diff --git a/toolchain/gcc/Makefile.inc b/toolchain/gcc/Makefile.inc index b6c24865a..e88b0ed10 100644 --- a/toolchain/gcc/Makefile.inc +++ b/toolchain/gcc/Makefile.inc @@ -2,25 +2,41 @@ # material, please see the LICENCE file in the top-level directory. PKG_NAME:= gcc +ifeq ($(ADK_TOOLCHAIN_GCC_15),y) +PKG_VERSION:= 15.1.0 +PKG_HASH:= 51b9919ea69c980d7a381db95d4be27edf73b21254eb13d752a08003b4d013b1 +PKG_SITES:= ${MASTER_SITE_GNU:=gcc/gcc-${PKG_VERSION}/} +PKG_RELEASE:= 1 +DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.gz +LIBSTDCXXVER:= 30 +endif +ifeq ($(ADK_TOOLCHAIN_GCC_14),y) +PKG_VERSION:= 14.2.0 +PKG_HASH:= 7d376d445f93126dc545e2c0086d0f647c3094aae081cdb78f42ce2bc25e7293 +PKG_SITES:= ${MASTER_SITE_GNU:=gcc/gcc-${PKG_VERSION}/} +PKG_RELEASE:= 1 +DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.gz +LIBSTDCXXVER:= 30 +endif ifeq ($(ADK_TOOLCHAIN_GCC_13),y) -PKG_VERSION:= 13.2.0 -PKG_HASH:= 8cb4be3796651976f94b9356fa08d833524f62420d6292c5033a9a26af315078 +PKG_VERSION:= 13.3.0 +PKG_HASH:= 3a2b10cab86e32358fdac871546d57e2700e9bdb5875ef33fff5b601265b9e32 PKG_SITES:= ${MASTER_SITE_GNU:=gcc/gcc-${PKG_VERSION}/} PKG_RELEASE:= 1 DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.gz LIBSTDCXXVER:= 29 endif ifeq ($(ADK_TOOLCHAIN_GCC_12),y) -PKG_VERSION:= 12.3.0 -PKG_HASH:= 11275aa7bb34cd8ab101d01b341015499f8d9466342a2574ece93f954d92273b +PKG_VERSION:= 12.4.0 +PKG_HASH:= 5a30de2be740062bb3ddd3fd13c9b1bb4584d8f85616d33f23a713439d714148 PKG_SITES:= ${MASTER_SITE_GNU:=gcc/gcc-${PKG_VERSION}/} PKG_RELEASE:= 1 DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.gz LIBSTDCXXVER:= 28 endif ifeq ($(ADK_TOOLCHAIN_GCC_11),y) -PKG_VERSION:= 11.4.0 -PKG_HASH:= af828619dd1970734dda3cfb792ea3f2cba61b5a00170ba8bce4910749d73c07 +PKG_VERSION:= 11.5.0 +PKG_HASH:= 5a447f9a2566d15376beece02270decec8b8c1fcb094b93cb335b23497d58117 PKG_SITES:= ${MASTER_SITE_GNU:=gcc/gcc-${PKG_VERSION}/} PKG_RELEASE:= 1 DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.gz @@ -58,8 +74,32 @@ PKG_RELEASE:= 1 DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.gz LIBSTDCXXVER:= 23 endif +ifeq ($(ADK_TOOLCHAIN_GCC_6),y) +PKG_VERSION:= 6.5.0 +PKG_HASH:= 4eed92b3c24af2e774de94e96993aadbf6761cdf7a0345e59eb826d20a9ebf73 +PKG_SITES:= ${MASTER_SITE_GNU:=gcc/gcc-${PKG_VERSION}/} +PKG_RELEASE:= 1 +DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.gz +LIBSTDCXXVER:= 22 +endif +ifeq ($(ADK_TOOLCHAIN_GCC_5),y) +PKG_VERSION:= 5.5.0 +PKG_HASH:= 3aabce75d6dd206876eced17504b28d47a724c2e430dbd2de176beb948708983 +PKG_SITES:= ${MASTER_SITE_GNU:=gcc/gcc-${PKG_VERSION}/} +PKG_RELEASE:= 1 +DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.gz +LIBSTDCXXVER:= 21 +endif +ifeq ($(ADK_TOOLCHAIN_GCC_4),y) +PKG_VERSION:= 4.9.4 +PKG_HASH:= 1680f92781b92cbdb57d7e4f647c650678c594154cb0d707fd9a994424a9860d +PKG_SITES:= ${MASTER_SITE_GNU:=gcc/gcc-${PKG_VERSION}/} +PKG_RELEASE:= 1 +DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.gz +LIBSTDCXXVER:= 20 +endif ifeq ($(ADK_TOOLCHAIN_GCC_ARC),y) -PKG_VERSION:= arc-2023.09 +PKG_VERSION:= arc-2024.12 PKG_GIT:= tag PKG_SITES:= https://github.com/foss-for-synopsys-dwc-arc-processors/gcc.git PKG_RELEASE:= 1 @@ -90,6 +130,14 @@ PKG_RELEASE:= 1 DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.gz LIBSTDCXXVER:= 19 endif +ifeq ($(ADK_TOOLCHAIN_GCC_NDS32),y) +PKG_VERSION:= 4.9.3 +PKG_HASH:= e6c63b40877bc756cc7cfe6ca98013eb15f02ec6c8c2cf68e24533ad1203aaba +PKG_SITES:= ${MASTER_SITE_GNU:=gcc/gcc-${PKG_VERSION}/} +PKG_RELEASE:= 1 +DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.gz +LIBSTDCXXVER:= 20 +endif ifeq ($(ADK_TOOLCHAIN_GCC_KVX),y) PKG_VERSION:= f98c17b1e78dd3a3da45c0ac1af7b105edf2bf66 PKG_GIT:= hash @@ -97,9 +145,18 @@ PKG_SITES:= https://github.com/kalray/gcc.git PKG_RELEASE:= 1 DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.gz endif +ifeq ($(ADK_TOOLCHAIN_GCC_XTENSA),y) +PKG_VERSION:= xtensa-fdpic-abi-spec-1.4 +PKG_GIT:= tag +PKG_SITES:= https://github.com/jcmvbkbc/gcc-xtensa.git +PKG_RELEASE:= 1 +DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.gz +LIBSTDCXXVER:= 30 +endif ifeq ($(ADK_TOOLCHAIN_GCC_GIT),y) PKG_VERSION:= git PKG_SITES:= https://github.com/gcc-mirror/gcc.git PKG_RELEASE:= 1 -LIBSTDCXXVER:= 23 +LIBSTDCXXVER:= 30 +DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.gz endif diff --git a/toolchain/gcc/patches/10.5.0/revert-sparc.patch b/toolchain/gcc/patches/10.5.0/revert-sparc.patch deleted file mode 100644 index 2ce948c82..000000000 --- a/toolchain/gcc/patches/10.5.0/revert-sparc.patch +++ /dev/null @@ -1,283 +0,0 @@ -diff -Nur gcc-10.3.0.orig/gcc/config/sparc/sparc.c gcc-10.3.0/gcc/config/sparc/sparc.c ---- gcc-10.3.0.orig/gcc/config/sparc/sparc.c 2021-04-08 13:56:28.201742273 +0200 -+++ gcc-10.3.0/gcc/config/sparc/sparc.c 2022-01-24 10:19:53.724121161 +0100 -@@ -4157,6 +4157,13 @@ - static bool - sparc_cannot_force_const_mem (machine_mode mode, rtx x) - { -+ /* After IRA has run in PIC mode, it is too late to put anything into the -+ constant pool if the PIC register hasn't already been initialized. */ -+ if ((lra_in_progress || reload_in_progress) -+ && flag_pic -+ && !crtl->uses_pic_offset_table) -+ return true; -+ - switch (GET_CODE (x)) - { - case CONST_INT: -@@ -4192,11 +4199,9 @@ - } - - /* Global Offset Table support. */ --static GTY(()) rtx got_symbol_rtx = NULL_RTX; --static GTY(()) rtx got_register_rtx = NULL_RTX; - static GTY(()) rtx got_helper_rtx = NULL_RTX; -- --static GTY(()) bool got_helper_needed = false; -+static GTY(()) rtx got_register_rtx = NULL_RTX; -+static GTY(()) rtx got_symbol_rtx = NULL_RTX; - - /* Return the SYMBOL_REF for the Global Offset Table. */ - -@@ -4209,6 +4214,27 @@ - return got_symbol_rtx; - } - -+#ifdef HAVE_GAS_HIDDEN -+# define USE_HIDDEN_LINKONCE 1 -+#else -+# define USE_HIDDEN_LINKONCE 0 -+#endif -+ -+static void -+get_pc_thunk_name (char name[32], unsigned int regno) -+{ -+ const char *reg_name = reg_names[regno]; -+ -+ /* Skip the leading '%' as that cannot be used in a -+ symbol name. */ -+ reg_name += 1; -+ -+ if (USE_HIDDEN_LINKONCE) -+ sprintf (name, "__sparc_get_pc_thunk.%s", reg_name); -+ else -+ ASM_GENERATE_INTERNAL_LABEL (name, "LADDPC", regno); -+} -+ - /* Wrapper around the load_pcrel_sym{si,di} patterns. */ - - static rtx -@@ -4228,78 +4254,30 @@ - return insn; - } - --/* Output the load_pcrel_sym{si,di} patterns. */ -- --const char * --output_load_pcrel_sym (rtx *operands) --{ -- if (flag_delayed_branch) -- { -- output_asm_insn ("sethi\t%%hi(%a1-4), %0", operands); -- output_asm_insn ("call\t%a2", operands); -- output_asm_insn (" add\t%0, %%lo(%a1+4), %0", operands); -- } -- else -- { -- output_asm_insn ("sethi\t%%hi(%a1-8), %0", operands); -- output_asm_insn ("add\t%0, %%lo(%a1-4), %0", operands); -- output_asm_insn ("call\t%a2", operands); -- output_asm_insn (" nop", NULL); -- } -- -- if (operands[2] == got_helper_rtx) -- got_helper_needed = true; -- -- return ""; --} -- --#ifdef HAVE_GAS_HIDDEN --# define USE_HIDDEN_LINKONCE 1 --#else --# define USE_HIDDEN_LINKONCE 0 --#endif -- - /* Emit code to load the GOT register. */ - - void - load_got_register (void) - { -- rtx insn; -+ if (!got_register_rtx) -+ got_register_rtx = gen_rtx_REG (Pmode, GLOBAL_OFFSET_TABLE_REGNUM); - - if (TARGET_VXWORKS_RTP) -- { -- if (!got_register_rtx) -- got_register_rtx = pic_offset_table_rtx; -- -- insn = gen_vxworks_load_got (); -- } -+ emit_insn (gen_vxworks_load_got ()); - else - { -- if (!got_register_rtx) -- got_register_rtx = gen_rtx_REG (Pmode, GLOBAL_OFFSET_TABLE_REGNUM); -- - /* The GOT symbol is subject to a PC-relative relocation so we need a - helper function to add the PC value and thus get the final value. */ - if (!got_helper_rtx) - { - char name[32]; -- -- /* Skip the leading '%' as that cannot be used in a symbol name. */ -- if (USE_HIDDEN_LINKONCE) -- sprintf (name, "__sparc_get_pc_thunk.%s", -- reg_names[REGNO (got_register_rtx)] + 1); -- else -- ASM_GENERATE_INTERNAL_LABEL (name, "LADDPC", -- REGNO (got_register_rtx)); -- -+ get_pc_thunk_name (name, GLOBAL_OFFSET_TABLE_REGNUM); - got_helper_rtx = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (name)); - } - -- insn -- = gen_load_pcrel_sym (got_register_rtx, sparc_got (), got_helper_rtx); -+ emit_insn (gen_load_pcrel_sym (got_register_rtx, sparc_got (), -+ got_helper_rtx)); - } -- -- emit_insn (insn); - } - - /* Ensure that we are not using patterns that are not OK with PIC. */ -@@ -5464,7 +5442,7 @@ - return true; - - /* GOT register (%l7) if needed. */ -- if (got_register_rtx && regno == REGNO (got_register_rtx)) -+ if (regno == GLOBAL_OFFSET_TABLE_REGNUM && got_register_rtx) - return true; - - /* If the function accesses prior frames, the frame pointer and the return -@@ -12507,9 +12485,10 @@ - sparc_file_end (void) - { - /* If we need to emit the special GOT helper function, do so now. */ -- if (got_helper_needed) -+ if (got_helper_rtx) - { - const char *name = XSTR (got_helper_rtx, 0); -+ const char *reg_name = reg_names[GLOBAL_OFFSET_TABLE_REGNUM]; - #ifdef DWARF2_UNWIND_INFO - bool do_cfi; - #endif -@@ -12546,22 +12525,17 @@ - #ifdef DWARF2_UNWIND_INFO - do_cfi = dwarf2out_do_cfi_asm (); - if (do_cfi) -- output_asm_insn (".cfi_startproc", NULL); -+ fprintf (asm_out_file, "\t.cfi_startproc\n"); - #endif - if (flag_delayed_branch) -- { -- output_asm_insn ("jmp\t%%o7+8", NULL); -- output_asm_insn (" add\t%%o7, %0, %0", &got_register_rtx); -- } -+ fprintf (asm_out_file, "\tjmp\t%%o7+8\n\t add\t%%o7, %s, %s\n", -+ reg_name, reg_name); - else -- { -- output_asm_insn ("add\t%%o7, %0, %0", &got_register_rtx); -- output_asm_insn ("jmp\t%%o7+8", NULL); -- output_asm_insn (" nop", NULL); -- } -+ fprintf (asm_out_file, "\tadd\t%%o7, %s, %s\n\tjmp\t%%o7+8\n\t nop\n", -+ reg_name, reg_name); - #ifdef DWARF2_UNWIND_INFO - if (do_cfi) -- output_asm_insn (".cfi_endproc", NULL); -+ fprintf (asm_out_file, "\t.cfi_endproc\n"); - #endif - } - -@@ -13056,10 +13030,7 @@ - edge entry_edge; - rtx_insn *seq; - -- /* In PIC mode, we need to always initialize the PIC register if optimization -- is enabled, because we are called from IRA and LRA may later force things -- to the constant pool for optimization purposes. */ -- if (!flag_pic || (!crtl->uses_pic_offset_table && !optimize)) -+ if (!crtl->uses_pic_offset_table) - return; - - start_sequence (); -diff -Nur gcc-10.3.0.orig/gcc/config/sparc/sparc.md gcc-10.3.0/gcc/config/sparc/sparc.md ---- gcc-10.3.0.orig/gcc/config/sparc/sparc.md 2021-04-08 13:56:28.205742322 +0200 -+++ gcc-10.3.0/gcc/config/sparc/sparc.md 2022-01-24 10:19:54.504102046 +0100 -@@ -1601,7 +1601,10 @@ - (clobber (reg:P O7_REG))] - "REGNO (operands[0]) == INTVAL (operands[3])" - { -- return output_load_pcrel_sym (operands); -+ if (flag_delayed_branch) -+ return "sethi\t%%hi(%a1-4), %0\n\tcall\t%a2\n\t add\t%0, %%lo(%a1+4), %0"; -+ else -+ return "sethi\t%%hi(%a1-8), %0\n\tadd\t%0, %%lo(%a1-4), %0\n\tcall\t%a2\n\t nop"; - } - [(set (attr "type") (const_string "multi")) - (set (attr "length") -diff -Nur gcc-10.3.0.orig/gcc/config/sparc/sparc-protos.h gcc-10.3.0/gcc/config/sparc/sparc-protos.h ---- gcc-10.3.0.orig/gcc/config/sparc/sparc-protos.h 2021-04-08 13:56:28.201742273 +0200 -+++ gcc-10.3.0/gcc/config/sparc/sparc-protos.h 2022-01-24 10:19:54.548100968 +0100 -@@ -69,7 +69,6 @@ - extern void sparc_split_mem_reg (rtx, rtx, machine_mode); - extern int sparc_split_reg_reg_legitimate (rtx, rtx); - extern void sparc_split_reg_reg (rtx, rtx, machine_mode); --extern const char *output_load_pcrel_sym (rtx *); - extern const char *output_ubranch (rtx, rtx_insn *); - extern const char *output_cbranch (rtx, rtx, int, int, int, rtx_insn *); - extern const char *output_return (rtx_insn *); -diff -Nur gcc-10.3.0.orig/gcc/testsuite/gcc.c-torture/compile/20191108-1.c gcc-10.3.0/gcc/testsuite/gcc.c-torture/compile/20191108-1.c ---- gcc-10.3.0.orig/gcc/testsuite/gcc.c-torture/compile/20191108-1.c 2021-04-08 13:56:28.929751064 +0200 -+++ gcc-10.3.0/gcc/testsuite/gcc.c-torture/compile/20191108-1.c 1970-01-01 01:00:00.000000000 +0100 -@@ -1,14 +0,0 @@ --/* PR target/92095 */ --/* Testcase by Sergei Trofimovich <slyfox@inbox.ru> */ -- --typedef union { -- double a; -- int b[2]; --} c; -- --double d(int e) --{ -- c f; -- (&f)->b[0] = 15728640; -- return e ? -(&f)->a : (&f)->a; --} -diff -Nur gcc-10.3.0.orig/gcc/testsuite/gcc.target/sparc/overflow-3.c gcc-10.3.0/gcc/testsuite/gcc.target/sparc/overflow-3.c ---- gcc-10.3.0.orig/gcc/testsuite/gcc.target/sparc/overflow-3.c 2021-04-08 13:56:29.453757389 +0200 -+++ gcc-10.3.0/gcc/testsuite/gcc.target/sparc/overflow-3.c 2022-01-24 10:19:54.688097536 +0100 -@@ -1,6 +1,6 @@ - /* { dg-do compile } */ - /* { dg-require-effective-target lp64 } */ --/* { dg-options "-O -fno-pie" } */ -+/* { dg-options "-O" } */ - - #include <stdbool.h> - #include <stdint.h> -diff -Nur gcc-10.3.0.orig/gcc/testsuite/gcc.target/sparc/overflow-4.c gcc-10.3.0/gcc/testsuite/gcc.target/sparc/overflow-4.c ---- gcc-10.3.0.orig/gcc/testsuite/gcc.target/sparc/overflow-4.c 2021-04-08 13:56:29.453757389 +0200 -+++ gcc-10.3.0/gcc/testsuite/gcc.target/sparc/overflow-4.c 2022-01-24 10:19:55.336081656 +0100 -@@ -1,6 +1,6 @@ - /* { dg-do compile } */ - /* { dg-require-effective-target lp64 } */ --/* { dg-options "-O -fno-pie -mno-vis3 -mno-vis4" } */ -+/* { dg-options "-O -mno-vis3 -mno-vis4" } */ - - #include <stdbool.h> - #include <stdint.h> -diff -Nur gcc-10.3.0.orig/gcc/testsuite/gcc.target/sparc/overflow-5.c gcc-10.3.0/gcc/testsuite/gcc.target/sparc/overflow-5.c ---- gcc-10.3.0.orig/gcc/testsuite/gcc.target/sparc/overflow-5.c 2021-04-08 13:56:29.453757389 +0200 -+++ gcc-10.3.0/gcc/testsuite/gcc.target/sparc/overflow-5.c 2022-01-24 10:19:55.336081656 +0100 -@@ -1,6 +1,6 @@ - /* { dg-do compile } */ - /* { dg-require-effective-target lp64 } */ --/* { dg-options "-O -fno-pie -mvis3" } */ -+/* { dg-options "-O -mvis3" } */ - - #include <stdbool.h> - #include <stdint.h> diff --git a/toolchain/gcc/patches/11.4.0/revert.sparc b/toolchain/gcc/patches/11.4.0/revert.sparc deleted file mode 100644 index 2ce948c82..000000000 --- a/toolchain/gcc/patches/11.4.0/revert.sparc +++ /dev/null @@ -1,283 +0,0 @@ -diff -Nur gcc-10.3.0.orig/gcc/config/sparc/sparc.c gcc-10.3.0/gcc/config/sparc/sparc.c ---- gcc-10.3.0.orig/gcc/config/sparc/sparc.c 2021-04-08 13:56:28.201742273 +0200 -+++ gcc-10.3.0/gcc/config/sparc/sparc.c 2022-01-24 10:19:53.724121161 +0100 -@@ -4157,6 +4157,13 @@ - static bool - sparc_cannot_force_const_mem (machine_mode mode, rtx x) - { -+ /* After IRA has run in PIC mode, it is too late to put anything into the -+ constant pool if the PIC register hasn't already been initialized. */ -+ if ((lra_in_progress || reload_in_progress) -+ && flag_pic -+ && !crtl->uses_pic_offset_table) -+ return true; -+ - switch (GET_CODE (x)) - { - case CONST_INT: -@@ -4192,11 +4199,9 @@ - } - - /* Global Offset Table support. */ --static GTY(()) rtx got_symbol_rtx = NULL_RTX; --static GTY(()) rtx got_register_rtx = NULL_RTX; - static GTY(()) rtx got_helper_rtx = NULL_RTX; -- --static GTY(()) bool got_helper_needed = false; -+static GTY(()) rtx got_register_rtx = NULL_RTX; -+static GTY(()) rtx got_symbol_rtx = NULL_RTX; - - /* Return the SYMBOL_REF for the Global Offset Table. */ - -@@ -4209,6 +4214,27 @@ - return got_symbol_rtx; - } - -+#ifdef HAVE_GAS_HIDDEN -+# define USE_HIDDEN_LINKONCE 1 -+#else -+# define USE_HIDDEN_LINKONCE 0 -+#endif -+ -+static void -+get_pc_thunk_name (char name[32], unsigned int regno) -+{ -+ const char *reg_name = reg_names[regno]; -+ -+ /* Skip the leading '%' as that cannot be used in a -+ symbol name. */ -+ reg_name += 1; -+ -+ if (USE_HIDDEN_LINKONCE) -+ sprintf (name, "__sparc_get_pc_thunk.%s", reg_name); -+ else -+ ASM_GENERATE_INTERNAL_LABEL (name, "LADDPC", regno); -+} -+ - /* Wrapper around the load_pcrel_sym{si,di} patterns. */ - - static rtx -@@ -4228,78 +4254,30 @@ - return insn; - } - --/* Output the load_pcrel_sym{si,di} patterns. */ -- --const char * --output_load_pcrel_sym (rtx *operands) --{ -- if (flag_delayed_branch) -- { -- output_asm_insn ("sethi\t%%hi(%a1-4), %0", operands); -- output_asm_insn ("call\t%a2", operands); -- output_asm_insn (" add\t%0, %%lo(%a1+4), %0", operands); -- } -- else -- { -- output_asm_insn ("sethi\t%%hi(%a1-8), %0", operands); -- output_asm_insn ("add\t%0, %%lo(%a1-4), %0", operands); -- output_asm_insn ("call\t%a2", operands); -- output_asm_insn (" nop", NULL); -- } -- -- if (operands[2] == got_helper_rtx) -- got_helper_needed = true; -- -- return ""; --} -- --#ifdef HAVE_GAS_HIDDEN --# define USE_HIDDEN_LINKONCE 1 --#else --# define USE_HIDDEN_LINKONCE 0 --#endif -- - /* Emit code to load the GOT register. */ - - void - load_got_register (void) - { -- rtx insn; -+ if (!got_register_rtx) -+ got_register_rtx = gen_rtx_REG (Pmode, GLOBAL_OFFSET_TABLE_REGNUM); - - if (TARGET_VXWORKS_RTP) -- { -- if (!got_register_rtx) -- got_register_rtx = pic_offset_table_rtx; -- -- insn = gen_vxworks_load_got (); -- } -+ emit_insn (gen_vxworks_load_got ()); - else - { -- if (!got_register_rtx) -- got_register_rtx = gen_rtx_REG (Pmode, GLOBAL_OFFSET_TABLE_REGNUM); -- - /* The GOT symbol is subject to a PC-relative relocation so we need a - helper function to add the PC value and thus get the final value. */ - if (!got_helper_rtx) - { - char name[32]; -- -- /* Skip the leading '%' as that cannot be used in a symbol name. */ -- if (USE_HIDDEN_LINKONCE) -- sprintf (name, "__sparc_get_pc_thunk.%s", -- reg_names[REGNO (got_register_rtx)] + 1); -- else -- ASM_GENERATE_INTERNAL_LABEL (name, "LADDPC", -- REGNO (got_register_rtx)); -- -+ get_pc_thunk_name (name, GLOBAL_OFFSET_TABLE_REGNUM); - got_helper_rtx = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (name)); - } - -- insn -- = gen_load_pcrel_sym (got_register_rtx, sparc_got (), got_helper_rtx); -+ emit_insn (gen_load_pcrel_sym (got_register_rtx, sparc_got (), -+ got_helper_rtx)); - } -- -- emit_insn (insn); - } - - /* Ensure that we are not using patterns that are not OK with PIC. */ -@@ -5464,7 +5442,7 @@ - return true; - - /* GOT register (%l7) if needed. */ -- if (got_register_rtx && regno == REGNO (got_register_rtx)) -+ if (regno == GLOBAL_OFFSET_TABLE_REGNUM && got_register_rtx) - return true; - - /* If the function accesses prior frames, the frame pointer and the return -@@ -12507,9 +12485,10 @@ - sparc_file_end (void) - { - /* If we need to emit the special GOT helper function, do so now. */ -- if (got_helper_needed) -+ if (got_helper_rtx) - { - const char *name = XSTR (got_helper_rtx, 0); -+ const char *reg_name = reg_names[GLOBAL_OFFSET_TABLE_REGNUM]; - #ifdef DWARF2_UNWIND_INFO - bool do_cfi; - #endif -@@ -12546,22 +12525,17 @@ - #ifdef DWARF2_UNWIND_INFO - do_cfi = dwarf2out_do_cfi_asm (); - if (do_cfi) -- output_asm_insn (".cfi_startproc", NULL); -+ fprintf (asm_out_file, "\t.cfi_startproc\n"); - #endif - if (flag_delayed_branch) -- { -- output_asm_insn ("jmp\t%%o7+8", NULL); -- output_asm_insn (" add\t%%o7, %0, %0", &got_register_rtx); -- } -+ fprintf (asm_out_file, "\tjmp\t%%o7+8\n\t add\t%%o7, %s, %s\n", -+ reg_name, reg_name); - else -- { -- output_asm_insn ("add\t%%o7, %0, %0", &got_register_rtx); -- output_asm_insn ("jmp\t%%o7+8", NULL); -- output_asm_insn (" nop", NULL); -- } -+ fprintf (asm_out_file, "\tadd\t%%o7, %s, %s\n\tjmp\t%%o7+8\n\t nop\n", -+ reg_name, reg_name); - #ifdef DWARF2_UNWIND_INFO - if (do_cfi) -- output_asm_insn (".cfi_endproc", NULL); -+ fprintf (asm_out_file, "\t.cfi_endproc\n"); - #endif - } - -@@ -13056,10 +13030,7 @@ - edge entry_edge; - rtx_insn *seq; - -- /* In PIC mode, we need to always initialize the PIC register if optimization -- is enabled, because we are called from IRA and LRA may later force things -- to the constant pool for optimization purposes. */ -- if (!flag_pic || (!crtl->uses_pic_offset_table && !optimize)) -+ if (!crtl->uses_pic_offset_table) - return; - - start_sequence (); -diff -Nur gcc-10.3.0.orig/gcc/config/sparc/sparc.md gcc-10.3.0/gcc/config/sparc/sparc.md ---- gcc-10.3.0.orig/gcc/config/sparc/sparc.md 2021-04-08 13:56:28.205742322 +0200 -+++ gcc-10.3.0/gcc/config/sparc/sparc.md 2022-01-24 10:19:54.504102046 +0100 -@@ -1601,7 +1601,10 @@ - (clobber (reg:P O7_REG))] - "REGNO (operands[0]) == INTVAL (operands[3])" - { -- return output_load_pcrel_sym (operands); -+ if (flag_delayed_branch) -+ return "sethi\t%%hi(%a1-4), %0\n\tcall\t%a2\n\t add\t%0, %%lo(%a1+4), %0"; -+ else -+ return "sethi\t%%hi(%a1-8), %0\n\tadd\t%0, %%lo(%a1-4), %0\n\tcall\t%a2\n\t nop"; - } - [(set (attr "type") (const_string "multi")) - (set (attr "length") -diff -Nur gcc-10.3.0.orig/gcc/config/sparc/sparc-protos.h gcc-10.3.0/gcc/config/sparc/sparc-protos.h ---- gcc-10.3.0.orig/gcc/config/sparc/sparc-protos.h 2021-04-08 13:56:28.201742273 +0200 -+++ gcc-10.3.0/gcc/config/sparc/sparc-protos.h 2022-01-24 10:19:54.548100968 +0100 -@@ -69,7 +69,6 @@ - extern void sparc_split_mem_reg (rtx, rtx, machine_mode); - extern int sparc_split_reg_reg_legitimate (rtx, rtx); - extern void sparc_split_reg_reg (rtx, rtx, machine_mode); --extern const char *output_load_pcrel_sym (rtx *); - extern const char *output_ubranch (rtx, rtx_insn *); - extern const char *output_cbranch (rtx, rtx, int, int, int, rtx_insn *); - extern const char *output_return (rtx_insn *); -diff -Nur gcc-10.3.0.orig/gcc/testsuite/gcc.c-torture/compile/20191108-1.c gcc-10.3.0/gcc/testsuite/gcc.c-torture/compile/20191108-1.c ---- gcc-10.3.0.orig/gcc/testsuite/gcc.c-torture/compile/20191108-1.c 2021-04-08 13:56:28.929751064 +0200 -+++ gcc-10.3.0/gcc/testsuite/gcc.c-torture/compile/20191108-1.c 1970-01-01 01:00:00.000000000 +0100 -@@ -1,14 +0,0 @@ --/* PR target/92095 */ --/* Testcase by Sergei Trofimovich <slyfox@inbox.ru> */ -- --typedef union { -- double a; -- int b[2]; --} c; -- --double d(int e) --{ -- c f; -- (&f)->b[0] = 15728640; -- return e ? -(&f)->a : (&f)->a; --} -diff -Nur gcc-10.3.0.orig/gcc/testsuite/gcc.target/sparc/overflow-3.c gcc-10.3.0/gcc/testsuite/gcc.target/sparc/overflow-3.c ---- gcc-10.3.0.orig/gcc/testsuite/gcc.target/sparc/overflow-3.c 2021-04-08 13:56:29.453757389 +0200 -+++ gcc-10.3.0/gcc/testsuite/gcc.target/sparc/overflow-3.c 2022-01-24 10:19:54.688097536 +0100 -@@ -1,6 +1,6 @@ - /* { dg-do compile } */ - /* { dg-require-effective-target lp64 } */ --/* { dg-options "-O -fno-pie" } */ -+/* { dg-options "-O" } */ - - #include <stdbool.h> - #include <stdint.h> -diff -Nur gcc-10.3.0.orig/gcc/testsuite/gcc.target/sparc/overflow-4.c gcc-10.3.0/gcc/testsuite/gcc.target/sparc/overflow-4.c ---- gcc-10.3.0.orig/gcc/testsuite/gcc.target/sparc/overflow-4.c 2021-04-08 13:56:29.453757389 +0200 -+++ gcc-10.3.0/gcc/testsuite/gcc.target/sparc/overflow-4.c 2022-01-24 10:19:55.336081656 +0100 -@@ -1,6 +1,6 @@ - /* { dg-do compile } */ - /* { dg-require-effective-target lp64 } */ --/* { dg-options "-O -fno-pie -mno-vis3 -mno-vis4" } */ -+/* { dg-options "-O -mno-vis3 -mno-vis4" } */ - - #include <stdbool.h> - #include <stdint.h> -diff -Nur gcc-10.3.0.orig/gcc/testsuite/gcc.target/sparc/overflow-5.c gcc-10.3.0/gcc/testsuite/gcc.target/sparc/overflow-5.c ---- gcc-10.3.0.orig/gcc/testsuite/gcc.target/sparc/overflow-5.c 2021-04-08 13:56:29.453757389 +0200 -+++ gcc-10.3.0/gcc/testsuite/gcc.target/sparc/overflow-5.c 2022-01-24 10:19:55.336081656 +0100 -@@ -1,6 +1,6 @@ - /* { dg-do compile } */ - /* { dg-require-effective-target lp64 } */ --/* { dg-options "-O -fno-pie -mvis3" } */ -+/* { dg-options "-O -mvis3" } */ - - #include <stdbool.h> - #include <stdint.h> diff --git a/toolchain/gcc/patches/13.2.0/csky.patch b/toolchain/gcc/patches/13.3.0/csky.patch index ee352951b..ee352951b 100644 --- a/toolchain/gcc/patches/13.2.0/csky.patch +++ b/toolchain/gcc/patches/13.3.0/csky.patch diff --git a/toolchain/gcc/patches/13.2.0/nios2-softfp.patch b/toolchain/gcc/patches/13.3.0/nios2-softfp.patch index c677c6c2f..c677c6c2f 100644 --- a/toolchain/gcc/patches/13.2.0/nios2-softfp.patch +++ b/toolchain/gcc/patches/13.3.0/nios2-softfp.patch diff --git a/toolchain/gcc/patches/14.2.0/add-crtreloc.frv b/toolchain/gcc/patches/14.2.0/add-crtreloc.frv new file mode 100644 index 000000000..30de24cdc --- /dev/null +++ b/toolchain/gcc/patches/14.2.0/add-crtreloc.frv @@ -0,0 +1,12 @@ +diff -Nur gcc-8.3.0.orig/gcc/config/frv/linux.h gcc-8.3.0/gcc/config/frv/linux.h +--- gcc-8.3.0.orig/gcc/config/frv/linux.h 2018-01-03 11:03:58.000000000 +0100 ++++ gcc-8.3.0/gcc/config/frv/linux.h 2019-10-08 10:52:00.176295821 +0200 +@@ -27,7 +27,7 @@ + + #undef STARTFILE_SPEC + #define STARTFILE_SPEC \ +- "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \ ++ "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} crtreloc.o%s \ + crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}" + + #undef ENDFILE_SPEC diff --git a/toolchain/gcc/patches/14.2.0/csky.patch b/toolchain/gcc/patches/14.2.0/csky.patch new file mode 100644 index 000000000..ee352951b --- /dev/null +++ b/toolchain/gcc/patches/14.2.0/csky.patch @@ -0,0 +1,12 @@ +diff -Nur gcc-11.2.0.orig/libgcc/config/csky/linux-atomic.c gcc-11.2.0/libgcc/config/csky/linux-atomic.c +--- gcc-11.2.0.orig/libgcc/config/csky/linux-atomic.c 2021-07-28 08:55:08.760307899 +0200 ++++ gcc-11.2.0/libgcc/config/csky/linux-atomic.c 2021-12-14 14:19:23.685729233 +0100 +@@ -24,7 +24,7 @@ + <http://www.gnu.org/licenses/>. */ + + /* Kernel helper for compare-and-exchange. */ +-inline int ++int + __kernel_cmpxchg (int oldval, int newval, volatile int *ptr) + { + register int _a0 asm ("a0") = oldval; diff --git a/toolchain/gcc/patches/14.2.0/libgcc-fdpic-bfin.patch b/toolchain/gcc/patches/14.2.0/libgcc-fdpic-bfin.patch new file mode 100644 index 000000000..df0b94fc9 --- /dev/null +++ b/toolchain/gcc/patches/14.2.0/libgcc-fdpic-bfin.patch @@ -0,0 +1,12 @@ +diff -Nur gcc-14.2.0.orig/libgcc/unwind-pe.h gcc-14.2.0/libgcc/unwind-pe.h +--- gcc-14.2.0.orig/libgcc/unwind-pe.h 2024-08-01 10:17:17.000000000 +0200 ++++ gcc-14.2.0/libgcc/unwind-pe.h 2025-03-10 10:40:25.191585648 +0100 +@@ -264,7 +264,7 @@ + + if (result != 0) + { +-#if __FDPIC__ ++#if defined(__FDPIC__) && !defined(__BFIN_FDPIC__) + /* FDPIC relative addresses imply taking the GOT address + into account. */ + if ((encoding & DW_EH_PE_pcrel) && (encoding & DW_EH_PE_indirect)) diff --git a/toolchain/gcc/patches/14.2.0/nios2-softfp.patch b/toolchain/gcc/patches/14.2.0/nios2-softfp.patch new file mode 100644 index 000000000..c677c6c2f --- /dev/null +++ b/toolchain/gcc/patches/14.2.0/nios2-softfp.patch @@ -0,0 +1,14 @@ +diff -Nur gcc-6.2.0.orig/libgcc/config.host gcc-6.2.0/libgcc/config.host +--- gcc-6.2.0.orig/libgcc/config.host 2016-05-17 08:15:52.000000000 +0200 ++++ gcc-6.2.0/libgcc/config.host 2016-10-15 14:42:53.971919904 +0200 +@@ -962,6 +962,10 @@ + ;; + esac + ;; ++nios2-*-linux-uclibc*) ++ tmake_file="$tmake_file nios2/t-nios2 nios2/t-linux t-libgcc-pic t-slibgcc-libgcc t-softfp-sfdf t-softfp" ++ md_unwind_header=nios2/linux-unwind.h ++ ;; + nios2-*-linux*) + tmake_file="$tmake_file nios2/t-nios2 nios2/t-linux t-libgcc-pic t-slibgcc-libgcc" + md_unwind_header=nios2/linux-unwind.h diff --git a/toolchain/gcc/patches/15.1.0/add-crtreloc.frv b/toolchain/gcc/patches/15.1.0/add-crtreloc.frv new file mode 100644 index 000000000..30de24cdc --- /dev/null +++ b/toolchain/gcc/patches/15.1.0/add-crtreloc.frv @@ -0,0 +1,12 @@ +diff -Nur gcc-8.3.0.orig/gcc/config/frv/linux.h gcc-8.3.0/gcc/config/frv/linux.h +--- gcc-8.3.0.orig/gcc/config/frv/linux.h 2018-01-03 11:03:58.000000000 +0100 ++++ gcc-8.3.0/gcc/config/frv/linux.h 2019-10-08 10:52:00.176295821 +0200 +@@ -27,7 +27,7 @@ + + #undef STARTFILE_SPEC + #define STARTFILE_SPEC \ +- "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \ ++ "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} crtreloc.o%s \ + crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}" + + #undef ENDFILE_SPEC diff --git a/toolchain/gcc/patches/15.1.0/csky.patch b/toolchain/gcc/patches/15.1.0/csky.patch new file mode 100644 index 000000000..ee352951b --- /dev/null +++ b/toolchain/gcc/patches/15.1.0/csky.patch @@ -0,0 +1,12 @@ +diff -Nur gcc-11.2.0.orig/libgcc/config/csky/linux-atomic.c gcc-11.2.0/libgcc/config/csky/linux-atomic.c +--- gcc-11.2.0.orig/libgcc/config/csky/linux-atomic.c 2021-07-28 08:55:08.760307899 +0200 ++++ gcc-11.2.0/libgcc/config/csky/linux-atomic.c 2021-12-14 14:19:23.685729233 +0100 +@@ -24,7 +24,7 @@ + <http://www.gnu.org/licenses/>. */ + + /* Kernel helper for compare-and-exchange. */ +-inline int ++int + __kernel_cmpxchg (int oldval, int newval, volatile int *ptr) + { + register int _a0 asm ("a0") = oldval; diff --git a/toolchain/gcc/patches/15.1.0/libgcc-fdpic-bfin.patch b/toolchain/gcc/patches/15.1.0/libgcc-fdpic-bfin.patch new file mode 100644 index 000000000..df0b94fc9 --- /dev/null +++ b/toolchain/gcc/patches/15.1.0/libgcc-fdpic-bfin.patch @@ -0,0 +1,12 @@ +diff -Nur gcc-14.2.0.orig/libgcc/unwind-pe.h gcc-14.2.0/libgcc/unwind-pe.h +--- gcc-14.2.0.orig/libgcc/unwind-pe.h 2024-08-01 10:17:17.000000000 +0200 ++++ gcc-14.2.0/libgcc/unwind-pe.h 2025-03-10 10:40:25.191585648 +0100 +@@ -264,7 +264,7 @@ + + if (result != 0) + { +-#if __FDPIC__ ++#if defined(__FDPIC__) && !defined(__BFIN_FDPIC__) + /* FDPIC relative addresses imply taking the GOT address + into account. */ + if ((encoding & DW_EH_PE_pcrel) && (encoding & DW_EH_PE_indirect)) |