summaryrefslogtreecommitdiffstats
path: root/runtime/arch/x86/asm_support_x86.S
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2014-02-28 16:20:21 -0800
committerIan Rogers <irogers@google.com>2014-02-28 19:03:57 -0800
commitb48b9eb6d181a1f52e2e605cf26a21505f1d46ed (patch)
tree117d99c16f201b2f14adfe0922e56b9ff433c133 /runtime/arch/x86/asm_support_x86.S
parent3c506f9877b4a106d93169b6bb5610b24a84d61c (diff)
downloadart-b48b9eb6d181a1f52e2e605cf26a21505f1d46ed.zip
art-b48b9eb6d181a1f52e2e605cf26a21505f1d46ed.tar.gz
art-b48b9eb6d181a1f52e2e605cf26a21505f1d46ed.tar.bz2
Fix clang to compile and run host tests.
Don't use the computed goto interpreter with clang 3.4 as it causes compilation to hang. Avoid inclusion of LLVM_(HOST|DEVICE)_BUILD_MK except for with portable as it sets clang incompatible cflags. Most fixes are self-evident, for the quick dex file method inliner the enums were being used with ostreams, so fix the enums and operator out python script to allow this. Note this change effects portable but this is untestable as portable was broken by ELF file and mc linker changes. Change-Id: Ia54348f6b1bd3f76d3b71c6e8c5f97626386b903
Diffstat (limited to 'runtime/arch/x86/asm_support_x86.S')
-rw-r--r--runtime/arch/x86/asm_support_x86.S64
1 files changed, 35 insertions, 29 deletions
diff --git a/runtime/arch/x86/asm_support_x86.S b/runtime/arch/x86/asm_support_x86.S
index 9ec1995..267717a 100644
--- a/runtime/arch/x86/asm_support_x86.S
+++ b/runtime/arch/x86/asm_support_x86.S
@@ -19,38 +19,25 @@
#include "asm_support_x86.h"
-#if defined(__APPLE__)
- // Mac OS' as(1) doesn't let you name macro parameters.
+#if defined(__clang__)
+ // Clang's as(1) doesn't let you name macro parameters.
#define MACRO0(macro_name) .macro macro_name
#define MACRO1(macro_name, macro_arg1) .macro macro_name
#define MACRO2(macro_name, macro_arg1, macro_args2) .macro macro_name
#define MACRO3(macro_name, macro_arg1, macro_args2, macro_args3) .macro macro_name
#define END_MACRO .endmacro
- // Mac OS' as(1) uses $0, $1, and so on for macro arguments, and function names
- // are mangled with an extra underscore prefix. The use of $x for arguments
- // mean that literals need to be represented with $$x in macros.
- #define SYMBOL(name) _ ## name
- #define PLT_SYMBOL(name) _ ## name
+ // Clang's as(1) uses $0, $1, and so on for macro arguments.
#define VAR(name,index) SYMBOL($index)
#define PLT_VAR(name, index) SYMBOL($index)
#define REG_VAR(name,index) %$index
#define CALL_MACRO(name,index) $index
+ #define FUNCTION_TYPE(name,index) .type $index, @function
+ #define SIZE(name,index) .size $index, .-$index
+
+ // The use of $x for arguments mean that literals need to be represented with $$x in macros.
#define LITERAL(value) $value
#define MACRO_LITERAL(value) $$value
-
- // Mac OS' doesn't like cfi_* directives
- #define CFI_STARTPROC
- #define CFI_ENDPROC
- #define CFI_ADJUST_CFA_OFFSET(size)
- #define CFI_DEF_CFA(reg,size)
- #define CFI_DEF_CFA_REGISTER(reg)
- #define CFI_RESTORE(reg)
- #define CFI_REL_OFFSET(reg,size)
-
- // Mac OS' doesn't support certain directives
- #define FUNCTION_TYPE(name)
- #define SIZE(name)
#else
// Regular gas(1) lets you name macro parameters.
#define MACRO0(macro_name) .macro macro_name
@@ -65,16 +52,19 @@
// no special meaning to $, so literals are still just $x. The use of altmacro means % is a
// special character meaning care needs to be taken when passing registers as macro arguments.
.altmacro
- #define SYMBOL(name) name
- #define PLT_SYMBOL(name) name@PLT
#define VAR(name,index) name&
#define PLT_VAR(name, index) name&@PLT
#define REG_VAR(name,index) %name
#define CALL_MACRO(name,index) name&
+ #define FUNCTION_TYPE(name,index) .type name&, @function
+ #define SIZE(name,index) .size name, .-name
+
#define LITERAL(value) $value
#define MACRO_LITERAL(value) $value
+#endif
- // CFI support
+ // CFI support.
+#if !defined(__APPLE__)
#define CFI_STARTPROC .cfi_startproc
#define CFI_ENDPROC .cfi_endproc
#define CFI_ADJUST_CFA_OFFSET(size) .cfi_adjust_cfa_offset size
@@ -82,9 +72,25 @@
#define CFI_DEF_CFA_REGISTER(reg) .cfi_def_cfa_register reg
#define CFI_RESTORE(reg) .cfi_restore reg
#define CFI_REL_OFFSET(reg,size) .cfi_rel_offset reg,size
+#else
+ // Mac OS' doesn't like cfi_* directives.
+ #define CFI_STARTPROC
+ #define CFI_ENDPROC
+ #define CFI_ADJUST_CFA_OFFSET(size)
+ #define CFI_DEF_CFA(reg,size)
+ #define CFI_DEF_CFA_REGISTER(reg)
+ #define CFI_RESTORE(reg)
+ #define CFI_REL_OFFSET(reg,size)
+#endif
- #define FUNCTION_TYPE(name) .type name&, @function
- #define SIZE(name) .size name, .-name
+ // Symbols.
+#if !defined(__APPLE__)
+ #define SYMBOL(name) name
+ #define PLT_SYMBOL(name) name
+#else
+ // Mac OS' symbols have an _ prefix.
+ #define SYMBOL(name) _ ## name
+ #define PLT_SYMBOL(name) _ ## name
#endif
/* Cache alignment for function entry */
@@ -93,7 +99,7 @@ MACRO0(ALIGN_FUNCTION_ENTRY)
END_MACRO
MACRO1(DEFINE_FUNCTION, c_name)
- FUNCTION_TYPE(\c_name)
+ FUNCTION_TYPE(\c_name, 0)
.globl VAR(c_name, 0)
ALIGN_FUNCTION_ENTRY
VAR(c_name, 0):
@@ -102,7 +108,7 @@ END_MACRO
MACRO1(END_FUNCTION, c_name)
CFI_ENDPROC
- SIZE(\c_name)
+ SIZE(\c_name, 0)
END_MACRO
MACRO1(PUSH, reg)
@@ -118,7 +124,7 @@ MACRO1(POP, reg)
END_MACRO
MACRO1(UNIMPLEMENTED,name)
- FUNCTION_TYPE(\name)
+ FUNCTION_TYPE(\name, 0)
.globl VAR(name, 0)
ALIGN_FUNCTION_ENTRY
VAR(name, 0):
@@ -126,7 +132,7 @@ VAR(name, 0):
int3
int3
CFI_ENDPROC
- SIZE(\name)
+ SIZE(\name, 0)
END_MACRO
MACRO0(SETUP_GOT_NOSAVE)