Subject: pkg/37131: 2 problems: i) NetBSD-current doesn't build because of signature of mremap(2) ii) os_mon driver doesn't build on NetBSD
To: None <email@example.com, firstname.lastname@example.org,>
From: None <email@example.com>
Date: 10/14/2007 16:00:02
>Synopsis: 2 problems: i) NetBSD-current doesn't build because of signature of mremap(2) ii) os_mon driver doesn't build on NetBSD
>Arrival-Date: Sun Oct 14 16:00:00 +0000 2007
>Originator: Juraj Hercek
NetBSD pkgsrc.hck.sk 4.99.31 NetBSD 4.99.31 (PKGSRC) #0: Sat Sep 29 11:35:18 CEST 2007 juraj@core:/netbsd/obj/sys/arch/i386/compile/PKGSRC i386
There are 2 problems:
1) mremap(2) signature in NetBSD-current is different from the one used in other OSes. This prevents erlang to be built because of compile error when compiling erts/emulator/sys/common/erl_mseg.c file
2) os_mon in lib/os_mon doesn't get built because memsup.c file tries to include vm/vm_param.h file which doesn't exist on NetBSD-current. Since the os_mon doesn't build, it is not installed, but still listed in PLIST.
NOTE: The above applies most probably to latest NetBSD-4.0 rc candidate as well.
Try to build the system on NetBSD-current and i) wait for compile error, when you fix signature of the mremap(), continue in build and see the problem of missing os_mon stuff when building binary package.
Following 2 patches allowed me to build erlang on current NetBSD:
The NetBSD got a mremap(2) function implemetation on 2007-07-17, however the
signature of the mremap(2) function differs from the one used in other systems.
This patch allows usage of the mremap(2) on current NetBSD.
--- erts/emulator/sys/common/erl_mseg.c.orig 2007-04-16 12:22:46.000000000 +0000
@@ -369,10 +369,18 @@ mseg_recreate(void *old_seg, Uint old_si
new_seg = erts_sys_realloc(ERTS_ALC_N_INVALID, NULL, old_seg, new_size);
+ new_seg = (void *) mremap((void *) old_seg,
+ (size_t) old_size,
+ (void *) old_seg,
+ (size_t) new_size,
new_seg = (void *) mremap((void *) old_seg,
if (new_seg == (void *) MAP_FAILED)
new_seg = NULL;
NetBSD doesn't have vm/vm_param.h file and including it ends in compiler error.
This patch allows building erlang's os_mon on NetBSD.
--- lib/os_mon/c_src/memsup.c.orig 2007-10-14 12:45:03.000000000 +0000
@@ -98,7 +98,7 @@
+#if !defined(__OpenBSD__) && !defined(__NetBSD__)
#if defined(__FreeBSD__) || defined(__DragonFly__)
After adding patch files to patches directory, recreate distinfo file with "make mdi".