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.

> 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.

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



-- 
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#9030): 
https://lists.yoctoproject.org/g/linux-yocto/message/9030
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