From 5da4a0bd56b40563fc8822b4ab6b975d17d63189 Mon Sep 17 00:00:00 2001 From: Evgeniy Ivanov Date: Sat, 9 Jul 2011 17:17:12 +0400 Subject: [PATCH] Move minimal libc from libsys into separate lib. Now users can choose between libsys, libsys + libminc and libsys + libc. E.g. PUFFS/FUSE servers need libsys + libc while old servers can use libsys + libminc. --- kernel/Makefile | 4 ++-- lib/Makefile | 2 +- lib/{libsys/Makefile.libc.inc => libminc/Makefile} | 9 +++++++-- lib/{libsys => libminc}/_stdfile.c | 0 lib/{libsys => libminc}/abort.c | 0 lib/{libsys => libminc}/arch/i386/Makefile.libc.inc | 0 lib/{libsys => libminc}/calloc.c | 0 lib/{libsys => libminc}/errlist.c | 0 lib/{libsys => libminc}/fputs.c | 0 lib/{libsys => libminc}/malloc.c | 0 lib/libsys/Makefile | 4 ++-- share/mk/minix.service.mk | 4 ++-- 12 files changed, 14 insertions(+), 9 deletions(-) rename lib/{libsys/Makefile.libc.inc => libminc/Makefile} (97%) rename lib/{libsys => libminc}/_stdfile.c (100%) rename lib/{libsys => libminc}/abort.c (100%) rename lib/{libsys => libminc}/arch/i386/Makefile.libc.inc (100%) rename lib/{libsys => libminc}/calloc.c (100%) rename lib/{libsys => libminc}/errlist.c (100%) rename lib/{libsys => libminc}/fputs.c (100%) rename lib/{libsys => libminc}/malloc.c (100%) diff --git a/kernel/Makefile b/kernel/Makefile index 9ad077a88..deb33e353 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -28,9 +28,9 @@ LDFLAGS+= -nostdlib -L${LIBDIR} LDADD+= -lminlib DPADD+= ${LIBMINLIB} .if ${CC} == "gcc" -LDADD+= -lgcc -lsys -lgcc +LDADD+= -lgcc -lsys -lgcc -lminc .elif ${CC} == "clang" -LDADD+= -L/usr/pkg/lib -lCompilerRT-Generic -lsys -lCompilerRT-Generic +LDADD+= -L/usr/pkg/lib -lCompilerRT-Generic -lsys -lCompilerRT-Generic -lminc DPADD+= ${LIBC} .endif .endif diff --git a/lib/Makefile b/lib/Makefile index 876928b5a..f5a596dcf 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -21,7 +21,7 @@ SUBDIR= csu ${LIBCOMPAT_DIR} ${LIBC_DIR} libcurses libdriver libnetdriver \ libddekit .if defined(NBSD_LIBC) && (${NBSD_LIBC} != "no") -SUBDIR+= libelf +SUBDIR+= libelf libminc .endif .if ${COMPILER_TYPE} == "ack" diff --git a/lib/libsys/Makefile.libc.inc b/lib/libminc/Makefile similarity index 97% rename from lib/libsys/Makefile.libc.inc rename to lib/libminc/Makefile index b2e819927..aac2f2644 100644 --- a/lib/libsys/Makefile.libc.inc +++ b/lib/libminc/Makefile @@ -2,9 +2,14 @@ # Minimal libc for servers and drivers. # +.include + +LIB= minc + +CPPFLAGS.sched_start.c+= -I${MINIXSRCDIR} + LIBCSRCDIR=${MINIXSRCDIR}/lib/nbsd_libc -.if (${NBSD_LIBC} != "no") MACHINE_ARCH=${MACHINE} # @@ -133,4 +138,4 @@ CPPFLAGS.${i}+= -I${LIBCSRCDIR}/include CPPFLAGS+= -D_LIBSYS -.endif +.include diff --git a/lib/libsys/_stdfile.c b/lib/libminc/_stdfile.c similarity index 100% rename from lib/libsys/_stdfile.c rename to lib/libminc/_stdfile.c diff --git a/lib/libsys/abort.c b/lib/libminc/abort.c similarity index 100% rename from lib/libsys/abort.c rename to lib/libminc/abort.c diff --git a/lib/libsys/arch/i386/Makefile.libc.inc b/lib/libminc/arch/i386/Makefile.libc.inc similarity index 100% rename from lib/libsys/arch/i386/Makefile.libc.inc rename to lib/libminc/arch/i386/Makefile.libc.inc diff --git a/lib/libsys/calloc.c b/lib/libminc/calloc.c similarity index 100% rename from lib/libsys/calloc.c rename to lib/libminc/calloc.c diff --git a/lib/libsys/errlist.c b/lib/libminc/errlist.c similarity index 100% rename from lib/libsys/errlist.c rename to lib/libminc/errlist.c diff --git a/lib/libsys/fputs.c b/lib/libminc/fputs.c similarity index 100% rename from lib/libsys/fputs.c rename to lib/libminc/fputs.c diff --git a/lib/libsys/malloc.c b/lib/libminc/malloc.c similarity index 100% rename from lib/libsys/malloc.c rename to lib/libminc/malloc.c diff --git a/lib/libsys/Makefile b/lib/libsys/Makefile index f5bdc73bc..4c9923d70 100644 --- a/lib/libsys/Makefile +++ b/lib/libsys/Makefile @@ -131,8 +131,8 @@ SRCS= \ CPPFLAGS.sched_start.c+= -I${MINIXSRCDIR} -.if (${NBSD_LIBC} != "no") -.include "Makefile.libc.inc" +.if (${CC} == "gcc") || (${CC} == "clang") +LDADD+= -lminc .endif .include diff --git a/share/mk/minix.service.mk b/share/mk/minix.service.mk index 52e47487a..df50c11ef 100644 --- a/share/mk/minix.service.mk +++ b/share/mk/minix.service.mk @@ -4,9 +4,9 @@ .if ${COMPILER_TYPE} == "gnu" .if ${CC} == "gcc" -LDADD+= -nodefaultlibs -lgcc -lsys -lgcc +LDADD+= -nodefaultlibs -lgcc -lsys -lgcc -lminc .elif ${CC} == "clang" -LDADD+= -nodefaultlibs -L/usr/pkg/lib -lCompilerRT-Generic -lsys -lCompilerRT-Generic +LDADD+= -nodefaultlibs -L/usr/pkg/lib -lCompilerRT-Generic -lsys -lCompilerRT-Generic -lminc .endif .endif -- 2.44.0