--- asmrun/i386.S.orig	Sun Feb 14 17:48:24 1999
+++ asmrun/i386.S	Fri May  7 01:05:46 1999
@@ -23,7 +23,7 @@
 #define CONCAT(a,b) a##b
 #endif
 
-#if defined(SYS_linux_elf) || defined(SYS_solaris)
+#if defined(SYS_linux_elf) || defined(SYS_solaris) || defined(SYS_freebsd)
 #define G(x) x
 #define LBL(x) CONCAT(.L,x)
 #define FUNCTION_ALIGN 4
@@ -33,13 +33,22 @@
 #define FUNCTION_ALIGN 2
 #endif
 
-#if defined(PROFILING) && defined(SYS_linux_elf)
+#if defined(PROFILING)
+#if defined(SYS_linux_elf)
 #define PROFILE_CAML \
         pushl %ebp; movl %esp, %ebp; pushl %eax; pushl %ecx; pushl %edx; \
         call mcount; \
         popl %edx; popl %ecx; popl %eax; popl %ebp
 #define PROFILE_C \
         pushl %ebp; movl %esp, %ebp; call mcount; popl %ebp
+#elif defined(SYS_freebsd)
+#define PROFILE_CAML \
+        pushl %ebp; movl %esp, %ebp; pushl %eax; pushl %ecx; pushl %edx; \
+        call .mcount; \
+        popl %edx; popl %ecx; popl %eax; popl %ebp
+#define PROFILE_C \
+        pushl %ebp; movl %esp, %ebp; call .mcount; popl %ebp
+#endif
 #else
 #define PROFILE_CAML
 #define PROFILE_C
