mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 22:27:35 +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:
parent
f042b3adeb
commit
f3754b8429
2 changed files with 3 additions and 4 deletions
|
@ -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 $<
|
||||
|
|
|
@ -8,7 +8,7 @@ MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
|
|||
SERENITY_BASE_DIR := $(patsubst %/,%,$(dir $(MAKEFILE_PATH)))
|
||||
|
||||
INCLUDE_FLAGS = -I$(SERENITY_BASE_DIR) -I. -I$(SERENITY_BASE_DIR)/LibC -I$(SERENITY_BASE_DIR)/Servers
|
||||
LDFLAGS = -L$(SERENITY_BASE_DIR)/LibC -L$(SERENITY_BASE_DIR)/LibCore -L$(SERENITY_BASE_DIR)/LibM -L$(SERENITY_BASE_DIR)/LibGUI
|
||||
LDFLAGS = -L$(SERENITY_BASE_DIR)/LibC -L$(SERENITY_BASE_DIR)/LibCore -L$(SERENITY_BASE_DIR)/LibM -L$(SERENITY_BASE_DIR)/LibGUI -Wl,--gc-sections
|
||||
CLANG_FLAGS = -Wconsumed -m32 -ffreestanding -march=i686
|
||||
#SUGGEST_FLAGS = -Wsuggest-final-types -Wsuggest-final-methods -Wsuggest-override #-Wsuggest-attribute=noreturn
|
||||
DEFINES = -DSANITIZE_PTRS
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue