seperation of arch dependent C/LD flags #5

This commit is contained in:
Furkan Mudanyali 2023-12-26 16:01:18 +03:00
parent 8f02f633f9
commit 6dd3c506f1
3 changed files with 39 additions and 55 deletions

View File

@ -9,6 +9,28 @@ else
$(error Unknown target architecture $(ARCH))
endif
override CFLAGS += \
-O3 \
-pipe \
-Wall \
-Wextra \
-std=c99 \
-ffreestanding \
-fno-stack-protector \
-fno-lto \
-fPIE \
-Ihanekawa/include \
-Iyukari/include
override LDFLAGS += \
-nostdlib \
-pie \
-static \
--no-dynamic-linker \
-z noexecstack \
--no-omagic \
--no-warn-rwx-segments
asagiri: build/bin/yukari
## KERNEL

View File

@ -2,33 +2,14 @@ override CC := aarch64-none-elf-gcc
override LD := aarch64-none-elf-ld
override OBJCOPY := aarch64-none-elf-objcopy
override CFLAGS := \
-O3 \
-pipe \
-Wall \
-Wextra \
-std=c99 \
-ffreestanding \
-fno-stack-protector \
-fno-stack-check \
-fno-lto \
-fPIE \
-march=armv8-a \
-Iarch/aarch64/include \
-Ihanekawa/include \
-Iyukari/include \
-D_ARCH_AARCH64
override CFLAGS := \
-march=armv8-a \
-Iarch/aarch64/include \
-D_ARCH_AARCH64
override LDFLAGS := \
-m aarch64elf \
-nostdlib \
-static \
-pie \
--no-dynamic-linker \
--no-omagic \
-z noexecstack \
-T arch/aarch64/linker.ld \
--no-warn-rwx-segments
override LDFLAGS := \
-m aarch64elf \
-T arch/aarch64/linker.ld
.PHONY: all
all: asagiri.img

View File

@ -28,36 +28,17 @@ endif
$(info $$OVMF_CODE is [${OVMF_CODE}])
$(info $$OVMF_VARS is [${OVMF_VARS}])
override CFLAGS := \
-O3 \
-pipe \
-Wall \
-Wextra \
-std=c99 \
-ffreestanding \
-fno-stack-protector \
-fno-stack-check \
-fno-lto \
-mno-red-zone \
-fshort-wchar \
-fPIE \
-march=x86-64 \
-mcmodel=large \
-Iarch/x86_64/include \
-Ihanekawa/include \
-Iyukari/include \
-D_ARCH_AMD64
override CFLAGS := \
-mno-red-zone \
-fshort-wchar \
-march=x86-64 \
-mcmodel=large \
-Iarch/x86_64/include \
-D_ARCH_AMD64
override LDFLAGS := \
-m elf_x86_64 \
-nostdlib \
-static \
-pie \
--no-dynamic-linker \
--no-omagic \
-z noexecstack \
-T arch/x86_64/linker.ld \
--no-warn-rwx-segments
override LDFLAGS := \
-m elf_x86_64 \
-T arch/x86_64/linker.ld
.PHONY: all
all: shinobu asagiri.img