Libraries updates and cleanup
* Updating common/lib * Updating lib/csu * Updating lib/libc * Updating libexec/ld.elf_so * Corrected test on __minix in featuretest to actually follow the meaning of the comment. * Cleaned up _REENTRANT-related defintions. * Disabled -D_REENTRANT for libfetch * Removing some unneeded __NBSD_LIBC defines and tests Change-Id: Ic1394baef74d11b9f86b312f5ff4bbc3cbf72ce2
This commit is contained in:
+40
-26
@@ -8,29 +8,42 @@ LIB= minc
|
||||
|
||||
CPPFLAGS.sched_start.c+= -I${NETBSDSRCDIR}
|
||||
|
||||
LIBCSRCDIR=${NETBSDSRCDIR}/lib/libc
|
||||
LIBCSRCDIR= ${NETBSDSRCDIR}/lib/libc
|
||||
CPPFLAGS+= -I${LIBCSRCDIR}/include -I${LIBCSRCDIR}
|
||||
CPPFLAGS+= -D_LIBMINC
|
||||
|
||||
#
|
||||
# Customized versions of libc functions.
|
||||
#
|
||||
SRCS+= fputs.c
|
||||
|
||||
#
|
||||
# Shared libc with userspace (/common/lib/libc)
|
||||
#
|
||||
.include "${NETBSDSRCDIR}/common/lib/libc/Makefile.inc"
|
||||
.include "${.CURDIR}/arch/${MACHINE_ARCH}/Makefile.libc.inc"
|
||||
|
||||
.if empty(SRCS:Mbyte_swap_8.*)
|
||||
SRCS+= bswap64.c
|
||||
.endif
|
||||
|
||||
.if empty(SRCS:Mmemset2.*)
|
||||
SRCS+= memset.c
|
||||
.endif
|
||||
|
||||
# Quad support
|
||||
.if (${MACHINE_ARCH} != "alpha") && \
|
||||
(${MACHINE_ARCH} != "mips64eb") && \
|
||||
(${MACHINE_ARCH} != "mips64el") && \
|
||||
(${MACHINE_ARCH} != "powerpc64") && \
|
||||
(${MACHINE_ARCH} != "sparc64") && \
|
||||
(${MACHINE_ARCH} != "x86_64")
|
||||
# Quad support
|
||||
SRCS+= adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c \
|
||||
iordi3.c lshldi3.c lshrdi3.c moddi3.c muldi3.c negdi2.c \
|
||||
notdi2.c qdivrem.c subdi3.c ucmpdi2.c udivdi3.c umoddi3.c \
|
||||
xordi3.c
|
||||
.endif
|
||||
|
||||
.for i in \
|
||||
random.c strtoll.c strtoul.c strtoull.c strtoumax.c \
|
||||
memchr.c memcmp.c memcpy.c memmove.c popcount32.c popcount64.c \
|
||||
@@ -38,42 +51,42 @@ SRCS+= adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c \
|
||||
strlcpy.c strlen.c strncasecmp.c strncmp.c strncpy.c strnlen.c \
|
||||
strrchr.c strsep.c strstr.c ptree.c rb.c sha1.c sha2.c
|
||||
SRCS+= ${i}
|
||||
CPPFLAGS.${i}+= -D_LIBC -I${LIBCSRCDIR}/include
|
||||
.endfor
|
||||
.if empty(SRCS:Mmemset2.*)
|
||||
SRCS+= memset.c
|
||||
.endif
|
||||
|
||||
#
|
||||
# Customized versions of libc functions.
|
||||
#
|
||||
SRCS+= fputs.c _stdfile.c
|
||||
CPPFLAGS.fputs.c+= -I${LIBCSRCDIR}/include
|
||||
|
||||
CPPFLAGS.sha2.c+= -D_LIBC
|
||||
CPPFLAGS.rb.c+= -D_LIBC
|
||||
CPPFLAGS.strlcpy.c+= -D_LIBC
|
||||
|
||||
#
|
||||
# Functions imported directly from the libc.
|
||||
#
|
||||
|
||||
# Import from misc (_libc_init symbols)
|
||||
.for i in initfini.c stack_protector.c
|
||||
.PATH.c: ${LIBCSRCDIR}/misc
|
||||
SRCS+= ${i}
|
||||
CPPFLAGS.${i}+= -Dxprintf=printf
|
||||
.endfor
|
||||
|
||||
# Import from stdio
|
||||
.for i in sprintf.c fprintf.c perror.c vsnprintf.c snprintf.c \
|
||||
.for i in findfp.c sprintf.c fprintf.c perror.c vsnprintf.c snprintf.c \
|
||||
_rand48.c lrand48.c srand48.c
|
||||
.PATH.c: ${LIBCSRCDIR}/stdio
|
||||
CPPFLAGS.${i}= -I${LIBCSRCDIR}/stdio -I${LIBCSRCDIR}/include
|
||||
CPPFLAGS.${i}= -I${LIBCSRCDIR}/stdio
|
||||
SRCS+= ${i}
|
||||
.endfor
|
||||
|
||||
# Import from stdlib
|
||||
.for i in abort.c atexit.c atoi.c exit.c getenv.c \
|
||||
getopt.c ldiv.c malloc.c
|
||||
.PATH.c: ${LIBCSRCDIR}/stdlib
|
||||
SRCS+= ${i}
|
||||
CPPFLAGS.${i}+= -I${LIBCSRCDIR}/stdlib -I${LIBCSRCDIR}/include
|
||||
CPPFLAGS.${i}+= -I${LIBCSRCDIR}/stdlib
|
||||
.endfor
|
||||
# Import from gen
|
||||
|
||||
# Import from gen
|
||||
errlist.c: ${LIBCSRCDIR}/gen/errlist.awk \
|
||||
${NETBSDSRCDIR}/include/sys/errno.h
|
||||
cat ${NETBSDSRCDIR}/include/sys/errno.h | ${TOOL_SED} 's/(_SIGN//' | ${TOOL_AWK} -f ${LIBCSRCDIR}/gen/errlist.awk > ${.TARGET}
|
||||
${NETBSDSRCDIR}/sys/sys/errno.h
|
||||
${TOOL_CAT} ${NETBSDSRCDIR}/sys/sys/errno.h | ${TOOL_SED} 's/(_SIGN//' | ${TOOL_AWK} -f ${LIBCSRCDIR}/gen/errlist.awk > ${.TARGET}
|
||||
CLEANFILES+= errlist.c
|
||||
|
||||
.for i in assert.c _errno.c errno.c _env.c errlist.c \
|
||||
@@ -86,42 +99,44 @@ CLEANFILES+= errlist.c
|
||||
isfinitef_ieee754.c isfinited_ieee754.c \
|
||||
signbitf_ieee754.c signbitd_ieee754.c \
|
||||
nanf.c
|
||||
.PATH.c: ${LIBCSRCDIR}/arch/${MACHINE_ARCH}/gen ${LIBCSRCDIR}/gen/minix \
|
||||
.PATH.c .PATH.S: ${LIBCSRCDIR}/arch/${MACHINE_ARCH}/gen ${LIBCSRCDIR}/gen/minix \
|
||||
${LIBCSRCDIR}/gen ${LIBCSRCDIR}
|
||||
SRCS+= ${i}
|
||||
CPPFLAGS.${i}+= -I${LIBCSRCDIR}/include
|
||||
.endfor
|
||||
CPPFLAGS.ctype_.c+= -I${LIBCSRCDIR}/locale
|
||||
CPPFLAGS.isctype.c+= -I${LIBCSRCDIR}/locale
|
||||
CPPFLAGS.tolower_.c+= -I${LIBCSRCDIR}/locale
|
||||
CPPFLAGS.toupper_.c+= -I${LIBCSRCDIR}/locale
|
||||
|
||||
# Import from regex
|
||||
.for i in regcomp.c regerror.c regexec.c regfree.c
|
||||
.PATH.c: ${LIBCSRCDIR}/regex
|
||||
SRCS+= ${i}
|
||||
CPPFLAGS.${i}+= -I${LIBCSRCDIR}/include
|
||||
.endfor
|
||||
|
||||
# Import from string
|
||||
.for i in strcspn.c strerror.c strerror_r.c strtol.c \
|
||||
bcopy.S bzero.S
|
||||
.PATH.S: ${LIBCSRCDIR}/arch/${MACHINE_ARCH}/string
|
||||
.PATH.c: ${LIBCSRCDIR}/string
|
||||
SRCS+= ${i}
|
||||
CPPFLAGS.${i}+= -D_LIBC -I${LIBCSRCDIR}/include
|
||||
CPPFLAGS.${i}+= -D_LIBC
|
||||
.endfor
|
||||
CPPFLAGS.strtol.c+= -I${LIBCSRCDIR}/../../common/lib/libc/stdlib
|
||||
|
||||
# Import from time
|
||||
.for i in asctime.c localtime.c strftime.c
|
||||
.PATH.c: ${LIBCSRCDIR}/time
|
||||
SRCS+= ${i}
|
||||
CPPFLAGS.${i}+= -I${LIBCSRCDIR}/include
|
||||
.endfor
|
||||
|
||||
# Import from locale
|
||||
.for i in _def_time.c
|
||||
.PATH.c: ${LIBCSRCDIR}/locale
|
||||
SRCS+= ${i}
|
||||
CPPFLAGS.${i}+= -I${LIBCSRCDIR}/include -I${LIBCSRCDIR}/locale
|
||||
CPPFLAGS.${i}+= -I${LIBCSRCDIR}/locale
|
||||
.endfor
|
||||
|
||||
# Import from sys-minix
|
||||
.for i in access.c brk.c close.c environ.c execve.c fork.c \
|
||||
getgid.c getpid.c getuid.c gettimeofday.c loadname.c \
|
||||
@@ -132,7 +147,6 @@ CPPFLAGS.${i}+= -I${LIBCSRCDIR}/include -I${LIBCSRCDIR}/locale
|
||||
.PATH.c: ${LIBCSRCDIR}/sys-minix
|
||||
.PATH.S: ${LIBCSRCDIR}/arch/${MACHINE_ARCH}/sys-minix
|
||||
SRCS+= ${i}
|
||||
CPPFLAGS.${i}+= -I${LIBCSRCDIR}/include
|
||||
.endfor
|
||||
|
||||
CPPFLAGS+= -D_LIBSYS
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
/* $NetBSD: findfp.c,v 1.25 2010/09/06 14:52:55 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* Chris Torek.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#define std(flags, file) \
|
||||
/* p r w flags file bf lfbsize cookie close */ \
|
||||
{ NULL, 0, 0, flags, file, { NULL, 0 }, 0, __sF + file, NULL, \
|
||||
/* read seek write ext up */ \
|
||||
NULL, NULL, NULL, { NULL, 0 }, NULL, \
|
||||
/* ur ubuf, nbuf lb blksize offset */ \
|
||||
0, { '\0', '\0', '\0' }, { '\0' }, { NULL, 0 }, 0, (fpos_t)0 }
|
||||
|
||||
FILE __sF[3] = {
|
||||
std(__SRD, STDIN_FILENO), /* stdin */
|
||||
std(__SWR, STDOUT_FILENO), /* stdout */
|
||||
std(__SWR|__SNBF, STDERR_FILENO) /* stderr */
|
||||
};
|
||||
@@ -1,7 +0,0 @@
|
||||
#include <stdlib.h>
|
||||
#include <minix/sysutil.h>
|
||||
|
||||
void abort()
|
||||
{
|
||||
panic("Abort.");
|
||||
}
|
||||
@@ -6,11 +6,10 @@ SRCS+= memchr.S memcmp.S memcpy.S memmove.S memset.S \
|
||||
.for i in infinityl.c
|
||||
.PATH.c: ${LIBCSRCDIR}/arch/${MACHINE_ARCH}/gen
|
||||
SRCS+= ${i}
|
||||
CPPFLAGS.${i}+= -I${LIBCSRCDIR}/include
|
||||
.endfor
|
||||
# Import from string
|
||||
.for i in bcmp.S
|
||||
.PATH.S: ${LIBCSRCDIR}/arch/${MACHINE_ARCH}/string
|
||||
SRCS+= ${i}
|
||||
CPPFLAGS.${i}+= -D_LIBC -I${LIBCSRCDIR}/include
|
||||
CPPFLAGS.${i}+= -D_LIBC
|
||||
.endfor
|
||||
|
||||
Reference in New Issue
Block a user