首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Linux内核构建compliler_assert错误

Linux内核构建compliler_assert错误
EN

Stack Overflow用户
提问于 2022-05-15 12:06:45
回答 1查看 380关注 1票数 0

我在构建内核方面有问题。这就是我在终端机上输入的内容。

代码语言:javascript
运行
复制
$ wget https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.5.16.tar.xz
$ xz -d linux-5.5.16.tar.xz
$ tar xvf linux-5.5.16.tar
$ apt update
$ apt install build-essential libncurses5 libncurses5-dev bin86 kernel-package libssh-dev bison flex libelf-dev
$ cd linux-5.5.16/
$ cp /boot/config-5.15.0-30-generic ./.config
$ make menuconfig
$ make -j6
$ make modules

下面的错误代码发生了。

代码语言:javascript
运行
复制
./include/linux/compiler.h:350:45: error: call to ‘__compiletime_assert_653’ declared with attribute error: BUILD_BUG_ON failed: (((0x0ffULL) + (1ULL << (__builtin_ffsll(0x0ffULL) - 1))) & (((0x0ffULL) + (1ULL << (__builtin_ffsll(0x0ffULL) - 1))) - 1)) != 0
  350 |         _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
      |                                             ^
./include/linux/compiler.h:331:25: note: in definition of macro ‘__compiletime_assert’
  331 |                         prefix ## suffix();                             \
      |                         ^~~~~~
./include/linux/compiler.h:350:9: note: in expansion of macro ‘_compiletime_assert’
  350 |         _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
      |         ^~~~~~~~~~~~~~~~~~~
./include/linux/build_bug.h:39:37: note: in expansion of macro ‘compiletime_assert’
   39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
      |                                     ^~~~~~~~~~~~~~~~~~
./include/linux/bitfield.h:49:17: note: in expansion of macro ‘BUILD_BUG_ON_MSG’
   49 |                 BUILD_BUG_ON_MSG(__builtin_constant_p(_val) ?           \
      |                 ^~~~~~~~~~~~~~~~
./include/linux/bitfield.h:67:17: note: in expansion of macro ‘__BF_FIELD_CHECK’
   67 |                 __BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_FIT: ");     \
      |                 ^~~~~~~~~~~~~~~~
drivers/net/ethernet/netronome/nfp/bpf/jit.c:653:13: note: in expansion of macro ‘FIELD_FIT’
  653 |         if (FIELD_FIT(UR_REG_IMM_MAX, imm))
      |             ^~~~~~~~~
make[5]: *** [scripts/Makefile.build:266: drivers/net/ethernet/netronome/nfp/bpf/jit.o] Error 1
make[4]: *** [scripts/Makefile.build:503: drivers/net/ethernet/netronome/nfp] Error 2
make[3]: *** [scripts/Makefile.build:503: drivers/net/ethernet/netronome] Error 2
make[2]: *** [scripts/Makefile.build:503: drivers/net/ethernet] Error 2
make[1]: *** [scripts/Makefile.build:503: drivers/net] Error 2
make: *** [Makefile:1694: drivers] Error 2

我该怎么解决呢?我花了一整天来解决这个问题。请帮帮我。

EN

回答 1

Stack Overflow用户

发布于 2022-05-16 14:02:10

我今天也犯了这个错误。原因是最新的gcc/g++有bug。你应该把gcc/g++版本降到9.4。见第二个answerhttps://askubuntu.com/questions/26498/how-to-choose-the-default-gcc-and-g-version

票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72248103

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档