401 Star 1.4K Fork 1.3K

GVPopenEuler / kernel

 / 详情

[OLK-5.10] build error when CONFIG_KABI_RESERVE=n && CONFIG_KABI_SIZE_ALIGN_CHECKS=y

已完成
任务 成员
创建于  
2022-02-09 19:28
When CONFIG_KABI_RESERVE=n && CONFIG_KABI_SIZE_ALIGN_CHECKS=y, with kabi reserved padding replaced by KABI_USE(), we will get the build error:

In file included from /home/liwei/main_code/hulk/arch/x86/include/asm/thread_info.h:15,
                 from /home/liwei/main_code/hulk/include/linux/thread_bits.h:32,
                 from /home/liwei/main_code/hulk/include/linux/thread_info.h:14,
                 from /home/liwei/main_code/hulk/arch/x86/include/asm/preempt.h:7,
                 from /home/liwei/main_code/hulk/include/linux/preempt.h:78,
                 from /home/liwei/main_code/hulk/include/linux/spinlock.h:51,
                 from /home/liwei/main_code/hulk/include/linux/mmzone.h:8,
                 from /home/liwei/main_code/hulk/include/linux/gfp.h:6,
                 from /home/liwei/main_code/hulk/include/linux/slab.h:15,
                 from /home/liwei/main_code/hulk/include/linux/crypto.h:20,
                 from /home/liwei/main_code/hulk/arch/x86/kernel/asm-offsets.c:9:
/home/liwei/main_code/hulk/include/linux/kabi.h:383:3: error: static assertion failed: "include/linux/fs.h:2306: long aaa is larger than .  Disable CONFIG_KABI_SIZE_ALIGN_CHECKS if debugging."
   _Static_assert(sizeof(struct{_new;}) <= sizeof(struct{_orig;}), \
   ^~~~~~~~~~~~~~
/home/liwei/main_code/hulk/include/linux/kabi.h:405:3: note: in expansion of macro ‘__KABI_CHECK_SIZE_ALIGN’
   __KABI_CHECK_SIZE_ALIGN(_orig, _new);  \
   ^~~~~~~~~~~~~~~~~~~~~~~
/home/liwei/main_code/hulk/include/linux/kabi.h:416:37: note: in expansion of macro ‘_KABI_REPLACE’
 # define KABI_REPLACE(_orig, _new)  _KABI_REPLACE(_orig, _new);
                                     ^~~~~~~~~~~~~
/home/liwei/main_code/hulk/include/linux/kabi.h:437:29: note: in expansion of macro ‘KABI_REPLACE’
 # define KABI_USE(n, _new)  KABI_REPLACE(_KABI_RESERVE(n), _new)
                             ^~~~~~~~~~~~
/home/liwei/main_code/hulk/include/linux/fs.h:2306:2: note: in expansion of macro ‘KABI_USE’
  KABI_USE(1, long aaa)
  ^~~~~~~~
In file included from /home/liwei/main_code/hulk/arch/x86/include/asm/thread_info.h:15,
                 from /home/liwei/main_code/hulk/include/linux/thread_bits.h:32,
                 from /home/liwei/main_code/hulk/include/linux/thread_info.h:14,
                 from /home/liwei/main_code/hulk/arch/x86/include/asm/preempt.h:7,
                 from /home/liwei/main_code/hulk/include/linux/preempt.h:78,
                 from /home/liwei/main_code/hulk/include/linux/spinlock.h:51,
                 from /home/liwei/main_code/hulk/include/linux/mmzone.h:8,
                 from /home/liwei/main_code/hulk/include/linux/gfp.h:6,
                 from /home/liwei/main_code/hulk/include/linux/slab.h:15,
                 from /home/liwei/main_code/hulk/include/linux/crypto.h:20,
                 from /home/liwei/main_code/hulk/arch/x86/kernel/asm-offsets.c:9:
/home/liwei/main_code/hulk/include/linux/kabi.h:385:3: error: static assertion failed: "include/linux/fs.h:2306:  is not aligned the same as long aaa.  Disable CONFIG_KABI_SIZE_ALIGN_CHECKS if debugging."
   _Static_assert(__alignof__(struct{_new;}) <= __alignof__(struct{_orig;}), \
   ^~~~~~~~~~~~~~
/home/liwei/main_code/hulk/include/linux/kabi.h:405:3: note: in expansion of macro ‘__KABI_CHECK_SIZE_ALIGN’
   __KABI_CHECK_SIZE_ALIGN(_orig, _new);  \
   ^~~~~~~~~~~~~~~~~~~~~~~
/home/liwei/main_code/hulk/include/linux/kabi.h:416:37: note: in expansion of macro ‘_KABI_REPLACE’
 # define KABI_REPLACE(_orig, _new)  _KABI_REPLACE(_orig, _new);
                                     ^~~~~~~~~~~~~
/home/liwei/main_code/hulk/include/linux/kabi.h:437:29: note: in expansion of macro ‘KABI_REPLACE’
 # define KABI_USE(n, _new)  KABI_REPLACE(_KABI_RESERVE(n), _new)
                             ^~~~~~~~~~~~
/home/liwei/main_code/hulk/include/linux/fs.h:2306:2: note: in expansion of macro ‘KABI_USE’
  KABI_USE(1, long aaa)
  ^~~~~~~~

评论 (4)

Wei Li 创建了任务

Hi stkid, welcome to the openEuler Community.
I'm the Bot here serving you. You can find the instructions on how to interact with me at Here.
If you have any questions, please contact the SIG: Kernel, and any of the maintainers: @YangYingliang , @pi3orama , @成坚 (CHENG Jian) , @Qiuuuuu , @zhengzengkai , @Xie XiuQi

openeuler-ci-bot 添加了
 
sig/Kernel
标签
Wei Li 修改了描述
Wei Li 修改了描述

When CONFIG_KABI_RESERVE=n && CONFIG_KABI_SIZE_ALIGN_CHECKS=y, with kabi
reserved padding replaced by KABI_USE(), we will get the build error:

include/linux/kabi.h:383:3: error: static assertion failed:
"include/linux/fs.h:2306: long aaa is larger than .
Disable CONFIG_KABI_SIZE_ALIGN_CHECKS if debugging."
_Static_assert(sizeof(struct{_new;}) <= sizeof(struct{_orig;}),
^~~~~~~~~~~~~~

Even if we disable the check, the result of KABI_USE() when CONFIG_KABI_RESERVE=n is weird,
输入图片说明
update _KABI_REPLACE() to fix this.

By the way, move config entries of kabi to "General setup", and make
CONFIG_KABI_SIZE_ALIGN_CHECKS depending on CONFIG_KABI_RESERVE.

Xie XiuQi 修改了描述
zhengzengkai 通过src-openeuler/kernel Pull Request !508任务状态待办的 修改为已完成

诚邀Issue的创建人,负责人,协作人以及评论人对此次Issue解决过程给予评价:

   0   1   2   3   4   5   6   7   8   9   10  

 不满意                        非常满意

登录 后才可以发表评论

状态
负责人
项目
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
预计工期 (小时)
参与者(3)
5329419 openeuler ci bot 1632792936 5625574 stkid 1587900794 9968373 openeuler survey bot 1637036855
C
1
https://gitee.com/openeuler/kernel.git
git@gitee.com:openeuler/kernel.git
openeuler
kernel
kernel

搜索帮助