Kernel: Strip kernel symbols when installing

Since we already extract the symbols into a separate file which the kernel then uses for backtraces, this only brings us a smaller kernel, with no downsides :)
This commit is contained in:
apio 2022-10-08 15:57:07 +02:00
parent 4a212b4c92
commit 1e0c8c5fe7
2 changed files with 5 additions and 3 deletions

View File

@ -6,7 +6,7 @@ MOON_BIN := $(MOON_DIR)/bin
CFLAGS := -pedantic -Wall -Wextra -Werror -Wfloat-equal -Wdisabled-optimization -Wformat=2 -Winit-self -Wmissing-include-dirs -Wswitch-default -Wcast-qual -Wundef -Wcast-align -Wwrite-strings -Wlogical-op -Wredundant-decls -Wshadow -Wconversion -Os -ffreestanding -fstack-protector-all -fno-omit-frame-pointer -mno-red-zone -mno-mmx -mno-sse -mno-sse2 -fshort-wchar -mcmodel=kernel -I$(MOON_DIR)/include -isystem $(MOON_DIR)/include/std
CXXFLAGS := -fno-rtti -fno-exceptions -Wsign-promo -Wstrict-null-sentinel -Wctor-dtor-privacy
ASMFLAGS := -felf64
LDFLAGS := -T$(MOON_DIR)/moon.ld -nostdlib -lgcc -Wl,--build-id=none -z max-page-size=0x1000
LDFLAGS := -T$(MOON_DIR)/moon.ld -nostdlib -lgcc -Wl,--build-id=none -z max-page-size=0x1000 -mno-red-zone -mcmodel=kernel
ifneq ($(MOON_BUILD_STABLE), 1)
CFLAGS := ${CFLAGS} -D_MOON_SUFFIX=-$(shell git rev-parse --short HEAD)
@ -54,7 +54,7 @@ $(MOON_OBJ)/%.asm.o: $(MOON_SRC)/%.asm
build: $(OBJS)
@mkdir -p $(@D)
$(CC) $(OBJS) $(CFLAGS) $(LDFLAGS) -o $(MOON_BIN)/moon.elf
$(CC) $(OBJS) $(LDFLAGS) -o $(MOON_BIN)/moon.elf
clean:
rm -rf $(MOON_OBJ)/*
@ -64,6 +64,7 @@ install: $(MOON_BIN)/moon.elf
@mkdir -p $(@D)
cp $^ $(LUNA_ROOT)/initrd/boot/moon.elf
$(LUNA_ROOT)/tools/generate-symbols.sh
$(STRIP) $(LUNA_ROOT)/initrd/boot/moon.elf
.PHONY: build clean install FORCE
FORCE:

View File

@ -7,4 +7,5 @@ export CC=x86_64-luna-gcc
export CXX=x86_64-luna-g++
export LD=x86_64-luna-ld
export AR=x86_64-luna-ar
export ASM=nasm
export ASM=nasm
export STRIP=x86_64-luna-strip