When the -fsanitize=address option is used to link a program, the GCC driver automatically links against libasan . If libasan is available as a shared library, and the -static option is not used, then this links against the shared version of libasan .