[erlang-bugs] [erlang-questions] Patches for HIPE on OS X (Leopard WWDC Beta)

Mikael Pettersson mikpe@REDACTED
Mon Jul 2 11:04:37 CEST 2007


On Sun, 1 Jul 2007 11:41:09 -0700, Brent Fulgham wrote:
> I ran into problems trying to build Erlang using the Leopard Beta from  
> WWDC.  Attached are the patches I generated to get HIPE to compile  
> with the new OS changes.
> 
> Most of these patches are simply adjusting the thread and float  
> primitives to the new structure (under Intel, 32-bit).  Someone  
> knowledgeable about HIPE should check them to see if they seem  
> reasonable.  It is very likely that they will break for PowerPC and 64- 
> bit Intel.
> 
> If any of the HIPE guys would like me to try variations on these  
> patches, I'd be happy to look into it.
> 
> At the very least, these changes let me run various shootout tests on  
> my MacBook Pro.

These patches look quite reasonable. The only change I don't
like is this one:

> --- erts/configure.in.orig	2007-06-30 19:35:17.000000000 -0700
> +++ erts/configure.in	2007-06-30 19:39:13.000000000 -0700
> @@ -1697,6 +1697,13 @@
>      __asm__ __volatile__("ldmxcsr %0" : : "m"(mxcsr));
>  }
>  
> +#if defined(__DARWIN__)
> +#include <mach/mach.h>
> +#include <mach/machine/thread_status.h>
> +#include <pthread.h>
> +#endif
> +
> +
>  #if defined(__x86_64__) || defined(__DARWIN__)
>  static inline int cpu_has_sse2(void) { return 1; }
>  #else /* !__x86_64__ */

It includes OS-specific stuff in an OS-agnostic part of
the code. I'd much prefer if you could move that to the
#ifdef/#include block just before fpe_sig_action(), and
make it #ifdef __DARWIN_UNIX03 like your other changes.

The HiPE group doesn't have OSX/x86 development machines,
so OSX/x86 support relies on contributions like this one.

Most of the changes in this patch set are about enabling
floating-point exceptions. This will benefit BEAM as well.

/Mikael



More information about the erlang-bugs mailing list