1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 04:27:45 +00:00

Build: Pass --gc-sections to the linker in all builds.

This removes unused sections from the output and reduces the binary size
of everything we compile.
This commit is contained in:
Andreas Kling 2019-04-23 21:37:10 +02:00
parent f042b3adeb
commit f3754b8429
2 changed files with 3 additions and 4 deletions

View file

@ -82,8 +82,7 @@ OBJS = $(CXX_OBJS) Boot/boot.ao
KERNEL = kernel
CXXFLAGS += -ffreestanding -mregparm=3 -mno-80387 -mno-mmx -mno-sse -mno-sse2
DEFINES += -DKERNEL
LD = i686-pc-serenity-ld
LDFLAGS += -T linker.ld
LDFLAGS += -Ttext 0x10000 -Wl,-T linker.ld -nostdlib
all: $(KERNEL) kernel.map
@ -91,7 +90,7 @@ kernel.map: kernel
@echo "MKMAP $@"; sh mkmap.sh
$(KERNEL): $(OBJS)
@echo "LD $@"; $(LD) $(LDFLAGS) -o $@ -Ttext 0x10000 $(OBJS)
@echo "LD $@"; $(LD) $(LDFLAGS) -o $@ $(OBJS)
.cpp.o:
@echo "CXX $<"; $(CXX) $(CXXFLAGS) -o $@ -c $<