mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Make clang asan work with FORTIFIED_SOURCE again.
Short version: clang asan hates the glibc strcmp macro in bits/string2.h if you are passing it a constant string argument of length two or less. (I could be off by one here, but that's the basic idea.) Closes issue 14821.
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
o Major bugfixes (compilation):
|
||||
- Correctly repair hardened builds under the clang compiler. Previously,
|
||||
our use of _FORTIFY_SOURCE would conflict with clang's address
|
||||
sanitizer. Closes ticket 14821.
|
||||
@@ -42,6 +42,15 @@
|
||||
#include <netinet6/in6.h>
|
||||
#endif
|
||||
|
||||
#if defined(__has_feature)
|
||||
# if __has_feature(address_sanitizer)
|
||||
/* Some of the fancy glibc strcmp() macros include references to memory that
|
||||
* clang rejects because it is off the end of a less-than-3. Clang hates this,
|
||||
* even though those references never actually happen. */
|
||||
# undef strcmp
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user