79456185

Date: 2025-02-21 01:37:55
Score: 1.5
Natty:
Report link

From ASan's wiki:

Q: I'm getting following error when building my code: gcc: error: cannot specify -static with -fsanitize=address.

A: ASan doesn't work with static linkage. You need to disable static linkage in order to use ASan on your code.

There's a bit of an inconsistency in GCC documentation for -static-libasan though:

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. The -static-libasan option directs the GCC driver to link libasan statically, without necessarily linking other libraries statically.

Reasons:
  • Blacklisted phrase (1): this link
  • RegEx Blacklisted phrase (1): I'm getting following error
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: McSinyx