MINOR: version: report the presence of the compiler's address sanitizer

Since we've seen clang emit bad code when the address sanitizer is enabled
at -O2, better clearly report it in the version output. It is detected both
for clang and gcc (both tested with and without).
This commit is contained in:
Willy Tarreau 2020-06-16 19:14:19 +02:00
parent 6d4c81db96
commit 7bf484ac91

View File

@ -14,8 +14,14 @@ char haproxy_version[] = HAPROXY_VERSION;
char haproxy_date[] = HAPROXY_DATE; char haproxy_date[] = HAPROXY_DATE;
char stats_version_string[] = STATS_VERSION_STRING; char stats_version_string[] = STATS_VERSION_STRING;
#if defined(__clang_version__) #if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__)
REGISTER_BUILD_OPTS("Built with clang compiler version " __clang_version__); #define SANITIZE_STRING " with address sanitizer"
#elif defined(__VERSION__) #else
REGISTER_BUILD_OPTS("Built with gcc compiler version " __VERSION__); #define SANITIZE_STRING ""
#endif
#if defined(__clang_version__)
REGISTER_BUILD_OPTS("Built with clang compiler version " __clang_version__ "" SANITIZE_STRING);
#elif defined(__VERSION__)
REGISTER_BUILD_OPTS("Built with gcc compiler version " __VERSION__ "" SANITIZE_STRING);
#endif #endif