Use LD instead of CC for linking
This commit is contained in:
parent
c24528a481
commit
0e48accbcf
1 changed files with 9 additions and 6 deletions
|
@ -17,6 +17,9 @@ endef
|
|||
# the host system's toolchain, but this is not guaranteed.
|
||||
$(eval $(call DEFAULT_VAR,CC,cc))
|
||||
|
||||
# Same thing for "ld" (the linker).
|
||||
$(eval $(call DEFAULT_VAR,LD,ld))
|
||||
|
||||
# User controllable CFLAGS.
|
||||
CFLAGS ?= -O2 -g -Wall -Wextra -Wpedantic -pipe
|
||||
|
||||
|
@ -53,8 +56,8 @@ override INTERNALCFLAGS := \
|
|||
override INTERNALLDFLAGS := \
|
||||
-nostdlib \
|
||||
-static \
|
||||
-Wl,-z,max-page-size=0x1000 \
|
||||
-Wl,-T,linker.ld
|
||||
-z max-page-size=0x1000 \
|
||||
-T linker.ld
|
||||
|
||||
# Internal nasm flags that should not be changed by the user.
|
||||
override INTERNALNASMFLAGS := \
|
||||
|
@ -76,7 +79,7 @@ limine.h:
|
|||
|
||||
# Link rules for the final kernel executable.
|
||||
$(KERNEL): $(OBJ)
|
||||
$(CC) $(CFLAGS) $(INTERNALCFLAGS) $(OBJ) $(LDFLAGS) $(INTERNALLDFLAGS) -o $@
|
||||
$(LD) $(OBJ) $(LDFLAGS) $(INTERNALLDFLAGS) -o $@
|
||||
|
||||
# Include header dependencies.
|
||||
-include $(HEADER_DEPS)
|
||||
|
|
Loading…
Reference in a new issue