X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvppinfra%2Fsanitizer.h;h=db4daea978d8929cdd7615cc2612cd5818a636e9;hb=418bf6aaef6048d15bc1f575a166e8f5e52696be;hp=d099d3a941f6632b115c492ee5cc32e34354f30a;hpb=9fb6d40eb3d4a2da8f45187de773498b784596e6;p=vpp.git diff --git a/src/vppinfra/sanitizer.h b/src/vppinfra/sanitizer.h index d099d3a941f..db4daea978d 100644 --- a/src/vppinfra/sanitizer.h +++ b/src/vppinfra/sanitizer.h @@ -51,6 +51,18 @@ CLIB_MEM_POISON_LEN (void *src, size_t oldlen, size_t newlen) #endif /* CLIB_SANITIZE_ADDR */ +/* + * clang tends to force alignment of all sections when compiling for address + * sanitizer. This confuse VPP plugin infra, prevent clang to do that + * On the contrary, GCC does not support this kind of attribute on sections + * sigh. + */ +#ifdef __clang__ +#define CLIB_NOSANITIZE_PLUGIN_REG_SECTION CLIB_NOSANITIZE_ADDR +#else +#define CLIB_NOSANITIZE_PLUGIN_REG_SECTION +#endif + #endif /* _included_clib_sanitizer_h */ /*