aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/hipe/hipe_amd64_asm.m4
diff options
context:
space:
mode:
authorGeoff Cant <[email protected]>2010-01-12 22:25:51 +1300
committerBjörn Gustavsson <[email protected]>2010-02-06 09:50:36 +0100
commitd17dd27c7d9b98f2cfd243fadd58a477c3edd7f1 (patch)
tree3d3d85504cdfaf7e0f4450c897b88ae75fefcf0c /erts/emulator/hipe/hipe_amd64_asm.m4
parent022fa2dd03a1e632c401e7c08aab8a184717847b (diff)
downloadotp-d17dd27c7d9b98f2cfd243fadd58a477c3edd7f1.tar.gz
otp-d17dd27c7d9b98f2cfd243fadd58a477c3edd7f1.tar.bz2
otp-d17dd27c7d9b98f2cfd243fadd58a477c3edd7f1.zip
Porting x86 darwin fixes to amd64 darwin hipe asm/m4 code
Compared to GNU as, Mac OS X's assembler uses different directives for text and global sections, and omits type and size directives entirely. We also need to mangle symbol names in order to allow linking with C object files.
Diffstat (limited to 'erts/emulator/hipe/hipe_amd64_asm.m4')
-rw-r--r--erts/emulator/hipe/hipe_amd64_asm.m423
1 files changed, 23 insertions, 0 deletions
diff --git a/erts/emulator/hipe/hipe_amd64_asm.m4 b/erts/emulator/hipe/hipe_amd64_asm.m4
index 9ce9b4fc5b..8e3faaa569 100644
--- a/erts/emulator/hipe/hipe_amd64_asm.m4
+++ b/erts/emulator/hipe/hipe_amd64_asm.m4
@@ -37,6 +37,29 @@ define(SIMULATE_NSP,0)dnl change to 1 to simulate call/ret insns
`#define LEAF_WORDS 'LEAF_WORDS
/*
+ * Workarounds for Darwin.
+ */
+ifelse(OPSYS,darwin,``
+/* Darwin */
+#define TEXT .text
+#define JOIN(X,Y) X##Y
+#define CSYM(NAME) JOIN(_,NAME)
+#define ASYM(NAME) CSYM(NAME)
+#define GLOBAL(NAME) .globl NAME
+#define SET_SIZE(NAME) /*empty*/
+#define TYPE_FUNCTION(NAME) /*empty*/
+'',``
+/* Not Darwin */
+#define TEXT .section ".text"
+#define CSYM(NAME) NAME
+#define ASYM(NAME) NAME
+#define GLOBAL(NAME) .global NAME
+#define SET_SIZE(NAME) .size NAME,.-NAME
+#define TYPE_FUNCTION(NAME) .type NAME,@function
+'')dnl
+
+
+/*
* Reserved registers.
*/
`#define P %rbp'