Commit Graph

512 Commits

Author SHA1 Message Date
Thomas Petazzoni
4ed7d51d18 package/gcc: add patch to fix glibc header conflict
This commit backports the patch "fixinc: don't "fix" machine names in
__has_include(...)" from upstream GCC, which is needed to resolve a
header conflict between glibc headers and kernel headers, which has
appeared since we bumped glibc to version 2.36 in commit
80c8c15c85.

The problem comes from the "fixinc" logic used by gcc to fixup some
headers files, generated inside an include-fixed/ folder. This logic
ended up replacing "linux/mount.h" by "__linux__/mount.h" in
__has_include() invocation, like this:

 #ifdef __has_include
 # if __has_include ("__linux__/mount.h")
 #  include "linux/mount.h"
 # endif
 #endif

in
build/host-gcc-final-11.3.0/build/gcc/include-fixed/sys/mount.h. With
this fix in place, this "include-fixed" header is no longer generated,
avoiding the problem.

This issue was visible in two different ways in glibc configurations:

 - As a build failure during the gcc build itself, for architectures
   that support libsanitizer, as libsanitizer includes mount.h, and
   would therefore encounter the header conflict.

 - As a build failure during another user-space package (such as
   sysvinit for example), on architectures when libsanitizer isn't
   used, and therefore for which the gcc build was successful, but the
   header conflict shows up when building some "random" user-space
   package.

The problem is already fixed in GCC 12.2.0, so no patch is
required. The problem did not exist back in GCC 8.4.0, so this version
does not need patching. Consequently, the patch is only needed for GCC
10.4.0, GCC 11.3.0 and the special ARC 2020.09-release version.

Fixes:

  (gcc build issue, on architecture that supports libsanitizer)
  http://autobuild.buildroot.net/results/90fe4c3b8b72a2c28555674383de9bbd9e8ae09a/

  (sysvinit build issue, on architecture that does not support libsanitizer)
  http://autobuild.buildroot.net/results/d7bf5795b7621a92be32f18794e3e67944fb96db/

  (crun)
  http://autobuild.buildroot.net/results/e3e8da4f797dced48aedf8c636db983d36849850/

  (libarchive)
  http://autobuild.buildroot.net/results/9fcbf0c036a97b2e9a4fcc6e173bcfa09e1b3dac/

Thanks a lot to Peter Seiderer for pointing the relevant GCC commit.

Fixes:

  https://bugs.busybox.net/show_bug.cgi?id=15021

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Reviewed-by: Romain Naour <romain.naour@smile.fr>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2022-10-26 13:35:59 +02:00
Peter Korsgaard
be914b97ad Merge branch 'next'
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2022-09-11 09:57:08 +02:00
Arnout Vandecappelle
4124d47b0b package/gcc: fix check-package warnings in patches
package/gcc/11.3.0/0005-rs6000-Improve-.machine.patch:4: generate your patches with 'git format-patch -N'
package/gcc/11.3.0/0006-rs6000-Do-not-use-rs6000_cpu-for-.machine-ppc-and-pp.patch:4: generate your patches with 'git format-patch -N'

Signed-off-by: Arnout Vandecappelle <arnout@mind.be>
2022-09-06 21:55:51 +02:00
Romain Naour
b42c6b2475 package/gcc: 11.3.0: fix glibc crash on G4 ppc cpus
gcc 11.3.0 contains a backported patch [1] that introduce
a regression for old powerpc cpus like the powerpc 7400 (G4).

The glibc crash the init process due to a wrong asm machine
directive (.machine).

Run /sbin/init as init process
init[1]: segfault (11) at 7369693e nip 6f6e08 lr 6f6a68 code 1 in libc.so.6[690000+18f000]
init[1]: code: 280a000c 41c1ffe0 811edb80 554a103a 7d48502e 7d4a4214 7d4903a6 4e800420
init[1]: code: 2c08007a 4bffffbc 89290000 5529103a <7d2a482e> 2c090000 41c2ff78 7fe4fb78
Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b

Backport two patches from the gcc-11 stable branch (the upcoming gcc
11.4.0).

[1] https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=3cb53c10831be59d967d9dce8e7980fee4703500

Fixes:
https://gitlab.com/kubu93/buildroot/-/jobs/2976071284

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Cc: Joel Stanley <joel@jms.id.au>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2022-09-06 11:41:20 +02:00
Romain Naour
6bd0cc0cb8 package/gcc: disable gcc D front-end with gcc 12
"The D front-end is now itself written in D, in order to build GDC, you
will need a working GDC compiler (GCC version 9.1 or later)." [1]

So we have to check if a D compiler is available on the host.

Fixes:
http://autobuild.buildroot.org/results/36a/36aa22e458d53ab8687b3a79ffeb65b18e8ac6e7/host-gcc-final-12.1.0/build

[1] https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=5fee5ec362f7a243f459e6378fd49dfc89dc9fb5

http://lists.busybox.net/pipermail/buildroot/2022-August/648841.html

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Cc: Eric Le Bihan <eric.le.bihan.dev@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2022-08-23 22:20:47 +02:00
Romain Naour
3ad17d88f4 package/gcc: bump to version 12.2.0
See announce:
https://gcc.gnu.org/pipermail/gcc-announce/2022/000174.html

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2022-08-23 22:18:01 +02:00
Yann E. MORIN
84fe8e694e package: drop csky support in toolchain-related packages
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Guo Ren <ren_guo@c-sky.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2022-07-27 17:00:30 +02:00
Romain Naour
3b6bce6598 package/gcc: bump to version 10.4.0
Remove upstream patch: 0004-Remove-cyclades-from-libsanitizer.patch

https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=a7e72b282177fbaa6a852324641c871313d326da

See announce:
https://gcc.gnu.org/pipermail/gcc-announce/2022/000173.html

Tested in gitlab:
https://gitlab.com/kubu93/buildroot/-/pipelines/597437606

Signed-off-by: Romain Naour <romain.naour@smile.fr>
2022-07-27 10:25:28 +02:00
Arnout Vandecappelle (Essensium/Mind)
b07210b272 package/gcc: remove BR2_GCC_ENABLE_LTO
Currently, this option doesn't do anything. It only adds
--enable-plugins --enable-lto to the configure flags, but doesn't
disable them if it is not set. Since both of these default to enabled,
plugins and lto are effectively always enabled.

There really is no need to make this configurable: it adds a bit of size
and build time to host-gcc, but we don't care about that for host tools.
It's still up to individual builds to enable the LTO options.

Therefore, remove the option entirely. For clarity, explicitly pass
--enable-plugins --enable-lto to configure.

No legacy handling is added for the removed option. Since the behaviour
hasn't actually changed (independently of whether the option was enabled
or not), there's no point bothering the user with a legacy option.

elf2flt was linking with libdl depending on this option. Since the
option doesn't do anything, this is probably not needed. Still, to avoid
breaking things, and because linking with libdl doesn't cost us anything
anyway, always link with libdl.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2022-07-26 21:56:31 +02:00
Arnout Vandecappelle (Essensium/Mind)
f0f99c9087 package/binutils: remove BR2_BINUTILS_ENABLE_LTO
Currently, this option doesn't do anything. It only adds
--enable-plugins --enable-lto to the configure flags, but doesn't
disable them if it is not set. Since both of these default to enabled,
plugins and lto are effectively always enabled.

There really is no need to make this configurable: it adds a bit of size
and build time to host-binutils, but we don't care about that for host
tools. It's still up to individual builds to enable the LTO options.

Therefore, remove the option entirely. For clarity, explicitly pass
--enable-plugins --enable-lto to configure.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2022-07-26 21:56:21 +02:00
Romain Naour
3915a3f589 package/gcc: disable split-stack for non-thread builds for gcc powerpc spe
The toolchain for powerpc spe can use uClibc-ng without thread support.
So we need the same fix as commit [1].

[1] fff68f75b3

Signed-off-by: Romain Naour <romain.naour@smile.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2022-07-26 18:46:19 +02:00
Romain Naour
fff68f75b3 package/gcc: disable split-stack for non-thread builds
Since commit [1], the autobuilder script generates fully random
configurations that can trigger configurations that were not tested
before.

Here, the toolchain build with uClibc-ng without threads support
(BR2_PTHREADS_NONE=y) fails to build due to a missing pthread.h
header:

../../../libgcc/generic-morestack-thread.c:42:10: fatal error: pthread.h: No such file or directory
   42 | #include <pthread.h>

This issue was actually fixed by this commit [2] adding a patch for
gcc 4.8, 4.9, 5.3. But it get lost when gcc 6 was added to Buildroot [3].

Since then the issue was present in Buildroot but has not been noticed.

[1] https://git.buildroot.net/buildroot-test/commit/?id=27b18dcb1686a98ce718b6a816e98f8505957a6c
[2] 2631219f64
[3] 519d83bfa0

Fixes:
http://autobuild.buildroot.org/results/5ec/5ec9eefacd27ef4fa73066013188796b43a30428
https://bugs.busybox.net/show_bug.cgi?id=8766

Signed-off-by: Romain Naour <romain.naour@smile.fr>
Cc: Waldemar Brodkorb <wbx@openadk.org>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2022-07-25 14:29:18 +02:00
Romain Naour
d159163e40 package/gcc: remove gcc 9.x
gcc 12.1 is around, gcc 11.3 is the default version, so drop
9.5 in order to reduce the gcc choice.

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2022-07-23 17:31:28 +02:00
Romain Naour
650bc56a55 package/gcc: switch to gcc 11.x as the default
Even if gcc 10.x is still maintained for some time, switch to gcc 11.x
since it has been released since 2021-04-27 and gcc 12.x is available
since "2022-05-10".

We have been having toolchains in the autobuilders with gcc 11.x since
mid-June 2021, so the vast majority of the problems should have
already been solved.

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2022-07-23 17:31:28 +02:00
Romain Naour
f953676166 arch: add BR2_ARCH_NEEDS_GCC_AT_LEAST_12
This new symbol will be used by architectures introduced with gcc 12.

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2022-07-23 17:31:27 +02:00
Romain Naour
0f1ad4fc93 package/gcc: add support for gcc 12
https://gcc.gnu.org/gcc-12/changes.html
https://gcc.gnu.org/gcc-12/porting_to.html

Tested with toolchain-builder:
https://gitlab.com/kubu93/toolchains-builder/-/pipelines/550404957

All three patches we had on gcc 11.x are upstream, so there are so far
no known patches needed for gcc 12.x. Here are the upstream commits of
the 3 patches:

https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=eff8110674ef193481d3657456a262beeb9951ff
https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=da8a9d695b3c4b9397b5d9a27660bfa48af8d707
https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=cac2f69cdad434ad5cb60f5fe931d45cd82ef476

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Tested-by: James Hilliard <james.hilliard1@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2022-07-23 17:31:27 +02:00
Romain Naour
4011ff535e package/gcc: disable libsanitizer for mips{el} and gcc > 12
Since [1], gcc contains a workaround for struct_kernel_stat_sz
definition and apply a local patch when updating libsanitizer with
upstream (llvm-project) [2].

Since gcc 12, the workaround is not enough and trigger the following
error:

In file included from ../../../../libsanitizer/sanitizer_common/sanitizer_platform_limits_linux.cpp:21:
../../../../libsanitizer/sanitizer_common/sanitizer_platform_limits_linux.cpp:75:38: error: static assertion failed
   75 | COMPILER_CHECK(struct_kernel_stat_sz == sizeof(struct stat));
      |                ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~

Disable libsanitizer for now.

Note: Only glibc toolchains are affected since libsanitizer is
disabled for musl and uClibc-ng	toolchains [3].

Fixes:
https://gitlab.com/kubu93/toolchains-builder/-/jobs/2510178606

[1] http://gcc.gnu.org/ml/gcc/2018-03/msg00133.html
[2] https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=9f943b2446f2d0a345bbf9b4be3d3a4316372270
[3] https://git.buildroot.net/buildroot/commit/?id=5f4d658d888b539de9a6247ae5b1a0999de5d4ec

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2022-07-23 17:31:27 +02:00
Romain Naour
e0ff7f5351 package/gcc: disable libsanitizer for mips64{el} w/ n32 ABI
libsanitizer has been enabled for mips64{el} in gcc 12 [1] but it
fail to build when n32 ABI is used:

In file included from output/mips64el-buildroot-linux-gnu/sysroot/usr/include/bits/stat.h:25,
                 from output/mips64el-buildroot-linux-gnu/sysroot/usr/include/fcntl.h:78,
                 from ../../../../libsanitizer/sanitizer_common/sanitizer_linux.cpp:55:
output/mips64el-buildroot-linux-gnu/sysroot/usr/include/bits/struct_stat.h:190:8: error: redefinition of ‘struct stat64’
  190 | struct stat64
      |        ^~~~~~

In file included from ../../../../libsanitizer/sanitizer_common/sanitizer_linux.cpp:49:
output/mips64el-buildroot-linux-gnu/sysroot/usr/include/asm/stat.h:52:8: note: previous definition of ‘struct stat64’
   52 | struct stat64 {
      |        ^~~~~~

Disable libsanitizer for mips64 with n32 ABI.

Note: Only glibc toolchains are affected since libsanitizer is
disabled for musl and uClibc-ng toolchains [2].

Fixes:
https://gitlab.com/kubu93/toolchains-builder/-/jobs/2510178651

[1] https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=344e6f9f2abcff9b2bb4b26b693be4a599272f43
[2] https://git.buildroot.net/buildroot/commit/?id=5f4d658d888b539de9a6247ae5b1a0999de5d4ec

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2022-07-23 17:31:27 +02:00
Romain Naour
dc000bd1a6 package/gcc: switch to https urls for archives hashes
FTP urls doesn't work anymore with Firefox [1] and Google Chrome [2],
switch to https urls.

[1] https://blog.mozilla.org/addons/2020/04/13/what-to-expect-for-the-upcoming-deprecation-of-ftp-in-firefox/
[2] https://chromestatus.com/feature/6246151319715840

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2022-07-23 16:32:58 +02:00
Romain Naour
242b87e299 package/gcc: add missing --enable-libquadmath-support option
When BR2_TOOLCHAIN_HAS_LIBQUADMATH is set, --enable-libquadmath-support
option is missing. So the float128 support is not fully enabled in gcc.

This lead to a build issue with gcc 12 on PowerPC power8 due to missing
M_2_SQRTPIq definition (provided by libquadmath.h).

../../../libgfortran/intrinsics/erfc_scaled.c: In function ‘erfc_scaled_r17’:
../../../libgfortran/intrinsics/erfc_scaled.c:143:22: error: ‘M_2_SQRTPIq’ undeclared (first use in this function); did you mean ‘M_2_SQRTPIf’?
  143 | # define _M_2_SQRTPI M_2_SQRTPIq
      |                      ^~~~~~~~~~~

This is fixed by adding --enable-libquadmath-support (like crosstool-ng
handling [1]).

Fixes:
https://gitlab.com/kubu93/toolchains-builder/-/jobs/2510178766

[1] https://github.com/crosstool-ng/crosstool-ng/blob/crosstool-ng-1.25.0/scripts/build/cc/gcc.sh#L370

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2022-07-23 16:32:58 +02:00
Romain Naour
770c9e5ce3 package/gcc: restrict hs4x_rel31 to arc gcc fork
All the ARC variants are supported by upstream gcc, except for the
HS48 rel31 (hs4x_rel31) which is only supported by the ARC fork.

Fixes:
http://autobuild.buildroot.net/results/357a74d53af96d4b868a9d5b9f9ce9432e0c53b5
http://autobuild.buildroot.net/results/bcdf160a3d5ffcccd4402f65aca153faca4b32c2

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Cc: ARC Maintainers <arc-buildroot@synopsys.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2022-05-17 21:59:23 +02:00
Romain Naour
24a2dc45cb package/gcc: bump to version 11.3
Tested with toolchain-builder:
https://gitlab.com/kubu93/toolchains-builder/-/pipelines/529686714

See:
https://gcc.gnu.org/pipermail/gcc/2022-April/238573.html
https://gcc.gnu.org/gcc-11/changes.html

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2022-05-04 21:43:40 +02:00
Norbert Lange
ee228403e9 package/gcc: use binutils wrappers for target libs
This will use gcc-ar, gcc-nm and gcc-ranlib instead of the
normal binutils tools. The difference is that with the
wrappers, gcc plugins will be automatically picked up,
which is necessary to build with LTO.

With this enabled, it is possible to build everything (including libgcc
and libstdc++) with LTO by setting BR2_TARGET_OPTIMIZATION="-flto".

Note that you'd expect that the GCC build system would automatically do
this when --enable-lto is set, but this is not the case. There are some
open bugs [1][2] to allow building libgcc and libstdc++ with LTO support
but it's apparently not done yet.

Note that there are also reports of problems building libstdc++ with LTO
[3], but it seems that's no longer a problem (and the bug didn't get
updated).

Signed-off-by: Norbert Lange <nolange79@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59893
[2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77278
[3] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60160
2022-01-25 22:10:26 +01:00
Fabrice Fontaine
98e39dc80e package/gcc: define _REENTRANT for OpenRISC when -pthread is passed
Patch added by commit eee96b0f0a on gcc
9.3.0 must also be applied on gcc 10 and 11 to avoid the following build
failure on numerous packages (babeltrace2, pcsc-lite, tpm2-pkcs11,
etc.):

configure:13774: checking whether pthreads work with -pthread
configure:13868: /home/giuliobenetti/autobuild/run/instance-0/output-1/host/bin/or1k-linux-gcc -o conftest -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os -g2  -std=gnu99 -pthread -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  conftest.c   >&5
conftest.c:27:26: error: #error "_REENTRANT must be defined"
   27 | #                        error "_REENTRANT must be defined"
      |                          ^~~~~

It should be noted that external bootlins will have to be rebuilt.

Fixes:
 - http://autobuild.buildroot.org/results/cb58d4fbaeb08d188c2f8bf05ef1604789fa8766
 - http://autobuild.buildroot.org/results/7af9d4b68bd46ed260ed66ba2cc3c9c21482e741
 - http://autobuild.buildroot.org/results/6f926bec146752873f8032b593f0de1cb222ea46

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2022-01-22 15:33:07 +01:00
Thomas Petazzoni
81662cf228 package/gcc/Config.in.host: fix BR2_GCC_VERSION_ARC select of BR2_TOOLCHAIN_GCC_AT_LEAST_xyz
When the gcc arc version was bumped to a version using gcc
10.x (arc-2020.09-release) in commit 0791abfba0 (toolchain: update ARC
tools to arc-2020.09-release), the select of BR2_GCC_VERSION_ARC on the
appropriate BR2_TOOLCHAIN_GCC_AT_LEAST_xyz was not updated.

Commit 0b4c7ba01c (toolchain: update option descriptions for ARC tools
arc-2020.09-release) fixed the prompt, but still forgot to update the
appropriate BR2_TOOLCHAIN_GCC_AT_LEAST_xyz.

This commit eventually fixes this issue.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2021-12-28 21:42:19 +01:00
Yann E. MORIN
b98ed34072 package/gcc: fix xtensa overlay for gcc ccache hash
Commit b3b6070622 (arch/xtensa: allow specifying path to tarball file)
missed a place where the xtensa overlay was referenced, thus breaking
the calculation for the ccache hash.

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Reviewed-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2021-12-25 15:59:05 +01:00
Fabrice Fontaine
9a3e6c5406 package/gcc/gcc-final: drop spurious space
Drop spurious space added by commit
7d6c79ed88

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2021-11-29 22:31:15 +01:00
Romain Naour
547d681b45 package/gcc: remove csky version
Remove gcc csky fork since it doesn't build with the latest compilers
(gcc 8, 10, 11 tested) [1].

Removing the csky gcc fork has become unavoidable since the
Buildroot Docker image used by the gitlab CI will switch soon to
Debian bullseye soon [2].

The csky support for csky807 and csky810 has been upstreamed in
gcc 10 [3] and csky860 will be supported by gcc 12 [4]. There is
no info about the csky610. Although the csky architecture is
supported since gcc 10, the support was not enabled in Buildroot.

[1] http://lists.busybox.net/pipermail/buildroot/2021-August/621504.html
[2] 71b8322712
[3] https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=cc7232b999b8336cf4e261407ed9289c77bed1f0
[4] https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=db92bd223e3957ee58b5a0c0fffd8b7766f1def3

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Cc: Guo Ren <ren_guo@c-sky.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Asked-by: Guo Ren <guoren@kernel.org>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2021-10-17 18:59:22 +02:00
Michael Fischer
35af76784f package/gcc: bump version 11.x to 11.2.0
patch 0001: already applied upstream

Signed-off-by: Michael Fischer <mf@go-sys.de>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2021-09-11 18:16:16 +02:00
Giulio Benetti
137225cef4 package/gcc: add OpenRisc patches for gcc version 11.1.0
At the moment of gcc 11.1.0 release the OpenRisc patches for -mcmodel=large
were still pending. They have been upstreamed yesterday as pointed in gcc
bugzilla[1]. So they will be part of gcc 11.3.0 or maybe before on 11.2.
2. Anyway at the moment if we try to build packages libgeos and protobuf
with OpenRisc gcc 11.1.0 it fails due to missing -mcmodel=large. So let's
add OpenRisc patches for it as done for all the previous versions.

Fixes:
still not appeared on autobuilers

[1]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99783

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2021-08-17 23:11:44 +02:00
Maxim Kochetkov
4d8ee4456a package/gcc: fix libsanitizer build with Linux 5.13 headers
Starting from 5.13 Cyclades async mux support is dropped from linux kernel:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f76edd8f7ce06cdff2fe5b6b39a49644c684a161

But gcc's libsanitizer uses <linux/cyclades.h> header.
This issue is fixed by:
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=745dae5923aba02982563481d75a21595df22ff8

gcc 9.4.0 has already been released with the fix, so we only patch gcc
8.x, 10.x, 11.x, the ARC and C-SKY versions

Fixes:

  http://autobuild.buildroot.net/results/7f2056d05f4e05fcb95e2606583e95fac8bf3aef/ (gcc 10.x)
  http://autobuild.buildroot.net/results/116f40c22946952a8190ccba85d26913d9786e52/ (gcc 11.x)

Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2021-07-31 12:02:24 +02:00
Romain Naour
531b2a10cd package/gcc: restrict gcc 8.x to PowerPC SPE
gcc 11.1 is around, gcc 10.2 is the default version, so drop
8.4 in order to reduce the gcc choice.

For PowerPC SPE, introduce BR2_GCC_VERSION_POWERPC_SPE
to avoid removing defconfigs arcturus_ucp1020_defconfig,
freescale_p1025twr_defconfig and qemu_ppc_mpc8544ds_defconfig
that are still used by some users [1].
BR2_GCC_VERSION_POWERPC_SPE use the same gcc version (8.4), no
change expected.

[1] 96e80ad214

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Cc: Oleksandr Zhadan <oleks@arcturusnetworks.com>
Cc: Michael Durrant <mdurrant@ArcturusNetworks.com>
Cc: Matthew Weber <matthew.weber@collins.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2021-07-21 22:20:28 +02:00
Romain Naour
eacf7a1d0b package/gcc: switch to gcc 10.x as the default
Even if gcc 9.x is still maintained for some time (gcc 9.5 will be the
last), switch to gcc 10.x since it has been released since 2020-05-07
and gcc 11.x is available since 2021-04-27.

We have been having toolchains in the autobuilders with gcc 10.x since
mid-January 2021, so the vast majority of the problems should have
already been solved.

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2021-06-20 19:03:22 +02:00
Romain Naour
b28e598cec arch: add BR2_ARCH_NEEDS_GCC_AT_LEAST_11
This new symbol will be used by architectures introduced with gcc 11.

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

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2021-06-20 18:46:51 +02:00
Romain Naour
2ab88dac29 package/gcc: add support for gcc 11
Disable sparc architecture for gcc 11 due to an recent gcc change
that broke uClibc-ng. The change was reverted by the patch
0005-Revert-re-PR-target-92095-internal-error-with-O1-mcp.patch
for gcc 8.4, 9.3 and 10.1 but stop maintaining it for newer gcc
releases.

Rutime tested:
https://gitlab.com/kubu93/buildroot/-/pipelines/318043235

https://gcc.gnu.org/gcc-11/changes.html
https://gcc.gnu.org/gcc-11/porting_to.html

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2021-06-20 18:43:46 +02:00
Romain Naour
ebda5414d3 package/gcc: bump to version 9.4.0
Remove upstream patches
Reorder remaining patches

See:
https://gcc.gnu.org/pipermail/gcc-announce/2021/000168.html

Runtime tested:
https://gitlab.com/kubu93/buildroot/-/pipelines/315291768

Signed-off-by: Romain Naour <romain.naour@gmail.com>
2021-06-20 14:50:54 +02:00
Peter Korsgaard
8d07baab43 Merge branch 'next'
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2021-06-07 17:14:37 +02:00
Giulio Benetti
f8367664f8 package/gcc: add upstream patches that introduce -mcmodel=large option for or1k
Let's add upstream patches introducing -mcmodel=large or1k gcc option that
works in conjunction with previous binutils patch. That option fix binutils
bug 21464[1] allowing to build libgeos with no problem. This way we can
consider buildroot toolchain binutils bug 21464 free.

[1]: https://sourceware.org/bugzilla/show_bug.cgi?id=21464

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
[Arnout: remove the PATCH M/N parts - cfr. check-package]
2021-05-21 10:37:20 +02:00
Romain Naour
578de6edbf package/gcc: enable secureplt for powerpc64
GCC support enabling secureplt for powerpc64.

From [1]
"PowerPC has two PLT models: BSS-PLT and Secure-PLT. BSS-PLT uses
runtime code generation to generate the PLT stubs. Secure-PLT was
introduced with GCC 4.1 and Binutils 2.17 (base has GCC 4.2.1 and
Binutils 2.17), and is a more secure PLT format, using a read-only
linkage table, with the dynamic linker populating a non-executable
index table."

This option is always enabled by glibc testing script
called build-many-glibcs.py [1]. This script exist since
glibc 2.25.

Runtime tested with qemu_ppc64_e5500_defconfig.

[1] https://reviews.freebsd.org/D20598
[2] https://sourceware.org/git/?p=glibc.git;a=blob;f=scripts/build-many-glibcs.py;h=9c08ab7b326e6385abb835eb32dd143952a71942;hb=9826b03b747b841f5fc6de2054bf1ef3f5c4bdf3#l345

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Cc: Matt Weber <matthew.weber@collins.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2021-05-18 14:04:11 +02:00
Romain Naour
81b0170a59 package/gcc: bump to version 10.3
Remove upstream patch
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=5aeabae7f0cdd8dd3a01103b68b2e7a66a71c685

Rebase the patch: Revert "re PR target/92095 (internal error with -O1 -mcpu=niagara2 -fPIE)"
Add the link to the bug report.

Tested with toolchain-builder:
https://gitlab.com/kubu93/toolchains-builder/-/pipelines/284176939

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2021-04-11 21:33:36 +02:00
Romain Naour
4d16e6f532 package/gcc: fix gcc 8.4, 9.3 and 10.2 for sparcv8 (ss10)
As reported on IRC by sephthir, the qemu_sparc_ss10_defconfig doesn't
work as expected: the system generated when booted under Qemu produces
illegal instruction messages.

gcc 8.3, 9.2 are the latest working gcc version. git bisect between
gcc 8.3 and 8.4 allowed to identify the commit that introcuced the
regression.

Reverting this patch allowed to produce a working rootfs.

Fixes:
https://gitlab.com/buildroot.org/buildroot/-/jobs/786589934

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2021-01-21 21:58:50 +01:00
Veronika Kremneva
a61529b6c3 package/gcc: fix ARC adc/sbc patterns handling in GCC 10.x
There is a problem while building various packages with GCC 10.x for ARC:

----------------------------->8---------------------------
make[2]: *** [magick/libGraphicsMagick_la-analyze.lo] Error 1
make[2]: *** Waiting for unfinished jobs....
/tmp/ccFqDn0F.s: Assembler messages:
/tmp/ccFqDn0F.s:1586: Error: operand is not duplicate of the previous one for instruction 'adc'
----------------------------->8---------------------------

This failure happens on regular basis and can also be observed in:

http://autobuild.buildroot.net/results/c9d13a3659e3a45864f9622b29122e666f763c6e/
http://autobuild.buildroot.net/results/84edcdb0f5759fa587a5638e1bab18379ee1f3b2/
http://autobuild.buildroot.net/results/6f6acbb1a8708ad840a9361ee72b8d14699b44d9/

More details you can find on filed issue:
https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/issues/310
Fix:
09944fba5b

This fix was already added in commit
692829d967 ("toolchain: add upstream fix
for arc gcc") for the ARC-specific gcc version, but not for gcc 10.x,
which can be selected on ARC and exhibits the same problem.

Signed-off-by: Veronika Kremneva <kremneva@synopsys.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2020-12-30 23:39:30 +01:00
Bernd Kuhls
692829d967 toolchain: add upstream fix for arc gcc
Fixes:
http://autobuild.buildroot.net/results/792/792e69eefc87d28b92972c452d5e230d86d9e114/

Upstream issue:
https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/issues/310

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2020-12-01 22:58:41 +01:00
Bernd Kuhls
0b4c7ba01c toolchain: update option descriptions for ARC tools arc-2020.09-release
https://git.buildroot.net/buildroot/commit/?id=0791abfba0227803b19895ea22326f4e17ac93dc

bumped
* Binutils 2.34.50 with additional ARC patches
* GCC 10.0.2 with additional ARC patches
* GDB 10.0.50 with additional ARC patches

but forgot to update the version numbers stored in option descriptions.

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2020-12-01 22:56:11 +01:00
Alexey Brodkin
d2ae7eb2a2 package/gcc: Fix libs building on ARC700 with atomics
As we many times by now discussed that - some ARC cores might
not have atomic instructions implemented. Namely that's ARC700
w/o explicitly added atomics during design creation/configuration.

Because of that when GCC gets configured for ARC700, i.e. via
"--with-cpu=arc700" atomic ops are assumed disabled.

Usually it's not a problem as we add "-matomics" in the wraper for
building all packages if targets CPU has atomis (BR2_ARC_ATOMIC_EXT).

But when bulding target's binaries which are essential parts of
the GCC itself we don't use the wrapper. Instead xgcc is being used.
That way we lose that important part of system's configuration about
atomics and:
 1. Atomic ops won't be used where otherwise they could have been used.
 2. Some configuration checks might end-up thinking there're no atomics

In particular (2) leads to pretty obscure failure on bulding of some
packages which use C++, for example:

log4cplus: http://autobuild.buildroot.net/results/a7732fdb2ba526a114d9fb759814236c5332f8d7
------------------------>8--------------------
./.libs/liblog4cplus.so: undefined reference to `std::__atomic_futex_unsigned_base::_M_futex_notify_all(unsigned int*)'
collect2: error: ld returned 1 exit status
------------------------>8--------------------

bitcoin: http://autobuild.buildroot.net/results/f73/f73d4c77e5fd6223abdbc83e344addcfc93227b8
------------------------>8--------------------
(.text+0x110c): undefined reference to `std::__atomic_futex_unsigned_base::_M_futex_wait_until(unsigned int*, unsigned int, bool, std::chrono::duration<long long, std::ratio<1ll, 1ll> >, std::chrono::duration<long long, std::ratio<1ll, 1000000000ll> >)'
collect2: error: ld returned 1 exit status
------------------------>8--------------------

apcupsd: http://autobuild.buildroot.net/results/7a2/7a2cc7a4ac2237c185817f75e55e05d144efd100
------------------------>8--------------------
/tmp/instance-0/output-1/host/lib/gcc/arc-buildroot-linux-uclibc/9.3.1/../../../../arc-buildroot-linux-uclibc/bin/ld: eh_throw.cc:(.text._ZL23__gxx_exception_cleanup19_Unwind_Reason_CodeP17_Unwind_Exception+0x24): undefined reference to `__gnu_cxx::__exchange_and_add(int volatile*, int)'
collect2: error: ld returned 1 exit status
------------------------>8--------------------

...and many more.

Interesting enough that was not seen earlier because "-matomic"
used to be added in TARGET_{C|CXX}FLAGS via TARGET_ABI,
but later "-matomic" was moved to ARCH_TOOLCHAIN_WRAPPER_OPTS, see
https://git.buildroot.org/buildroot/commit/?id=c568b4f37fa6d7f51e6d14d33d7eb75dfe26d7bf
and since then we started to see that new breakage which we now
attempt to fix right where it hapens on GCC configuration.

In contrast ARC HS family has atomic ops enabled by default thus
we never spotted that kind of problem for it.

More datails with analysis of what really happens under the hodd and
how do error messages above are related to libs of GCC configuration could
be found here: http://lists.busybox.net/pipermail/buildroot/2020-October/293614.html

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
Cc: Peter Korsgaard <peter@korsgaard.com>
Cc: Romain Naour <romain.naour@gmail.com>
[Peter: simplify conditional]
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2020-11-03 21:33:10 +01:00
Evgeniy Didin
0791abfba0 toolchain: update ARC tools to arc-2020.09-release
This commit bumps ARC toolchain to arc-2020.09-release.

ARC GNU tools of version arc-2020.09-release bring some quite significant
changes like:
* Binutils 2.34.50 with additional ARC patches
* GCC 10.0.2 with additional ARC patches
* GDB 10.0.50 with additional ARC patches

Signed-off-by: Evgeniy Didin <Evgeniy.Didin@synopsys.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: arc-buildroot@synopsys.com
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2020-11-03 20:10:08 +01:00
Michael Durrant
96e80ad214 package/gcc: re-enable gcc 8.x for PowerPC SPE
The GCC-7.x compiler series was the last to officially support PowerPC
SPE CPUs. Now that GCC-8.x is the default compiler used by Buildroot,
some defconfigs, notably the arcturus_ucp1020_defconfig and
freescale_p1025twr_defconfig ones started to fail building, as they
are PowerPC SPE platforms.

In fact, the GCC-8.x compiler series continues to support PowerPC SPE
CPU cores, but only as an --enable-obsoleted instruction set. This
patch enables the use of GCC-8.x and asserts the required option to
enable the PowerPC SPE instruction set.

This patch passes compilation and run tests with the
arcturus/ppc-ucp1020  board.

This patch should address a noted job failure on GitLab CI
https://gitlab.com/buildroot.org/buildroot/-/jobs/805461732

Fixes: https://gitlab.com/buildroot.org/buildroot/-/jobs/805461732
Signed-off-by: Michael Durrant <mdurrant@ArcturusNetworks.com>
Signed-off-by: Oleksandr G Zhadan <Oleks@ArcturusNetworks.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2020-10-31 23:48:51 +01:00
Matt Weber
a07fc4b03b package/gcc: disable fortran use of libquadmath
The GCC package has a default conf option of disabling libquadmath and
the toolchain dependencies selectively enabled it if i386 / x64.

Fixes:
https://gitlab.com/bootlin/toolchains-builder/-/jobs/729359622

This patch fixes a build failure when (GCC + glibc) is being built for
the IBM Power8 arch and has libgfortran enabled + libquadmath disabled.
The libgfortran has a code condition for __float128 and includes the
quadmath headers. The bug occurs because Power8 has emulated
float128 support. The fix per GCC options is to also set
--disable-libquadmath-support which disables the
__float128/libquadmath support in gcc/fortran and in libgfortran [1].

Another option to fix the build failure was to enable libquadmath for
IBM Power8 (ISA 2.07), however this would be soft float based as the
ISA 3.0+ (Power9) first supports native float128 [2][3].

[1] https://fortran.gcc.gnu.narkive.com/8uSfoKUS/patch-build-pr-46540-add-disable-libquadmath-disable-libquadmath-support
[2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66382#c7
[3] https://gcc.gnu.org/onlinedocs/gcc/RS_002f6000-and-PowerPC-Options.html

Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2020-10-25 15:58:02 +01:00
Romain Naour
4504bf3785 package/gcc: remove gcc 7.5.0
gcc 10.2 is around, gcc 9.3 is the default version, so drop
7.5 in order to reduce the gcc choice.

See:
https://gcc.gnu.org/legacy-ml/gcc/2019-11/msg00099.html

The last defconfig using gcc 7 (roseapplepi_defconfig) has been
updated by 9cd0654380.

Signed-off-by: Romain Naour <romain.naour@gmail.com>
[Peter: add Config.in.legacy entry]
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2020-10-04 11:27:21 +02:00
Thomas Petazzoni
a4fb6dedfc package/gcc: drop leftovers from PowerPC conditional patching
We used to have a conditional patch applied on PowerPC soft-float, but
this logic was dropped in commit
0c82f3f635 ("package/gcc: remove powerpc
conditional patching logic"). However, we still have some related
leftovers in the calculation of the hashes for ccache, which can now
be dropped.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Romain Naour <romain.naour@gmail.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
Acked-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2020-10-01 10:52:42 +02:00