rumpkernel / rumprun

The Rumprun unikernel and toolchain for various platforms
Other
1.14k stars 128 forks source link

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

Open fabianfreyer opened 5 years ago

fabianfreyer commented 5 years ago

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 https://github.com/NetBSD/src/commit/ff4eff81e3b6454b848a46b64db75576014f1e1b.

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 commented 5 years ago

Hi,

May I suggest you to read that thread the following thread in the mailing list? https://www.freelists.org/post/rumpkernel-users/How-to-update-srcnetbsd-status-of-rumpkernel-and-related-questions

I think some parts are relevant.