во время компиляции linux ядра до старой версии (2.6.11), и я застрял - PullRequest
0 голосов
/ 22 марта 2020

Я новичок ie при изучении linux ядра, и я получил задание.

Я пытаюсь скомпилировать старое linux ядро ​​= 2.6.11 и получил некоторые ошибки. Текущая среда выглядит следующим образом:

distro: ubuntu 14.04 64bit
kernel: 4.4.0
gcc: 4.8.4
binutils: 2.24

Я установил menuconfig по умолчанию и попробовал свою первую компиляцию. Я обнаружил следующие ошибки:

scripts/kconfig/mconf arch/x86_64/Kconfig
#
# using defaults found in .config
#


*** End of Linux kernel configuration.
*** Execute 'make' to build the kernel or try 'make help'.

ilak@ilak-vm:~/workspace/linux-2.6.11$ make
  CHK     include/linux/version.h
  SPLIT   include/linux/autoconf.h -> include/config/*
make[1]: `arch/x86_64/kernel/asm-offsets.s' is up to date.
  CHK     include/asm-x86_64/offset.h
  CHK     include/linux/compile.h
  CHK     usr/initramfs_list
  CC      arch/x86_64/kernel/process.o
In file included from include/asm/smp.h:18:0,
                 from include/linux/smp.h:19,
                 from include/linux/sched.h:25,
                 from arch/x86_64/kernel/process.c:22:
include/asm/mpspec.h:79:2: warning: ‘packed’ attribute ignored for field of type ‘unsigned char[6]’ [-Wattributes]
  unsigned char mpc_bustype[6] __attribute((packed));
  ^
In file included from include/asm/processor.h:19:0,
                 from include/linux/spinlock.h:16,
                 from include/linux/capability.h:45,
                 from include/linux/sched.h:7,
                 from arch/x86_64/kernel/process.c:22:
include/asm/apic.h: In function ‘apic_write_atomic’:
include/asm/system.h:185:22: warning: value computed is not used [-Wunused-value]
 #define xchg(ptr,v) ((__typeof__(*(ptr)))__xchg((unsigned long)(v),(ptr),sizeof(*(ptr))))
                      ^
include/asm/apic.h:47:2: note: in expansion of macro ‘xchg’
  xchg((volatile unsigned int *)(APIC_BASE+reg), v);
  ^
In file included from include/asm/mmu_context.h:5:0,
                 from arch/x86_64/kernel/process.c:43:
arch/x86_64/kernel/process.c: At top level:
include/asm/desc.h:202:2: warning: ‘set_ldt_desc’ is static but used in inline function ‘load_LDT_nolock’ which is not static [enabled by default]
  set_ldt_desc(cpu, pc->ldt, count);
  ^
In file included from arch/x86_64/kernel/process.c:37:0:
include/asm/uaccess.h:47:39: warning: ‘current_thread_info’ is static but used in inline function ‘verify_area’ which is not static [enabled by default]
   :"1" (addr),"g" ((long)(size)),"g" (current_thread_info()->addr_limit.seg)); \
                                       ^
include/asm/uaccess.h:50:38: note: in expansion of macro ‘__range_not_ok’
 #define access_ok(type, addr, size) (__range_not_ok(addr,size) == 0)
                                      ^
include/asm/uaccess.h:54:9: note: in expansion of macro ‘access_ok’
  return access_ok(type,addr,size) ? 0 : -EFAULT;
         ^
In file included from include/linux/mm.h:36:0,
                 from arch/x86_64/kernel/process.c:24:
include/asm/pgtable.h:264:46: warning: ‘set_pte’ is static but used in inline function ‘pte_mkwrite’ which is not static [enabled by default]
 extern inline pte_t pte_mkwrite(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_RW)); return pte; }
                                              ^
include/asm/pgtable.h:263:46: warning: ‘set_pte’ is static but used in inline function ‘pte_mkyoung’ which is not static [enabled by default]
 extern inline pte_t pte_mkyoung(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_ACCESSED)); return pte; }
                                              ^
include/asm/pgtable.h:262:46: warning: ‘set_pte’ is static but used in inline function ‘pte_mkdirty’ which is not static [enabled by default]
 extern inline pte_t pte_mkdirty(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_DIRTY)); return pte; }
                                              ^
include/asm/pgtable.h:261:45: warning: ‘set_pte’ is static but used in inline function ‘pte_mkexec’ which is not static [enabled by default]
 extern inline pte_t pte_mkexec(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_USER)); return pte; }
                                             ^
include/asm/pgtable.h:260:45: warning: ‘set_pte’ is static but used in inline function ‘pte_mkread’ which is not static [enabled by default]
 extern inline pte_t pte_mkread(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_USER)); return pte; }
                                             ^
include/asm/pgtable.h:259:48: warning: ‘set_pte’ is static but used in inline function ‘pte_wrprotect’ which is not static [enabled by default]
 extern inline pte_t pte_wrprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_RW)); return pte; }
                                                ^
include/asm/pgtable.h:258:44: warning: ‘set_pte’ is static but used in inline function ‘pte_mkold’ which is not static [enabled by default]
 extern inline pte_t pte_mkold(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_ACCESSED)); return pte; }
                                            ^
include/asm/pgtable.h:257:46: warning: ‘set_pte’ is static but used in inline function ‘pte_mkclean’ which is not static [enabled by default]
 extern inline pte_t pte_mkclean(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_DIRTY)); return pte; }
                                              ^
include/asm/pgtable.h:256:48: warning: ‘set_pte’ is static but used in inline function ‘pte_exprotect’ which is not static [enabled by default]
 extern inline pte_t pte_exprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_USER)); return pte; }
                                                ^
include/asm/pgtable.h:255:48: warning: ‘set_pte’ is static but used in inline function ‘pte_rdprotect’ which is not static [enabled by default]
 extern inline pte_t pte_rdprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_USER)); return pte; }
                                                ^
include/asm/pgtable.h:99:2: warning: ‘set_pgd’ is static but used in inline function ‘pgd_clear’ which is not static [enabled by default]
  set_pgd(pgd, __pgd(0));
  ^
include/asm/pgtable.h:89:2: warning: ‘set_pud’ is static but used in inline function ‘pud_clear’ which is not static [enabled by default]
  set_pud(pud, __pud(0));
  ^
arch/x86_64/kernel/process.c: Assembler messages:
arch/x86_64/kernel/process.c:459: Error: unsupported instruction `mov'
arch/x86_64/kernel/process.c:463: Error: unsupported instruction `mov'
arch/x86_64/kernel/process.c:393: Error: unsupported instruction `mov'
arch/x86_64/kernel/process.c:394: Error: unsupported instruction `mov'
arch/x86_64/kernel/process.c:395: Error: unsupported instruction `mov'
arch/x86_64/kernel/process.c:396: Error: unsupported instruction `mov'
make[1]: *** [arch/x86_64/kernel/process.o] Error 1
make: *** [arch/x86_64/kernel] Error 2

После поиска информации в Google я подумал, что binutils может быть проблемой и пробовал что-то, но это казалось бесполезным.

В чем дело и что мне нужно для компиляции старой версии ядра?

Заранее спасибо

...