Skip to content

Commit

Permalink
llvm: add NDEBUG when assertion mode is off
Browse files Browse the repository at this point in the history
`llvm-config --cxxflags` unfortunately does not set `-DNDEBUG`, which
Julia needs to set correctly when including LLVM header files.
  • Loading branch information
haampie committed May 24, 2022
1 parent fc52b3f commit c9c2082
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ PUBLIC_HEADER_TARGETS := $(addprefix $(build_includedir)/julia/,$(notdir $(PUBLI
LLVM_LDFLAGS := $(shell $(LLVM_CONFIG_HOST) --ldflags)
LLVM_CXXFLAGS := $(shell $(LLVM_CONFIG_HOST) --cxxflags)

# llvm-config --cxxflags does not return -DNDEBUG
ifeq ($(shell $(LLVM_CONFIG_HOST) --assertion-mode),OFF)
LLVM_CXXFLAGS += -DNDEBUG
endif

ifeq ($(JULIACODEGEN),LLVM)
ifneq ($(USE_SYSTEM_LLVM),0)
CG_LLVMLINK += $(LLVM_LDFLAGS) $(shell $(LLVM_CONFIG_HOST) --libs --system-libs)
Expand Down

0 comments on commit c9c2082

Please sign in to comment.