clang: work around asm input constraint problems
[linux-block.git] / include / linux / compiler_types.h
index 8f8236317d5b15b97d059f3684e16d9ddb247317..f82bdac63961cc16eb71e8be354028c34c9b18d7 100644 (file)
@@ -391,6 +391,15 @@ struct ftrace_likely_data {
 #define asm_goto_output(x...) asm volatile goto(x)
 #endif
 
+/*
+ * Clang has trouble with constraints with multiple
+ * alternative behaviors (mainly "g" and "rm").
+ */
+#ifndef ASM_INPUT_G
+  #define ASM_INPUT_G "g"
+  #define ASM_INPUT_RM "rm"
+#endif
+
 #ifdef CONFIG_CC_HAS_ASM_INLINE
 #define asm_inline asm __inline
 #else