summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc
AgeCommit message (Collapse)Author
2021-03-10gcc-cross: make use of the system include directories fatalRoss Burton
When building the cross GCC, configure it so that including the host system include directories is fatal, not just a warning. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-03-10gcc: add an option for --enable-poison-system-directories to be fatalRoss Burton
Extend --enable-poison-system-directories so that it can be an error instead of a warning by default. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-03-02gcc-sanitizers: Move content from gcclibdir into libdirMike Crowe
In e9e5744ba8b0d43c8b874d365f83071ce20bf0a1, Khem Raj wrote: > OE does not use the traditional /usr/lib/gcc prefix to store > gcc-runtime it basically is moved into libdir, however some newer > files were installed by newer versions of gcc especially libgomp ( > omp.h openacc.h ) into gcclibdir, so we have content in both > directories, this confuses other tools which are trying to guess the > gcc installation and its runtime location, since now we have two > directories, the tools either choose one or other and we get > inconsistent behavior, e.g. clang for aarch64 uses /usr/lib but same > clang for riscv64 chose /usr/lib/gcc > This change ensures that OE ends up with single valid location for gcc > runtime files I think that the same thing needs to happen in gcc-sanitizers.inc, otherwise I get errors like: | .../recipe-sysroot/usr/include/gpg-error-64.h:884:11: fatal error: sanitizer/lsan_interface.h: No such file or directory when attempting to compile with sanitizers enabled. FILES_${PN} needs updating to match too. Signed-off-by: Mike Crowe <mac@mcrowe.com> Cc: Khem Raj <raj.khem@gmail.com> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-02-26meta/recipes-devtools: Add HOMEPAGE / DESCRIPTIONDorinda
Added HOMEPAGE and DESCRIPTION for recipes with missing decriptions or homepage [YOCTO #13471] Signed-off-by: Dorinda Bassey <dorindabassey@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-01-20gcc: Backport patch to resolve i*86 tune configuration overridesNathan Rossi
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. Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-12-18gcc: Add patch to resolve i*86 tune configuration overridesNathan Rossi
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. Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-11-11gcc: Handle duplicate names for variablesKhem Raj
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 Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-11-11gcc: Do no parameterize LTO configuration flagsKhem Raj
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 Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-26gcc10: Don't default back to -fcommonJacob Kroon
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. Signed-off-by: Jacob Kroon <jacob.kroon@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-22gcc-cross-canadian: Install gcc/g++ wrappers for muslKhem Raj
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] 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-21gcc-cross-canadian: Correct the regexp to delete versioned gcc binaryKhem Raj
After gcc 10 this expression needed to be adjusted, its better to use a bitbake variable which we do have readily available Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-18gcc: Upgrade to 10.2.0Khem Raj
Drop 0036-Enable-CET-in-cross-compiler-if-possible.patch and pr96130.patch they are already in 10.2 Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-15gcc-runtime.inc: fix m32 compile fail with x86-64 compilerChangqing Li
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 Signed-off-by: Changqing Li <changqing.li@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-12gcc: backport a fix for out-of-line atomics on aarch64Ross Burton
Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-07-28gcc: Fix mangled patchRichard Purdie
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-07-22gcc-10.1: add fix for PR 96130Dmitry Baryshkov
Fix for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96130 causing ICE (SegFault) when compiling current Mesa git tree. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-07-22gcc: mitigate the Straight-line Speculation attackRoss Burton
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 Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-05-19gcc: Remove mudflap remnantsAdrian Bunk
mudflap was removed in gcc 4.9. Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-05-15gcc: Drop reverting __getauxval patchKhem Raj
Issue has been fixed in valgrind itself Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-05-15gcc: Do not set -march for arm64 for libatomicKhem Raj
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 Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-05-14gcc10: Revert using __getauxval in libgccKhem Raj
This was added recently, but it seems be chewing more than what it should and causes non glibc packages also depend on it. Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-05-14gcc10: Default back to -fcommonKhem Raj
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 Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-05-14gcc10: Update to GCC 10.1 ReleaseKhem Raj
* 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 Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-05-12gcc-runtime: Avoid march conflicts with newer cortex-a55 CPUsKhem Raj
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 Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-05-02gcc-target: Ensure buildtools-extended-tarball doesn't use arch=nativeRichard Purdie
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-04-26gcc: Configure all gccs with --disable-install-libibertyKhem Raj
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. Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-04-24nativesdk-gcc-runtime: enable building libstdc++.aJeremy Puhlman
Signed-off-by: Jeremy Puhlman <jpuhlman@mvista.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-28gcc-runtime: apply ARM specific workaround to big-endian ARM tooAndre McCurdy
Signed-off-by: Andre McCurdy <armccurdy@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-21gcc-target: Use --with-arch=native for target gccKhem Raj
This should help gcc detect and use target ISA on x86_64 machines when -march is not used on cmdline [YOCTO #139] 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-13gcc: Upgrade to 9.3 bugfix releaseKhem Raj
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 Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-11gcc: strip line numbers from generated code in gcc-plugins on targetRoss Burton
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-11gcc: don't ship build host information in the target gcc-plugins packageRoss Burton
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-02-05gcc-9.2: fix bug #91102 'aarch64 ICE on Linux kernel with -Os'Taras Kondratiuk via Openembedded-core
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. Signed-off-by: Taras Kondratiuk <takondra@cisco.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-02-02libgcc.inc: Fix an issue w/ a recursive symlinkMark Hatle
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. 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-02gcc-cross-canadian: A missing space in an append caused an invalid optionMark Hatle
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. Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-01-19newlib: Enable building libstdc++ for newlib based toolchainsAlejandro Enedino Hernandez Samaniego
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. Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandro@enedino.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-01-19gcc-configure: Enable the use of different symbol versioningAlejandro Enedino Hernandez Samaniego
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. Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandro@enedino.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-01-19gcc: Enable 32bit powerpcle at multi-arch for powerpc64leKhem Raj
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 Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-12-30gcc-sanitizers: Fix build with glibc 2.31Khem Raj
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 Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-12-30gcc-sanitizers: Add missing dep on libcryptKhem Raj
Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-12-05gcc-cross.inc: Remove test runner script generationNathan Rossi
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). Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-12-05gcc: Improve build reproduciblityNathan Rossi
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. Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-12-05gcc-target.inc: Prevent sysroot from leaking into configargs.hNathan Rossi
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 "/". Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-11-29gcc-cross.inc: Prevent native sysroot from leaking into configargs.hNathan Rossi
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). Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2019-11-29gcc-9.2: Update the relocation patch to add PREFIX/EXEC_PREFIXMark Hatle
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. Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org> Signed-off-by: Ross Burton <ross.burton@intel.com>
2019-11-27gcc-runtime: Package libstdc++.a-gdb.pyKhem Raj
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 Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-10-28gcc: Remove stale gcc 8 patchfileAdrian Bunk
Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-09-19gcc: Security fix for CVE-2019-15847Armin Kuster
Affects <= 9.2.0 Dropped Changelog changes. Signed-off-by: Armin Kuster <akuster@mvista.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-09-11gcc-cross.inc: Process binaries in build dir to be relocatableNathan Rossi
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). Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-09-06gcc-9.2: Fix risc-v dynamic linker relocationKhem Raj
Accidentally dropped in 9.2 update Reported-by: Ricardo Salveti <ricardo@foundries.io> Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>