[erlang-patches] Make Erlang compile on FreeBSD 6.3

Akira Kitada <>
Sun Oct 12 03:22:29 CEST 2008

To build R12B-4 on FreeBSD 6.3, I had to apply the following patches.
Your can reproduce this problem by simply invoking "./configure
--enable-threads --enable-dynamic-ssl-lib && gmake"
(If you run configure without arguments, the build will fail, but
that's another story)

(1) gethostbyname_r argument
gcc  -g -O2 -DEI_64BIT -fPIC -Wall -Wstrict-prototypes
-Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline
-fno-strict-aliasing -I. -I../include -Iconnect -Iencode -Idecode
-Imisc -Iepmd -Iregistry -Ix86_64-unknown-freebsd6.3   -D_REENTRANT
-D_THREAD_SAFE -DPOSIX_THREADS -c connect/ei_resolve.c -o
connect/ei_resolve.c: In function `ei_gethostbyname_r':
connect/ei_resolve.c:629: warning: passing arg 5 of `gethostbyname_r'
from incompatible pointer type
connect/ei_resolve.c:629: error: too few arguments to function `gethostbyname_r'
connect/ei_resolve.c:629: warning: return makes pointer from integer
without a cast

--- lib/erl_interface/src/connect/ei_resolve.c.orig     2008-10-12
08:41:50.000000000 +0900
+++ lib/erl_interface/src/connect/ei_resolve.c  2008-10-12
08:42:23.000000000 +0900
@@ -619,7 +619,7 @@
   return my_gethostbyname_r(name,hostp,buffer,buflen,h_errnop);
-#ifdef __GLIBC__
+#if (defined(__GLIBC__) || (__FreeBSD_version >= 602000))
   struct hostent *result;

   gethostbyname_r(name, hostp, buffer, buflen, &result, h_errnop);

(2) Type of get_extended_mem

gcc -c -o ../priv/obj/x86_64-unknown-freebsd6.3/memsup.o -g -O2
-DHAVE_CONFIG_H  memsup.c
memsup.c: In function `get_extended_mem':
memsup.c:456: error: void value not ignored as it ought to be


More information about the erlang-patches mailing list