Use LLVM linker, Dockerfile now works without GCC
All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m16s
All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m16s
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
cc := clang
|
||||
ld := ld.lld
|
||||
o :=
|
||||
c :=
|
||||
ldflags :=
|
||||
@@ -12,7 +13,7 @@ include make/src.mk
|
||||
all: build/kernel.elf
|
||||
|
||||
build/kernel.elf: $(o)
|
||||
$(cc) -o $@ $(ldflags) -T $(platform)/link.ld $^
|
||||
$(ld) -o $@ $(ldflags) -T $(platform)/link.ld $^
|
||||
|
||||
%.o: %.c
|
||||
$(cc) -c -o $@ $(cflags) $<
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
cflags += --target=x86_64-pc-none-elf \
|
||||
cflags += --target=x86_64-unknown-unknown-elf \
|
||||
-mno-sse \
|
||||
-mno-sse2 \
|
||||
-mno-avx \
|
||||
@@ -7,5 +7,4 @@ cflags += --target=x86_64-pc-none-elf \
|
||||
-mno-red-zone \
|
||||
-fno-omit-frame-pointer
|
||||
|
||||
ldflags += --target=x86_64-pc-none-elf \
|
||||
-Wl,-zmax-page-size=0x1000
|
||||
ldflags += -zmax-page-size=0x1000
|
||||
|
||||
@@ -23,18 +23,11 @@ ifeq ($(buildtype),release)
|
||||
cflags += -ffunction-sections -fdata-sections -Oz
|
||||
endif
|
||||
|
||||
ldflags += -ffreestanding \
|
||||
-nostdlib \
|
||||
-fno-builtin \
|
||||
-fuse-ld=lld \
|
||||
-static
|
||||
|
||||
ifeq ($(buildtype),debug)
|
||||
ldflags += -g
|
||||
endif
|
||||
ldflags += --nostdlib \
|
||||
--static
|
||||
|
||||
ifeq ($(buildtype),release)
|
||||
ldflags += -Wl,--gc-sections \
|
||||
-Wl,--strip-all \
|
||||
-flto
|
||||
ldflags += --gc-sections \
|
||||
--strip-all \
|
||||
-O3
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user