UBSan conditional compilation
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user