config GCC_USE_VERSION_12
bool "gcc 12.x"
+
+ config GCC_USE_VERSION_13
+ bool "gcc 13.x"
endchoice
config GCC_USE_GRAPHITE
default y if GCC_USE_VERSION_11
bool
+config GCC_VERSION_13
+ default y if GCC_USE_VERSION_13
+ bool
+
config GCC_VERSION
string
default "11.3.0" if GCC_VERSION_11
+ default "13.1.0" if GCC_VERSION_13
default "12.2.0"
PKG_HASH:=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
endif
+ifeq ($(PKG_VERSION),13.1.0)
+ PKG_HASH:=61d684f0aa5e76ac6585ad8898a2427aade8979ed5e7f85492286c4dfc13ee86
+endif
+
PATCH_DIR=../patches-$(GCC_MAJOR_VERSION).x
BUGURL=http://bugs.openwrt.org/
endef
-ifeq ($(GCC_MAJOR_VERSION),12)
- GCC_VERSION_FILE:=gcc/genversion.cc
-else
+ifeq ($(GCC_MAJOR_VERSION),11)
GCC_VERSION_FILE:=gcc/version.c
+else
+ GCC_VERSION_FILE:=gcc/genversion.cc
endif
ifneq ($(GCC_PREPARE),)
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
-@@ -3366,18 +3366,10 @@ doc/gcc.info: $(TEXI_GCC_FILES)
+@@ -3397,18 +3397,10 @@ doc/gcc.info: $(TEXI_GCC_FILES)
doc/gccint.info: $(TEXI_GCCINT_FILES)
doc/cppinternals.info: $(TEXI_CPPINT_FILES)
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
-@@ -985,7 +985,9 @@ proper position among the other output f
+@@ -972,7 +972,9 @@ proper position among the other output f
#endif
#ifndef LINK_SSP_SPEC
--- a/gcc/config/mips/mips.cc
+++ b/gcc/config/mips/mips.cc
-@@ -20216,7 +20216,7 @@ mips_option_override (void)
+@@ -20213,7 +20213,7 @@ mips_option_override (void)
flag_pcc_struct_return = 0;
/* Decide which rtx_costs structure to use. */
--- a/libgcc/Makefile.in
+++ b/libgcc/Makefile.in
-@@ -930,11 +930,12 @@ $(libgcov-driver-objects): %$(objext): $
+@@ -933,11 +933,12 @@ $(libgcov-driver-objects): %$(objext): $
# Static libraries.
libgcc.a: $(libgcc-objects)
-rm -f $@
objects="$(objects)"; \
-@@ -958,7 +959,7 @@ all: libunwind.a
+@@ -961,7 +962,7 @@ all: libunwind.a
endif
ifeq ($(enable_shared),yes)
ifneq ($(LIBUNWIND),)
all: libunwind$(SHLIB_EXT)
libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT)
-@@ -1164,6 +1165,10 @@ install-shared:
+@@ -1167,6 +1168,10 @@ install-shared:
chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a
$(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a
--- a/gcc/config/arm/linux-eabi.h
+++ b/gcc/config/arm/linux-eabi.h
-@@ -91,10 +91,15 @@
+@@ -88,10 +88,15 @@
#define MUSL_DYNAMIC_LINKER \
"/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}%{mfdpic:-fdpic}.so.1"
SVN-Revision: 30486
--- a/gcc/config/arm/linux-eabi.h
+++ b/gcc/config/arm/linux-eabi.h
-@@ -132,10 +132,6 @@
- "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} " \
+@@ -129,10 +129,6 @@
+ "%{Ofast|ffast-math|funsafe-math-optimizations:%{!shared:crtfastmath.o%s}} " \
LINUX_OR_ANDROID_LD (GNU_USER_TARGET_ENDFILE_SPEC, ANDROID_ENDFILE_SPEC)
-/* Use the default LIBGCC_SPEC, not the version in linux-elf.h, as we
is used. */
--- a/gcc/config/linux.h
+++ b/gcc/config/linux.h
-@@ -71,6 +71,10 @@ see the files COPYING3 and COPYING.RUNTI
- builtin_version ("CRuntime_Musl"); \
+@@ -58,6 +58,10 @@ see the files COPYING3 and COPYING.RUNTI
+ builtin_assert ("system=posix"); \
} while (0)
+#ifndef LIBGCC_SPEC
--- a/gcc/config/rs6000/rs6000-logue.cc
+++ b/gcc/config/rs6000/rs6000-logue.cc
-@@ -348,7 +348,7 @@ rs6000_savres_strategy (rs6000_stack_t *
+@@ -344,7 +344,7 @@ rs6000_savres_strategy (rs6000_stack_t *
/* Define cutoff for using out-of-line functions to save registers. */
if (DEFAULT_ABI == ABI_V4 || TARGET_ELF)
{
--- a/gcc/c-family/c-opts.cc
+++ b/gcc/c-family/c-opts.cc
-@@ -107,6 +107,9 @@ static dump_flags_t original_dump_flags;
+@@ -104,6 +104,9 @@ static size_t include_cursor;
/* Whether any standard preincluded header has been preincluded. */
static bool done_preinclude;
static void handle_OPT_d (const char *);
static void set_std_cxx98 (int);
static void set_std_cxx11 (int);
-@@ -478,6 +481,12 @@ c_common_handle_option (size_t scode, co
+@@ -475,6 +478,12 @@ c_common_handle_option (size_t scode, co
flag_no_builtin = !value;
break;
case OPT_fconstant_string_class_:
constant_string_class_name = arg;
break;
-@@ -1218,6 +1227,47 @@ c_common_init (void)
+@@ -1228,6 +1237,47 @@ c_common_init (void)
return false;
}
--- a/gcc/c-family/c.opt
+++ b/gcc/c-family/c.opt
-@@ -1755,6 +1755,9 @@ C++ ObjC++ Optimization Alias(fexception
+@@ -1837,6 +1837,9 @@ C++ ObjC++ Optimization Alias(fexception
fhonor-std
C++ ObjC++ WarnRemoved
Assume normal C execution environment.
--- a/gcc/common.opt
+++ b/gcc/common.opt
-@@ -1770,6 +1770,9 @@ fharden-conditional-branches
+@@ -1801,6 +1801,9 @@ fharden-conditional-branches
Common Var(flag_harden_conditional_branches) Optimization
Harden conditional branches by checking reversed conditions.
; On SVR4 targets, it also controls whether or not to emit a
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
-@@ -9596,6 +9596,17 @@ This option is only supported for C and
+@@ -10061,6 +10061,17 @@ This option is only supported for C and
@option{-Wall} and by @option{-Wpedantic}, which can be disabled with
@option{-Wno-pointer-sign}.
+The warning is quelled if @env{GCC_HONOUR_COPTS} is set to @samp{s}.
+This flag and environment variable only affect the C language.
+
- @item -Wstack-protector
@opindex Wstack-protector
@opindex Wno-stack-protector
+ @item -Wstack-protector
--- a/gcc/opts.cc
+++ b/gcc/opts.cc
-@@ -2692,6 +2692,9 @@ common_handle_option (struct gcc_options
+@@ -2767,6 +2767,9 @@ common_handle_option (struct gcc_options
add_comma_separated_to_vector (&opts->x_flag_ignored_attributes, arg);
break;
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
-@@ -10213,8 +10213,10 @@ getenv_spec_function (int argc, const ch
+@@ -10174,8 +10174,10 @@ getenv_spec_function (int argc, const ch
}
if (!value)
--- a/gcc/config/aarch64/aarch64.h
+++ b/gcc/config/aarch64/aarch64.h
-@@ -1290,7 +1290,7 @@ extern const char *aarch64_rewrite_mcpu
- #define MCPU_TO_MARCH_SPEC_FUNCTIONS \
- { "rewrite_mcpu", aarch64_rewrite_mcpu },
+@@ -1185,7 +1185,7 @@ extern enum aarch64_code_model aarch64_c
+ /* Extra specs when building a native AArch64-hosted compiler.
+ Option rewriting rules based on host system. */
-#if defined(__aarch64__)
+#if defined(__aarch64__) && ! defined(__APPLE__)
extern const char *host_detect_local_cpu (int argc, const char **argv);
#define HAVE_LOCAL_CPU_DETECT
- # define EXTRA_SPEC_FUNCTIONS \
+ # define EXTRA_SPEC_FUNCTIONS \
--- a/gcc/config/host-darwin.cc
+++ b/gcc/config/host-darwin.cc
@@ -23,6 +23,8 @@