项目

一般

简介

错误 #1176

新国产平台,编译驱动出现错误。

战 弋戈将近 2 年 之前添加. 更新于 将近 2 年 之前.

状态:
已解决
优先级:
普通
指派给:
开始日期:
2023-06-20
计划完成日期:
% 完成:

0%

预期时间:
问题归属:
DRV

描述

单独编译ko文件时,出现错误信息如下:
/root/zyg/P13_Pre1/dev2/lib/ko/nr_pcie.c:256:4: warning: ignoring return value of ‘copy_from_user’, declared with attribute warn_unused_result [-Wunused-result]
copy_from_user( (void )barinf, (void *)arg, sizeof(barinf));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/root/zyg/P13_Pre1/dev2/lib/ko/nr_pcie.c:276:6: warning: ignoring return value of ‘copy_from_user’, declared with attribute warn_unused_result [-Wunused-result]
copy_from_user( (void *)&barRegInfo, (void *)arg, count);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ././include/linux/compiler_types.h:68:0,
from <command-line>:0:
./arch/arm64/include/asm/jump_label.h: In function ‘arm64_kernel_unmapped_at_el0’:
./include/linux/compiler-gcc.h:120:38: warning: asm operand 0 probably doesn’t match constraints
#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
^
./arch/arm64/include/asm/jump_label.h:38:2: note: in expansion of macro ‘asm_volatile_goto’
asm_volatile_goto(
^~~~~~~~~~~~~~~
./include/linux/compiler-gcc.h:120:38: warning: asm operand 0 probably doesn’t match constraints
#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
^
./arch/arm64/include/asm/jump_label.h:21:2: note: in expansion of macro ‘asm_volatile_goto’
asm_volatile_goto(
^~~~~~~~~~~~~~~
./include/linux/compiler-gcc.h:120:38: error: impossible constraint in ‘asm’
#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
^
./arch/arm64/include/asm/jump_label.h:38:2: note: in expansion of macro ‘asm_volatile_goto’
asm_volatile_goto(
^~~~~~~~~~~~~~~
./include/linux/compiler-gcc.h:120:38: error: impossible constraint in ‘asm’
#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
^
./arch/arm64/include/asm/jump_label.h:21:2: note: in expansion of macro ‘asm_volatile_goto’
asm_volatile_goto(
^~~~~~~~~~~~~~~
make2:
[scripts/Makefile.build:275:/root/zyg/P13_Pre1/dev2/lib/ko/nr_pcie.o] 错误 1
make1:
[Makefile:1698:/root/zyg/P13_Pre1/dev2/lib/ko] 错误 2
make1: 离开目录“/usr/src/linux-headers-5.4.18-41kt01-generic”
make: *
* [Makefile:17:all] 错误 2

历史记录

#1

战 弋戈 更新于 将近 2 年 之前

内核的头文件出现错误的概率比较少,可能还是makefile设置的问题。

#2

战 弋戈 更新于 将近 2 年 之前

重新写一个hello的ko文件也没有编译通过, 考虑可能是内核的问题。 重新编译内核并安装后,可以启动。 还是出现asm 错误。
后来考虑是gcc 环境的问题, 重新安装系统后,可以编译通过。

#3

战 弋戈 更新于 将近 2 年 之前

  • 状态新建 变更为 已解决

导出 Atom PDF