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,6 +1,6 @@
|
||||
FROM ubuntu:latest AS builder
|
||||
|
||||
RUN apt-get update && apt-get -y install clang llvm lld make xorriso gcc
|
||||
RUN apt-get update && apt-get -y install clang llvm lld make xorriso
|
||||
|
||||
WORKDIR /usr/src/MOP3
|
||||
|
||||
|
||||
@@ -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 \
|
||||
-mcmodel=large
|
||||
|
||||
ldflags += --target=x86_64-pc-none-elf \
|
||||
-Wl,-zmax-page-size=0x1000
|
||||
ldflags += -zmax-page-size=0x1000
|
||||
|
||||
@@ -17,18 +17,11 @@ endif
|
||||
|
||||
cflags += -isystem ../include
|
||||
|
||||
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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
cc := clang
|
||||
ld := ld.lld
|
||||
o :=
|
||||
c :=
|
||||
ldflags += -L ../libsystem/build -l:libsystem.a -L ../liballoc/build -l:liballoc.a
|
||||
@@ -12,7 +13,7 @@ include ../$(platform)/flags.mk
|
||||
all: $(app)
|
||||
|
||||
$(app): $(o)
|
||||
$(cc) -o $@ $(ldflags) -T ../$(platform)/link.ld $^
|
||||
$(ld) -o $@ $(ldflags) -T ../$(platform)/link.ld $^
|
||||
|
||||
%.o: %.c
|
||||
$(cc) -c -o $@ $(cflags) $<
|
||||
|
||||
Reference in New Issue
Block a user