Hunk 1:
XXX not quite sure why this is needed as it's built without PIE anyway, but
this fixes a segfault on i386 during build following the switch to PIE by
default.

===
gplc -c --fast-math fd2c.pl

Fatal Error: Segmentation Violation
compilation failed
*** Error 1 in Fd2C (Makefile:10 'fd2c.o')
*** Error 1 in /tmp_ports/gprolog-1.3.1/gprolog-1.3.1/src (Makefile:47 'all')
===

Hunk 2:
use system malloc(3), not Doug Lea malloc backed by sbrk(2)

Index: EnginePl/machine.h
--- EnginePl/machine.h.orig
+++ EnginePl/machine.h
@@ -124,7 +124,7 @@ void M_Check_Magic_Words(void); /* not compiled if not
 #    define M_USED_REGS            {"$9", "$10", "$11", "$12", "$13", "$14", 0}
 
 /* on M_ix86_darwin : %ebx is used by gcc for pic base */
-#elif defined(M_ix86) && !defined(_MSC_VER) && !defined(M_ix86_darwin)
+#elif defined(M_ix86) && !defined(_MSC_VER) && !defined(M_ix86_darwin) && !defined(__OpenBSD__)
 
 #ifdef NO_USE_EBP
 #    define M_USED_REGS            {"ebx", 0}
@@ -224,7 +224,7 @@ void M_Check_Magic_Words(void); /* not compiled if not
  *---------------------------------*/
 
 #if defined(__OpenBSD__) || defined(M_bsd)
-#define USE_DL_MALLOC
+//#define USE_DL_MALLOC
 #endif
 
 
