Firefly开源社区

标题: make编译报错 [打印本页]

作者: yzzz    时间: 2023-8-4 12:20
标题: make编译报错
按照手册1.1获取SDK然后进入到第三步1.3编译 u-boot和kernel,只在虚拟机上进行操作
$ make
make -C /home/yz/proj/rk3588_sdk/kernel M=/home/yz/class/hello modules
make[1]: Entering directory '/home/yz/proj/rk3588_sdk/kernel'

arch/arm64/Makefile:25: ld does not support --fix-cortex-a53-843419; kernel may be susceptible to erratum
  CC [M]  /home/yz/class/hello/helloworld.o
gcc: error: unrecognized argument in option '-mstack-protector-guard=sysreg'
gcc: note: valid arguments to '-mstack-protector-guard=' are: global tls
gcc: error: unrecognized command line option '-mlittle-endian'; did you mean '-fconvert=little-endian'?
gcc: error: unrecognized command line option '-fpatchable-function-entry=2'; did you mean '--machine-function-return=keep'?
gcc: error: unrecognized command line option '-mstack-protector-guard-reg=sp_el0'; did you mean '-mstack-protector-guard=global'?
gcc: error: unrecognized command line option '-mstack-protector-guard-offset=1344'; did you mean '-mstack-protector-guard=tls'?
scripts/Makefile.build:273: recipe for target '/home/yz/class/hello/helloworld.o' failed
make[2]: *** [/home/yz/class/hello/helloworld.o] Error 1
Makefile:1935: recipe for target '/home/yz/class/hello' failed
make[1]: *** [/home/yz/class/hello] Error 2
make[1]: Leaving directory '/home/yz/proj/rk3588_sdk/kernel'
Makefile:5: recipe for target 'all' failed
make: *** [all] Error 2



作者: yzzz    时间: 2023-8-4 12:36
~/class/hello$ make
make -C /home/yz/proj/rk3588_sdk/kernel M=/home/yz/class/hello modules
make[1]: Entering directory '/home/yz/proj/rk3588_sdk/kernel'
  CC [M]  /home/yz/class/hello/helloworld.o
/home/yz/class/hello/helloworld.c:1:9: fatal error: linus/module.h: No such file or directory
    1 | #include<linus/module.h>
      |         ^~~~~~~~~~~~~~~~
compilation terminated.
scripts/Makefile.build:273: recipe for target '/home/yz/class/hello/helloworld.o' failed
make[2]: *** [/home/yz/class/hello/helloworld.o] Error 1
Makefile:1935: recipe for target '/home/yz/class/hello' failed
make[1]: *** [/home/yz/class/hello] Error 2
make[1]: Leaving directory '/home/yz/proj/rk3588_sdk/kernel'
Makefile:5: recipe for target 'all' failed
make: *** [all] Error 2

作者: yzzz    时间: 2023-8-4 12:40
yzzz 发表于 2023-8-4 12:36
~/class/hello$ make
make -C /home/yz/proj/rk3588_sdk/kernel M=/home/yz/class/hello modules
make[1] ...

第一步先前交叉编译命令中出现错误修改后:
export CROSS_COMPILE=/home/yz/proj/rk3588_sdk/prebuilts/gcc/linux-x86/aarch64/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-
但是修改之后实现交叉编译之后到了第二步仍未找到头文件




欢迎光临 Firefly开源社区 (https://dev.t-firefly.com/) Powered by Discuz! X3.1