blade-build
blade-build copied to clipboard
请问如何在blade中应用AddressSanitizer
如题
修改 BLADE_ROOT 如下
cc_config(
cppflags = [
# Other flags...
'-fsanitize=address',
],
# Other configurations...
linkflags = [
# Other flags...
'-fsanitize=address -static-libasan',
]
)
此外,需要注意的是,使用 AddressSanitizer 时,不能链接其他的内存管理库,例如 tcmalloc/jemalloc
考虑支持命令行启用
blade启动前,先执行下面命令,不知是否可行 export CPP="cpp -fsanitize=address" export CXX="c++ -fsanitize=address" export CC="gcc -fsanitize=address" export LD="c++ -fsanitize=address"
修改 BLADE_ROOT 如下
cc_config( cppflags = [ # Other flags... '-fsanitize=address', ], # Other configurations... linkflags = [ # Other flags... '-fsanitize=address -static-libasan', ] )
此外,需要注意的是,使用 AddressSanitizer 时,不能链接其他的内存管理库,例如 tcmalloc/jemalloc
请问这个'-fsanitize=address -static-libasan', 对gcc的版本有要求吗? Linking Shared Library build64_release/app/brand/common/libdatetime.so g++: error: unrecognized command line option '-fsanitize=address -static-libasan'
分开写呢?分别用引号包括,逗号分割
On Tue, Jun 30, 2020, 17:28 paleyl [email protected] wrote:
修改 BLADE_ROOT 如下
cc_config(
cppflags = [ # Other flags... '-fsanitize=address', ], # Other configurations... linkflags = [ # Other flags... '-fsanitize=address -static-libasan', ]
)
此外,需要注意的是,使用 AddressSanitizer 时,不能链接其他的内存管理库,例如 tcmalloc/jemalloc
请问这个'-fsanitize=address -static-libasan', 对gcc的版本有要求吗? Linking Shared Library build64_release/app/brand/common/libdatetime.so g++: error: unrecognized command line option '-fsanitize=address -static-libasan'
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/chen3feng/blade-build/issues/578#issuecomment-651676929, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAPH4SVMKBJ2T6OXZSADRNTRZGV3JANCNFSM4J7CRMNQ .