[Simh] Unable to build on NetBSD

Rhialto rhialto at falu.nl
Mon Apr 27 19:22:43 EDT 2015


On Mon 27 Apr 2015 at 18:56:49 -0400, Cory Smelosky wrote:
> sim_fio.c: In function 'sim_shmem_open':
> sim_fio.c:470:1: warning: implicit declaration of function 'shm_open'
> /var/tmp//cca0Q6I4.o: In function `sim_shmem_open':
> sim_fio.c:(.text+0x5c0): undefined reference to `shm_open'
> sim_fio.c:(.text+0x64e): undefined reference to `shm_open'
> 
> This is a bit of a problem.

It seems that NetBSD 7 will have that function. In the mean time I've
stubbed it out. That is of course not a proper solution.

Also, there is a typo still in the makefile.

diff --git a/makefile b/makefile
index 1acdcb0..9934e60 100644
--- a/makefile
+++ b/makefile
@@ -276,7 +276,7 @@ ifeq ($(WIN32),)  #*nix Environments (&& cygwin)
             ifeq (X11R7,$(shell if $(TEST) -d /usr/X11R7/lib; then echo X11R7; fi))
               LIBPATH += /usr/X11R7/lib
               INCPATH += /usr/X11R7/include
-              OS_LDFLAGS += -L/X11R7/pkg/lib -R/usr/X11R7/lib
+              OS_LDFLAGS += -L/usr/X11R7/lib -R/usr/X11R7/lib
               OS_CCDEFS += -I/usr/X11R7/include
             endif
             ifeq (/usr/local/lib,$(findstring /usr/local/lib,$(LIBPATH)))
diff --git a/sim_fio.c b/sim_fio.c
index 8381674..3465262 100644
--- a/sim_fio.c
+++ b/sim_fio.c
@@ -451,6 +451,14 @@ return -1;
 
 #include <sys/mman.h>
 
+#ifdef __NetBSD__
+int shm_open(const char *name, int oflag, ...)
+{
+    return -1;
+}
+
+#endif
+
 struct SHMEM {
     int shm_fd;
     size_t shm_size;

-Olaf.
-- 
___ Olaf 'Rhialto' Seibert  -- The Doctor: No, 'eureka' is Greek for
\X/ rhialto/at/xs4all.nl    -- 'this bath is too hot.'
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://mailman.trailing-edge.com/pipermail/simh/attachments/20150428/97f10ad2/attachment.sig>


More information about the Simh mailing list