Hi Bruce,

When I excuted "make -C /usr/src/kernel scripts prepare" on target
mechine, I will be asked for choicing if to enable "GCC_PLUGINS" and
other configurations depend on "GCC_PLUGINS" (The .config file doesn't
contain 'GCC_PLUGINS is not set')

But there were never be asked for these before yocto add the
configuration which is "EXTRA_OEMAKE += " HOSTCXX="${BUILD_CXX}
${BUILD_CXXFLAGS} ${BUILD_LDFLAGS}""

With these, I met a failure during compiling an external module on
target mechine after I enabled the GCC_PLUGINS and
CONFIG_GCC_PLUGIN_RANDSTRUCT by above methond. Failure messages as
below. There might be some other unexpected situations with GCC_PLUGIN
enabled.

In my oppinion, GCC_PLUGINS is rarely used, and It can be enable by who
want to use it. So how about disable it by defualt in ktypes/base
/base.cfg file? Do you think it is appropriate?

======================cut here===============================

$ make -C /usr/src/kernel scripts prepare
......
\ * GCC plugins
*
GCC plugins (GCC_PLUGINS) [Y/n/?] (NEW) y
Generate some entropy during boot and runtime (GCC_PLUGIN_LATENT_ENTROPY) [N/y/?] (NEW) y Randomize layout of sensitive kernel structures (GCC_PLUGIN_RANDSTRUCT) [N/y/?] (NEW) y Use cacheline-aware structure randomization (GCC_PLUGIN_RANDSTRUCT_PERFORMANCE) [N/y/?] (NEW) y
*
\ * Memory initialization
*
Initialize kernel stack variables at function entry
> 1. no automatic initialization (weakest) (INIT_STACK_NONE)
2. zero-init structs marked for userspace (weak) (GCC_PLUGIN_STRUCTLEAK_USER) (NEW) 3. zero-init structs passed by reference (strong) (GCC_PLUGIN_STRUCTLEAK_BYREF) (NEW) 4. zero-init anything passed by reference (very strong) (GCC_PLUGIN_STRUCTLEAK_BYREF_ALL) (NEW)
choice[1-4?]: 1
Poison kernel stack before returning from syscalls (GCC_PLUGIN_STACKLEAK) [N/y/?] (NEW) y Minimum stack frame size of functions tracked by STACKLEAK (STACKLEAK_TRACK_MIN_SIZE) [100] (NEW) Show STACKLEAK metrics in the /proc file system (STACKLEAK_METRICS) [N/y/?] (NEW) y Allow runtime disabling of kernel stack erasing (STACKLEAK_RUNTIME_DISABLE) [N/y/?] (NEW) y Enable heap memory zeroing on allocation by default (INIT_ON_ALLOC_DEFAULT_ON) [N/y/?] n Enable heap memory zeroing on free by default (INIT_ON_FREE_DEFAULT_ON) [N/y/?] n

HOSTCC scripts/dtc/dtc.o
......
==
then build the module,
==
$ make -C /usr/src/kernel M=/module_path/module_example modules
Build external kernel module ...
make: Entering directory '/lib/modules/5.4.57-yocto-standard/build'
CC [M] /module_path/module_example/hello.o
Building modules, stage 2.
MODPOST 1 modules
ERROR: "module_layout" [/module_path/module_example/hello.ko] undefined!
make[1]: *** [scripts/Makefile.modpost:94: __modpost] Error 1
make: *** [Makefile:1630: modules] Error 2
make: Leaving directory '/lib/modules/5.4.57-yocto-standard/build'
==


Regards,
Yanfei
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#9029): 
https://lists.yoctoproject.org/g/linux-yocto/message/9029
Mute This Topic: https://lists.yoctoproject.org/mt/76682672/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub  
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to