Add a new target clang-asan to use LLVM's address sanitizer.

This commit is contained in:
Yukihiro "Matz" Matsumoto
2020-05-16 21:46:41 +09:00
parent b941e91866
commit 509f2bfd93
+21
View File
@@ -0,0 +1,21 @@
MRuby::Build.new do |conf|
toolchain :clang
# include the GEM box
conf.gembox 'default'
# C compiler settings
conf.cc do |cc|
cc.flags << "-fsanitize=address,undefined"
cc.include_paths = ["#{root}/include"]
end
# Linker settings
conf.linker do |linker|
linker.flags << "-fsanitize=address,undefined"
end
# Turn on `enable_debug` for better debugging
enable_debug
conf.enable_bintest
conf.enable_test
end