diff options
Diffstat (limited to 'toolchain/gcc')
26 files changed, 384585 insertions, 23670 deletions
diff --git a/toolchain/gcc/Makefile b/toolchain/gcc/Makefile index 3f533bad9..51fc1fe8b 100644 --- a/toolchain/gcc/Makefile +++ b/toolchain/gcc/Makefile @@ -26,6 +26,15 @@ ifeq ($(ADK_TARGET_ARCH_ARM),y) TARGET_CFLAGS:= $(filter-out -mcpu=cortex-a9,$(TARGET_CFLAGS)) TARGET_CXXFLAGS:= $(filter-out -mcpu=cortex-a9,$(TARGET_CXXFLAGS)) endif +ifeq ($(ADK_TARGET_ARCH_ARM),y) +TARGET_CFLAGS:= $(filter-out -mcpu=cortex-a7,$(TARGET_CFLAGS)) +TARGET_CXXFLAGS:= $(filter-out -mcpu=cortex-a7,$(TARGET_CXXFLAGS)) +endif + +ifeq ($(ADK_TARGET_ARCH_ARM),y) +TARGET_CFLAGS:= $(filter-out -mcpu=xscale,$(TARGET_CFLAGS)) +TARGET_CXXFLAGS:= $(filter-out -mcpu=xscale,$(TARGET_CXXFLAGS)) +endif ifeq ($(ADK_TARGET_USE_STATIC_AND_SHARED_LIBS),y) TARGET_CFLAGS:= $(filter-out -static,$(TARGET_CFLAGS)) @@ -54,6 +63,7 @@ GCC_CONFOPTS:= --prefix=$(TOOLCHAIN_DIR)/usr \ --disable-libquadmath \ --disable-libquadmath-support \ --disable-decimal-float \ + --disable-gcov \ --disable-libstdcxx-pch \ --disable-ppl-version-check \ --disable-cloog-version-check \ @@ -122,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) @@ -155,10 +167,6 @@ ifeq ($(ADK_TARGET_ARCH_METAG),y) GCC_CONFOPTS+= --with-cpu=2.1 --enable-meta-default --disable-symvers endif -ifeq ($(ADK_TARGET_CPU_CF),y) -GCC_CONFOPTS+= --with-arch=cf --disable-multilib -endif - ifeq ($(ADK_TARGET_ARCH_NDS32),y) GCC_CONFOPTS+= --with-arch=v3 endif @@ -167,6 +175,16 @@ ifeq ($(ADK_TARGET_ARCH_M68K)$(ADK_TARGET_ARCH_X86_64)$(ADK_TARGET_ARCH_X86),) GCC_FINAL_CONFOPTS+= --disable-biarch --disable-multilib endif +ifeq ($(ADK_TARGET_CPU_CF),y) +GCC_CONFOPTS+= --with-arch=cf +GCC_INITIAL_CONFOPTS+= --enable-multilib +ifeq ($(ADK_TARGET_BINFMT_ELF)$(ADK_TARGET_WITH_MMU),y) +GCC_FINAL_CONFOPTS+= --disable-multilib --disable-threads --disable-libatomic +endif +else +GCC_INITIAL_CONFOPTS+= --disable-multilib +endif + ifeq ($(ADK_TARGET_ARCH_SH),y) ifeq ($(ADK_TARGET_LITTLE_ENDIAN),y) @@ -243,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 @@ -270,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 @@ -299,21 +326,27 @@ ifeq ($(ADK_TARGET_CPU_SH_SH4A),y) (cd ${STAGING_TARGET_DIR}/ && ln -sf . m4a) endif endif +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 + $(SED) 's/&& (FLAGS ~ "FL_MMU")//' $(WRKBUILD)/gcc/config/m68k/t-linux +endif $(SED) '/k prot/agcc_cv_libc_provides_ssp=yes' $(WRKBUILD)/gcc/configure cd $(GCC_BUILD_DIR_INITIAL); \ PATH='$(TARGET_PATH)' \ 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} \ ${GCC_TLS_CONFOPTS} \ --enable-languages=c \ --with-newlib \ --disable-shared \ --disable-threads \ - --disable-multilib \ --without-headers touch $@ @@ -346,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 \ @@ -368,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 b765f9b66..e88b0ed10 100644 --- a/toolchain/gcc/Makefile.inc +++ b/toolchain/gcc/Makefile.inc @@ -2,52 +2,109 @@ # 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.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.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.2.0 -PKG_HASH:= d08edc536b54c372a1010ff6619dd274c0f1603aa49212ba20f7aa2cda36fa8b +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.xz +DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.gz LIBSTDCXXVER:= 27 endif ifeq ($(ADK_TOOLCHAIN_GCC_10),y) -PKG_VERSION:= 10.3.0 -PKG_HASH:= 64f404c1a650f27fc33da242e1f2df54952e3963a49e06e73f6940f3223ac344 +PKG_VERSION:= 10.5.0 +PKG_HASH:= eed4dd5fc3cd9f52cb3a51a4fde1728cb19ec76292f559518e83652e7437befe PKG_SITES:= ${MASTER_SITE_GNU:=gcc/gcc-${PKG_VERSION}/} PKG_RELEASE:= 1 -DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.xz +DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.gz LIBSTDCXXVER:= 26 endif ifeq ($(ADK_TOOLCHAIN_GCC_9),y) -PKG_VERSION:= 9.4.0 -PKG_HASH:= c95da32f440378d7751dd95533186f7fc05ceb4fb65eb5b85234e6299eb9838e +PKG_VERSION:= 9.5.0 +PKG_HASH:= 15b34072105272a3eb37f6927409f7ce9aa0dd1498efebc35f851d6e6f029a4d PKG_SITES:= ${MASTER_SITE_GNU:=gcc/gcc-${PKG_VERSION}/} PKG_RELEASE:= 1 -DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.xz +DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.gz LIBSTDCXXVER:= 25 endif ifeq ($(ADK_TOOLCHAIN_GCC_8),y) PKG_VERSION:= 8.5.0 -PKG_HASH:= d308841a511bb830a6100397b0042db24ce11f642dab6ea6ee44842e5325ed50 +PKG_HASH:= 6e6e0628573d2185727a2dd83211d04a2b2748e4a262099099b9c8064634c9ee PKG_SITES:= ${MASTER_SITE_GNU:=gcc/gcc-${PKG_VERSION}/} PKG_RELEASE:= 1 -DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.xz +DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.gz LIBSTDCXXVER:= 24 endif ifeq ($(ADK_TOOLCHAIN_GCC_7),y) PKG_VERSION:= 7.5.0 -PKG_HASH:= b81946e7f01f90528a1f7352ab08cc602b9ccc05d4e44da4bd501c5a189ee661 +PKG_HASH:= 4f518f18cfb694ad7975064e99e200fe98af13603b47e67e801ba9580e50a07f PKG_SITES:= ${MASTER_SITE_GNU:=gcc/gcc-${PKG_VERSION}/} PKG_RELEASE:= 1 -DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.xz +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-2020.09 -PKG_GIT:= tag -PKG_SITES:= https://github.com/foss-for-synopsys-dwc-arc-processors/gcc.git -PKG_RELEASE:= 1 -DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.xz +PKG_VERSION:= arc-2024.12 +PKG_GIT:= tag +PKG_SITES:= https://github.com/foss-for-synopsys-dwc-arc-processors/gcc.git +PKG_RELEASE:= 1 +DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.gz +LIBSTDCXXVER:= 29 endif ifeq ($(ADK_TOOLCHAIN_GCC_AVR32),y) PKG_VERSION:= 4.4.7 @@ -57,6 +114,14 @@ PKG_RELEASE:= 1 DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.gz LIBSTDCXXVER:= 19 endif +ifeq ($(ADK_TOOLCHAIN_GCC_LM32),y) +PKG_VERSION:= 4.5.4 +PKG_HASH:= 33fb968907ef7b6c528f6395ba049eb34c4df859bf5aa6c2bc3856268801e078 +PKG_SITES:= https://ftp.gnu.org/gnu/gcc/gcc-$(PKG_VERSION)/ +PKG_RELEASE:= 1 +DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.gz +LIBSTDCXXVER:= 19 +endif ifeq ($(ADK_TOOLCHAIN_GCC_METAG),y) PKG_VERSION:= 4.2.4 PKG_HASH:= 7cb75c5183bd18f415860084440377016dc78feeee2852227b831f2e4fcaa5d6 @@ -65,31 +130,33 @@ 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:= 50bb1935d20f383c3d37c98b681f63de873688b2 +PKG_VERSION:= f98c17b1e78dd3a3da45c0ac1af7b105edf2bf66 PKG_GIT:= hash PKG_SITES:= https://github.com/kalray/gcc.git PKG_RELEASE:= 1 -DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.xz -endif -ifeq ($(ADK_TOOLCHAIN_GCC_LM32),y) -PKG_VERSION:= 4.5.4 -PKG_HASH:= 33fb968907ef7b6c528f6395ba049eb34c4df859bf5aa6c2bc3856268801e078 -PKG_SITES:= https://ftp.gnu.org/gnu/gcc/gcc-$(PKG_VERSION)/ -PKG_RELEASE:= 1 DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.gz -LIBSTDCXXVER:= 19 endif -ifeq ($(ADK_TOOLCHAIN_GCC_NDS32),y) -PKG_VERSION:= nds32-6.3.0-open -PKG_HASH:= b23ce96df25dfdd5526496a3c2cd7ee1da4ed4094971a2e0c47c73ad7e1ad30a -PKG_SITES:= https://github.com/andestech/gcc.git +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.xz +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.3.0/revert-sparc.patch b/toolchain/gcc/patches/10.3.0/revert-sparc.patch deleted file mode 100644 index 5df11ce40..000000000 --- a/toolchain/gcc/patches/10.3.0/revert-sparc.patch +++ /dev/null @@ -1,23628 +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 2021-04-09 07:51:37.884501308 +0200 -@@ -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.c.orig gcc-10.3.0/gcc/config/sparc/sparc.c.orig ---- gcc-10.3.0.orig/gcc/config/sparc/sparc.c.orig 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-10.3.0/gcc/config/sparc/sparc.c.orig 2021-04-08 13:56:28.201742273 +0200 -@@ -0,0 +1,13813 @@ -+/* Subroutines for insn-output.c for SPARC. -+ Copyright (C) 1987-2020 Free Software Foundation, Inc. -+ Contributed by Michael Tiemann (tiemann@cygnus.com) -+ 64-bit SPARC-V9 support by Michael Tiemann, Jim Wilson, and Doug Evans, -+ at Cygnus Support. -+ -+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/>. */ -+ -+#define IN_TARGET_CODE 1 -+ -+#include "config.h" -+#include "system.h" -+#include "coretypes.h" -+#include "backend.h" -+#include "target.h" -+#include "rtl.h" -+#include "tree.h" -+#include "memmodel.h" -+#include "gimple.h" -+#include "df.h" -+#include "tm_p.h" -+#include "stringpool.h" -+#include "attribs.h" -+#include "expmed.h" -+#include "optabs.h" -+#include "regs.h" -+#include "emit-rtl.h" -+#include "recog.h" -+#include "diagnostic-core.h" -+#include "alias.h" -+#include "fold-const.h" -+#include "stor-layout.h" -+#include "calls.h" -+#include "varasm.h" -+#include "output.h" -+#include "insn-attr.h" -+#include "explow.h" -+#include "expr.h" -+#include "debug.h" -+#include "cfgrtl.h" -+#include "common/common-target.h" -+#include "gimplify.h" -+#include "langhooks.h" -+#include "reload.h" -+#include "tree-pass.h" -+#include "context.h" -+#include "builtins.h" -+#include "tree-vector-builder.h" -+#include "opts.h" -+ -+/* This file should be included last. */ -+#include "target-def.h" -+ -+/* Processor costs */ -+ -+struct processor_costs { -+ /* Integer load */ -+ const int int_load; -+ -+ /* Integer signed load */ -+ const int int_sload; -+ -+ /* Integer zeroed load */ -+ const int int_zload; -+ -+ /* Float load */ -+ const int float_load; -+ -+ /* fmov, fneg, fabs */ -+ const int float_move; -+ -+ /* fadd, fsub */ -+ const int float_plusminus; -+ -+ /* fcmp */ -+ const int float_cmp; -+ -+ /* fmov, fmovr */ -+ const int float_cmove; -+ -+ /* fmul */ -+ const int float_mul; -+ -+ /* fdivs */ -+ const int float_div_sf; -+ -+ /* fdivd */ -+ const int float_div_df; -+ -+ /* fsqrts */ -+ const int float_sqrt_sf; -+ -+ /* fsqrtd */ -+ const int float_sqrt_df; -+ -+ /* umul/smul */ -+ const int int_mul; -+ -+ /* mulX */ -+ const int int_mulX; -+ -+ /* integer multiply cost for each bit set past the most -+ significant 3, so the formula for multiply cost becomes: -+ -+ if (rs1 < 0) -+ highest_bit = highest_clear_bit(rs1); -+ else -+ highest_bit = highest_set_bit(rs1); -+ if (highest_bit < 3) -+ highest_bit = 3; -+ cost = int_mul{,X} + ((highest_bit - 3) / int_mul_bit_factor); -+ -+ A value of zero indicates that the multiply costs is fixed, -+ and not variable. */ -+ const int int_mul_bit_factor; -+ -+ /* udiv/sdiv */ -+ const int int_div; -+ -+ /* divX */ -+ const int int_divX; -+ -+ /* movcc, movr */ -+ const int int_cmove; -+ -+ /* penalty for shifts, due to scheduling rules etc. */ -+ const int shift_penalty; -+ -+ /* cost of a (predictable) branch. */ -+ const int branch_cost; -+}; -+ -+static const -+struct processor_costs cypress_costs = { -+ COSTS_N_INSNS (2), /* int load */ -+ COSTS_N_INSNS (2), /* int signed load */ -+ COSTS_N_INSNS (2), /* int zeroed load */ -+ COSTS_N_INSNS (2), /* float load */ -+ COSTS_N_INSNS (5), /* fmov, fneg, fabs */ -+ COSTS_N_INSNS (5), /* fadd, fsub */ -+ COSTS_N_INSNS (1), /* fcmp */ -+ COSTS_N_INSNS (1), /* fmov, fmovr */ -+ COSTS_N_INSNS (7), /* fmul */ -+ COSTS_N_INSNS (37), /* fdivs */ -+ COSTS_N_INSNS (37), /* fdivd */ -+ COSTS_N_INSNS (63), /* fsqrts */ -+ COSTS_N_INSNS (63), /* fsqrtd */ -+ COSTS_N_INSNS (1), /* imul */ -+ COSTS_N_INSNS (1), /* imulX */ -+ 0, /* imul bit factor */ -+ COSTS_N_INSNS (1), /* idiv */ -+ COSTS_N_INSNS (1), /* idivX */ -+ COSTS_N_INSNS (1), /* movcc/movr */ -+ 0, /* shift penalty */ -+ 3 /* branch cost */ -+}; -+ -+static const -+struct processor_costs supersparc_costs = { -+ COSTS_N_INSNS (1), /* int load */ -+ COSTS_N_INSNS (1), /* int signed load */ -+ COSTS_N_INSNS (1), /* int zeroed load */ -+ COSTS_N_INSNS (0), /* float load */ -+ COSTS_N_INSNS (3), /* fmov, fneg, fabs */ -+ COSTS_N_INSNS (3), /* fadd, fsub */ -+ COSTS_N_INSNS (3), /* fcmp */ -+ COSTS_N_INSNS (1), /* fmov, fmovr */ -+ COSTS_N_INSNS (3), /* fmul */ -+ COSTS_N_INSNS (6), /* fdivs */ -+ COSTS_N_INSNS (9), /* fdivd */ -+ COSTS_N_INSNS (12), /* fsqrts */ -+ COSTS_N_INSNS (12), /* fsqrtd */ -+ COSTS_N_INSNS (4), /* imul */ -+ COSTS_N_INSNS (4), /* imulX */ -+ 0, /* imul bit factor */ -+ COSTS_N_INSNS (4), /* idiv */ -+ COSTS_N_INSNS (4), /* idivX */ -+ COSTS_N_INSNS (1), /* movcc/movr */ -+ 1, /* shift penalty */ -+ 3 /* branch cost */ -+}; -+ -+static const -+struct processor_costs hypersparc_costs = { -+ COSTS_N_INSNS (1), /* int load */ -+ COSTS_N_INSNS (1), /* int signed load */ -+ COSTS_N_INSNS (1), /* int zeroed load */ -+ COSTS_N_INSNS (1), /* float load */ -+ COSTS_N_INSNS (1), /* fmov, fneg, fabs */ -+ COSTS_N_INSNS (1), /* fadd, fsub */ -+ COSTS_N_INSNS (1), /* fcmp */ -+ COSTS_N_INSNS (1), /* fmov, fmovr */ -+ COSTS_N_INSNS (1), /* fmul */ -+ COSTS_N_INSNS (8), /* fdivs */ -+ COSTS_N_INSNS (12), /* fdivd */ -+ COSTS_N_INSNS (17), /* fsqrts */ -+ COSTS_N_INSNS (17), /* fsqrtd */ -+ COSTS_N_INSNS (17), /* imul */ -+ COSTS_N_INSNS (17), /* imulX */ -+ 0, /* imul bit factor */ -+ COSTS_N_INSNS (17), /* idiv */ -+ COSTS_N_INSNS (17), /* idivX */ -+ COSTS_N_INSNS (1), /* movcc/movr */ -+ 0, /* shift penalty */ -+ 3 /* branch cost */ -+}; -+ -+static const -+struct processor_costs leon_costs = { -+ COSTS_N_INSNS (1), /* int load */ -+ COSTS_N_INSNS (1), /* int signed load */ -+ COSTS_N_INSNS (1), /* int zeroed load */ -+ COSTS_N_INSNS (1), /* float load */ -+ COSTS_N_INSNS (1), /* fmov, fneg, fabs */ -+ COSTS_N_INSNS (1), /* fadd, fsub */ -+ COSTS_N_INSNS (1), /* fcmp */ -+ COSTS_N_INSNS (1), /* fmov, fmovr */ -+ COSTS_N_INSNS (1), /* fmul */ -+ COSTS_N_INSNS (15), /* fdivs */ -+ COSTS_N_INSNS (15), /* fdivd */ -+ COSTS_N_INSNS (23), /* fsqrts */ -+ COSTS_N_INSNS (23), /* fsqrtd */ -+ COSTS_N_INSNS (5), /* imul */ -+ COSTS_N_INSNS (5), /* imulX */ -+ 0, /* imul bit factor */ -+ COSTS_N_INSNS (5), /* idiv */ -+ COSTS_N_INSNS (5), /* idivX */ -+ COSTS_N_INSNS (1), /* movcc/movr */ -+ 0, /* shift penalty */ -+ 3 /* branch cost */ -+}; -+ -+static const -+struct processor_costs leon3_costs = { -+ COSTS_N_INSNS (1), /* int load */ -+ COSTS_N_INSNS (1), /* int signed load */ -+ COSTS_N_INSNS (1), /* int zeroed load */ -+ COSTS_N_INSNS (1), /* float load */ -+ COSTS_N_INSNS (1), /* fmov, fneg, fabs */ -+ COSTS_N_INSNS (1), /* fadd, fsub */ -+ COSTS_N_INSNS (1), /* fcmp */ -+ COSTS_N_INSNS (1), /* fmov, fmovr */ -+ COSTS_N_INSNS (1), /* fmul */ -+ COSTS_N_INSNS (14), /* fdivs */ -+ COSTS_N_INSNS (15), /* fdivd */ -+ COSTS_N_INSNS (22), /* fsqrts */ -+ COSTS_N_INSNS (23), /* fsqrtd */ -+ COSTS_N_INSNS (5), /* imul */ -+ COSTS_N_INSNS (5), /* imulX */ -+ 0, /* imul bit factor */ -+ COSTS_N_INSNS (35), /* idiv */ -+ COSTS_N_INSNS (35), /* idivX */ -+ COSTS_N_INSNS (1), /* movcc/movr */ -+ 0, /* shift penalty */ -+ 3 /* branch cost */ -+}; -+ -+static const -+struct processor_costs sparclet_costs = { -+ COSTS_N_INSNS (3), /* int load */ -+ COSTS_N_INSNS (3), /* int signed load */ -+ COSTS_N_INSNS (1), /* int zeroed load */ -+ COSTS_N_INSNS (1), /* float load */ -+ COSTS_N_INSNS (1), /* fmov, fneg, fabs */ -+ COSTS_N_INSNS (1), /* fadd, fsub */ -+ COSTS_N_INSNS (1), /* fcmp */ -+ COSTS_N_INSNS (1), /* fmov, fmovr */ -+ COSTS_N_INSNS (1), /* fmul */ -+ COSTS_N_INSNS (1), /* fdivs */ -+ COSTS_N_INSNS (1), /* fdivd */ -+ COSTS_N_INSNS (1), /* fsqrts */ -+ COSTS_N_INSNS (1), /* fsqrtd */ -+ COSTS_N_INSNS (5), /* imul */ -+ COSTS_N_INSNS (5), /* imulX */ -+ 0, /* imul bit factor */ -+ COSTS_N_INSNS (5), /* idiv */ -+ COSTS_N_INSNS (5), /* idivX */ -+ COSTS_N_INSNS (1), /* movcc/movr */ -+ 0, /* shift penalty */ -+ 3 /* branch cost */ -+}; -+ -+static const -+struct processor_costs ultrasparc_costs = { -+ COSTS_N_INSNS (2), /* int load */ -+ COSTS_N_INSNS (3), /* int signed load */ -+ COSTS_N_INSNS (2), /* int zeroed load */ -+ COSTS_N_INSNS (2), /* float load */ -+ COSTS_N_INSNS (1), /* fmov, fneg, fabs */ -+ COSTS_N_INSNS (4), /* fadd, fsub */ -+ COSTS_N_INSNS (1), /* fcmp */ -+ COSTS_N_INSNS (2), /* fmov, fmovr */ -+ COSTS_N_INSNS (4), /* fmul */ -+ COSTS_N_INSNS (13), /* fdivs */ -+ COSTS_N_INSNS (23), /* fdivd */ -+ COSTS_N_INSNS (13), /* fsqrts */ -+ COSTS_N_INSNS (23), /* fsqrtd */ -+ COSTS_N_INSNS (4), /* imul */ -+ COSTS_N_INSNS (4), /* imulX */ -+ 2, /* imul bit factor */ -+ COSTS_N_INSNS (37), /* idiv */ -+ COSTS_N_INSNS (68), /* idivX */ -+ COSTS_N_INSNS (2), /* movcc/movr */ -+ 2, /* shift penalty */ -+ 2 /* branch cost */ -+}; -+ -+static const -+struct processor_costs ultrasparc3_costs = { -+ COSTS_N_INSNS (2), /* int load */ -+ COSTS_N_INSNS (3), /* int signed load */ -+ COSTS_N_INSNS (3), /* int zeroed load */ -+ COSTS_N_INSNS (2), /* float load */ -+ COSTS_N_INSNS (3), /* fmov, fneg, fabs */ -+ COSTS_N_INSNS (4), /* fadd, fsub */ -+ COSTS_N_INSNS (5), /* fcmp */ -+ COSTS_N_INSNS (3), /* fmov, fmovr */ -+ COSTS_N_INSNS (4), /* fmul */ -+ COSTS_N_INSNS (17), /* fdivs */ -+ COSTS_N_INSNS (20), /* fdivd */ -+ COSTS_N_INSNS (20), /* fsqrts */ -+ COSTS_N_INSNS (29), /* fsqrtd */ -+ COSTS_N_INSNS (6), /* imul */ -+ COSTS_N_INSNS (6), /* imulX */ -+ 0, /* imul bit factor */ -+ COSTS_N_INSNS (40), /* idiv */ -+ COSTS_N_INSNS (71), /* idivX */ -+ COSTS_N_INSNS (2), /* movcc/ |