I am going to take a hit here because I am using tools I don't fully understand and haven't taken the time to do so. I just want to remove unnecessary steps / dependencies from my work quickly at this point.
I was using AddressSanitizer to find the cause of segfaults and other issues in my C code during development. I did this by adding -fsanitize=address
to my list of CFLAGS
in a Makefile.
Now, having fixed all such issues, if I remove this flag from my compilation, I can no longer compile my code, and get many errors much like those described in this question...
How to use AddressSanitizer with GCC?
~/xxx/util.c:20: undefined reference to
__asan_option_detect_stack_use_after_return' /usr/bin/ld: ~/xxx/util.c:20: undefined reference to
__asan_stack_malloc_2' usr/bin/ld: /xxx/util.c:23: undefined reference to__asan_report_store8' /usr/bin/ld: /xxx/util.c:40: undefined reference to
__asan_report_load8' /usr/bin/ld: /xxx/util.c:45: undefined reference to `__asan_report_load8' /usr/bin/ld: And so on.
The difference is I just want to compile my code normally. In that question, they suggest adding a flag -lasan
to link/compile step. That doesn't seem like it will help me to stop using -fsanitize
, though I could be wrong. Obviously something is wrong in the linking step here. It feels like I have included a dependency that I forgot about somewhere, but I don't recall doing that.
What am I missing? Probably something obvious. Also, let me know if I need to give more info about my compilation step.