Skip to content

Commit

Permalink
Rump component_simple.c: Add _IOCONF_NO_CFDRIVER_DECL option
Browse files Browse the repository at this point in the history
Some rump components (libpci_virtio, libvirtio_if_vioif,
libvirtio_vioscsi) include their CFDRIVER_DECL(s) via their SRCS. When
they link in component_simple to initialize their RUMP_COMPONENT, their
CFDRIVER_DECLs are redefined in ioconf.c.

This causes linker errors when trying to load these libraries.
See: rumpkernel/rumprun#129

Add a preprocessor directive _IO_CONF_NO_CFDRIVER_DECL which will
disable redefining the CFDRIVER_DECLs in component_simple when defined.
  • Loading branch information
sundbry committed Sep 10, 2021
1 parent 9cb5c5e commit a67421b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
8 changes: 8 additions & 0 deletions sys/rump/dev/lib/component_simple.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ __KERNEL_RCSID(0, "$NetBSD: component_simple.c,v 1.3 2016/01/26 23:12:14 pooka E

#include <rump-sys/kern.h>


#ifdef _IOCONF_NO_CFDRIVER_DECL
/*
* XXX Don't allow ioconf.c to redefine struct cfdrivers.
*/
#undef CFDRIVER_DECL
#define CFDRIVER_DECL(name, class, attr)
#endif
#include "ioconf.c"

#define CONFIG_INIT_COMPONENT(a) config_init_component( \
Expand Down
1 change: 1 addition & 0 deletions sys/rump/dev/lib/libpci_virtio/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ RUMP_COMPONENT=ioconf
SRCS+= virtio.c

CPPFLAGS+= -I${RUMPTOP}/librump/rumpkern
CPPFLAGS+= -D_IOCONF_NO_CFDRIVER_DECL

.include "${RUMPTOP}/Makefile.rump"
.include <bsd.lib.mk>
Expand Down
3 changes: 2 additions & 1 deletion sys/rump/dev/lib/libvirtio_if_vioif/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ RUMP_COMPONENT=ioconf

SRCS+= if_vioif.c

CPPFLAGS+= -I${RUMPTOP}/librump/rumpkern
CPPFLAGS+= -I${RUMPTOP}/librump/rumpkern
CPPFLAGS+= -D_IOCONF_NO_CFDRIVER_DECL

.include "${RUMPTOP}/Makefile.rump"
.include <bsd.lib.mk>
Expand Down
1 change: 1 addition & 0 deletions sys/rump/dev/lib/libvirtio_vioscsi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ RUMP_COMPONENT=ioconf
SRCS+= vioscsi.c

CPPFLAGS+= -I${RUMPTOP}/librump/rumpkern
CPPFLAGS+= -D_IOCONF_NO_CFDRIVER_DECL

.include "${RUMPTOP}/Makefile.rump"
.include <bsd.lib.mk>
Expand Down

0 comments on commit a67421b

Please sign in to comment.