summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--board/cr50/dcrypto/dcrypto.h8
-rw-r--r--include/common.h17
2 files changed, 17 insertions, 8 deletions
diff --git a/board/cr50/dcrypto/dcrypto.h b/board/cr50/dcrypto/dcrypto.h
index 561a1df7a9..3712f56fc4 100644
--- a/board/cr50/dcrypto/dcrypto.h
+++ b/board/cr50/dcrypto/dcrypto.h
@@ -46,14 +46,6 @@ enum hashing_mode {
HASH_NULL = 0x0010 /* = TPM_ALG_NULL, Only supported for PKCS#1 */
};
-#ifndef __warn_unused_result
-#define __warn_unused_result __attribute__((warn_unused_result))
-#endif
-
-#ifndef __always_inline
-#define __always_inline __inline __attribute__((always_inline))
-#endif
-
/**
* SHA1/SHA2, HMAC API
*/
diff --git a/include/common.h b/include/common.h
index 485cbcbe5c..2bbc24d684 100644
--- a/include/common.h
+++ b/include/common.h
@@ -130,6 +130,23 @@
#endif
#endif
+#ifndef __warn_unused_result
+#define __warn_unused_result __attribute__((warn_unused_result))
+#endif
+
+#ifdef TEST_CR50_FUZZ
+/**
+ * Workaround: Clang incorrectly handles profiling information
+ * used for fuzzing with __attribute__((always_inline)).
+ */
+#undef __always_inline
+#define __always_inline static inline
+#else
+#ifndef __always_inline
+#define __always_inline __inline __attribute__((always_inline))
+#endif
+#endif
+
/*
* Macros for combining bytes into larger integers. _LE and _BE signify little
* and big endian versions respectively.