NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/55777: rump fails to compile



>Number:         55777
>Category:       kern
>Synopsis:       rump fails to compile
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Nov 02 13:25:00 +0000 2020
>Originator:     Ruslan Nikolaev
>Release:        master
>Organization:
Virginia Tech
>Environment:
>Description:
There are several problems with rump kernels, which were introduced recently. The below bug report is when we are compiling the code using our version of rumprun (SMP): https://github.com/ssrg-vt/rumprun-smp, which is forked from https://github.com/rumpkernel/rumprun

1. 

/mnt/testdrive/rumpddom/./rumprun-netddom/rumprun-x86_64/lib/libpthread.a(libpthread.a.o): In function `pthread_getcpuclockid':
/mnt/testdrive/rumpddom/src-netbsd/lib/libpthread/pthread_getcpuclockid.c:49: undefined reference to `clock_getcpuclockid2'
collect2: error: ld returned 1 exit status

To solve it, just define this dummy symbol in RUMP. Note that all system calls files need to be regenerated after this fix! This happens after
the following change:

Author: maya <maya%NetBSD.org@localhost>
Date:   Tue May 7 18:12:53 2019 +0000

    Replace the link command for libpthread.a so that we create a single section
    with all the libpthread symbols in it.
    This makes -lpthread behave like to -Wl,--whole-archive -lpthread.
    
    This avoids a situation where threaded static binaries use some libc thread
    stubs, which are racy.
    
    Fixes PR lib/54001: call_once2_32, call_once2_static test cases failing on
    amd64 since gcc7 import.
    
    Suggested by Jonathan Wakely, thanks!


2. no min() definition

3. Multiple definitions of unp_sysctl_create() resulting in linking errors

The patch is attached. I have one more fix for rump, which I will post shortly in a separate bug report.
>How-To-Repeat:

>Fix:
diff --git a/sys/kern/syscalls.master b/sys/kern/syscalls.master
index f814c189ee67..b3807db4b680 100644
--- a/sys/kern/syscalls.master
+++ b/sys/kern/syscalls.master
@@ -1011,7 +1011,7 @@
 481	STD		{ int|sys||wait6(idtype_t idtype, id_t id, \
 			    int *status, int options, struct wrusage *wru, \
 			    siginfo_t *info); }
-482	STD		{ int|sys||clock_getcpuclockid2(idtype_t idtype, \
+482	STD	RUMP	{ int|sys||clock_getcpuclockid2(idtype_t idtype, \
 			    id_t id, clockid_t *clock_id); }
 483	STD	RUMP	{ int|sys|90|getvfsstat(struct statvfs *buf, \
 			    size_t bufsize, int flags); }
diff --git a/sys/rump/dev/lib/libpci/rumpdev_bus_dma.c b/sys/rump/dev/lib/libpci/rumpdev_bus_dma.c
index 07c0dc931d1f..0f48606c9751 100644
--- a/sys/rump/dev/lib/libpci/rumpdev_bus_dma.c
+++ b/sys/rump/dev/lib/libpci/rumpdev_bus_dma.c
@@ -84,6 +84,10 @@ __KERNEL_RCSID(0, "$NetBSD: rumpdev_bus_dma.c,v 1.9 2020/09/05 16:30:12 riastrad
 
 #define	EIEIO	membar_sync()
 
+#ifndef min
+# define min(a,b) ((a) < (b) ? (a) : (b))
+#endif
+
 int	_bus_dmamap_load_buffer (bus_dma_tag_t, bus_dmamap_t, void *,
 	    bus_size_t, struct vmspace *, int, paddr_t *, int *, int);
 
diff --git a/sys/rump/librump/rumpnet/net_stub.c b/sys/rump/librump/rumpnet/net_stub.c
index e43cdec4ab3f..4249be54f158 100644
--- a/sys/rump/librump/rumpnet/net_stub.c
+++ b/sys/rump/librump/rumpnet/net_stub.c
@@ -88,12 +88,6 @@ int ipsec_used;
 percpu_t *ipsecstat_percpu;
 u_int ipsec_spdgen;
 
-/* sysctl */
-void
-unp_sysctl_create(struct sysctllog **clog)
-{
-}
-
 __weak_alias(ah4_ctlinput,rumpnet_stub);
 __weak_alias(ah6_ctlinput,rumpnet_stub);
 __weak_alias(esp4_ctlinput,rumpnet_stub);



Home | Main Index | Thread Index | Old Index