Adding Address Sanitizer build
This commit is contained in:
9
Makefile
9
Makefile
@@ -104,7 +104,7 @@ default: ispc
|
|||||||
|
|
||||||
depend: llvm_check $(CXX_SRC) $(HEADERS)
|
depend: llvm_check $(CXX_SRC) $(HEADERS)
|
||||||
@echo Updating dependencies
|
@echo Updating dependencies
|
||||||
@gcc -MM $(CXXFLAGS) $(CXX_SRC) | sed 's_^\([a-z]\)_objs/\1_g' > depend
|
@$(CXX) -MM $(CXXFLAGS) $(CXX_SRC) | sed 's_^\([a-z]\)_objs/\1_g' > depend
|
||||||
|
|
||||||
-include depend
|
-include depend
|
||||||
|
|
||||||
@@ -134,6 +134,13 @@ ispc: print_llvm_src dirs $(OBJS)
|
|||||||
@echo Creating ispc executable
|
@echo Creating ispc executable
|
||||||
@$(CXX) $(OPT) $(LDFLAGS) -o $@ $(OBJS) $(ISPC_LIBS)
|
@$(CXX) $(OPT) $(LDFLAGS) -o $@ $(OBJS) $(ISPC_LIBS)
|
||||||
|
|
||||||
|
# Build ispc with address sanitizer instrumentation using clang compiler
|
||||||
|
# Note that this is not portable build
|
||||||
|
asan: ispc
|
||||||
|
asan: CXX=clang++
|
||||||
|
asan: OPT+=-fsanitize=address
|
||||||
|
|
||||||
|
|
||||||
objs/%.o: %.cpp
|
objs/%.o: %.cpp
|
||||||
@echo Compiling $<
|
@echo Compiling $<
|
||||||
@$(CXX) $(CXXFLAGS) -o $@ -c $<
|
@$(CXX) $(CXXFLAGS) -o $@ -c $<
|
||||||
|
|||||||
Reference in New Issue
Block a user