Problem with using newlib
Posted: Sat Dec 11, 2021 1:02 am
Hi,
After about a year of not working on my os (new baby and no time ) I finally got around to working on it again and had to clone my project on a new PC
I wanted to see that I could still compile user space programs ok, but I have some problem with newlib. I've tried deleting newlib and recompiling as per instructions in "porting newlib". Making and installing newlib works completes without any problems...
my userspace program is a simple printf "hello world" but make complains with:
and it will complain about every other system call printf needs (_write, _seek etc")
my makefile:
I managed to compile and run a userspace program fine last time I worked on my os, so not sure what i'm missing here. Its trying to use reentrant functions it seems, as if it ignores my own system call wrappers that I wrote.
Any help is appreciated - thanks!
After about a year of not working on my os (new baby and no time ) I finally got around to working on it again and had to clone my project on a new PC
I wanted to see that I could still compile user space programs ok, but I have some problem with newlib. I've tried deleting newlib and recompiling as per instructions in "porting newlib". Making and installing newlib works completes without any problems...
my userspace program is a simple printf "hello world" but make complains with:
Code: Select all
in function `_sbrk_r': "...newlib/libc/reent/sbrkr.c:51: undefined reference to `_sbrk'"
my makefile:
Code: Select all
CFILES = program.c
CC=i686-myos-gcc
CFLAGS = -O0 -Wall -Wextra
LIBS = ~/myos/sysroot/usr/lib/libc.a
all:
$(CC) $(LIBS) $(CFILES) $(CFLAGS) -o program.o
clean:
rm -f *.o
Any help is appreciated - thanks!