I know I've had a few toolchain issues before and I know sometimes they've been daft mistakes, but I'm afraid I'm stuck again!
I've developped a library (libos.a) which contains some useful classes and functions for the freestanding environment. This includes a string class, for example. The idea behind the (static) library is that I can use the functions in both my OS and my second stage loader with minimal effort.
The problem is this: Until this point, I have been linking with the following command line in my makefile:
Code: Select all
LDFLAGS:=-T $(SRCBASE)link.ld -nostdinc -nostdlib -o
...
@$(LD) $(LDFLAGS) $(BUILD)$(BINARY) $(OBJ) $(LIBPATH)$(LIB)
Code: Select all
LDFLAGS:=-T $(SRCBASE)link.ld -nostdinc -nostdlib -static -L$(LIBPATH) -l$(LIB) -o
...
@$(LD) $(LDFLAGS) $(BUILD)$(BINARY) $(OBJ)
Removing -nostdlib does not change anything - and according to the LD docs this should make no difference to explicitly declared libraries anyway. The library is archived with ar (flags -vcrs to create an archive index as per ranlib - removing the s argument makes no difference).
Does anyone know what I have missed this time?
Cheers,
Adam