未定义对“__ubsan_handle_out_of_bounds_abort”的引用

undefined reference to `__ubsan_handle_out_of_bounds_abort'

提问人:gabbar 提问时间:12/21/2021 最后编辑:yugrgabbar 更新时间:12/21/2021 访问量:584

问:

在使用 clang-4.0 的编译器标志编译代码时,尽管代码没有越界访问,但我似乎收到了此链接错误。 编译器何时抛出此错误 - 未定义对 .-fsanitize=bounds__ubsan_handle_out_of_bounds_abort

链接 clang llvm 链接器错误

评论


答:

0赞 yugr 12/21/2021 #1

很可能你忘了添加到你的链接器标志。-fsanitize=bounds

评论

0赞 gabbar 12/21/2021
它添加到链接器标志中,但仍:(
0赞 yugr 12/22/2021
@gabbar如果你在 ?-fsanitize=undefinedLDFLAGS