Kernel source not linking against sysroot libs
Posted: Wed Oct 08, 2014 12:49 pm
Git repo is here
I've been loosely following the "Meaty Skeleton" tutorial and this is the first big issue I can't figure out how to solve. My src/kernel/kernel.c relies on strlen(), and since I was carrying over from the Bare Bones tutorial I originally included that function's definition in kernel.c. The project is now reorganized such that src/libc/include/string.h declares strlen(), and src/libc/string/strlen.c defines it. strlen.o gets archived into libk.a with the other standard library functions, so the kernel source should reference that library, if I understand correctly.
kernel.c has and is referencing it from sysroot/include/string.h, but when I comment out the definition of strlen() in kernel.c I get an undefined reference error. I've looked over my Makefile, and, as far as I can tell, I use the same method for compiling the libc source into libk.a that the tutorial does. Can anyone help me out?
I've been loosely following the "Meaty Skeleton" tutorial and this is the first big issue I can't figure out how to solve. My src/kernel/kernel.c relies on strlen(), and since I was carrying over from the Bare Bones tutorial I originally included that function's definition in kernel.c. The project is now reorganized such that src/libc/include/string.h declares strlen(), and src/libc/string/strlen.c defines it. strlen.o gets archived into libk.a with the other standard library functions, so the kernel source should reference that library, if I understand correctly.
kernel.c has
Code: Select all
#include <string.h>