Commit Graph

700 Commits

Author SHA1 Message Date
Nathan Rossi
496d849224 gcc: Backport patch to resolve i*86 tune configuration overrides
Upstream has merged a change to handle detection of target overrides so
that they are only applied as required. Backport this patch from
upstream and remove the OE specific patch.

(From OE-Core rev: d430f425e1a5725e93833a652e5c6988576f7347)

Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-01-20 00:45:05 +00:00
Nathan Rossi
5a5795349b gcc: Add patch to resolve i*86 tune configuration overrides
When compiling gcc-runtime for i686 libatomic, libgomp and libitm are
compiled with additional '-march' and '-mtune' overrides. This typically
does not cause build errors (e.g. core2-32 tune), and results in less
optimally tuned outputs. However with specific TUNE_CCARGS (e.g. has
'-mfpmath=sse' but not '-msse*'), the build errors with conflicting
'-mfpmath' options.

This is caused by gcc-runtime specific configure scripts and Makefile
options that override by adding additional '-march'/'-mtune' args. OE
builds gcc-runtime differently to other build systems, and provides
target specific arch/tune options directly. As such, this change adds a
patch for gcc to remove the specific cases where the args are added.

(From OE-Core rev: d39b686cc5fcc89405ffeb560ea64b5d305b0608)

Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-12-18 22:52:24 +00:00
Khem Raj
19d9a1915c gcc: Handle duplicate names for variables
PREFIXVAR is defined in cppdefaults.c as well which shows up as error
when LTO is enabled to build gcc, therefore rename the one instance to PREFIXVAR1

(From OE-Core rev: 984da023a595a10ae62d4fc2a1f2fe96c4701223)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-11-11 10:08:12 +00:00
Khem Raj
c55b6ce9ed gcc: Do no parameterize LTO configuration flags
These flags are redundant as LTO now enabled in GCC by default for
sometime, Moreover, dropping LTO variable here avoids a conflict with
global LTO variable being added for distrowide LTO support

(From OE-Core rev: 50cd8edc9849d6ab6249d4c49c7e41bb476dcb71)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-11-11 10:08:11 +00:00
Jacob Kroon
780d38ee5e gcc10: Don't default back to -fcommon
It has been almost 3 months since the upgrade to gcc 10. Switch back to
relying on gcc default configuration (-fno-common).

This reverts OE-Core commit 951e859b1e8297970278c539e989b8a6d06a9cb3.

(From OE-Core rev: 4ee733e1551d3960a23a600eb71a01cf7a51fa06)

Signed-off-by: Jacob Kroon <jacob.kroon@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-26 14:33:57 +01:00
Khem Raj
dd14862946 gcc-cross-canadian: Install gcc/g++ wrappers for musl
gcc needs -mmusl option to be passed in SDK since we ship crossdk compiler
configured for glibc by default, this helps in creating correct
compiler defaults for musl based SDK compilers

[YOCTO #13459]

(From OE-Core rev: e6fbac7aeabe00d8fb734992012dd629a8527b25)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Leon Woestenberg <leon@sidebranch.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-22 15:46:55 +01:00
Khem Raj
52635969f9 gcc-cross-canadian: Correct the regexp to delete versioned gcc binary
After gcc 10 this expression needed to be adjusted, its better to use a
bitbake variable which we do have readily available

(From OE-Core rev: ee2beaff701d02736c8244ebc76f6d6ca96a04f4)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-21 14:29:10 +01:00
Khem Raj
a8fef8bee7 gcc: Upgrade to 10.2.0
Drop 0036-Enable-CET-in-cross-compiler-if-possible.patch and
pr96130.patch they are already in 10.2

(From OE-Core rev: 35eda14fbdc38ae5e686c2d30a2c1d5569bd3088)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-18 11:44:55 +01:00
Changqing Li
de11fb92cf gcc-runtime.inc: fix m32 compile fail with x86-64 compiler
configuration:
MACHINE ??= "qemux86-64"
require conf/multilib.conf
MULTILIBS ?= "multilib:lib32"
DEFAULTTUNE_virtclass-multilib-lib32 ?= "core2-32"
IMAGE_INSTALL_append = " packagegroup-core-buildessential lib32-libstdc++ lib32-libstdc++-dev"

m32 compile failed on target:
cmd: gcc -m32 -v test.cpp -o test
output:
GGC heuristics: --param ggc-min-expand=45 --param ggc-min-heapsize=29590
ignoring nonexistent directory "/usr/lib64/gcc/x86_64-poky-linux/10.1.0/../../../../include/c++/10.1.0/x86_64-poky-linux/32"
ignoring nonexistent directory "/usr/lib64/x86_64-poky-linux/10.1.0/include"
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/lib64/gcc/x86_64-poky-linux/10.1.0/../../../../x86_64-poky-linux/include"
 /usr/lib64/gcc/x86_64-poky-linux/10.1.0/../../../../include/c++/10.1.0
 /usr/lib64/gcc/x86_64-poky-linux/10.1.0/../../../../include/c++/10.1.0/backward
 /usr/lib64/gcc/x86_64-poky-linux/10.1.0/include
 /usr/lib64/gcc/x86_64-poky-linux/10.1.0/include-fixed
 /usr/include
End of search list.
GNU C++14 (GCC) version 10.1.0 (x86_64-poky-linux)
	compiled by GNU C version 10.1.0, GMP version 6.2.0, MPFR version 4.1.0, MPC version 1.1.0, isl version none
GGC heuristics: --param ggc-min-expand=45 --param ggc-min-heapsize=29590
Compiler executable checksum: bc3b2f3a33dad80e30112cf1235bf631
In file included from test.cpp:1:
/usr/include/c++/10.1.0/iostream:38:10: fatal error: bits/c++config.h: No such file or directory
   38 | #include <bits/c++config.h>
      |          ^~~~~~~~~~~~~~~~~~

cannot find header since
/usr/lib64/gcc/x86_64-poky-linux/10.1.0/x86_64-poky-linux/32 is missing

fixed by link it to ../i686-poky-linux

(From OE-Core rev: 509022ea8db314dd9d010a478fd84d0234905c6b)

Signed-off-by: Changqing Li <changqing.li@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-15 11:44:20 +01:00
Ross Burton
65a2323431 gcc: backport a fix for out-of-line atomics on aarch64
(From OE-Core rev: ce99eb6b042cb36f5c07461fff7f49719550a955)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-12 10:51:46 +01:00
Richard Purdie
94eb5724b1 gcc: Fix mangled patch
To quote Zhuang <qiuguang.zqg@alibaba-inc.com>:
"""
A few days ago, I tried to compile a gcc plugin with the toolchain from poky sdk.
It failed with errors about missing header files such as backend.h etc.

After investigation, I found that the problem was brought by a gcc patch:
0012-gcc-Fix-argument-list-too-long-error.patch (which is considered derived from the original patch)

- headers=`echo $(PLUGIN_HEADERS) $$(cd $(srcdir); echo *.h *.def) | tr ' ' '\012' | sort -u`; \
+ headers="$(sort $(PLUGIN_HEADERS) $$(cd $(srcdir); echo *.h *.def))"; \

It changes the commands of install-plugin, making the sorting taken effect before the shell globs.
Thus results in the header files under gcc $(srcdir) being not installed.

By checking log.do_install, we can find that the `headers=' statement to run is incorrect and will not work as expected:
headers="$(cd *.def) *.h ../../../../../../../work-shared/gcc-10.1.0-r0/gcc-10.1.0/gcc/../include/ansidecl.h ...

As the patch says,
"The PLUGIN_HEADERS is too long before sort, so the "echo" can't handle it, ..."
my suggestion is that we can simply take care of PLUGIN_HEADERS
using the original proposed sort.
"""

This fixes the gcc patch as proposed as it does appear its been
broken over time.

(From OE-Core rev: dce28d8ac7fbae487cb6674b91fe2b574036b26d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-07-28 12:39:54 +01:00
Dmitry Baryshkov
48cd01d208 gcc-10.1: add fix for PR 96130
Fix for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96130 causing ICE
(SegFault) when compiling current Mesa git tree.

(From OE-Core rev: bc2f2e72f20e6b272e48d1073bb2290665cbde24)

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-07-22 23:47:57 +01:00
Ross Burton
4ad6e1182e gcc: mitigate the Straight-line Speculation attack
Straight-line Speculation is a SPECTRE-like attack on Armv8-A, further
details can be found in the white paper here:

https://developer.arm.com/support/arm-security-updates/speculative-processor-vulnerability/downloads/straight-line-speculation

Backport the GCC patches to mitigate the attack.

CVE: CVE-2020-13844
(From OE-Core rev: 3415e0ccdf75575014fb8c600edb707bbec0f566)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-07-22 23:47:57 +01:00
Adrian Bunk
329c600411 gcc: Remove mudflap remnants
mudflap was removed in gcc 4.9.

(From OE-Core rev: 6d649a07cfa0a89448caa67e4ca0a990973961b9)

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-05-19 22:57:26 +01:00
Khem Raj
b6dc3c1d8c gcc: Drop reverting __getauxval patch
Issue has been fixed in valgrind itself

(From OE-Core rev: c4070f3d76e0170cf6ee672a8a9a38e4cdbbcad9)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-05-15 16:31:45 +01:00
Khem Raj
18f718cefd gcc: Do not set -march for arm64 for libatomic
libatomic has mind of its own when it comes to setting -march for arm64
which conflicts with -mcpu option we pass from environment in some cases
since we always pass -march/-mcpu in OE, its safe to remove this option

mcpu removal from cortex-a55 is no longer needed since the option
conflict is now removed from libatomic instead

(From OE-Core rev: a5331c5a8bbe63c6c2e56ebec496b28968d4663d)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-05-15 16:31:44 +01:00
Khem Raj
5757286da1 gcc10: Revert using __getauxval in libgcc
This was added recently, but it seems be chewing more than what it
should and causes non glibc packages also depend on it.

(From OE-Core rev: 595d2df62b049e463568ab97cfe26d6df96a18a9)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-05-14 14:15:11 +01:00
Khem Raj
d8981bb2eb gcc10: Default back to -fcommon
For time being change back to -fcommon as default, helps us iron
out other issues, eventually this should be removed as we fix the
packages to work with -fno-common

(From OE-Core rev: 951e859b1e8297970278c539e989b8a6d06a9cb3)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-05-14 14:15:11 +01:00
Khem Raj
d8d7d9e8f0 gcc10: Update to GCC 10.1 Release
* Package new gomp header acc_prof.h
* Package lto-dump which is a new tool in gcc10
* All Changes are here [1]
* Porting apps to gcc 10 help is here [2]
* Backport a patch to fix CET errors on cross builds
* Add patch to fix mingw libstdc++

[1] https://gcc.gnu.org/gcc-10/changes.html
[2] https://gcc.gnu.org/gcc-10/porting_to.html

(From OE-Core rev: 44c3881b18f74eb64379818fc150f94398fb8a49)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-05-14 14:15:11 +01:00
Khem Raj
9e44438a9d gcc-runtime: Avoid march conflicts with newer cortex-a55 CPUs
gcc-runtime/libatomic explicitly add -march=armv8-a+lse for all arch64
but cortex-a55 is armv8.2-a, which essentially conflicts, so let gcc
override it by not forcing the -mcpu option from TUNE_CCARGS

(From OE-Core rev: 882df891e13ce5c64718c364efb9ef2bf189eabf)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-05-12 15:20:43 +01:00
Richard Purdie
13297d8589 gcc-target: Ensure buildtools-extended-tarball doesn't use arch=native
A nativesdk BBCLASSEXTEND was added to gcc-target without realising this
would pass arch=native through to it for x86-64. This heavily optimises
gcc output for the host its running on meaning it can't be reused via
sstate on other machines.

Add class-target overrides here to get the desired behaviour. All
targets have been covered for completeness.

(From OE-Core rev: d0d4853dd773f7bbe0f72e50144559b80e80d67a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-05-02 09:08:52 +01:00
Khem Raj
43b340fb27 gcc: Configure all gccs with --disable-install-libiberty
OE uses libiberty from binutils, since its properly compiled as pic
archive and applications and other libraries needing libiberty can
properly link with it.

With this option applied, explicit delete of libiberty headers and
libraries is not required in install step, since they wont get installed
in first place.

(From OE-Core rev: fa8a205c69770d23323c9a06373db958af4b34d3)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-04-26 14:00:50 +01:00
Jeremy Puhlman
aee7ed7b38 nativesdk-gcc-runtime: enable building libstdc++.a
(From OE-Core rev: ef5cff3db22e911b7a6ecf3dac212903757b4df1)

Signed-off-by: Jeremy Puhlman <jpuhlman@mvista.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-04-24 14:10:07 +01:00
Andre McCurdy
4a3c1b0cf0 gcc-runtime: apply ARM specific workaround to big-endian ARM too
(From OE-Core rev: 633010f7c9f369565fd43465a857ad5680405e11)

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-29 12:05:31 +01:00
Khem Raj
d566448b3d gcc-target: Use --with-arch=native for target gcc
This should help gcc detect and use target ISA on x86_64 machines when
-march is not used on cmdline

[YOCTO #139]

(From OE-Core rev: f9e410521c92e2458ba7e2ca63d28434618b9f25)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-21 22:39:01 +00:00
Khem Raj
901a93885f gcc: Upgrade to 9.3 bugfix release
This brings ~157 bugfixes [1] to gcc-9 with no features
Drop backports which are already part of the release now

[1] https://gcc.gnu.org/bugzilla/buglist.cgi?bug_status=RESOLVED&list_id=260610&resolution=FIXED&target_milestone=9.3

(From OE-Core rev: caf80e4e245132bdc3bbe219b567013f2c5d2f46)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-13 13:35:16 +00:00
Ross Burton
f48d73995c gcc: strip line numbers from generated code in gcc-plugins on target
The line numbers are influenced by the gcc version on the host used to generate
the code. Remove these to ensure the shipped source code is the same.

(From OE-Core rev: 5c3d3440809e9d76377af653ac8c5307bc1a01b4)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-11 13:44:02 +00:00
Ross Burton
2e2f1980e0 gcc: don't ship build host information in the target gcc-plugins package
The build host configuration isn't reproducible as it varies depending
on the gcc version of the build host. This information isn't useful on the
target anyway so remove it.

(From OE-Core rev: f9154b2c3eff8434914710ab453e13cf338597ec)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-11 13:44:02 +00:00
Taras Kondratiuk via Openembedded-core
e03c56c30b gcc-9.2: fix bug #91102 'aarch64 ICE on Linux kernel with -Os'
Linux kernel compilation for aarch64 triggers ICE if
CONFIG_CC_OPTIMIZE_FOR_SIZE=y.

The rootcause is GCC bug #91102 'aarch64 ICE on Linux kernel with -Os'.
Apply the fix to 9.2.

(From OE-Core rev: 14f34d32bfdaa752f5043e62750d2e7b92c4b419)

Signed-off-by: Taras Kondratiuk <takondra@cisco.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-02-05 12:00:34 +00:00
Mark Hatle
1c28cf571a libgcc.inc: Fix an issue w/ a recursive symlink
If the OS is not Linux, the code could end up generating a recursive symlink.
This can happen because the same symlink can be created twice in a row.  If this
happenes, the second symlink becomes a link to itself within the directory
pointed to by the original link.

In order to prevent this, verify that the destination does not already exist.

(From OE-Core rev: ef28e5a74d939acc98d6e8e9a0efbeb143b8025f)

Signed-off-by: Mark Hatle <mark.hatle@xilinx.com>
Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-02-02 16:57:21 +00:00
Mark Hatle
753cffb105 gcc-cross-canadian: A missing space in an append caused an invalid option
When configuring the cross-candian toolchain for a non-linux target system,
the resulting gcc configuration included:

  --enable-initfini-array--without-headers

these should have been two separate options.

(From OE-Core rev: 7b52893632dae7bc9ac75dddc7ad625e19f41050)

Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-02-02 16:57:21 +00:00
Alejandro Enedino Hernandez Samaniego
e261883a0f newlib: Enable building libstdc++ for newlib based toolchains
Some baremetal applications might require support from libstdc++
On newlib based toolchains, libstdc++ can be built as a static
library that applications can then link against it.

Pass libsdtc++-(static)dev to LIBC_DEPENDENCIES allowing the
library to be present for cross compilation as well as on
sdk builds.

(From OE-Core rev: 18af9ecef6e247519d8a1573e32208bb69cf81fe)

Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandro@enedino.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-01-19 23:49:39 +00:00
Alejandro Enedino Hernandez Samaniego
0b088f99e6 gcc-configure: Enable the use of different symbol versioning
While the gnu style for symbol versioning is the most usual,
--enable-symvers[=style] can be provided several values,
gnu, gnu-versioned-namespace, darwin, darwin-export, and sun,
depending on users needs.

Introduce the SYMVERS_CONF variable to allow the user to
configure the symbol versioning in shared libraries.

(From OE-Core rev: f850931173fc210ed25706fd8fbfe0a310f99dfc)

Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandro@enedino.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-01-19 23:49:39 +00:00
Khem Raj
c2f78e062f gcc: Enable 32bit powerpcle at multi-arch for powerpc64le
Even though we do not expect any legacy ( 32bit ) for LE, linux-yocto
does enable the compat code, so enable 32bit support to get that going

(From OE-Core rev: 8e24fd8dcadc6dd13171a2c4cfec6bcff8db772a)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-01-19 23:49:39 +00:00
Khem Raj
16e2585e6d gcc-sanitizers: Fix build with glibc 2.31
Backport a patch from latest gcc-9-branch to fix an API change in glibc
2.31, this patch wont be needed when upgrading to 9.3 or 10.x

(From OE-Core rev: d089f84d64b90776623e0e43d237ac3fcc6a0d7d)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-12-30 08:47:12 +00:00
Khem Raj
38a63c5ea0 gcc-sanitizers: Add missing dep on libcrypt
(From OE-Core rev: fa1968884fd46568fcfcdb62f3bd6c52ea30df53)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-12-30 08:47:12 +00:00
Nathan Rossi
4e166a5a1f gcc-cross.inc: Remove test runner script generation
Remove the generation of the testgcc script which could be used to run
the gcc test suite against a cross compiler with a remote execution
target. The same functionality can now be achieved with the 'do_check'
task of gcc-runtime or with oe-selftest (for automation of execution
against qemu-user/qemu-system targets).

(From OE-Core rev: 1a6801c4d0850e9f1b6d993f1d6a2492f5bbea85)

Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-12-06 14:41:28 +00:00
Nathan Rossi
098ef4f019 gcc: Improve build reproduciblity
Prevent the gcc embedded checksum from containing a checksum that was
computed with build specific paths. The checksum-options file included
the value of LINKER/LDFLAGS which contains DEBUG_PREFIX_MAP and
STAGING_DIR_TARGET.

(From OE-Core rev: 0ead8cbdfb96c4fcbefd24c6647d0f50599f45b3)

Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-12-06 14:41:28 +00:00
Nathan Rossi
eb308499c2 gcc-target.inc: Prevent sysroot from leaking into configargs.h
Prevent the full recipe-sysroot path from leaking into configargs.h. The
configargs.h header is intended to be static and unchanged as the
content is used as a means of determining that a gcc plugin is built for
the same gcc. This also effects the output of 'gcc -v'. Due to per
recipe sysroots and staging, the sysroot path would be replaced with the
sysroot local to the recipe thus changing the content of configargs.h.
This change also improves gcc binary reproducibility. The sysroot path
is replaced with the base target root "/".

(From OE-Core rev: b8d6e2ab68ee5e341fe970b191bfd334e6d2c40b)

Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-12-06 14:41:28 +00:00
Nathan Rossi
decb74d362 gcc-cross.inc: Prevent native sysroot from leaking into configargs.h
Prevent the native(sdk) sysroot path from leaking into configargs.h. The
configargs.h header is intended to be static and unchanged as the
content is used as a means of determining that a gcc plugin is built for
the same gcc. This also effects the output of 'gcc --version'. Due to
per recipe sysroots and staging, the sysroot path would be replaced with
the sysroot local to the recipe thus changing the content of
configargs.h.

The sysroot path is replaced with a generic "/host" prefix which
represents the host sysroot (e.g. native or nativesdk).

(From OE-Core rev: 84a78f46d59447eeec3d69532a7506148f64c979)

Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-11-29 17:43:40 +00:00
Mark Hatle
5507707f0d gcc-9.2: Update the relocation patch to add PREFIX/EXEC_PREFIX
Without relocating PREFIX/EXEC_PREFIX the system can not do runtime
relocation for the path to the usr/lib/gcc directory, and other components.

While this is not a normal or supported use-case it does work in the upstream
gcc.  This is difficult to test with the regular OE SDKs, as it requires
running the components with the correct LD_LIBRARY_PATH and ld.so.

Without this update, gcc will typically not be able to find the gcc
provided include file for stddef.h and similar.  This is due to certain
relocations being based on the PREFIX and/or EXEC_PREFIX locations which
are hardcoded at compilation time.

(From OE-Core rev: b879fe730bc2cbce99704705cb53fa9ee958b311)

Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-11-29 17:43:39 +00:00
Khem Raj
cf57a45026 gcc-runtime: Package libstdc++.a-gdb.py
There is python gdb script for static libstdc++ archives as well
fixes
ERROR: gcc-runtime-9.2.0-r0 do_package: QA Issue: gcc-runtime: Files/directories were installed but not shipped in any package:
/usr/lib/libstdc++.a-gdb.py

(From OE-Core rev: 9becb6c1ea68096930fe77cc0e4126ff204d0592)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-11-27 13:25:18 +00:00
Adrian Bunk
c79f8c1513 gcc: Remove stale gcc 8 patchfile
(From OE-Core rev: 176c70277d82228bc440f3fcd40ea90f0b12d641)

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-10-28 05:31:42 +00:00
Armin Kuster
9a6cfc0fee gcc: Security fix for CVE-2019-15847
Affects <= 9.2.0

Dropped Changelog changes.

(From OE-Core rev: 4d56cf8743270c1998e8cb1524881a36de982c39)

Signed-off-by: Armin Kuster <akuster@mvista.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-09-19 10:54:32 +01:00
Nathan Rossi
0c19c09335 gcc-cross.inc: Process binaries in build dir to be relocatable
Process binaries within the build directory before stashing to be
relocatable with ORIGIN relative rpaths. This corrects issues with
rpaths being invalid when trying to use the binaries from an unstashed
build directory (e.g. gcc-runtime).

(From OE-Core rev: 34d9f60a8c2e98fdacbb799af11ec015bc5700f4)

Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-09-16 23:02:43 +01:00
Khem Raj
4bed6fe63d gcc-9.2: Fix risc-v dynamic linker relocation
Accidentally dropped in 9.2 update

Reported-by: Ricardo Salveti <ricardo@foundries.io>
(From OE-Core rev: bd21f36faeceb83ab629bd34a4e53a6947d6a469)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-09-06 14:58:10 +01:00
Armin Kuster
0c8397aa68 gcc-8.3: remove 8.3 from zeus
warrior only had one gcc so lets be consistent.

This will also reduce our maintenance overhead and we don't build this either

(From OE-Core rev: fa4ecadd980eff95eacd840ba0259f6272daa9aa)

Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-09-06 12:45:47 +01:00
Nathan Rossi
568130c122 gcc-testsuite.inc: Fix ssh.exp, ensure multilib_flags are populated
The 'process_multilib_options' function of dejagnu also populates the
'multilib_flags' content from the '--target_board=' arguments. The
'ssh.exp' generated is missing this call ('user.exp' includes it).

(From OE-Core rev: 4d3d7cac012a1f53c61a997615a761a7f25dd33f)

Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-09-06 12:45:47 +01:00
Nathan Rossi
6ccf0746cf gcc-runtime: Add do_check task for executing gcc test suites
Add a do_check task to implement execution of the gcc component test
suites. The component test suites require execution of compiled programs
on the target.

The implementation provided allows for execution testing against a host
via SSH or within the local build environment using qemu linux-user
execution. The selection of execution is done via the
TOOLCHAIN_TEST_TARGET variable, and configuration of the remote host is
done with the TOOLCHAIN_TEST_HOST, TOOLCHAIN_TEST_HOST_USER and
TOOLCHAIN_TEST_HOST_PORT variables.

By default the do_check task will execute all check targets, this can be
changed by setting MAKE_CHECK_TARGETS to the desired test suite target
(e.g. check-gcc or check-target-libatomic).

(From OE-Core rev: 9d5d680baa91b34dc97641f98856a51d1bb060c1)

Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-09-06 12:45:47 +01:00
Richard Purdie
3f8d0969d1 gcc-cross: Fix header file corruption problems
gcc's makefile can move files, replacing with the contents "timestamp". This
corrupts the headers and breaks things like the gcc testsuite.

Add in a fix to ensure the headers are not corrupted through their hardlink copies.

(From OE-Core rev: 7e75ed5aec86b94fe7fadbed606619f84a2e58e7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-09-06 08:24:41 +01:00