From 5e8b114e58570ca13f29a119a0302fab26b28055 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Tue, 21 Jul 2015 13:48:48 -0400 Subject: [PATCH] Added macro to abstract differences in sytax string parsing between GAS and Clang integrated assembler. Also see LLVM Bug 18916 (https://llvm.org/bugs/show_bug.cgi?id=18916) --- cpu.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cpu.h b/cpu.h index 3b258d8c..115ed31c 100644 --- a/cpu.h +++ b/cpu.h @@ -228,6 +228,18 @@ inline int GetCacheLineSize() #define AS_HEX(y) 0x##y #endif +// https://llvm.org/bugs/show_bug.cgi?id=18916 +#if defined(__clang__) +# define GNU_ATT_SYNTAX ".att_syntax;" +# define GNU_INTEL_SYNTAX ".intel_syntax;" +#elif defined(__GNUC__) +# define GNU_ATT_SYNTAX ".att_syntax prefix;" +# define GNU_INTEL_SYNTAX ".intel_syntax noprefix;" +#else +# define GNU_ATT_SYNTAX ".att_syntax prefix;" +# define GNU_INTEL_SYNTAX ".intel_syntax noprefix;" +#endif + #define IF0(y) #define IF1(y) y