0

我想make tinyconfig在完成所有步骤后编译一个自己的简约 Linux 内核(如这里:)

我收到此错误消息:

arch/x86/kernel/apic/apic.c:2282:6: error: redefinition of ‘apic_id_disabled’
 bool apic_id_disabled(unsigned int id)
      ^~~~~~~~~~~~~~~~
In file included from arch/x86/kernel/apic/apic.c:47:0:
./arch/x86/include/asm/apic.h:529:20: note: previous definition of ‘apic_id_disabled’ was here
 static inline bool apic_id_disabled(unsigned int id) { return false; }
                    ^~~~~~~~~~~~~~~~
scripts/Makefile.build:330: recipe for target 'arch/x86/kernel/apic/apic.o' failed
make[6]: *** [arch/x86/kernel/apic/apic.o] Error 1
scripts/Makefile.build:604: recipe for target 'arch/x86/kernel/apic' failed
make[5]: *** [arch/x86/kernel/apic] Error 2
scripts/Makefile.build:604: recipe for target 'arch/x86/kernel' failed
make[4]: *** [arch/x86/kernel] Error 2
Makefile:1077: recipe for target 'arch/x86' failed
make[3]: *** [arch/x86] Error 2
make[3]: Verzeichnis „/home/lukas/kernel/linux-source-4.15.0“ wird verlassen
debian/ruleset/targets/common.mk:295: recipe for target 'debian/stamp/build/kernel' failed
make[2]: *** [debian/stamp/build/kernel] Error 2
make[2]: Verzeichnis „/home/lukas/kernel/linux-source-4.15.0“ wird verlassen
debian/ruleset/common/targets.mk:242: recipe for target 'debian/stamp/do-build-arch' failed
make[1]: *** [debian/stamp/do-build-arch] Error 2
make[1]: Verzeichnis „/home/lukas/kernel/linux-source-4.15.0“ wird verlassen
dpkg-buildpackage: Fehler: debian/rules build Unterprozess gibt Abbruchstatus 2 zurück
debian/ruleset/targets/common.mk:401: recipe for target 'debian/stamp/build/buildpackage' failed
make: *** [debian/stamp/build/buildpackage] Error 2

先感谢您

4

1 回答 1

0

#ifdef CONFIG_SMP
535 bool apic_id_is_primary_thread(unsigned int id);
第536章
537 #else
538 静态内联 bool apic_id_is_primary_thread(unsigned int id) { return false; }
539 静态内联 bool apic_id_disabled(unsigned int id) { return false; }
540 #endif

实际上,您可以从这些代码中看到 /arch/x86/include/asm/apic.h 中的冲突代码,在您的配置中启用 SMP 是解决此问题的最简单方法。

过程:

 make menuconfig 
 -> Processor type and features

然后在那里启用[Symmetric multi-processing support]

make -j8 # will compile successfully now
于 2020-09-01T07:42:46.370 回答