Merge "Fix Mac OS build breakage." into ics-mr1-plus-art
diff --git a/src/oat/runtime/x86/runtime_support_x86.S b/src/oat/runtime/x86/runtime_support_x86.S
index 943b55c..ccf8403 100644
--- a/src/oat/runtime/x86/runtime_support_x86.S
+++ b/src/oat/runtime/x86/runtime_support_x86.S
@@ -26,7 +26,8 @@
     // 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 VAR(name,index) _$index
+    #define SYMBOL(name) _ # name
+    #define VAR(name,index) SYMBOL($index)
     #define LITERAL(value) $$value
 #else
     // Regular gas(1) lets you name macro parameters.
@@ -40,6 +41,7 @@
     // will screw us by inserting a space between the \ and the name. Even in this mode there's
     // no special meaning to $, so literals are still just $x.
     .altmacro
+    #define SYMBOL(name) name
     #define VAR(name,index) name&
     #define LITERAL(value) $value
 #endif
@@ -110,7 +112,7 @@
     subl  LITERAL(8), %esp                   // Alignment padding
     pushl %ecx                               // pass SP
     pushl %fs:THREAD_SELF_OFFSET             // pass Thread::Current()
-    call artDeliverPendingExceptionFromCode  // artDeliverExceptionFromCode(Thread*, SP)
+    call SYMBOL(artDeliverPendingExceptionFromCode)  // artDeliverExceptionFromCode(Thread*, SP)
     int3
 END_MACRO
 
@@ -322,7 +324,7 @@
     pushl %edx                    // pass SP
     pushl %fs:THREAD_SELF_OFFSET  // pass Thread::Current()
     pushl %eax                    // pass arg1
-    call artLockObjectFromCode    // (Object*, Thread*, SP)
+    call SYMBOL(artLockObjectFromCode)    // (Object*, Thread*, SP)
     addl LITERAL(16), %esp        // pop arguments
     RESTORE_REF_ONLY_CALLEE_SAVE_FRAME  // restore frame up to return address
     ret
@@ -337,7 +339,7 @@
     pushl %edx                    // pass SP
     pushl %fs:THREAD_SELF_OFFSET  // pass Thread::Current()
     pushl %eax                    // pass arg1
-    call artUnlockObjectFromCode  // (Object*, Thread*, SP)
+    call SYMBOL(artUnlockObjectFromCode)  // (Object*, Thread*, SP)
     addl LITERAL(16), %esp        // pop arguments
     RESTORE_REF_ONLY_CALLEE_SAVE_FRAME  // restore frame up to return address
     testl %eax, %eax               // eax == 0 ?
@@ -356,7 +358,7 @@
     pushl %fs:THREAD_SELF_OFFSET  // pass Thread::Current()
     pushl %ecx                    // pass arg2
     pushl %eax                    // pass arg1
-    call artHandleFillArrayDataFromCode  // (Array* array, const uint16_t* table, Thread*, SP)
+    call SYMBOL(artHandleFillArrayDataFromCode)  // (Array* array, const uint16_t* table, Thread*, SP)
     addl LITERAL(16), %esp        // pop arguments
     RESTORE_REF_ONLY_CALLEE_SAVE_FRAME  // restore frame up to return address
     testl %eax, %eax               // eax == 0 ?
@@ -371,7 +373,7 @@
     pushl %eax                    // alignment padding
     pushl %ecx                    // pass arg2
     pushl %eax                    // pass arg1
-    call artIsAssignableFromCode  // (Class* a, Class* b, Thread*, SP)
+    call SYMBOL(artIsAssignableFromCode)  // (Class* a, Class* b, Thread*, SP)
     addl LITERAL(12), %esp        // pop arguments
     ret
 
@@ -381,7 +383,7 @@
     pushl %edx                    // pass arg3
     pushl %ecx                    // pass arg2
     pushl %eax                    // pass arg1
-    call memcpy                   // (void*, const void*, size_t)
+    call SYMBOL(memcpy)           // (void*, const void*, size_t)
     addl LITERAL(12), %esp        // pop arguments
     ret
 
@@ -395,7 +397,7 @@
     pushl %fs:THREAD_SELF_OFFSET  // pass Thread::Current()
     pushl %ecx                    // pass arg2
     pushl %eax                    // pass arg1
-    call artCheckCastFromCode     // (Class* a, Class* b, Thread*, SP)
+    call SYMBOL(artCheckCastFromCode)     // (Class* a, Class* b, Thread*, SP)
     addl LITERAL(16), %esp        // pop arguments
     RESTORE_REF_ONLY_CALLEE_SAVE_FRAME  // restore frame up to return address
     testl %eax, %eax               // eax == 0 ?
@@ -431,7 +433,7 @@
     pushl %fs:THREAD_SELF_OFFSET  // pass Thread::Current()
     pushl %ecx                    // pass arg2
     pushl %eax                    // pass arg1
-    call artCanPutArrayElementFromCode  // (Object* element, Class* array_class, Thread*, SP)
+    call SYMBOL(artCanPutArrayElementFromCode)  // (Object* element, Class* array_class, Thread*, SP)
     addl LITERAL(16), %esp        // pop arguments
     RESTORE_REF_ONLY_CALLEE_SAVE_FRAME  // restore frame up to return address
     testl %eax, %eax               // eax == 0 ?