]> git.dujemihanovic.xyz Git - nameless-os.git/commitdiff
kernel, stage3: Enable -O2 and LTO by default
authorDuje Mihanović <duje.mihanovic@skole.hr>
Wed, 29 Jun 2022 08:49:01 +0000 (10:49 +0200)
committerDuje Mihanović <duje.mihanovic@skole.hr>
Wed, 29 Jun 2022 08:49:01 +0000 (10:49 +0200)
boot/x86/stage3/Makefile
kernel/Makefile

index c9622b20db8ba34c273c681b213404e64df3a94e..81a429044e99dfee4e6e06d4bddb069c4d8fa8fe 100644 (file)
@@ -1,8 +1,9 @@
 STAGE3_OBJ = loader.o elf.o paging.o prekernel.o
 
 ASFLAGS_BASE = -f elf -g dwarf2 -DGIT_REVISION=\"$(GIT_REV)\"
-CFLAGS_BASE = -ffreestanding -nostdlib -DGIT_REVISION=\"$(GIT_REV)\" -g
-LDFLAGS_BASE = -ffreestanding -nostdlib -g -lgcc -T stage3.ld
+CFLAGS_BASE = -ffreestanding -nostdlib -DGIT_REVISION=\"$(GIT_REV)\" -g \
+             -O2 -flto
+LDFLAGS_BASE = -ffreestanding -nostdlib -g -lgcc -T stage3.ld -flto
 
 default: LOADER.BIN loader.elf
 
index a872ca6dac43ebe77470a37c2637fdd6b04f5aba..8c9b27bedfab7082cb555d45856ed70df7cf30fa 100644 (file)
@@ -4,8 +4,10 @@ include drivers/Makefile
 include arch/x86/Makefile
 
 ASFLAGS_BASE = -f elf -g dwarf2
-CFLAGS_BASE = -fgnu89-inline -ffreestanding -nostdlib -Iinclude -Iinclude/arch/x86 -g -DGIT_COMMIT=\"$(GIT_REV)\"
-LDFLAGS_BASE = -ffreestanding -nostdlib -lgcc -g
+CFLAGS_BASE = -fgnu89-inline -ffreestanding -nostdlib -Iinclude \
+             -Iinclude/arch/x86 -g -DGIT_COMMIT=\"$(GIT_REV)\" \
+             -O2 -flto
+LDFLAGS_BASE = -ffreestanding -nostdlib -lgcc -g -flto
 
 kernel.elf kernel.dbg: $(KERNEL_OBJ)
        $(CC) $(LDFLAGS_BASE) $(LDFLAGS) -T linker.ld $^ -o $@