Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GoStdlib is not compatible with c++ asan #1306

Closed
ivyxyz opened this issue Feb 7, 2018 · 1 comment
Closed

GoStdlib is not compatible with c++ asan #1306

ivyxyz opened this issue Feb 7, 2018 · 1 comment
Labels

Comments

@ivyxyz
Copy link

ivyxyz commented Feb 7, 2018

When tools/bazel.rc has build:asan --strip=never --copt -fsanitize=address --linkopt -fsanitize=address, bazel build --config=asan //... fails to build go targets, although individual c++ targets can be built successfully. This error did not happen when go stdlib was not built before. Can copt only affect cc targets?

https://groups.google.com/d/msg/bazel-discuss/zYqML_mqyOA/4ysD4_x-ZSwJ

GoStdlib external/io_bazel_rules_go/linux_amd64_stripped/stdlib~/pkg failed (Exit 1)
# runtime/cgo
cgo-generated-wrappers:1: error: undefined reference to '__asan_init_v4'
_cgo_export.c:9: error: undefined reference to '__asan_init_v4'
cgo-gcc-prolog:23: error: undefined reference to '__asan_init_v4'
gcc_context.c:11: error: undefined reference to '__asan_option_detect_stack_use_after_return'
gcc_context.c:11: error: undefined reference to '__asan_stack_malloc_1'
gcc_context.c:21: error: undefined reference to '__asan_init_v4'
gcc_fatalf.c:14: error: undefined reference to '__asan_option_detect_stack_use_after_return'
gcc_fatalf.c:22: error: undefined reference to '__asan_handle_no_return'
gcc_fatalf.c:14: error: undefined reference to '__asan_stack_malloc_1'
gcc_fatalf.c:21: error: undefined reference to '__asan_report_load8'
gcc_fatalf.c:19: error: undefined reference to '__asan_report_load8'
gcc_fatalf.c:17: error: undefined reference to '__asan_report_load8'
gcc_fatalf.c:23: error: undefined reference to '__asan_unregister_globals'
gcc_fatalf.c:23: error: undefined reference to '__asan_register_globals'
gcc_libinit.c:35: error: undefined reference to '__asan_option_detect_stack_use_after_return'
gcc_libinit.c:35: error: undefined reference to '__asan_stack_malloc_1'
gcc_libinit.c:94: error: undefined reference to '__asan_option_detect_stack_use_after_return'
gcc_libinit.c:94: error: undefined reference to '__asan_stack_malloc_1'
gcc_libinit.c:30: error: undefined reference to '__asan_handle_no_return'
gcc_libinit.c:29: error: undefined reference to '__asan_report_load8'
gcc_libinit.c:109: error: undefined reference to '__asan_unregister_globals'
gcc_libinit.c:109: error: undefined reference to '__asan_register_globals'
gcc_linux_amd64.c:44: error: undefined reference to '__asan_report_load4'
gcc_linux_amd64.c:48: error: undefined reference to '__asan_report_store8'
gcc_linux_amd64.c:60: error: undefined reference to '__asan_stack_malloc_4'
gcc_linux_amd64.c:73: error: undefined reference to '__asan_report_store8'
gcc_linux_amd64.c:104: error: undefined reference to '__asan_unregister_globals'
gcc_linux_amd64.c:104: error: undefined reference to '__asan_register_globals'
gcc_mmap.c:23: error: undefined reference to '__asan_report_load4'
gcc_mmap.c:37: error: undefined reference to '__asan_handle_no_return'
gcc_sigaction.c:69: error: undefined reference to '__asan_report_store8'
gcc_sigaction.c:62: error: undefined reference to '__asan_report_load4'
gcc_sigaction.c:32: error: undefined reference to '__asan_stack_malloc_3'
gcc_sigaction.c:67: error: undefined reference to '__asan_report_store8'
gcc_util.c:19: error: undefined reference to '__asan_handle_no_return'
gcc_util.c:21: error: undefined reference to '__asan_report_load_n'
gcc_util.c:21: error: undefined reference to '__asan_report_store_n'
gcc_util.c:27: error: undefined reference to '__asan_unregister_globals'
gcc_util.c:27: error: undefined reference to '__asan_register_globals'
collect2: error: ld returned 1 exit status
@jayconrod
Copy link
Contributor

(re-triaging old issues)

Closing as obsolete. I couldn't reproduce this anymore. Bazel's C/C++ toolchain handling and rules_go's integration with it have been rewritten since this issue was filed, so it seems that this has been fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants