loocars
loocars

Reputation: 46

Minimalistic Linux Kernel not compiling

I want to compile an own minimalistic Linux Kernel with make tinyconfig and after doing all steps (like here:)

I get this error message:

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

Thank you in advance

Upvotes: 0

Views: 781

Answers (1)

Zhuangh7
Zhuangh7

Reputation: 66

#ifdef CONFIG_SMP
535 bool apic_id_is_primary_thread(unsigned int id);
536 bool apic_id_disabled(unsigned int id);
537 #else
538 static inline bool apic_id_is_primary_thread(unsigned int id) { return false; }
539 static inline bool apic_id_disabled(unsigned int id) { return false; }
540 #endif

actually you can see the conflict code in /arch/x86/include/asm/apic.h from these code, enable SMP in your config is the easiest way to fix this problem.

PROCESS:

 make menuconfig 
 -> Processor type and features

enable [Symmetric multi-processing support] there then

make -j8 # will compile successfully now

Upvotes: 0

Related Questions