From 6f62992d5efb85475c8294fc63b242e163acd635 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Fri, 22 Sep 2023 14:19:04 +0200 Subject: [PATCH] Test Unix x86 with asan/ubsan in CI --- .github/workflows/push.yml | 6 ++++++ Makefile | 12 ++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index d7545d0e..d0cef58e 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -14,6 +14,8 @@ jobs: runs-on: ubuntu-22.04 container: image: ubuntu:22.04 + env: + CFLAGS: '-fsanitize=address,undefined' steps: - uses: actions/checkout@v3 - name: apt @@ -33,6 +35,8 @@ jobs: runs-on: ubuntu-22.04 container: image: ubuntu:22.04 + env: + CFLAGS: '-fsanitize=address,undefined' steps: - uses: actions/checkout@v3 - name: apt @@ -86,6 +90,8 @@ jobs: MACOS_x86_64: runs-on: macos-11 + env: + CFLAGS: '-fsanitize=address,undefined' steps: - uses: actions/checkout@v3 - name: brew diff --git a/Makefile b/Makefile index 253fe4e9..f609f8d6 100644 --- a/Makefile +++ b/Makefile @@ -10,32 +10,32 @@ EXAMPLES_BUILD_DIR = $(BUILD_DIR)/examples CC = gcc CXX = g++ BUILD_CC = gcc -CFLAGS = -Wall -Wextra -Wno-unused-parameter +override CFLAGS += -Wall -Wextra -Wno-unused-parameter LDFLAGS = -lm -ldl PHP = php LLK = llk #LLK = $(PHP) $(HOME)/php/llk/llk.php ifeq (debug, $(BUILD)) - CFLAGS += -O0 -g -DIR_DEBUG=1 + override CFLAGS += -O0 -g -DIR_DEBUG=1 endif ifeq (release, $(BUILD)) - CFLAGS += -O2 -g + override CFLAGS += -O2 -g endif ifeq (x86_64, $(TARGET)) - CFLAGS += -DIR_TARGET_X64 + override CFLAGS += -DIR_TARGET_X64 DASM_ARCH = x86 DASM_FLAGS = -M -D X64=1 endif ifeq (x86, $(TARGET)) - CFLAGS += -m32 -DIR_TARGET_X86 + override CFLAGS += -m32 -DIR_TARGET_X86 DASM_ARCH = x86 DASM_FLAGS = -M endif ifeq (aarch64, $(TARGET)) CC= aarch64-linux-gnu-gcc --sysroot=$(HOME)/php/ARM64 - CFLAGS += -DIR_TARGET_AARCH64 + override CFLAGS += -DIR_TARGET_AARCH64 DASM_ARCH = aarch64 DASM_FLAGS = -M endif