Browse Source

toolchain: update toolchain setting from offical tag 2022.11.3

Signed-off-by: Andy Hu <andy.hu@starfivetech.com>
Andy Hu 1 year ago
parent
commit
cce9841ee9

+ 61 - 12
toolchain/Config.in

@@ -115,15 +115,13 @@ config BR2_TOOLCHAIN_SUPPORTS_VARIADIC_MI_THUNK
 	depends on !BR2_or1k
 	depends on !BR2_xtensa
 
-# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43744. This bug no
+# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43744. This bug
 # reappeared on gcc 9.x and is still not fixed on gcc 11.x
 config BR2_TOOLCHAIN_HAS_GCC_BUG_43744
 	bool
-	default y if BR2_sh4
-	depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_8 || \
-		BR2_TOOLCHAIN_GCC_AT_LEAST_9 || \
-		BR2_TOOLCHAIN_GCC_AT_LEAST_10 || \
-		BR2_TOOLCHAIN_GCC_AT_LEAST_11
+	default y if !BR2_TOOLCHAIN_GCC_AT_LEAST_8
+	default y if BR2_TOOLCHAIN_GCC_AT_LEAST_9
+	depends on BR2_sh
 
 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63261. This bug no
 # longer exists in gcc 8.x.
@@ -144,7 +142,7 @@ config BR2_TOOLCHAIN_HAS_GCC_BUG_64735
 		!BR2_TOOLCHAIN_GCC_AT_LEAST_7
 
 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68485. This bug still
-# exists in gcc 9.x
+# exists in gcc 12.x
 config BR2_TOOLCHAIN_HAS_GCC_BUG_68485
 	bool
 	default y if BR2_microblaze
@@ -155,8 +153,9 @@ config BR2_TOOLCHAIN_HAS_GCC_BUG_68485
 # it still not been fixed yet.
 config BR2_TOOLCHAIN_HAS_GCC_BUG_83143
 	bool
-	default y if BR2_sh
-	depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_10 || BR2_TOOLCHAIN_GCC_AT_LEAST_11
+	default y if !BR2_TOOLCHAIN_GCC_AT_LEAST_10
+	default y if BR2_TOOLCHAIN_GCC_AT_LEAST_11
+	depends on BR2_sh
 
 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85180. This bug no
 # longer exists in gcc 8.x.
@@ -175,11 +174,12 @@ config BR2_TOOLCHAIN_HAS_GCC_BUG_85862
 
 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90620
 # ICE: in do_output_reload, at reload1.c:7978 on microblaze.
-# This bug no longer exists in gcc 10.x
+# This bug no longer exists in gcc 10.x but reappeared in gcc 11.x
 config BR2_TOOLCHAIN_HAS_GCC_BUG_90620
 	bool
 	default y if BR2_microblaze
-	depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_10
+	depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_10 \
+		|| BR2_TOOLCHAIN_GCC_AT_LEAST_11
 
 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93847
 # ICE: compiler error: Segmentation fault on Nios II. This bug
@@ -207,7 +207,7 @@ config BR2_TOOLCHAIN_HAS_GCC_BUG_101737
 
 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101915
 # ICE: in extract_insn, at recog.c:2294 on microblaze.
-# This bug still exists in gcc = 11.1.0
+# This bug still exists in gcc = 12.1.0
 config BR2_TOOLCHAIN_HAS_GCC_BUG_101915
 	bool
 	default y if BR2_microblaze
@@ -226,6 +226,25 @@ config BR2_TOOLCHAIN_HAS_GCC_BUG_101952
 	bool
 	default y if BR2_sh4
 
+# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104028
+# ICE: on M68K: Error: value -16034 out of range
+# This bug still exists in gcc = 11.1.0
+config BR2_TOOLCHAIN_HAS_GCC_BUG_104028
+	bool
+	default y if BR2_m68k
+
+# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107728
+# https://sourceware.org/bugzilla/show_bug.cgi?id=29621
+config BR2_TOOLCHAIN_HAS_GCC_BUG_107728
+	bool
+	default y if BR2_microblazebe || BR2_microblazeel \
+		|| BR2_mips || BR2_mipsel \
+		|| BR2_nios2 \
+		|| BR2_or1k \
+		|| BR2_sh
+	depends on BR2_TOOLCHAIN_USES_GLIBC
+	depends on BR2_OPTIMIZE_0
+
 config BR2_TOOLCHAIN_HAS_NATIVE_RPC
 	bool
 
@@ -572,6 +591,26 @@ config BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_14
 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_15
 	bool
 	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_14
+
+config BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_16
+	bool
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_15
+
+config BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_17
+	bool
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_16
+
+config BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_18
+	bool
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_17
+
+config BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_19
+	bool
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_18
+
+config BR2_TOOLCHAIN_HEADERS_AT_LEAST_6_0
+	bool
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_19
 	select BR2_TOOLCHAIN_HEADERS_LATEST
 
 # This should be selected by the latest version, above, to indicate that
@@ -585,6 +624,11 @@ config BR2_TOOLCHAIN_HEADERS_LATEST
 # stops affecting a value on the first matching default.
 config BR2_TOOLCHAIN_HEADERS_AT_LEAST
 	string
+	default "6.0"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_6_0
+	default "5.19" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_19
+	default "5.18" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_18
+	default "5.17" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_17
+	default "5.16" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_16
 	default "5.15" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_15
 	default "5.14" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_14
 	default "5.13" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_13
@@ -699,10 +743,15 @@ config BR2_TOOLCHAIN_GCC_AT_LEAST_11
 	bool
 	select BR2_TOOLCHAIN_GCC_AT_LEAST_10
 
+config BR2_TOOLCHAIN_GCC_AT_LEAST_12
+	bool
+	select BR2_TOOLCHAIN_GCC_AT_LEAST_11
+
 # This order guarantees that the highest version is set, as kconfig
 # stops affecting a value on the first matching default.
 config BR2_TOOLCHAIN_GCC_AT_LEAST
 	string
+	default "12"	if BR2_TOOLCHAIN_GCC_AT_LEAST_12
 	default "11"	if BR2_TOOLCHAIN_GCC_AT_LEAST_11
 	default "10"	if BR2_TOOLCHAIN_GCC_AT_LEAST_10
 	default "9"	if BR2_TOOLCHAIN_GCC_AT_LEAST_9

+ 1 - 1
toolchain/helpers.mk

@@ -150,7 +150,7 @@ copy_toolchain_sysroot = \
 	if test -n "$${SUPPORT_LIB_DIR}" ; then \
 		cp -a $${SUPPORT_LIB_DIR}/* $(STAGING_DIR)/lib/ ; \
 	fi ; \
-	find $(STAGING_DIR) -type d | xargs chmod 755
+	find $(STAGING_DIR) -type d -print0 | xargs -0 chmod 755
 
 #
 # Check the specified kernel headers version actually matches the

+ 32 - 5
toolchain/toolchain-buildroot/Config.in

@@ -22,8 +22,7 @@ config BR2_TOOLCHAIN_BUILDROOT_VENDOR
 
 choice
 	prompt "C library"
-	default BR2_TOOLCHAIN_BUILDROOT_UCLIBC
-	default BR2_TOOLCHAIN_BUILDROOT_GLIBC if BR2_powerpc64
+	default BR2_TOOLCHAIN_BUILDROOT_GLIBC
 
 config BR2_TOOLCHAIN_BUILDROOT_UCLIBC
 	bool "uClibc-ng"
@@ -66,9 +65,9 @@ config BR2_TOOLCHAIN_BUILDROOT_GLIBC
 
 	  http://www.gnu.org/software/libc/
 
-comment "glibc needs a toolchain w/ dynamic library, kernel headers >= 3.2"
-	depends on BR2_USE_MMU
-	depends on BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_2
+comment "glibc needs a toolchain w/ kernel headers >= 3.2"
+	depends on BR2_PACKAGE_GLIBC_ARCH_SUPPORTS
+	depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_2
 
 # glibc >= 2.26 require kernel headers >= 3.10 on powerpc64le.
 comment "glibc on powerpc64le needs a toolchain w/ headers >= 3.10"
@@ -80,6 +79,22 @@ comment "glibc on MIPS w/ NAN2008 needs a toolchain w/ headers >= 4.5"
 	depends on BR2_MIPS_NAN_2008
 	depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_5
 
+comment "glibc on RISC-V 64-bit needs a toolchain w/ headers >= 5.0"
+	depends on BR2_RISCV_64
+	depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_0
+
+comment "glibc on RISC-V 32-bit needs a toolchain w/ headers >= 5.4"
+	depends on BR2_RISCV_32
+	depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_4
+
+comment "glibc on ARC needs a toolchain w/ headers >= 5.1"
+	depends on BR2_arc
+	depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_1
+
+comment "glibc on or1k needs a toolchain w/ headers >= 5.4"
+	depends on BR2_or1k
+	depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_4
+
 config BR2_TOOLCHAIN_BUILDROOT_MUSL
 	bool "musl"
 	depends on BR2_aarch64	   || BR2_arm   || BR2_armeb   || BR2_i386 || \
@@ -98,6 +113,18 @@ config BR2_TOOLCHAIN_BUILDROOT_MUSL
 
 	  https://www.musl-libc.org/
 
+config BR2_TOOLCHAIN_BUILDROOT_NONE
+	bool "none"
+	depends on !BR2_PACKAGE_UCLIBC_SUPPORTS && \
+		!BR2_PACKAGE_GLIBC_SUPPORTS && \
+		!BR2_PACKAGE_MUSL_SUPPORTS
+	help
+	  This option is visible if no C library is available for the
+	  currently selected configuration. If you select this option,
+	  the build will refuse to start as Buildroot needs a C
+	  library to build a toolchain. Change your configuration
+	  settings to make sure one of the C libraries is selected.
+
 endchoice
 
 config BR2_TOOLCHAIN_BUILDROOT_LIBC

+ 25 - 1
toolchain/toolchain-external/toolchain-external-custom/Config.in.options

@@ -31,6 +31,10 @@ choice
 	  Set to the gcc version that is used by your external
 	  toolchain.
 
+config BR2_TOOLCHAIN_EXTERNAL_GCC_12
+	bool "12.x"
+	select BR2_TOOLCHAIN_GCC_AT_LEAST_12
+
 config BR2_TOOLCHAIN_EXTERNAL_GCC_11
 	bool "11.x"
 	select BR2_TOOLCHAIN_GCC_AT_LEAST_11
@@ -123,8 +127,28 @@ choice
 	  If your toolchain uses headers newer than the latest version
 	  in the choice, then select the latest version.
 
+config BR2_TOOLCHAIN_EXTERNAL_HEADERS_6_0
+	bool "6.0.x or later"
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_6_0
+
+config BR2_TOOLCHAIN_EXTERNAL_HEADERS_5_19
+	bool "5.19.x"
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_19
+
+config BR2_TOOLCHAIN_EXTERNAL_HEADERS_5_18
+	bool "5.18.x"
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_18
+
+config BR2_TOOLCHAIN_EXTERNAL_HEADERS_5_17
+	bool "5.17.x"
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_17
+
+config BR2_TOOLCHAIN_EXTERNAL_HEADERS_5_16
+	bool "5.16.x"
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_16
+
 config BR2_TOOLCHAIN_EXTERNAL_HEADERS_5_15
-	bool "5.15.x or later"
+	bool "5.15.x"
 	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_15
 
 config BR2_TOOLCHAIN_EXTERNAL_HEADERS_5_14

+ 4 - 2
toolchain/toolchain-wrapper.c

@@ -507,8 +507,10 @@ int main(int argc, char **argv)
 
 	exec_args = args;
 #ifdef BR_CCACHE
-	if (getenv("BR_NO_CCACHE"))
-		/* Skip the ccache call */
+	/* If BR2_USE_CCACHE is not defined, or its value is not 1,
+	 * skip the ccache call */
+	char *br_use_ccache = getenv("BR2_USE_CCACHE");
+	if (!br_use_ccache || strncmp(br_use_ccache, "1", strlen("1")))
 		exec_args++;
 #endif
 

+ 4 - 0
toolchain/toolchain-wrapper.mk

@@ -26,11 +26,15 @@ TOOLCHAIN_WRAPPER_OPTS += -Wl,--build-id=none
 ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_8),y)
 TOOLCHAIN_WRAPPER_OPTS += -ffile-prefix-map=$(BASE_DIR)=buildroot
 else
+TOOLCHAIN_WRAPPER_OPTS += -fdebug-prefix-map=$(BASE_DIR)=buildroot
 TOOLCHAIN_WRAPPER_OPTS += -D__FILE__=\"\" -D__BASE_FILE__=\"\" -Wno-builtin-macro-redefined
 endif
 ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_7),)
 TOOLCHAIN_WRAPPER_OPTS += -DBR_NEED_SOURCE_DATE_EPOCH
 endif
+ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_6),)
+TOOLCHAIN_WRAPPER_OPTS += -gno-record-gcc-switches
+endif
 endif
 
 # Disable -ftree-loop-distribute-patterns on microblaze to

+ 7 - 2
toolchain/toolchain.mk

@@ -27,6 +27,10 @@ define TOOLCHAIN_GLIBC_COPY_GCONV_LIBS
 		$(INSTALL) -m 0644 $(STAGING_DIR)/usr/lib/$${d}/gconv/*.so \
 				   $(TARGET_DIR)/usr/lib/gconv \
 		|| exit 1; \
+		if [ -d $(STAGING_DIR)/usr/lib/$${d}/gconv/gconv-modules.d ]; then \
+			cp -a $(STAGING_DIR)/usr/lib/$${d}/gconv/gconv-modules.d \
+				$(TARGET_DIR)/usr/lib/gconv/ || exit 1; \
+		fi; \
 	else \
 		for l in $(TOOLCHAIN_GLIBC_GCONV_LIBS); do \
 			$(INSTALL) -m 0644 -D $(STAGING_DIR)/usr/lib/$${d}/gconv/$${l}.so \
@@ -41,8 +45,9 @@ define TOOLCHAIN_GLIBC_COPY_GCONV_LIBS
 				 || exit 1; \
 			done; \
 		done; \
-		./support/scripts/expunge-gconv-modules "$(TOOLCHAIN_GLIBC_GCONV_LIBS)" \
-			<$(STAGING_DIR)/usr/lib/$${d}/gconv/gconv-modules \
+		./support/scripts/expunge-gconv-modules \
+			$(STAGING_DIR)/usr/lib/$${d}/gconv \
+			"$(TOOLCHAIN_GLIBC_GCONV_LIBS)" \
 			>$(TARGET_DIR)/usr/lib/gconv/gconv-modules; \
 	fi
 endef