libasn may have many paths, pick the last

also exclude 32 bit lib
This commit is contained in:
Sam Saffron 2019-05-27 15:52:03 +10:00
parent aaff4fc494
commit 38cd347048
1 changed files with 2 additions and 1 deletions

View File

@ -21,7 +21,8 @@ namespace :test do
ENV["CONFIGURE_ARGS"] = [ENV["CONFIGURE_ARGS"], '--enable-asan'].compact.join(' ')
Rake::Task['compile'].invoke
asan_path = `ldconfig -N -p | grep libasan | sed 's/.* => \\(.*\\)$/\\1/'`.chomp
asan_path = `ldconfig -N -p |grep libasan | grep -v 32 | sed 's/.* => \\(.*\\)$/\\1/'`.chomp.split("\n")[-1]
cmdline = "env LD_PRELOAD=\"#{asan_path}\" ruby test/test_leak.rb"
puts cmdline