Module Name: src Committed By: pooka Date: Wed Dec 10 00:37:30 UTC 2014
Modified Files: src/lib/libc: Makefile Makefile.inc src/lib/libc/sys: Makefile.inc Log Message: Add hooks for RUMPRUN build of libc If "yes", does the following (default "no"): * prevents ASM syscalls from being built (librump provides syscalls) * does not include compat (useless when application is linked with libc) * does not build tags (no /var/db to install them to) * does not include tls ==> libc for rumprun can now be built against unmodified NetBSD sources To generate a diff of this commit: cvs rdiff -u -r1.166 -r1.167 src/lib/libc/Makefile cvs rdiff -u -r1.16 -r1.17 src/lib/libc/Makefile.inc cvs rdiff -u -r1.225 -r1.226 src/lib/libc/sys/Makefile.inc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/lib/libc/Makefile diff -u src/lib/libc/Makefile:1.166 src/lib/libc/Makefile:1.167 --- src/lib/libc/Makefile:1.166 Sun Aug 10 23:39:08 2014 +++ src/lib/libc/Makefile Wed Dec 10 00:37:30 2014 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.166 2014/08/10 23:39:08 matt Exp $ +# $NetBSD: Makefile,v 1.167 2014/12/10 00:37:30 pooka Exp $ # @(#)Makefile 8.2 (Berkeley) 2/3/94 # # All library objects contain sccsid strings by default; they may be @@ -41,6 +41,7 @@ assym.h: ${ARCHDIR}/genassym.cf mv -f assym.h.tmp assym.h .endif +.if ${RUMPRUN} != "yes" # The following controls how to build compatibility code for old NetBSD # binaries. If BUILD_LEGACY is yes, then we build a separate library; otherwise # we include the code in libc. @@ -54,6 +55,7 @@ COMPATDIR=${.CURDIR}/compat # Marker for compat code that can't be easily isolated CPPFLAGS+= -D__BUILD_LEGACY .endif +.endif .include "${.CURDIR}/../../common/lib/libc/Makefile.inc" .include "${.CURDIR}/atomic/Makefile.inc" @@ -90,7 +92,9 @@ CPPFLAGS+= -D__BUILD_LEGACY .include "${.CURDIR}/termios/Makefile.inc" .include "${.CURDIR}/thread-stub/Makefile.inc" .include "${.CURDIR}/time/Makefile.inc" +.if ${RUMPRUN} != "yes" .include "${.CURDIR}/tls/Makefile.inc" +.endif .include "${.CURDIR}/sys/Makefile.inc" .if ${HAVE_LIBGCC_EH} == "no" .include "${NETBSDSRCDIR}/sys/lib/libunwind/Makefile.inc" @@ -128,6 +132,7 @@ REGEX_SPECIALS=[][)(^$$.?*\\;] MKREPRO_SED= -e 's;${NETBSDSRCDIR:C/${REGEX_SPECIALS}/\\\\&/g};/usr/src;' .endif +.if ${RUMPRUN} != "yes" realall: tags tags: ${SRCS} ${_MKTARGET_CREATE} @@ -145,6 +150,7 @@ tags: ${SRCS} FILES= tags FILESNAME= libc.tags FILESDIR= /var/db +.endif # workaround for I18N stuffs: build singlebyte setlocale() for libc.a, Index: src/lib/libc/Makefile.inc diff -u src/lib/libc/Makefile.inc:1.16 src/lib/libc/Makefile.inc:1.17 --- src/lib/libc/Makefile.inc:1.16 Thu Sep 19 21:18:17 2013 +++ src/lib/libc/Makefile.inc Wed Dec 10 00:37:30 2014 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.16 2013/09/19 21:18:17 christos Exp $ +# $NetBSD: Makefile.inc,v 1.17 2014/12/10 00:37:30 pooka Exp $ # @(#)Makefile 8.2 (Berkeley) 2/3/94 # # All library objects contain sccsid strings by default; they may be @@ -23,6 +23,10 @@ USE_SHLIBDIR= yes .include <bsd.own.mk> +# build libc suitable for rumprun software stack, i.e. are system calls +# rump kernel function calls instead of kernel traps? +RUMPRUN?= no + WARNS=5 CPPFLAGS+= -D_LIBC -DLIBC_SCCS -DSYSLIBC_SCCS -D_REENTRANT CPPFLAGS+= -D_DIAGNOSTIC -DMLIBDIR=\"${MLIBDIR}\" Index: src/lib/libc/sys/Makefile.inc diff -u src/lib/libc/sys/Makefile.inc:1.225 src/lib/libc/sys/Makefile.inc:1.226 --- src/lib/libc/sys/Makefile.inc:1.225 Thu Sep 25 15:08:29 2014 +++ src/lib/libc/sys/Makefile.inc Wed Dec 10 00:37:30 2014 @@ -1,18 +1,22 @@ -# $NetBSD: Makefile.inc,v 1.225 2014/09/25 15:08:29 manu Exp $ +# $NetBSD: Makefile.inc,v 1.226 2014/12/10 00:37:30 pooka Exp $ # @(#)Makefile.inc 8.3 (Berkeley) 10/24/94 # sys sources .PATH: ${ARCHDIR}/sys ${.CURDIR}/sys +# other sources shared with the kernel, used in syscalls +SRCS+= cpuset.c +# glue to offer userland wrappers for some syscalls +SRCS+= posix_fadvise.c posix_madvise.c sched.c sigqueue.c sigtimedwait.c \ + sigwait.c sigwaitinfo.c statvfs.c swapon.c semctl.c + +.if ${RUMPRUN} != "yes" # modules with non-default implementations on at least one architecture: SRCS+= __clone.S __vfork14.S brk.S exect.S fork.S pipe.S \ getcontext.S \ ptrace.S sbrk.S shmat.S \ syscall.S __syscall.S __clone.S cerror.S -# other sources shared with the kernel, used in syscalls -SRCS+= cpuset.c - _LSRC+= Lint___clone.c Lint___vfork14.c Lint_brk.c Lint_clone.c \ Lint_getcontext.c Lint_exect.c Lint_pipe.c Lint_ptrace.c \ Lint_sbrk.c Lint___sigaction14.c Lint_syscall.c Lint___syscall.c \ @@ -24,10 +28,6 @@ DPSRCS+= ${_LSRC:MLintSys*.c} CLEANFILES+= ${_LSRC:MLintSys*.c} .endif -# glue to offer userland wrappers for some syscalls -SRCS+= posix_fadvise.c posix_madvise.c sched.c sigqueue.c sigtimedwait.c \ - sigwait.c sigwaitinfo.c statvfs.c swapon.c semctl.c - # glue to provide compatibility between GCC 1.X and 2.X and for compat # with old syscall interfaces. GLUE+= fdiscard.c ftruncate.c lseek.c mmap.c posix_fallocate.c \ @@ -170,6 +170,7 @@ ASMDEPS= ${.CURDIR}/sys/Makefile.inc ${A ${DESTDIR}/usr/include/sys/syscall.h _LINTASM= ${ASM:Nsa_*.S} ${WEAKASM:Nsa_*.S} +.endif # RUMPRUN != yes ${ASM}: ${ASMDEPS} ${_MKTARGET_CREATE}