From f659f0c214dfc44ea5a7deb6b4875befa66b6fca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Tue, 4 Aug 2015 22:19:05 +0200 Subject: [PATCH] Disable Padlock code with ASan We're getting build errors with Clang 3.5.0 on our Debian Jessie buildslave: library/padlock.c:99:10: error: inline assembly requires more registers than available --- include/mbedtls/padlock.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/include/mbedtls/padlock.h b/include/mbedtls/padlock.h index 3f96d1388..0cc52bde9 100644 --- a/include/mbedtls/padlock.h +++ b/include/mbedtls/padlock.h @@ -29,7 +29,15 @@ #define MBEDTLS_ERR_PADLOCK_DATA_MISALIGNED -0x0030 /**< Input data should be aligned. */ -#if defined(MBEDTLS_HAVE_ASM) && defined(__GNUC__) && defined(__i386__) +#if defined(__has_feature) +#if __has_feature(address_sanitizer) +#define MBEDTLS_HAVE_ASAN +#endif +#endif + +/* Some versions of ASan result in errors about not enough registers */ +#if defined(MBEDTLS_HAVE_ASM) && defined(__GNUC__) && defined(__i386__) && \ + defined(MBEDTLS_HAVE_ASAN) #ifndef MBEDTLS_HAVE_X86 #define MBEDTLS_HAVE_X86