[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

2.4.20 kernel link failure: undefined reference to `_mcount'



I'm attempting to compile kernel 2.4.20 on a sun ultra 2 using 
gcc-3.0 (3.0.4) from debian gnu/linux sparc woody 3.0r0.

The linux kernel faq (http://www.wsinf.edu.pl/doc/doc-linux-html/FAQ/Linux-FAQ-8.html)
suggests that the linker is using a static libc for linking.

The linker command below doesn't show that /usr/lib/libc.a is being linked
in but perhaps it's implied (this doesn't quite make sense though, since
kernels are usually 500k to 1 MB and libc.a is a little over 2MB on both
i386 and sparc) ?

In any case, is there any special magic I need to do to compile this ?
I used 3.0.4 because 2.9.5 didn't seem to have a compiler for sparc64.

Lots of thanks in advance.

link error:

ld -m elf64_sparc -T arch/sparc64/vmlinux.lds arch/sparc64/kernel/head.o
arch/sparc64/kernel/init_task.o init/main.o init/version.o
init/do_mounts.o \
        --start-group \
        arch/sparc64/kernel/kernel.o arch/sparc64/mm/mm.o
kernel/kernel.o mm/mm.o fs/fs.o ipc/ipc.o
arch/sparc64/math-emu/math-emu.o \
         drivers/char/char.o drivers/block/block.o drivers/misc/misc.o
drivers/net/net.o drivers/media/media.o drivers/scsi/scsidrv.o
drivers/cdrom/driver.o drivers/pci/driver.o drivers/sbus/sbus_all.o
drivers/video/video.o drivers/md/mddev.o \
        net/network.o \
        /usr/src/linux-2.4.20/lib/lib.a /usr/src/linux-2.4.20/lib/lib.a
/usr/src/linux-2.4.20/arch/sparc64/prom/promlib.a
/usr/src/linux-2.4.20/arch/sparc64/lib/lib.a \
        --end-group \
        -o vmlinux
init/main.o: In function `check_bugs':
init/main.o(.text+0x8): undefined reference to `_mcount'
init/main.o: In function `rest_init':
init/main.o(.text+0x28): undefined reference to `_mcount'
init/main.o: In function `init':
init/main.o(.text+0x88): undefined reference to `_mcount'
init/main.o: In function `profile_setup':
init/main.o(.text.init+0x8): undefined reference to `_mcount'
init/main.o: In function `checksetup':
init/main.o(.text.init+0x48): undefined reference to `_mcount'
init/main.o(.text.init+0xe8): more undefined references to `_mcount'
follow
make: *** [vmlinux] Error 1



Reply to: