Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linking errors in rumprun-bake when building against newer netbsd sources #129

Open
fabianfreyer opened this issue Jan 5, 2019 · 1 comment

Comments

@fabianfreyer
Copy link

Build process

I Built rumprun with GCC 8.2.0 after applying #127.
I also had to apply #128, as NetBSD seems to have dropped the const qualifier on _lwp_park in NetBSD/src@ff4eff8.

Updating src-netbsd

I used buildrum.sh/checkout.sh to generate an updated src-netbsd repository at https://github.com/fabianfreyer/rumpkernel-src-netbsd/tree/all-src. The CVSDATE of the checkout was

NBSRC_CVSDATE="20180401 0436UTC"

Note: I had to add --allow-unrelated-histories to the git merge commands, since git >= 2.9 won't merge those otherwise (not sure if I should open a PR for this?):

--- a/checkout.sh
+++ b/checkout.sh
@@ -260,14 +260,14 @@ githubdate ()
        hubdateonebranch usr user
 
        ${GIT} checkout appstack-src
-       ${GIT} merge --no-edit kernel-src user-src
+       ${GIT} merge --no-edit --allow-unrelated-histories kernel-src user-src
 
        ${GIT} checkout all-src
-       ${GIT} merge --no-edit kernel-src user-src posix-src
+       ${GIT} merge --no-edit --allow-unrelated-histories kernel-src user-src posix-src
 
        # buildrump-src revision gets embedded in buildrump.sh
        ${GIT} checkout buildrump-src
-       ${GIT} merge --no-edit kernel-src posix-src
+       ${GIT} merge --no-edit --allow-unrelated-histories kernel-src posix-src
        gitsrcrev=$(${GIT} rev-parse HEAD)
 
        ${GIT} checkout master

Output

$ x86_64-rumprun-netbsd-gcc helloer.c -o helloer-rumprun
$ rumprun-bake hw_generic helloer-rumprun.bin helloer-rumprun

!!!
!!! NOTE: rumprun-bake is experimental. syntax may change in the future
!!!

/usr/local/rumprun-x86_64/lib/rumprun-hw/librumpdev_virtio_if_vioif.a(if_vioif.o):(.data+0x60): multiple definition of `rumpns_vioif_cd'
/usr/local/rumprun-x86_64/lib/rumprun-hw/librumpdev_virtio_if_vioif.a(component_simple.o):(.data+0x80): first defined here
/usr/local/rumprun-x86_64/lib/rumprun-hw/librumpdev_virtio_ld.a(ld.o):(.data+0x0): multiple definition of `rumpns_ld_cd'
/usr/local/rumprun-x86_64/lib/rumprun-hw/librumpdev_virtio_ld.a(ld_at_virtio.o):(.data+0xa0): first defined here
/usr/local/rumprun-x86_64/lib/rumprun-hw/librumpdev_pci_virtio.a(virtio.o):(.data+0x80): multiple definition of `rumpns_virtio_cd'
/usr/local/rumprun-x86_64/lib/rumprun-hw/librumpdev_pci_virtio.a(component_simple.o):(.data+0xa0): first defined here
/usr/local/rumprun-x86_64/lib/rumprun-hw/librumpdev_virtio_vioscsi.a(vioscsi.o):(.data+0x60): multiple definition of `rumpns_vioscsi_cd'
/usr/local/rumprun-x86_64/lib/rumprun-hw/librumpdev_virtio_vioscsi.a(component_simple.o):(.data+0x80): first defined here
/usr/local/rumprun-x86_64/lib/rumprun-hw/librumpdev_pci_virtio.a(component_simple.o):/usr/ports/misc/rumprun/work/rumprun-085e6e0/objdir/buildrump.sh/sys/rump/dev/lib/libpci_virtio/./ioconf.c:56: undefined reference to `rumpns_virtio_pci_ca'
/usr/local/rumprun-x86_64/lib/rumprun-hw/librumpdev_pci_virtio.a(virtio.o):/usr/ports/misc/rumprun/work/rumprun-085e6e0/objdir/buildrump.sh/sys/rump/dev/lib/libpci_virtio/./ioconf.c:56: undefined reference to `rumpns_virtio_pci_ca'
/usr/local/rumprun-x86_64/lib/rumprun-hw/librumpdev_pci_if_wm.a(if_wm.o): In function `wm_init_rss':
/usr/ports/misc/rumprun/work/rumprun-085e6e0/src-netbsd/sys/rump/../dev/pci/if_wm.c:4887: undefined reference to `rumpns_rss_getkey'
/usr/local/rumprun-x86_64/lib/rumprun-hw/librumpdev_umass.a(umass_isdata.o): In function `uisdata_kill_pending':
/usr/ports/misc/rumprun/work/rumprun-085e6e0/src-netbsd/sys/rump/dev/lib/libumass/../../../../dev/usb/umass_isdata.c:511: undefined reference to `rumpns_ata_queue_get_active_xfer'
/usr/local/rumprun-x86_64/lib/rumprun-hw/librumpdev_umass.a(umass_isdata.o): In function `uisdata_get_params':
/usr/ports/misc/rumprun/work/rumprun-085e6e0/src-netbsd/sys/rump/dev/lib/libumass/../../../../dev/usb/umass_isdata.c:543: undefined reference to `rumpns_ata_get_xfer_ext'
/usr/ports/misc/rumprun/work/rumprun-085e6e0/src-netbsd/sys/rump/dev/lib/libumass/../../../../dev/usb/umass_isdata.c:599: undefined reference to `rumpns_ata_free_xfer'
/usr/local/rumprun-x86_64/lib/rumprun-hw/librumpdev_umass.a(umass_isdata.o): In function `umass_isdata_attach':
/usr/ports/misc/rumprun/work/rumprun-085e6e0/src-netbsd/sys/rump/dev/lib/libumass/../../../../dev/usb/umass_isdata.c:224: undefined reference to `rumpns_ata_channel_init'
/usr/local/rumprun-x86_64/lib/rumprun-hw/librumpdev_umass.a(umass_isdata.o): In function `umass_isdata_detach':
/usr/ports/misc/rumprun/work/rumprun-085e6e0/src-netbsd/sys/rump/dev/lib/libumass/../../../../dev/usb/umass_isdata.c:240: undefined reference to `rumpns_ata_channel_destroy'
/usr/local/rumprun-x86_64/lib/rumprun-hw/librump.a(locks.o): In function `mutex_enter':
/usr/ports/misc/rumprun/work/rumprun-085e6e0/src-netbsd/sys/rump/librump/rumpkern/locks.c:164: undefined reference to `rumpuser_mutex_spin_p'
/usr/local/rumprun-x86_64/lib/rumprun-hw/librump.a(locks.o): In function `mutex_spin_enter':
/usr/ports/misc/rumprun/work/rumprun-085e6e0/src-netbsd/sys/rump/librump/rumpkern/locks.c:174: undefined reference to `rumpuser_mutex_spin_p'
/usr/local/rumprun-x86_64/lib/rumprun-hw/librump.a(locks.o): In function `mutex_enter':
/usr/ports/misc/rumprun/work/rumprun-085e6e0/src-netbsd/sys/rump/librump/rumpkern/locks.c:164: undefined reference to `rumpuser_mutex_spin_p'
/usr/ports/misc/rumprun/work/rumprun-085e6e0/src-netbsd/sys/rump/librump/rumpkern/locks.c:164: undefined reference to `rumpuser_mutex_spin_p'
collect2: error: ld returned 1 exit status
@yarlB
Copy link
Contributor

yarlB commented Jan 5, 2019 via email

sundbry added a commit to arctype-co/src that referenced this issue Sep 10, 2021
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants