On 9/7/20 10:42 PM, Xu, Yanfei wrote:


On 9/7/20 7:53 PM, Bruce Ashfield wrote:
On Mon, Sep 7, 2020 at 5:56 AM Xu, Yanfei <yanfei...@windriver.com> wrote:

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 didn,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}""


Which machine and configuration are you seeing that in ? I've modified
devsrc several times to remove the triggers that cause that behaviour,
and would like to see how it crept back in.

Firstly, the commit:'kernel.bbclass: Configuration for environment with
HOSTCXX' expose this problem. After revert it, everything will be
normal.

Secondly, the mechine is qemuarm64. Which configuration you mean? The
project's configuration is normal and only with ""IMAGE_INSTALL +=
"packagegroup-core-buildessential".  The configurations of Kconfig for
choosing is as the blow log messages.

Add the target kernel's version.
cat /proc/version
Linux version 5.4.59-yocto-standard (oe-user@oe-host) (gcc version 10.2.0 (GCC)) #1 SMP PREEMPT Thu Sep 3 06:59:55 UTC 2020
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?

I don't disagree, but also, the configuration phase shouldn't be
triggered on target, so I'll fix that behaviour first.

That's great!

Thanks,
Yanfei



Bruce




Regards,
Yanfei


=============================================================

$ 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'
==






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

View/Reply Online (#9032): 
https://lists.yoctoproject.org/g/linux-yocto/message/9032
Mute This Topic: https://lists.yoctoproject.org/mt/76682606/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to