Index: erts/emulator/sys/unix/erl_unix_sys.h
--- erts/emulator/sys/unix/erl_unix_sys.h.orig	2019-09-17 11:26:03.000000000 +0200
+++ erts/emulator/sys/unix/erl_unix_sys.h	2019-09-17 20:25:43.717759000 +0200
@@ -333,7 +333,7 @@
 #ifdef USE_ISINF_ISNAN		/* simulate finite() */
 #  define isfinite(f) (!isinf(f) && !isnan(f))
 #  define HAVE_ISFINITE
-#elif (defined(__GNUC__) && !defined(__llvm__)) && defined(HAVE_FINITE)
+#elif (defined(__GNUC__) && !defined(__llvm__)) && defined(HAVE_FINITE) && !defined(__FreeBSD__)
 /* We use finite in gcc as it emits assembler instead of
    the function call that isfinite emits. The assembler is
    significantly faster. */
Index: lib/erl_interface/src/connect/ei_resolve.c
--- lib/erl_interface/src/connect/ei_resolve.c.orig	2019-09-17 11:26:03.000000000 +0200
+++ lib/erl_interface/src/connect/ei_resolve.c	2019-09-17 20:25:43.717951000 +0200
@@ -55,6 +55,10 @@
 #include "ei_resolve.h"
 #include "ei_locking.h"
 
+#if defined(HAVE_GETHOSTBYNAME_R) && defined(__FreeBSD__)
+#undef HAVE_GETHOSTBYNAME_R
+#endif
+
 #ifdef HAVE_GETHOSTBYNAME_R
 
 int ei_init_resolve(void)
Index: lib/wx/configure
--- lib/wx/configure.orig	2019-09-17 20:25:43.719094000 +0200
+++ lib/wx/configure	2019-09-17 20:26:42.878662000 +0200
@@ -4428,8 +4428,8 @@
 	CFLAGS="-g -Wall -fPIC $CFLAGS -fno-strict-aliasing"
 	;;
     *)
-	DEBUG_CFLAGS="-g -Wall -fPIC $CFLAGS -DDEBUG"
-	CFLAGS="-Wall -fPIC $CFLAGS -fomit-frame-pointer -fno-strict-aliasing"
+	DEBUG_CFLAGS="-fPIC $CFLAGS -DDEBUG"
+	CFLAGS="-fPIC $CFLAGS -fomit-frame-pointer -fno-strict-aliasing"
 	;;
 esac
 
