Commit Graph

124 Commits (ebe2a113aba9f15e19c36c0c204e50980ba7e7ae)

Author SHA1 Message Date
Yann E. MORIN ebe2a113ab arch/powerpc: drop ABI selection
Since it was introduced in 5a6087d62e (toolchain: add powerpc SPE ABI
support), the CLASSIC vs. SPE choice for the ABI was never really a
choice: CPU without SPE could only use the CLASSIC ABI, while CPUs with
SPE could only use the SPE ABI.

Commit b4c824562b (powerpc: add BR2_POWERPC_CPU_HAS_SPE to replace
adhoc deps/checks) added a blind option that CPUs with SPE would select
rather than duplicate the ad-hoc dependencies in both CLASSIC and SPE
ABI options. Since then, it was even more obvious that the ABI choice
was really not a choice, as the two options have mutually exclusive
conditions.

Drop the useless choice, and directly use the blind option as selected
by the specific CPUs.

We don't need legacy handling, because the situation fixes itself.

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Joel Stanley <joel@jms.id.au>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2023-08-20 23:22:27 +02:00
Fabrice Fontaine 6455558f62 package/gcc: fix GCC_DL_DIR
GCC_DL_DIR is empty as gcc is not a "real" package, as a result, the
following (silent) error is raised when BR2_CCACHE is set:

/home/thomas/autobuild/instance-0/output-1/per-package/host-gcc-initial/host/bin/ccache /usr/bin/gcc -O2 -I/home/thomas/autobuild/instance-0/output-1/per-package/host-gcc-initial/host/include -DBR_CROSS_PATH_SUFFIX='".br_real"' -DBR_CCACHE_HASH=\"` printf '%s\n'  --target=aarch64_be-buildroot-linux-gnu --with-sysroot=@HOST_DIR@/aarch64_be-buildroot-linux-gnu/sysroot --enable-__cxa_atexit --with-gnu-ld --disable-libssp --disable-multilib --disable-decimal-float --enable-plugins --enable-lto --with-gmp=@HOST_DIR@ --with-mpc=@HOST_DIR@ --with-mpfr=@HOST_DIR@  --with-bugurl="http://bugs.buildroot.net/" --without-zstd --disable-libquadmath --disable-libquadmath-support --enable-tls --enable-threads --without-isl --without-cloog --with-abi="lp64" --with-cpu=cortex-a53 --enable-languages=c --disable-shared --without-headers --disable-threads --with-newlib --disable-largefile  | sha256sum - /gcc-11.3.0.tar.xz package/gcc/11.3.0/0001-or1k-Add-mcmodel-option-to-handle-large-GOTs.patch package/
 gcc/11.3.0/0002-or1k-Use-cmodel-large-when-building-crtstuff.patch package/gcc/11.3.0/0003-gcc-define-_REENTRANT-for-OpenRISC-when-pthread-is-p.patch package/gcc/11.3.0/0004-disable-split-stack-for-non-thread-builds.patch package/gcc/11.3.0/0005-rs6000-Improve-.machine.patch package/gcc/11.3.0/0006-rs6000-Do-not-use-rs6000_cpu-for-.machine-ppc-and-pp.patch package/gcc/11.3.0/0007-fixinc-don-t-fix-machine-names-in-__has_include-.-PR.patch | cut -c -64 | tr -d '\n'`\" -DBR_SYSROOT='"aarch64_be-buildroot-linux-gnu/sysroot"' -DBR_ADDITIONAL_CFLAGS='"-Wl,-z,max-page-size=65536", "-Wl,-z,common-page-size=65536", "-fstack-protector-strong",' -DBR_CCACHE -DBR2_RELRO_PARTIAL -s -Wl,--hash-style=both toolchain/toolchain-wrapper.c -o /home/thomas/autobuild/instance-0/output-1/build/host-gcc-initial-11.3.0/toolchain-wrapper
sha256sum: /gcc-11.3.0.tar.xz: No such file or directory

This patch replaces GCC_DL_DIR by $($(PKG)_DL_DIR) as suggested by
Arnout Vandecappelle.

Fixes:
 - Found when investigating: http://autobuild.buildroot.org/results/ae75f5cdd4a1fe97359b99b2bcade258097c86dd

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2023-02-23 23:44:23 +01:00
John Keeping f9a92ea1cb package/gcc: map debug prefix when reproducible
When building with BR2_REPRODUCIBLE the toolchain wrapper passes
-fdebug-prefix-map for all packages that are built.  But this doesn't
affect the target libraries (like libgcc) built by GCC's build system.

GCC 4.3 added a configure option to set the debug prefix map for these
libraries, which is used here to avoid encoding potentially
non-reproducible build paths into the debug data.

Signed-off-by: John Keeping <john@metanate.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2023-02-07 23:23:19 +01: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
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 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
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
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
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
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
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
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
Thomas Petazzoni 0bec4c8a4a package/gcc: help libbacktrace detection of sync builtins
The logic in libbacktrace/configure.ac to detect if __sync builtins
are available assumes they are as soon as target_subdir is not
empty, i.e when cross-compiling. However, some platforms do not have
__sync builtins, so help the configure script a bit.

"libbacktrace_cv_sys_sync=no" is lost when it is added to
HOST_GCC_COMMON_CONF_ENV because the environment is not exported
when executing the libbacktrace configure script.

Use target_configargs to force "libbacktrace_cv_sys_sync=no" when
executiong the libbacktrace configure script.

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

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
[Romain: use target_configargs="libbacktrace_cv_sys_sync=no"]
Signed-off-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2020-10-01 10:48:03 +02:00
Alexander Egorenkov 29353bbef7 toolchain: add support for the internal IBM s390x and Z toolchain
Signed-off-by: Alexander Egorenkov <egorenar@linux.ibm.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-09-24 22:03:54 +02:00
Matt Weber f9b539bf40 package/gcc: transition PowerPC 32 to secureplt
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.

References to other distro/BSD transitions:
  https://patchwork.openembedded.org/patch/106621/
  https://reviews.freebsd.org/D20598

Fixes a bug observed when creating SELinux policy where all apps
require execmem because the heap requires execute before this change.

Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2020-09-23 20:47:02 +02:00
Romain Naour 3df3021120 package/gcc: disable libsanitizer with gcc 7.5 and glibc 2.31 toolchain
libsanitizer in gcc 7.x fails to build with glibc 2.31. Fixing it would
require backporting an upstream commit:

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

However, the backport is not trivial, as there are a lot of conflicts.

Disable libsanitizer since the gcc 7.5 branch is now closed
(unmaintained) and it's not a trivial merge.

Signed-off-by: Romain Naour <romain.naour@smile.fr>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-07-27 15:26:30 +02:00
Romain Naour 5502943b3b package/gcc: add support for gcc 10
Keep the same patch as for gcc 9.x fixing a parallel build issue:
58ecbbc3ef.

Keep libzstd support disabled for now, it could be used in the future
for LTO bytecode compression.

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

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2020-06-24 21:57:43 +02:00
Romain Naour 0c82f3f635 package/gcc: remove powerpc conditional patching logic
Back in commit [1], a patch fixing an issue a PowerPC issue in gcc was
added in gcc 4.3.3. It was present until gcc 4.9, which itself was
removed in [2]. The patch was dropped starting gcc 5.1 [3] but it's
know to be useful for gcc 4.7.3 [4]. However, even though we no longer
support building any of those older gcc versions, the conditional
patching logic in gcc.mk is still there.

We used to have a patch directory (package/gcc/$(GCC_VERSION)) for
every gcc version available in Buildroot, the apply-patches.sh script
doesn't error out even if
1000-powerpc-link-with-math-lib.patch.conditional is missing.

But with gcc 10, we don't need (for the moment) to apply any patch, so
the patch directory doesn't exist. apply-patches.sh breaks the build
since the patch directory is missing:

  Aborting.  'package/gcc/10.1.0' is not a directory.

Since we removed gcc 4.9 last year [2], we can safely remove this code.

Tested using qemu_ppc_virtex_ml507_defconfig.

[1] bb1f42e442
[2] baf1775022
[3] 4deb2d93c5
[4] 197006a41c

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2020-05-09 16:53:06 +02:00
Yann E. MORIN 2a6003ddd5 package/gcc: fix check-package
Commit dcaf6e75a (package/gcc: pass -Wno-error to debug builds)
introduced non-ASCII characters in a comment, copy-pasted from a
terminal output.

check-package does not like non-ASCII characters, and whines about
them.

Replace the fancy quotes by standard ASCII ones.

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-04-10 21:30:14 +02:00
James Hilliard dcaf6e75ac package/gcc: pass -Wno-error to debug builds
gcc fails to build in debug build with debug optimisations:

BR2_x86_corei7=y
BR2_ENABLE_DEBUG=y
BR2_DEBUG_3=y
BR2_OPTIMIZE_G=y
BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
BR2_TOOLCHAIN_BUILDROOT_CXX=y

which fails with:
    ../../../../libsanitizer/libbacktrace/../../libbacktrace/elf.c:772:21: error: ‘st.st_mode’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
       return S_ISLNK (st.st_mode);
                     ^
Upstream has been unable to reproduce/fix properly, details:
https://gcc.gnu.org/legacy-ml/gcc-patches/2019-03/threads.html#00827

Upstream recommends passing -Wno-error as a workaround, see:
https://gcc.gnu.org/pipermail/gcc-patches/2019-April/519867.html

Reviewed-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
[yann.morin.1998@free.fr: add the reproducing defconfig]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-04-07 22:24:59 +02:00
Romain Naour a85b464b94 package/gcc: fix download url when using upstream gcc for csky
When the csky cpu support was added [1], the gcc download url was selected
depending on the csky cpu architecture (BR2_csky) rather than the csky gcc
fork version (BR2_GCC_VERSION_CSKY)[2].

When adding gcc 9.x version [3], we forgot to update the condition in order
to use the url to the gcc csky fork only when BR2_GCC_VERSION_CSKY=y.

Due to this error, the toolchain build with the upstream gcc 9.x for csky
cpu is broken due a download error.

Fix this by using BR2_GCC_VERSION_CSKY instead of BR2_csky.

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

[1] 7873a5bd5e
[2] https://git.buildroot.net/buildroot/tree/package/gcc/gcc.mk?id=7873a5bd5ebbeb1674293dae6b06b50f0a1f2184#n19
[3] 089000eccf

Signed-off-by: Romain Naour <romain.naour@smile.fr>
Cc: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Guo Ren <guoren@kernel.org>
Cc: Arnout Vandecappelle <arnout@mind.be>
Cc: Peter Korsgaard <peter@korsgaard.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2020-03-14 15:15:59 +01:00
Romain Naour f424b8afa2 package/gcc: remove gcc 5.5 or1k fork
Remove the old gcc 5.5 fork for or1k architecture
that start to fail to build with recent version
of Binutils >= 2.32 with the following error:

host-gcc-final-or1k-musl-5.4.0-20170218/build/./gcc/crtbeginS.o: addend should be zero for plt relocations
host/or1k-buildroot-linux-uclibc/bin/ld: final link failed: bad value

https://gitlab.com/kubu93/buildroot/-/jobs/391938988

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2020-02-04 21:18:42 +01:00
Eric Le Bihan 22e82f22d1 package/gcc: install wrapper for GDC
Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2019-11-04 23:01:13 +01:00
Romain Naour baf1775022 package/gcc: remove gcc 4.9
In order to reduce the number of choice in gcc selection, remove the
gcc 4.9 version.

This version was kept due to libstdc++ ABI-incompatible changes and
other build issues with kernel and bootloader as reported by Arnout
[1].

Since then, gcc 4.9 is not supported any more since glibc 2.29 [2]
and recent kernel and bootloaders has been fixed to use more recent
compiler version.

[1] http://lists.busybox.net/pipermail/buildroot/2017-June/194374.html
[2] https://www.sourceware.org/ml/libc-alpha/2019-01/msg00723.html

Signed-off-by: Romain Naour <romain.naour@smile.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2019-08-04 12:57:59 +02:00
Romain Naour 77b3c089e9 package/gcc: remove libmudflap option
libmudflap was removed from gcc 4.9 [1] so it depends on gcc <= 4.9.
This option can't be selected since we removed gcc 4.8 from Buildroot
[2].

[1] 4a692aefee
[2] f66952197b

Signed-off-by: Romain Naour <romain.naour@smile.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2019-08-02 22:51:54 +02:00
Romain Naour da70a55a19 package/gcc: enable gcc 9.1 for ork1 (openrisc)
openrisc support has been added with gcc 9.1.
Keep for now the old gcc 5 fork for ork1.

https://gcc.gnu.org/gcc-9/changes.html

Tested using qemu_or1k_defconfig.

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2019-07-13 23:09:03 +02:00
Guo Ren 7873a5bd5e package/gcc: add C-SKY specific gcc version
Signed-off-by: Guo Ren <ren_guo@c-sky.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2019-05-31 22:59:57 +02:00
Alexey Brodkin 3e53b51983 package/gcc: enable __cxa_atexit
This is what GCC manual says [1]:
-------------------------->8----------------------
--enable-__cxa_atexit

    Define if you want to use __cxa_atexit, rather than atexit,
    to register C++ destructors for local statics and global objects.

    This is essential for fully standards-compliant handling of destructors,
    but requires __cxa_atexit in libc.

    This option is currently only available on systems with GNU libc
    ...
-------------------------->8----------------------

Important disadvantages of a simple atexit() are that [2]:
-------------------------->8----------------------
1999 C Standard only requires that the implementation support 32
registered functions, although most implementations support many more.

More important it does not deal at all with the ability in most implementations
to remove DSOs from a running program image by calling dlclose
prior to program termination.
-------------------------->8----------------------

Also it seems like all libc's we support in Buildroot (Glibc, uClibc and musl)
support __cxa_at_exit() so enable it unconditionally.

FWIW if we look around we'll see:
 1. In OpenEmbedded it is enabled for everything except gcc-cross-initial: [3], [4]
 2. In Crosstool-NG it is enabled by default: [5]
 3. In OpenWrt it is disabled only for uClibc, otherwise enabled: [6]

So I think we should be good with it as well.

[1] https://gcc.gnu.org/install/configure.html
[2] https://itanium-cxx-abi.github.io/cxx-abi/abi.html#dso-dtor-motivation
[3] https://github.com/openembedded/openembedded-core/blob/master/meta/recipes-devtools/gcc/gcc-configure-common.inc#L59
[4] https://github.com/openembedded/openembedded-core/blob/master/meta/recipes-devtools/gcc/gcc-cross-initial.inc#L23
[5] https://github.com/crosstool-ng/crosstool-ng/blob/master/config/cc/gcc.in#L270
[6] https://github.com/openwrt/openwrt/blob/master/toolchain/gcc/common.mk#L170

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Nicolas Cavallari <Nicolas.Cavallari@green-communications.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Mark Corbin <mark.corbin@embecosm.com>
Cc: Romain Naour <romain.naour@gmail.com>
Cc: Peter Korsgaard <peter@korsgaard.com>
Cc: Bernd Kuhls <bernd.kuhls@t-online.de>
Cc: Claudiu Zissulescu <claziss@synopsys.com>
Cc: Cupertino Miranda <cmiranda@synopsys.com>
Cc: Vineet Gupta <vgupta@synopsys.com>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2018-11-29 22:12:38 +01:00
Alexey Brodkin 545ca6a0f2 gcc: Don't mess with test-suite exclusion
We used to exclude GCC's test-suite for quite some time now
mostly for the sake of space reduction.

But:
 1. On each GCC version bump we need to revise that functionality
    as we need to accommodate changes in GCC sources and this
    couldn't be automated

 2. The space reduction is significant, but not huge. The two test
    suites together take up 290MB, out of 660MB total for GCC (each of
    them times two because there is the -initial and -final copy).
    However, whenever we build GCC, we also have kernel headers (about
    900MB) and a libc (e.g. glibc is 250MB). So at best, it saves less
    than 20%.

 3. It doesn't really save on build time either.
    Below are timings of 2 runs on my laptop:

    a) Vanilla master:
    --------------------->8---------------------
    time make host-gcc-final
    real	7m15.114s
    user	19m36.611s
    sys 	2m26.927s
    --------------------->8---------------------

    b) master + testsuite:
    --------------------->8---------------------
    time make host-gcc-final
    real	7m59.860s
    user	20m21.668s
    sys 	2m36.618s
    --------------------->8---------------------

    From figures above it's seen that difference is ~45 seconds
    or ~10%. On both host-gcc-initial and -final we may save ~1.5
    minutes... but these are not the only components we build and
    compared to a total toolchain build time IMHO it is not that
    much time to care especially traded for maintenance costs
    on GCC version bumps.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Bernd Kuhls <bernd.kuhls@t-online.de>
Cc: Romain Naour <romain.naour@gmail.com>
Cc: Peter Korsgaard <peter@korsgaard.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
[Arnout: add explanation about size impact.]
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2018-11-03 11:49:00 +01:00
Thomas Petazzoni 6561d925f4 package/gcc: remove BR2_GCC_SUPPORTS_FINEGRAINEDMTUNE
Since commit 8f8e9162fa ("package/gcc:
do not mourn avr32 for too long..."), in which we dropped AVR32
support, the BR2_GCC_SUPPORTS_FINEGRAINEDMTUNE is always
'y'. Therefore, it is totally useless to keep this option around, and
this commit removes it, making the corresponding code unconditional
along the way.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Reviewed-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2018-10-21 16:26:59 +02:00
Thomas Petazzoni cf2b12cbfb arch: drop BR2_GCC_TARGET_CPU_REVISION option
In commit 325bb37942, support for the
Blackfin architecture was removed. This was our only use of
BR2_GCC_TARGET_CPU_REVISION, and since this config option somewhat
complicates the calculation of the --with-cpu/-mcpu option values,
let's drop it.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2018-10-01 14:52:32 +02:00
Mark Corbin bd0640a213 arch: allow GCC target options to be optionally overwritten
The BR2_GCC_TARGET_* configuration variables are copied to
corresponding GCC_TARGET_* variables which may then be optionally
modified or overwritten by architecture specific makefiles.

All makefiles must use the new GCC_TARGET_* variables instead
of the BR2_GCC_TARGET_* versions.

Signed-off-by: Mark Corbin <mark.corbin@embecosm.com>
[Thomas: simplify include of arch/arch.mk]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2018-09-23 22:17:57 +02:00
Romain Naour 91b1fbb766 package/gcc: add support for gcc 8.1.0
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

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2018-05-30 21:44:40 +02:00
Thomas Petazzoni 0cd6d15a20 toolchain, gcc, gdb, binutils, uclibc: remove Blackfin code
This commit removes Blackfin related code from all toolchain code and
components.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2018-04-15 22:05:14 +02:00
Thomas Petazzoni 9be2041fcf gcc: fix HOST_GCC_COMMON_WRAPPER_TARGET_FLOAT_ABI typos
The HOST_GCC_COMMON_WRAPPER_TARGET_FLOAT_ABI variable was incorrectly
used as HOST_GCC_COMMON_WRAPPER_TARGET_FLOATABI_, which would always
be empty.

In practice, this block of code is only used on Blackfin (which has
BR2_GCC_ARCH_HAS_CONFIGURABLE_DEFAULTS unset) and Blackfin doesn't use
float-abi, so this block of code is in fact useless. But even if it's
useless, it's better to have it without typos.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2018-04-09 11:26:41 +02:00
Maxime Hadjinlian 514291f39e packages: use new $($PKG)_DL_DIR) variable
Instead of DL_DIR, the package should now use $(PKG)_DL_DIR to ease the
transition into a new directory structure for DL_DIR.

This commit has been generated with the following scripts:

for i in $(find . -iname "*.mk"); do
	if ! grep -q "\$(DL_DIR)" ${i}; then
		continue
	fi
	pkg_name="$(basename $(dirname ${i}))"
	[ "${pkg_name}" = "package" ] && continue
	raw_pkg_name=$(echo ${pkg_name} | tr [a-z] [A-Z] | tr '-' '_')
	pkg_dl_dir="${raw_pkg_name}_DL_DIR"
	sed -i "s/\$(DL_DIR)/\$($pkg_dl_dir)/" ${i}
done

Signed-off-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2018-04-02 15:53:53 +02:00
Alexey Brodkin b09586c4c3 gcc: allow the selection of upstream GCC 7.x for ARC
Upstream gcc now has support for ARC, as of 7.x, with 7.2 being
usable, so let's allow its selection.

GCC from Synopsys GitHub still has a lot of fixes and improvements
most of which will be a part of the next upstream release but let's
see how it goes and if we see vanilla GCC doesn't require way too many
back-ported patches we'll be able to get rid of Synopsys GitHub here
at all.

As of today the only really required back-port is the one for non-uClibc
libc.

Back-ported from upstream master with help of:
-------------------->8--------------------
git format-patch 927c0132251f -1 -- . ':!gcc/ChangeLog' ':!libgcc/ChangeLog'
-------------------->8--------------------

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Peter Korsgaard <peter@korsgaard.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-11-29 23:20:53 +01:00
Yann E. MORIN 31b134a645 arch/mips: inverse the NaN logic
Currently the possibility to choose the NaN encoding is conditional to
having a sufficiently recent gcc version.

Which means that the architecture selection depends on the gcc version.

But that's opposite to what we've always done in Buildroot: the software
versions are conditional to the architecture options. There is nothing
we can do about the hardware: it is there, we can't change it, while we
can restrict ourselves to using software that is working on said
hardware.

Thus, we inverse the logic, to move the condition onto the software
side: whenever NaN-2008 are selected, we restrict the toolchain
selection to at least a gcc-4.9.

But now, the option with the NaN type is always set, so we must enclose
the code in gcc.mk inside a HAS_NAN_OPTION condition, as is already done
for the external toolchain case.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-11-24 22:39:56 +01:00
Romain Naour 1960ad837b package/gcc: bump to 5.5.0
Remove xtensa patches included in this release:
872-xtensa-use-unwind-dw2-fde-dip-instead-of-unwind-dw2-.patch
873-xtensa-fix-_Unwind_GetCFA.patch
876-xtensa-Fix-PR-target-78603.patch
877-xtensa-fix-PR-target-82181.patch

Remove upstream patch:
942-asan-fix-missing-include-signal-h.patch

Remove backported patches for glibc >= 2.26
943-Use-ucontext_t-not-struct-ucontext-in-linux-unwind.h.patch
944-sanitizer-linux.patch

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2017-10-17 22:40:42 +02:00
Romain Naour 6c0dd2fb68 package/gcc: enable float128 on powerpc64le with glibc >= 2.26 toolchains
float128 is now required on powerpc64le with glibc >= 2.26 toolchains.

Fixes:
running configure fragment for sysdeps/gnu
running configure fragment for sysdeps/powerpc/powerpc64le
checking if [...]powerpc64le-buildroot-linux-gnu-gcc supports binary128 floating point type... no
checking if the target machine is at least POWER8... yes
configure: error: ***  binary128 floating point type (GCC >= 6.2) is required on powerpc64le.

In order to prepare the glibc bump to this version, we enable
binary128 floating point in gcc. This require at least gcc >= 6.2.

Disable gcc 4.x and 5.x for internal toolchain.

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2017-09-27 22:56:11 +02:00
Thomas Petazzoni 80546e97fa gcc: bump 7.x series to 7.2.0
All patches continue to apply with no changes. 7.2.0 is a bugfix
release of the 7.x branch.

The only change that is not a simple bump is that the 7.2.0 tarball is
now available xz-compressed instead of bz2-compressed.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-08-21 23:30:39 +02:00
Andrey Yurovsky d16b6bf9b9 gcc: support grahite only for GCC 5 or above
GCC 4.9.x requires an old version of ISL to support graphite, and this
old version of ISL is not sufficient to support graphite in modern GCC
versions.

Since GCC 4.9.x is getting older, and to keep things simple, we stop
supporting graphite on old GCC < 5.x. This way, we will be able to
bump ISL to a version that is suitable for modern GCC versions.

In addition, this allows to drop the dependency on cloog, which was
only needed for GCC 4.9.

Signed-off-by: Andrey Yurovsky <yurovsky@gmail.com>
[Thomas: rework commit log.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-08-02 21:16:45 +02:00
Vicente Olivert Riera 9a0a0a976b arch/mips: add support for MIPS32 FP mode
MIPS32 support different FP modes (32,xx,64), so give the user the
opportunity to choose between them. That will cause host-gcc to be built
using the --with-fp-32=[32|xx|64] configure option. Also the
-mfp[32|xx|64] gcc option will be added to TARGET_CFLAGS and to the
toolchain wrapper.

FP mode option shouldn't be used for soft-float, so we add logic in the
toolchain wrapper if -msoft-float is among the arguments in order to not
append the -fp[[32|xx|64] option, otherwise the compilation may fail.

Information about FP modes here:

- https://sourceware.org/binutils/docs/as/MIPS-Options.html
- https://dmz-portal.imgtec.com/wiki/MIPS_O32_ABI_-_FR0_and_FR1_Interlinking#5._Generating_modeless_code

Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-16 16:45:22 +02:00
Vicente Olivert Riera 2d8f3fc430 arch/mips: add support for MIPS NaN
MIPS supports two different NaN encodings, legacy and 2008. Information
about MIPS NaN encodings can be found here:

  https://sourceware.org/binutils/docs/as/MIPS-NaN-Encodings.html

NaN legacy is the only option available for R2 cores and older.
NaN 2008 is the only option available for R6 cores.
R5 cores can have either NaN legacy or NaN 2008, depending on the
implementation. So, if the user selects a generic R5 target architecture
variant, we show a choice menu with both options available. For well
known R5 cores we directly select the NaN enconding they use.

Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-16 16:35:39 +02:00
Jörg Krause 1a405ea56d gcc: bump 6.x series to version 6.4.0
Drop the following patches:
  * the Xtensa patches 870 and 871 are upstream now
  * patch 942 was backported to GCC 6 branch

Note, that a bz2 release tarball is not provided anymore and is replaced by
a xz tarball file.

Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2017-07-11 22:17:12 +02:00
Arnout Vandecappelle 685f44de98 Globally replace $(HOST_DIR)/usr with $(HOST_DIR)
Since things are no longer installed in $(HOST_DIR)/usr, the callers
should also not refer to it.

This is a mechanical change with
git grep -l '\$(HOST_DIR)/usr' | xargs sed -i 's%\$(HOST_DIR)/usr%$(HOST_DIR)%g'

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-05 15:22:29 +02:00