Loading CMakeLists.txt +9 −2 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ set(CMAKE_C_STANDARD 99) if(UNIX) set(TARGET_PLATFORM "" CACHE STRING "i686 / x86_64") set(CLANG "" CACHE STRING "1=msan / 2=asan / 3=usan") set(GCC "" CACHE STRING "1=use gcc instead of default (clang)") set(GCOV OFF CACHE BOOL "enable GCOV") set(STRIP OFF CACHE BOOL "enable STRIP") Loading @@ -62,10 +63,16 @@ if(UNIX) # to be uncommented in CI # set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") # set C compiler if(GCC OR GCOV) find_program(cc NAMES gcc-13 gcc REQUIRED) else() find_program(cc NAMES clang-18 clang REQUIRED) endif() set(CMAKE_C_COMPILER "${cc}" CACHE STRING "") # CLANG if(CLANG) find_program(clangBin NAMES /home/amm-archiv/soft/Linux/clang/current/bin/clang clang REQUIRED) set(CMAKE_C_COMPILER "${clangBin}" CACHE STRING "") if("${CLANG}" MATCHES "1" OR "${CLANG}" MATCHES "msan") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=memory") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=memory") Loading Makefile +20 −6 Original line number Diff line number Diff line Loading @@ -34,7 +34,7 @@ LIB_LC3PLUS ?= liblc3plus.a LIB_LIBUTIL ?= libivasutil.a # Default tool settings CC ?= gcc CC ?= cc RM ?= rm -f AR ?= ar Loading Loading @@ -74,23 +74,31 @@ CFLAGS += -Wunused-but-set-variable # libs to link LDLIBS += -lm # check if clang is available on system and use it if it is there CLANG_EXISTS := $(shell which clang) ifneq "$(CLANG_EXISTS)" "" CC = clang else $(warning clang compiler not found - falling back to cc) endif # Clang sanitizer compiler options CCCLANG = clang ifeq "$(CLANG)" "0" CC = $(CCCLANG) CC = clang endif ifeq "$(CLANG)" "1" CC = $(CCCLANG) CC = clang CFLAGS += -fsanitize=memory LDFLAGS += -fsanitize=memory endif ifeq "$(CLANG)" "2" CC = $(CCCLANG) CC = clang CFLAGS += -fsanitize=address LDFLAGS += -fsanitize=address endif ifeq "$(CLANG)" "3" CC = $(CCCLANG) CC = clang # NOTE: keep in sync with list in CMakeLists.txt usan_checks = undefined,float-divide-by-zero,implicit-conversion,local-bounds CFLAGS += -fsanitize=$(usan_checks) Loading @@ -104,6 +112,11 @@ LDFLAGS += -fsanitize-ignorelist=ubsan_ignorelist.txt endif endif # check if explicitly gcc is mandated ifneq "$(GCC)" "" CC = gcc endif ifeq "$(RELEASE)" "1" CFLAGS += -DRELEASE OPTIM ?= 2 Loading @@ -115,6 +128,7 @@ LDFLAGS += -g3 endif ifeq "$(GCOV)" "1" CC = gcc CFLAGS += -fprofile-arcs -ftest-coverage -fprofile-update=atomic LDFLAGS += -fprofile-arcs -ftest-coverage -fprofile-update=atomic endif Loading Loading
CMakeLists.txt +9 −2 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ set(CMAKE_C_STANDARD 99) if(UNIX) set(TARGET_PLATFORM "" CACHE STRING "i686 / x86_64") set(CLANG "" CACHE STRING "1=msan / 2=asan / 3=usan") set(GCC "" CACHE STRING "1=use gcc instead of default (clang)") set(GCOV OFF CACHE BOOL "enable GCOV") set(STRIP OFF CACHE BOOL "enable STRIP") Loading @@ -62,10 +63,16 @@ if(UNIX) # to be uncommented in CI # set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") # set C compiler if(GCC OR GCOV) find_program(cc NAMES gcc-13 gcc REQUIRED) else() find_program(cc NAMES clang-18 clang REQUIRED) endif() set(CMAKE_C_COMPILER "${cc}" CACHE STRING "") # CLANG if(CLANG) find_program(clangBin NAMES /home/amm-archiv/soft/Linux/clang/current/bin/clang clang REQUIRED) set(CMAKE_C_COMPILER "${clangBin}" CACHE STRING "") if("${CLANG}" MATCHES "1" OR "${CLANG}" MATCHES "msan") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=memory") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=memory") Loading
Makefile +20 −6 Original line number Diff line number Diff line Loading @@ -34,7 +34,7 @@ LIB_LC3PLUS ?= liblc3plus.a LIB_LIBUTIL ?= libivasutil.a # Default tool settings CC ?= gcc CC ?= cc RM ?= rm -f AR ?= ar Loading Loading @@ -74,23 +74,31 @@ CFLAGS += -Wunused-but-set-variable # libs to link LDLIBS += -lm # check if clang is available on system and use it if it is there CLANG_EXISTS := $(shell which clang) ifneq "$(CLANG_EXISTS)" "" CC = clang else $(warning clang compiler not found - falling back to cc) endif # Clang sanitizer compiler options CCCLANG = clang ifeq "$(CLANG)" "0" CC = $(CCCLANG) CC = clang endif ifeq "$(CLANG)" "1" CC = $(CCCLANG) CC = clang CFLAGS += -fsanitize=memory LDFLAGS += -fsanitize=memory endif ifeq "$(CLANG)" "2" CC = $(CCCLANG) CC = clang CFLAGS += -fsanitize=address LDFLAGS += -fsanitize=address endif ifeq "$(CLANG)" "3" CC = $(CCCLANG) CC = clang # NOTE: keep in sync with list in CMakeLists.txt usan_checks = undefined,float-divide-by-zero,implicit-conversion,local-bounds CFLAGS += -fsanitize=$(usan_checks) Loading @@ -104,6 +112,11 @@ LDFLAGS += -fsanitize-ignorelist=ubsan_ignorelist.txt endif endif # check if explicitly gcc is mandated ifneq "$(GCC)" "" CC = gcc endif ifeq "$(RELEASE)" "1" CFLAGS += -DRELEASE OPTIM ?= 2 Loading @@ -115,6 +128,7 @@ LDFLAGS += -g3 endif ifeq "$(GCOV)" "1" CC = gcc CFLAGS += -fprofile-arcs -ftest-coverage -fprofile-update=atomic LDFLAGS += -fprofile-arcs -ftest-coverage -fprofile-update=atomic endif Loading