[erlang-bugs] Erlang/OTP R11B-3 OpenBSD patches

Mikael Pettersson mikpe@REDACTED
Fri Feb 2 19:29:55 CET 2007


On Fri, 2 Feb 2007 18:19:38 +0100, Jon Olsson wrote:
>Hi, I sent these patches earlier to patches@, but they didn't reach the
>mailing list so I'm reposting them to erlang-bugs@REDACTED
>
>All patches are against R11B-3.
>
>/ Jon
>
>This fixes a bug on OpenBSD/sparc64 build - this needs to be conditionalized for 
>OpenBSD if these are the right flags for other sparc64 OS'en.
>--- erts/emulator/Makefile.in.orig      Mon Jan 29 13:52:09 2007
>+++ erts/emulator/Makefile.in   Wed Jan 31 17:25:33 2007
>@@ -137,7 +137,7 @@ darwinCFLAGS=-DDARWIN
> noopsysCFLAGS=
> OPSYSCFLAGS=$($(OPSYS)CFLAGS)
> ARCH=@ARCH@
>-ultrasparcCFLAGS=-Wa,-xarch=v8plusa
>+ultrasparcCFLAGS=
> ARCHCFLAGS=$($(ARCH)CFLAGS)
> 
> ifdef HIPE_ENABLED

They were introduced originally for Solaris, but they
also see use (whether needed or not) on Linux.
They are (were) needed on Solaris because the compilers do not
necessarily support the SPARC v9 instruction set by default,
and parts of the runtime system need(ed) to include v9 instructions.

What exactly is the failure on OpenBSD?

>This fixes a hang in the configure script on OpenBSD/amd64 similiar to the FreeBSD one.
>--- erts/configure.in.orig      Wed Jan 31 17:36:19 2007
>+++ erts/configure.in   Wed Jan 31 17:37:08 2007
>@@ -1855,14 +1855,14 @@ static __inline__ int check_fpe(double f
> 
> #endif
> 
>-#if (defined(__linux__) && (defined(__i386__) || defined(__x86_64__) || defined(__sparc__) || defined(
>__powerpc__))
>) || (defined(__DARWIN__) && (defined(__i386__) || defined(__ppc__))) || (defined(__FreeBSD__) && (defi
>ned(__i386__)
> || defined(__x86_64__))) || (defined(__sun__) && defined(__x86_64__))
>+#if (defined(__linux__) && (defined(__i386__) || defined(__x86_64__) || defined(__sparc__) || defined(
>__powerpc__))
>) || (defined(__DARWIN__) && (defined(__i386__) || defined(__ppc__))) || ((defined(__OpenBSD__) || defi
>ned(__FreeBSD
>__)) && (defined(__i386__) || defined(__x86_64__))) || (defined(__sun__) && defined(__x86_64__))
> 
> #if defined(__linux__) && defined(__i386__)
> #include <asm/sigcontext.h>
> #elif defined(__FreeBSD__) && defined(__i386__)
> #include <sys/types.h>
> #include <machine/npx.h>
>-#elif defined(__FreeBSD__) && defined(__x86_64__)
>+#elif (defined(__OpenBSD__) || defined(__FreeBSD__)) && defined(__x86_64__)
> #include <sys/types.h>
> #include <machine/fpu.h>
> #endif

This patch is broken due word-wrapping. But what it implies is
that OpenBSD should receive the same treatment as FreeBSD wrt
floating-point exceptions and SIGFPE handlers, correct?

A (perhaps temporary) shell account on an x86-32 and an x86-64
OpenBSD box would do wonders for Erlang/OTP's OpenBSD support.
(That's how the FreeBSD folks got their verified support for HiPE,
floating-point exceptions, and SMP. Hint hint, nudge nudge.)

/Mikael



More information about the erlang-bugs mailing list