--- erts/emulator/hipe/hipe_amd64_asm.m4	2009-03-12 13:16:06.000000000 +0100
+++ erts/emulator/hipe/hipe_amd64_asm.m4	2009-09-02 18:31:07.000000000 +0200
@@ -37,6 +37,28 @@
 `#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'
