diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-05-16 21:46:41 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-10-12 16:20:56 +0900 |
| commit | 509f2bfd938f2f1e69c2f27821f5b0ab8295b05b (patch) | |
| tree | 240723eec637788320fe80dc864ebde7de025551 | |
| parent | b941e918664af9390d4a61d6645dd2d1b9336c9d (diff) | |
| download | mruby-509f2bfd938f2f1e69c2f27821f5b0ab8295b05b.tar.gz mruby-509f2bfd938f2f1e69c2f27821f5b0ab8295b05b.zip | |
Add a new target `clang-asan` to use LLVM's address sanitizer.
| -rw-r--r-- | target/clang-asan.rb | 21 |
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 |
