Bug 13480 - gcc-cross plugins feature cannot be used
Summary: gcc-cross plugins feature cannot be used
Status: NEW
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: devtools / tool chain (show other bugs)
Version: 3.0
Hardware: All Multiple
: Medium+ normal
Target Milestone: 6.1 M2
Assignee: Sermsity Sunil Kumar Dora
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2019-08-13 10:10 UTC by He Zhe
Modified: 2026-06-17 04:57 UTC (History)
5 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments
oe-core.patch (2.94 KB, patch)
2019-08-13 10:10 UTC, He Zhe
no flags Details | Diff
kernel-source.patch (556 bytes, patch)
2019-08-13 10:11 UTC, He Zhe
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description He Zhe 2019-08-13 10:10:51 UTC
Created attachment 4552 [details]
oe-core.patch

As defined in the following kernel source, a kernel security/hardening option CONFIG_PLUGIN_HOSTCC depends on gcc-plugins feature which is provided by gcc-cross, but cannot be used from Yocto build environment. And thus it and the related kernel options cannot be enabled.

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/scripts/gcc-plugins/Kconfig
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/scripts/gcc-plugin.sh

With my effort and the patches attached, I still cannot make it pass. The following misplacing of the file cannot be properly fixed by simply moving the missing file.

/build/tmp-glibc/work/intel_x86_64-wrs-linux/linux-yocto-dev/5.3-rc++gitAUTOINC+5e432442d5_31a7feab3b-r0/recipe-sysroot-native/usr/bin/x86_64-wrs-linux/../../lib/x86_64-wrs-linux/gcc/x86_64-wrs-linux/9.1.0/plugin/include/tm.h:39:36: fatal error: ./config/i386/linux64.h: No such file or directory
Comment 1 He Zhe 2019-08-13 10:11:48 UTC
Created attachment 4553 [details]
kernel-source.patch
Comment 2 He Zhe 2019-08-13 10:14:01 UTC
The attached kernel-source.patch or similar one needs to be applied to enable the error print.
Comment 3 He Zhe 2019-08-13 10:15:43 UTC
The attached oe-core is simply for testing "bitbake virtual/kernel -cmenuconfig". Further change is still needed for do_configure.
Comment 4 Randy MacLeod 2019-08-15 14:40:46 UTC
Khem and Zhe please work on this. It's not clear if it's a toolchain issue or not.
Comment 5 Randy MacLeod 2022-06-23 15:17:46 UTC
Richard is going to check on this. 
I"ve CCed Sundeep since I think he worked on a bug for WR that is related.
Comment 6 Sundeep KOKKONDA 2022-06-23 15:29:34 UTC
The same error was reported in WR Linux when below flags are enabled.
CONFIG_GCC_PLUGIN_LATENT_ENTROPY=y
CONFIG_GCC_PLUGIN_STRUCTLEAK=y
CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL=y

The build issue was resolved with the patch from below link.
https://www.mail-archive.com/openembedded-core@lists.openembedded.org/msg157205.html

Hope this helps...
Comment 7 Randy MacLeod 2023-10-24 14:24:52 UTC
Bulk move from 4.99 or 0.00 to 5.99
Comment 8 Randy MacLeod 2026-01-29 16:29:28 UTC
Sundeep - for post-6.0.
The attached patches are potentially the wrong approach.
Comment 9 Randy MacLeod 2026-03-31 14:42:31 UTC
Sundeep, Always nice to enable a standard kernel feature so let's investigate.