summaryrefslogtreecommitdiffhomepage
path: root/target/clang-asan.rb
diff options
context:
space:
mode:
Diffstat (limited to 'target/clang-asan.rb')
-rw-r--r--target/clang-asan.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/target/clang-asan.rb b/target/clang-asan.rb
new file mode 100644
index 000000000..e693332c2
--- /dev/null
+++ b/target/clang-asan.rb
@@ -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