gpt4 book ai didi

linux - `arch/x86/tools/relocs.c' 需要 i586-poky-linux : No rule to make target `arch/x86/tools/relocs' ,

转载 作者:太空宇宙 更新时间:2023-11-04 03:52:30 29 4
gpt4 key购买 nike

我在 Macbook Pro 上的 VirtualBox 上运行 Ubuntu 14.04 64 位 MAC。我在 hello_kernel.c 中有以下内容,我想运行它。

#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>

static int __init enter(void)
{
printk(KERN_ALERT "Hello Kernel Galileo\n");
return 0;
}

static void __exit exit(void)
{
printk(KERN_ALERT "Bye kernel Galileo\n");
return;
}

module_init(enter);
module_exit(exit);

我已在 /home/esp/SDK/i586-poky-linux 中安装了 i586-poky-linux,这是我的 Makefile

obj-m:= hello_kernel.o

ARCH=x86
CROSS_COMPILE=i586-poky-linux-

all:
make -C /home/esp/SDK/sysroots/i586-poky-linux/usr/src/kernel M=$(PWD) modules

clean:
rm -fr *.o
rm -fr *.ko
rm -fr *.mod.c
rm -fr *.order
rm -fr *.symvers

运行 sudo make 时出现以下错误。

make[2]: Nothing to be done for `all'.
make[2]: *** No rule to make target `arch/x86/tools/relocs.c', needed by `arch/x86/tools/relocs'. Stop.
make[1]: *** [archscripts] Error 2
make[1]: Leaving directory `/home/esp/SDK/sysroots/i586-poky-linux/usr/src/kernel'

我在 ~/SDK/sysroots/i586-poky-linux/usr/src/kernel/arch/x86/tools/ 中没有看到 relocsrelocs.c

最佳答案

找到解决方案了!我安装的 i586-poky-linux 内核中缺少一些脚本。要生成这些脚本,请在 SDK/sysroots/i586-poky-linux/usr/src/kernel 中运行 sudo make script。这将生成所需的脚本,一切正常。 :)

关于linux - `arch/x86/tools/relocs.c' 需要 i586-poky-linux : No rule to make target `arch/x86/tools/relocs' ,,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25825612/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com