UBSan conditional compilation

This commit is contained in:
2026-03-29 09:38:24 +02:00
parent 65371077d9
commit 2f1eef9e15
2 changed files with 24 additions and 1 deletions
+10 -1
View File
@@ -2,12 +2,21 @@
BUILDDIR := build
ELFFILE := pepperk
SRC := src
CC_PROBLEMATIC_FLAGS:=-Wno-unused-parameter -Wno-unused-variable
ifeq ($(UBSAN),true)
SOURCES := $(shell find src -name '*.c')
CC_PROBLEMATIC_FLAGS:= -fsanitize=undefined
else
SOURCES := $(shell find src -name '*.c')
SOURCES := $(filter-out src/security/ubsan.c, $(SOURCES))
endif
OBJFILES := $(patsubst $(SRC)/%.c, $(BUILDDIR)/%.o, $(SOURCES))
CC := x86_64-elf-gcc
CC_FLAGS=-Wall -Wextra -std=gnu99 -nostdlib -ffreestanding -fstack-protector -fno-omit-frame-pointer -fno-stack-check -fno-PIC -ffunction-sections -fdata-sections -mcmodel=kernel
CC_PROBLEMATIC_FLAGS=-Wno-unused-parameter -Wno-unused-variable -fsanitize=undefined
LD := x86_64-elf-ld