Skip to contentSkip to conversation

arch: add BR2_ARCH_NEEDS_GCC_AT_LEAST_8

PATCH New Romain Naour 2 participants 6 messages May 29, 2018 – May 30, 2018

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/5 arch: add BR2_ARCH_NEEDS_GCC_AT_LEAST_8

This new symbol will be used by architectures introduced with gcc 8 and by external toolchains based on gcc 8.

[1] https://gcc.gnu.org/gcc-8/changes.html

Cc Thomas Petazzoni <[email protected]>
---
 arch/Config.in | 4 ++++
 1 file changed, 4 insertions(+)
arch/Config.in +4 -0
index a66ea0d03b..a16012bdfd 100644
@@ -282,6 +282,10 @@ config BR2_ARCH_NEEDS_GCC_AT_LEAST_7
 	bool
 	select BR2_ARCH_NEEDS_GCC_AT_LEAST_6
 
+config BR2_ARCH_NEEDS_GCC_AT_LEAST_8
+	bool
+	select BR2_ARCH_NEEDS_GCC_AT_LEAST_7
+
 # The following string values are defined by the individual
 # Config.in.$ARCH files
 config BR2_ARCH
Signature · 1 line
2.14.3
#1 lore raw

PATCH v3 2/5 toolchain: add gcc 8 entry

In order to add gcc 8 support for internal and external toolchain in follow-up commits, introduce BR2_TOOLCHAIN_GCC_AT_LEAST_8 symbol.

Cc Thomas Petazzoni <[email protected]>
---
 toolchain/Config.in | 5 +++++
 1 file changed, 5 insertions(+)
toolchain/Config.in +5 -0
index 77f95ee1c3..064bd4c28c 100644
@@ -404,10 +404,15 @@ config BR2_TOOLCHAIN_GCC_AT_LEAST_7
 	bool
 	select BR2_TOOLCHAIN_GCC_AT_LEAST_6
 
+config BR2_TOOLCHAIN_GCC_AT_LEAST_8
+	bool
+	select BR2_TOOLCHAIN_GCC_AT_LEAST_7
+
 # 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 "8"	if BR2_TOOLCHAIN_GCC_AT_LEAST_8
 	default "7"	if BR2_TOOLCHAIN_GCC_AT_LEAST_7
 	default "6"	if BR2_TOOLCHAIN_GCC_AT_LEAST_6
 	default "5"	if BR2_TOOLCHAIN_GCC_AT_LEAST_5
Signature · 1 line
2.14.3
#2 lore raw

PATCH v3 3/5 package/gcc: add support for gcc 8.1.0

In reply to Romain Naour

Remove 0860-cilk-fix-build-without-wchar.patch since cilk has been removed from gcc.

Rebase 0900-remove-selftests.patch on gcc 8.1.0

Remove upstream patches 0001-m68k-coldfire-pr68467.patch and 0892-microblaze-Revert.patch.

Use bz2 release tarball only for gcc 4.9 since all other version now use xz tarball.

Runtime tested on x86_64 with binutils 2.30, gcc 8.1.0, kernel headers 4.14 and glibc 2.27.

Buildtime tested with glibc with all supported architectures.

Buildtime tested on x86_64 with musl and uClibc-ng

Cc Thomas Petazzoni <[email protected]>

---
v3: add BR2_ARCH_NEEDS_GCC_AT_LEAST_8 for gcc 7.

---
 package/gcc/8.1.0/0001-uclibc-conf.patch          |  29 +++++
 package/gcc/8.1.0/0002-arm-softfloat-libgcc.patch |  45 +++++++
 package/gcc/8.1.0/0003-remove-selftests.patch     | 149 ++++++++++++++++++++++
 package/gcc/Config.in.host                        |   8 ++
 package/gcc/gcc.hash                              |   2 +
 package/gcc/gcc.mk                                |  10 +-
 6 files changed, 238 insertions(+), 5 deletions(-)
 create mode 100644 package/gcc/8.1.0/0001-uclibc-conf.patch
 create mode 100644 package/gcc/8.1.0/0002-arm-softfloat-libgcc.patch
 create mode 100644 package/gcc/8.1.0/0003-remove-selftests.patch
package/gcc/8.1.0/0001-uclibc-conf.patch new file +29 -0
new file mode 100644
index 0000000000..dc223f9653
@@ -0,0 +1,29 @@
+From 897881dfdf6a922957c40cbbe9f96bbbe5374770 Mon Sep 17 00:00:00 2001
+From: Romain Naour <[email protected]>
+Date: Tue, 2 May 2017 22:36:15 +0200
+Subject: [PATCH] uclibc-conf
+
+[Romain: convert to git patch]
+Signed-off-by: Romain Naour <[email protected]>
+---
+ contrib/regression/objs-gcc.sh | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/contrib/regression/objs-gcc.sh b/contrib/regression/objs-gcc.sh
+index 60b0497fea2..6dc7eadff36 100755
+--- a/contrib/regression/objs-gcc.sh
++++ b/contrib/regression/objs-gcc.sh
+@@ -106,6 +106,10 @@ if [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-gnu ]
+  then
+   make all-gdb all-dejagnu all-ld || exit 1
+   make install-gdb install-dejagnu install-ld || exit 1
++elif [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-uclibc ]
++ then
++  make all-gdb all-dejagnu all-ld || exit 1
++  make install-gdb install-dejagnu install-ld || exit 1
+ elif [ $H_REAL_TARGET = $H_REAL_HOST ] ; then
+   make bootstrap || exit 1
+   make install || exit 1
+-- 
+2.14.3
+
package/gcc/8.1.0/0002-arm-softfloat-libgcc.patch new file +45 -0

45 lines not on this page · raw message

package/gcc/8.1.0/0003-remove-selftests.patch new file +149 -0

149 lines not on this page · raw message

package/gcc/Config.in.host +8 -0
index 00e72db032..09d88fc929 100644
@@ -57,10 +57,17 @@ config BR2_GCC_VERSION_6_X
 
 config BR2_GCC_VERSION_7_X
 	bool "gcc 7.x"
+	depends on !BR2_ARCH_NEEDS_GCC_AT_LEAST_8
 	# Broken or unsupported architectures
 	depends on !BR2_or1k
 	select BR2_TOOLCHAIN_GCC_AT_LEAST_7
 
+config BR2_GCC_VERSION_8_X
+	bool "gcc 8.x"
+	# Broken or unsupported architectures
+	depends on !BR2_or1k
+	select BR2_TOOLCHAIN_GCC_AT_LEAST_8
+
 endchoice
 
 config BR2_GCC_SUPPORTS_FINEGRAINEDMTUNE
@@ -73,6 +80,7 @@ config BR2_GCC_VERSION
 	default "5.5.0"     if BR2_GCC_VERSION_5_X
 	default "6.4.0"     if BR2_GCC_VERSION_6_X
 	default "7.3.0"     if BR2_GCC_VERSION_7_X
+	default "8.1.0"     if BR2_GCC_VERSION_8_X
 	default "arc-2018.03-rc2" if BR2_GCC_VERSION_ARC
 	default "or1k-musl-5.4.0-20170218" if BR2_GCC_VERSION_OR1K
 
package/gcc/gcc.hash +2 -0
index 817d04e390..6d2fcda13e 100644
@@ -6,6 +6,8 @@ sha512  670ff52c2ae12c7852c12987e91798c5aa8bd6daf21f0d6e0cd57a4aa59cc4f06a837fe7
 sha512  02c60e54527c7adf584798d5251f8a0b80c93d5deafce82501b2c28e6692e0bd783927bbfc4bc527a863c0cccc025150a34740a9e29badb02d4b48e56a8aba90  gcc-6.4.0.tar.xz
 # From ftp://gcc.gnu.org/pub/gcc/releases/gcc-7.3.0/sha512.sum
 sha512  ad41a7e4584e40e92cdf860bc0288500fbaf5dfb7e8c3fcabe9eba809c87bcfa85b46c19c19921b0cdf6d05483faede8287bb9ea120c0d1559449a70e602c8d4  gcc-7.3.0.tar.xz
+# From ftp://gcc.gnu.org/pub/gcc/releases/gcc-8.1.0/sha512.sum
+sha512  c96246f34a7aeb404c4525b754dc7f7708a18e06271aadb2b32fef00e6e0940f584e52430bfe2ab01e699c93e3cb418adc113d2622fa826facbec0ec8ce3eb2c  gcc-8.1.0.tar.xz
 
 # Locally calculated (fetched from Github)
 sha512  a0faf2bb34f6c72b6460c6432639d89915cfc63456cfdf016896b3ef075655b2e9f26e745d841bbc38e776bc7a3729359cca88f1e4fb83489fa6775a3ccb55b8  gcc-arc-2018.03-rc2.tar.gz
package/gcc/gcc.mk +5 -5
index 0afb06a57e..1ae9b7edd9 100644
@@ -18,13 +18,13 @@ GCC_SITE = $(call github,openrisc,or1k-gcc,$(GCC_VERSION))
 GCC_SOURCE = gcc-$(GCC_VERSION).tar.gz
 else
 GCC_SITE = $(BR2_GNU_MIRROR:/=)/gcc/gcc-$(GCC_VERSION)
-# From version 5.5.0, 6.4.0 and 7.2.0 a bz2 release tarball is not
+# From version 5.5.0, 6.4.0, 7.2.0 and 8.1.0 a bz2 release tarball is not
 # provided anymore. Use the xz tarball instead.
-ifeq ($(BR2_GCC_VERSION_5_X)$(BR2_GCC_VERSION_6_X)$(BR2_GCC_VERSION_7_X),y)
-GCC_SOURCE = gcc-$(GCC_VERSION).tar.xz
-else
+ifeq ($(BR2_GCC_VERSION_4_9_X),y)
 GCC_SOURCE = gcc-$(GCC_VERSION).tar.bz2
-endif # BR2_GCC_VERSION_6_X
+else
+GCC_SOURCE = gcc-$(GCC_VERSION).tar.xz
+endif
 endif
 
 #
Signature · 1 line
2.14.3
#3 lore raw

PATCH v3 4/5 toolchain-external: add gcc 8 entry

In reply to Romain Naour

This patch allow to use an external toolchain based on gcc 8.

Cc Thomas Petazzoni <[email protected]>
---
 .../toolchain-external/toolchain-external-custom/Config.in.options  | 6 ++++++
 1 file changed, 6 insertions(+)
toolchain/toolchain-external/toolchain-external-custom/Config.in.options +6 -0
index 55370e967a..2ef1126740 100644
@@ -27,6 +27,7 @@ config BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX
 
 choice
 	bool "External toolchain gcc version"
+	default BR2_TOOLCHAIN_EXTERNAL_GCC_8   if BR2_ARCH_NEEDS_GCC_AT_LEAST_8
 	default BR2_TOOLCHAIN_EXTERNAL_GCC_7   if BR2_ARCH_NEEDS_GCC_AT_LEAST_7
 	default BR2_TOOLCHAIN_EXTERNAL_GCC_6   if BR2_ARCH_NEEDS_GCC_AT_LEAST_6
 	default BR2_TOOLCHAIN_EXTERNAL_GCC_5   if BR2_ARCH_NEEDS_GCC_AT_LEAST_5
@@ -37,8 +38,13 @@ choice
 	  Set to the gcc version that is used by your external
 	  toolchain.
 
+config BR2_TOOLCHAIN_EXTERNAL_GCC_8
+	bool "8.x"
+	select BR2_TOOLCHAIN_GCC_AT_LEAST_8
+
 config BR2_TOOLCHAIN_EXTERNAL_GCC_7
 	bool "7.x"
+	depends on !BR2_ARCH_NEEDS_GCC_AT_LEAST_8
 	select BR2_TOOLCHAIN_GCC_AT_LEAST_7
 
 config BR2_TOOLCHAIN_EXTERNAL_GCC_6
Signature · 1 line
2.14.3
#4 lore raw

PATCH v3 5/5 package/gcc: switch to gcc 6.x as the default

In reply to Romain Naour

Even if gcc 6 is still maintained for some time (gcc 6.5 is pending), switch to gcc 7.x since it has been released since 2017-05-02 and gcc 8.x is available since 2018-05-02.

We have been having toolchains in the autobuilders with gcc 7.x for a while, so the vast majority of the problems should have already been solved.

Cc Thomas Petazzoni <[email protected]>
---
 package/gcc/Config.in.host | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/gcc/Config.in.host +1 -1
index 09d88fc929..c9a20f6d77 100644
@@ -4,7 +4,7 @@ choice
 	prompt "GCC compiler Version"
 	default BR2_GCC_VERSION_ARC if BR2_arc
 	default BR2_GCC_VERSION_OR1K if BR2_or1k
-	default BR2_GCC_VERSION_6_X
+	default BR2_GCC_VERSION_7_X
 	help
 	  Select the version of gcc you wish to use.
 
Signature · 1 line
2.14.3
#5 lore raw

PATCH v3 1/5 arch: add BR2_ARCH_NEEDS_GCC_AT_LEAST_8

In reply to Romain Naour

Hello,

Quoted 10 lines · Romain Naour

This new symbol will be used by architectures introduced with gcc 8 and by external toolchains based on gcc 8.

[1] https://gcc.gnu.org/gcc-8/changes.html

Cc Thomas Petazzoni <[email protected]>
---
 arch/Config.in | 4 ++++
 1 file changed, 4 insertions(+)

Thanks, I've applied this series to the next branch!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com