Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libc Add hooks for RUMPRUN build of libc
details: https://anonhg.NetBSD.org/src/rev/895ca95c8289
branches: trunk
changeset: 334838:895ca95c8289
user: pooka <pooka%NetBSD.org@localhost>
date: Wed Dec 10 00:37:30 2014 +0000
description:
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
diffstat:
lib/libc/Makefile | 8 +++++++-
lib/libc/Makefile.inc | 6 +++++-
lib/libc/sys/Makefile.inc | 17 +++++++++--------
3 files changed, 21 insertions(+), 10 deletions(-)
diffs (120 lines):
diff -r 2c7f1900e1fc -r 895ca95c8289 lib/libc/Makefile
--- a/lib/libc/Makefile Wed Dec 10 00:16:05 2014 +0000
+++ b/lib/libc/Makefile Wed Dec 10 00:37:30 2014 +0000
@@ -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 @@
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 @@
# 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 @@
.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 @@
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 @@
FILES= tags
FILESNAME= libc.tags
FILESDIR= /var/db
+.endif
# workaround for I18N stuffs: build singlebyte setlocale() for libc.a,
diff -r 2c7f1900e1fc -r 895ca95c8289 lib/libc/Makefile.inc
--- a/lib/libc/Makefile.inc Wed Dec 10 00:16:05 2014 +0000
+++ b/lib/libc/Makefile.inc Wed Dec 10 00:37:30 2014 +0000
@@ -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 @@
.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}\"
diff -r 2c7f1900e1fc -r 895ca95c8289 lib/libc/sys/Makefile.inc
--- a/lib/libc/sys/Makefile.inc Wed Dec 10 00:16:05 2014 +0000
+++ b/lib/libc/sys/Makefile.inc Wed Dec 10 00:37:30 2014 +0000
@@ -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 @@
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 @@
${DESTDIR}/usr/include/sys/syscall.h
_LINTASM= ${ASM:Nsa_*.S} ${WEAKASM:Nsa_*.S}
+.endif # RUMPRUN != yes
${ASM}: ${ASMDEPS}
${_MKTARGET_CREATE}
Home |
Main Index |
Thread Index |
Old Index