mirror of
https://github.com/holub/mame
synced 2025-10-04 16:34:53 +03:00
moved some clang-specific stuff from makefile to src/build/flags_clang.mak (nw)
This commit is contained in:
parent
79930bb168
commit
1e29bb1347
29
makefile
29
makefile
@ -608,39 +608,16 @@ COBJFLAGS += \
|
|||||||
CPPONLYFLAGS += \
|
CPPONLYFLAGS += \
|
||||||
-Woverloaded-virtual
|
-Woverloaded-virtual
|
||||||
|
|
||||||
include $(SRC)/build/cc_detection.mak
|
|
||||||
|
|
||||||
ifdef SANITIZE
|
ifdef SANITIZE
|
||||||
CCOMFLAGS += -fsanitize=$(SANITIZE)
|
CCOMFLAGS += -fsanitize=$(SANITIZE)
|
||||||
|
|
||||||
ifneq (,$(findstring thread,$(SANITIZE)))
|
ifneq (,$(findstring thread,$(SANITIZE)))
|
||||||
CCOMFLAGS += -fPIE
|
CCOMFLAGS += -fPIE
|
||||||
endif
|
endif
|
||||||
ifneq (,$(findstring memory,$(SANITIZE)))
|
|
||||||
ifneq (,$(findstring clang,$(CC)))
|
|
||||||
CCOMFLAGS += -fsanitize-memory-track-origins -fPIE
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
ifneq (,$(findstring undefined,$(SANITIZE)))
|
|
||||||
ifneq (,$(findstring clang,$(CC)))
|
|
||||||
# TODO: check if linker is clang++
|
|
||||||
# produces a lot of messages - disable it for now
|
|
||||||
CCOMFLAGS += -fno-sanitize=alignment
|
|
||||||
# these are false positives because of the way our delegates work
|
|
||||||
CCOMFLAGS += -fno-sanitize=function
|
|
||||||
# clang takes forever to compile src/emu/cpu/tms57002/tms57002.c when this isn't disabled
|
|
||||||
CCOMFLAGS += -fno-sanitize=shift
|
|
||||||
# clang takes forever to compile src/emu/cpu/tms57002/tms57002.c, src/emu/cpu/m6809/hd6309.c when this isn't disabled
|
|
||||||
CCOMFLAGS += -fno-sanitize=object-size
|
|
||||||
# clang takes forever to compile src/emu/cpu/tms57002/tms57002.c, src/emu/cpu/m6809/konami.c, src/emu/cpu/m6809/hd6309.c, src/emu/video/psx.c when this isn't disabled
|
|
||||||
CCOMFLAGS += -fno-sanitize=vptr
|
|
||||||
# clang takes forever to compile src/emu/video/psx.c when this isn't disabled
|
|
||||||
CCOMFLAGS += -fno-sanitize=null
|
|
||||||
# clang takes forever to compile src/emu/cpu/tms57002/tms57002.c when this isn't disabled
|
|
||||||
CCOMFLAGS += -fno-sanitize=signed-integer-overflow
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
include $(SRC)/build/cc_detection.mak
|
||||||
|
|
||||||
#-------------------------------------------------
|
#-------------------------------------------------
|
||||||
# include paths
|
# include paths
|
||||||
#-------------------------------------------------
|
#-------------------------------------------------
|
||||||
|
@ -9,6 +9,18 @@ CCOMFLAGS += -Wno-self-assign-field
|
|||||||
# caused by src/mame/video/jagblit.inc on older clang versions
|
# caused by src/mame/video/jagblit.inc on older clang versions
|
||||||
CCOMFLAGS += -Wno-constant-logical-operand
|
CCOMFLAGS += -Wno-constant-logical-operand
|
||||||
|
|
||||||
|
ifneq (,$(findstring undefined,$(SANITIZE)))
|
||||||
|
# TODO: check if linker is clang++
|
||||||
|
# produces a lot of messages - disable it for now
|
||||||
|
CCOMFLAGS += -fno-sanitize=alignment
|
||||||
|
# these are false positives because of the way our delegates work
|
||||||
|
CCOMFLAGS += -fno-sanitize=function
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifneq (,$(findstring memory,$(SANITIZE)))
|
||||||
|
CCOMFLAGS += -fsanitize-memory-track-origins -fPIE
|
||||||
|
endif
|
||||||
|
|
||||||
# TODO: needs to use $(CC)
|
# TODO: needs to use $(CC)
|
||||||
TEST_CLANG := $(shell clang --version)
|
TEST_CLANG := $(shell clang --version)
|
||||||
|
|
||||||
@ -29,6 +41,19 @@ CCOMFLAGS += -Wno-deprecated-register -Wno-reserved-user-defined-literal -Wno-c+
|
|||||||
CCOMFLAGS += -Wno-unknown-warning-option
|
CCOMFLAGS += -Wno-unknown-warning-option
|
||||||
# XCode 6.0.1 gives this when using SDL2 in /Library/Frameworks/SDL2.framework/Headers/SDL_syswm.h:150 included from src/osd/sdl/sdlinc.h
|
# XCode 6.0.1 gives this when using SDL2 in /Library/Frameworks/SDL2.framework/Headers/SDL_syswm.h:150 included from src/osd/sdl/sdlinc.h
|
||||||
CCOMFLAGS += -Wno-extern-c-compat
|
CCOMFLAGS += -Wno-extern-c-compat
|
||||||
|
|
||||||
|
ifneq (,$(findstring undefined,$(SANITIZE)))
|
||||||
|
# clang takes forever to compile src/emu/cpu/tms57002/tms57002.c when this isn't disabled
|
||||||
|
CCOMFLAGS += -fno-sanitize=shift
|
||||||
|
# clang takes forever to compile src/emu/cpu/tms57002/tms57002.c, src/emu/cpu/m6809/hd6309.c when this isn't disabled
|
||||||
|
CCOMFLAGS += -fno-sanitize=object-size
|
||||||
|
# clang takes forever to compile src/emu/cpu/tms57002/tms57002.c, src/emu/cpu/m6809/konami.c, src/emu/cpu/m6809/hd6309.c, src/emu/video/psx.c when this isn't disabled
|
||||||
|
CCOMFLAGS += -fno-sanitize=vptr
|
||||||
|
# clang takes forever to compile src/emu/video/psx.c when this isn't disabled
|
||||||
|
CCOMFLAGS += -fno-sanitize=null
|
||||||
|
# clang takes forever to compile src/emu/cpu/tms57002/tms57002.c when this isn't disabled
|
||||||
|
CCOMFLAGS += -fno-sanitize=signed-integer-overflow
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(TARGETOS),emscripten)
|
ifeq ($(TARGETOS),emscripten)
|
||||||
|
Loading…
Reference in New Issue
Block a user