1
This commit is contained in:
2022-07-22 22:34:52 +02:00
parent 9b6e84641c
commit 60a01461b0
2 changed files with 10 additions and 11 deletions

View File

@ -74,22 +74,21 @@ CXX ?= g++
# CC = clang
# CXX = clang++
# Separate these as they are not compatible with clang14
EMPTY :=
GCC = gcc
ifeq ($(CXX),$(GCC))
# Separate these as they are not compatible with clang14
EXTRAFLAGS = -mmanual-endbr -mpreferred-stack-boundary=2
else
EXTRAFLAGS = $(EMPTY)
endif
# NOTE: In some cases I needed O1/O0 to allow paging/bluescreen to work (We need the ebp on the stack)
# I don't know why but right now it works with O2
# NOTE: Need -O0 to allow paging/bluescreen to work (We need the ebp on the stack)
CFLAGS := $(CFLAGS) -O0 -m32 -march=i486 -Wall -fno-stack-protector -nostdlib -I. -g -ffreestanding -fno-pie -fno-pic -Wno-write-strings -mno-sse -mno-sse2 $(EXTRAFLAGS)
# I added -std=c++17 for if constexpr, but it isn't necessary for anything critical (I think?)
# -std=c++20 is needed for template concepts and optional references, but we don't have it available :(
# NOTE: -std=c++17 for if constexpr and probably some other stuff
# -std=c++20 is needed for template concepts and optional references, but we don't have it available :(
CXXFLAGS := $(CFLAGS) -Wno-non-virtual-dtor -fno-threadsafe-statics -fno-use-cxa-atexit -fno-rtti -fno-exceptions -std=c++17
BOOT = ../boot