1

I just tried to complie xv6 in my Ubuntu 18.04.3 using make qemu-nox

It failed with the following error. Can you give me some information about this error?

ld -m elf_i386 -T kernel.ld -o kernel entry.o bio.o console.o exec.o file.o fs.o ide.o ioapic.o kalloc.o kbd.o lapic.o log.o main.o mp.o picirq.o pipe.o proc.o sleeplock.o spinlock.o string.o swtch.o syscall.o sysfile.o sysproc.o trapasm.o trap.o uart.o vectors.o vm.o -b binary initcode entryother trap.o: In function tvinit': /home/lee/OS-Homework/trap.c:23: undefined reference tovectors' /home/lee/OS-Homework/trap.c:24: undefined reference to `vectors' Makefile:124: recipe for target 'kernel' failed make: *** [kernel] Error 1

2nebin
  • 125
  • 3
  • 9

1 Answers1

1

When linking, ld complains about the lack of vectors array which is generated by rule vectors.S

vectors.S: vectors.pl
    perl vectors.pl > vectors.S

It seems that it that this rule is not generated...

To build vector.S just type make vectors.S before make qemu-nox, or even in one command:

make vectors.S qemu-nox
Mathieu
  • 8,840
  • 7
  • 32
  • 45