[SOLVED] Custom LibC and linking issue...
Posted: Thu Feb 15, 2018 3:54 am
Hi,
I am trying since yesterday to develop my own LibC for my kernel. The big problem I encountered is that when I tried to compile my implementation of lldiv, I started getting linking errors :
I think that the problem comes from my libgcc as when I'm trying to link with -lgcc I get the following error :
But when I'm linking with GCC with -lgcc, I don't get the -lgcc error but the other.
I have built the complete i686-elf toolchain (gcc + binutils) with the given commands on the wiki.
Did anyone ever get this kind of error or know how to solve it ?
Thanks,
Ankeraout.
Edit :
As I thought that it was possible that I had made a mistake while building the toolchain, I have just rebuilt it, and it still does not work.
I am trying since yesterday to develop my own LibC for my kernel. The big problem I encountered is that when I tried to compile my implementation of lldiv, I started getting linking errors :
Code: Select all
i686-elf-ld -nostdlib -T kernel/link.ld kernel/i386/isr.o kernel/boot/multiboot.o kernel/video/kernel_video.o kernel/i386/irq.o kernel/i386/exception.o kernel/i386/idt.o kernel/i386/pic.o kernel/i386/gdt.o kernel/boot/kernel.o kernel/drivers/serial.o kernel/libc/stdlib.o kernel/libc/string.o -o kernel/kernel.elf
kernel/libc/stdlib.o: In function `lldiv':
stdlib.c:(.text+0x204): undefined reference to `__divmoddi4'
Code: Select all
i686-elf-ld -nostdlib -lgcc -T kernel/link.ld kernel/i386/isr.o kernel/boot/multiboot.o kernel/video/kernel_video.o kernel/i386/irq.o kernel/i386/exception.o kernel/i386/idt.o kernel/i386/pic.o kernel/i386/gdt.o kernel/boot/kernel.o kernel/drivers/serial.o kernel/libc/stdlib.o kernel/libc/string.o -o kernel/kernel.elf
i686-elf-ld: cannot find -lgcc
I have built the complete i686-elf toolchain (gcc + binutils) with the given commands on the wiki.
Did anyone ever get this kind of error or know how to solve it ?
Thanks,
Ankeraout.
Edit :
As I thought that it was possible that I had made a mistake while building the toolchain, I have just rebuilt it, and it still does not work.