summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2020-05-16 21:46:41 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2020-10-12 16:20:56 +0900
commit509f2bfd938f2f1e69c2f27821f5b0ab8295b05b (patch)
tree240723eec637788320fe80dc864ebde7de025551
parentb941e918664af9390d4a61d6645dd2d1b9336c9d (diff)
downloadmruby-509f2bfd938f2f1e69c2f27821f5b0ab8295b05b.tar.gz
mruby-509f2bfd938f2f1e69c2f27821f5b0ab8295b05b.zip
Add a new target `clang-asan` to use LLVM's address sanitizer.
-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