Full switch to clang/ELF. Drop ack. Simplify.

There is important information about booting non-ack images in
docs/UPDATING. ack/aout-format images can't be built any more, and
booting clang/ELF-format ones is a little different. Updating to the
new boot monitor is recommended.

Changes in this commit:

	. drop boot monitor -> allowing dropping ack support
	. facility to copy ELF boot files to /boot so that old boot monitor
	  can still boot fairly easily, see UPDATING
	. no more ack-format libraries -> single-case libraries
	. some cleanup of OBJECT_FMT, COMPILER_TYPE, etc cases
	. drop several ack toolchain commands, but not all support
	  commands (e.g. aal is gone but acksize is not yet).
	. a few libc files moved to netbsd libc dir
	. new /bin/date as minix date used code in libc/
	. test compile fix
	. harmonize includes
	. /usr/lib is no longer special: without ack, /usr/lib plays no
	  kind of special bootstrapping role any more and bootstrapping
	  is done exclusively through packages, so releases depend even
	  less on the state of the machine making them now.
	. rename nbsd_lib* to lib*
	. reduce mtree
This commit is contained in:
Ben Gras
2012-02-11 19:31:25 +01:00
parent 2487445f5f
commit 2fe8fb192f
5056 changed files with 16216 additions and 133169 deletions

View File

@@ -1,267 +1,64 @@
/* inttypes.h - Format conversions of integer types.
* Author: Kees J. Bot
* 4 Oct 2003
* Assumptions and bugs the same as for <stdint.h>
* Bug: Wide character integer conversion functions missing.
/* $NetBSD: inttypes.h,v 1.7 2009/11/15 22:21:03 christos Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Klaus Klein.
*
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
*/
#ifndef _INTTYPES_H
#define _INTTYPES_H
#ifndef _INTTYPES_H_
#define _INTTYPES_H_
#ifndef _STDINT_H
#include <stdint.h>
#include <sys/cdefs.h>
#include <sys/inttypes.h>
#include <machine/ansi.h>
#if defined(_BSD_WCHAR_T_) && !defined(__cplusplus)
typedef _BSD_WCHAR_T_ wchar_t;
#undef _BSD_WCHAR_T_
#endif
#if !__cplusplus || defined(__STDC_FORMAT_MACROS)
__BEGIN_DECLS
intmax_t strtoimax(const char * __restrict,
char ** __restrict, int);
uintmax_t strtoumax(const char * __restrict,
char ** __restrict, int);
intmax_t wcstoimax(const wchar_t * __restrict,
wchar_t ** __restrict, int);
uintmax_t wcstoumax(const wchar_t * __restrict,
wchar_t ** __restrict, int);
/* Macros to print integers defined in <stdint.h>. The first group should
* not be used in code, they're merely here to build the second group.
* (The standard really went overboard here, only the first group is needed.)
*/
#define PRI8 ""
#define PRILEAST8 ""
#define PRIFAST8 ""
#define PRI16 ""
#define PRILEAST16 ""
#define PRIFAST16 ""
intmax_t imaxabs(intmax_t);
#if __SIZEOF_LONG__ > 4
#define PRI32 ""
#else
#define PRI32 "l"
#endif
#define PRILEAST32 PRI32
#define PRIFAST32 PRI32
typedef struct {
intmax_t quot;
intmax_t rem;
} imaxdiv_t;
#if defined(__LONG_LONG_SUPPORTED)
#define PRI64 "ll"
#elif _WORD_SIZE > 2 && __L64
#define PRI64 "l"
#endif
imaxdiv_t imaxdiv(intmax_t, intmax_t);
__END_DECLS
#ifdef PRI64
#define PRILEAST64 PRI64
#define PRIFAST64 PRI64
#define PRIMAX PRI64
#else
#define PRIMAX PRI32
#endif
#if _PTR_SIZE == _WORD_SIZE
#define PRIPTR ""
#elif _PTR_SIZE == 2*_WORD_SIZE
#define PRIPTR "l"
#endif
/* Macros for fprintf, the ones defined by the standard. */
#define PRId8 PRI8"d"
#define PRIdLEAST8 PRILEAST8"d"
#define PRIdFAST8 PRIFAST8"d"
#define PRId16 PRI16"d"
#define PRIdLEAST16 PRILEAST16"d"
#define PRIdFAST16 PRIFAST16"d"
#define PRId32 PRI32"d"
#define PRIdLEAST32 PRILEAST32"d"
#define PRIdFAST32 PRIFAST32"d"
#ifdef PRI64
#define PRId64 PRI64"d"
#define PRIdLEAST64 PRILEAST64"d"
#define PRIdFAST64 PRIFAST64"d"
#endif
#define PRIdMAX PRIMAX"d"
#define PRIdPTR PRIPTR"d"
#define PRIi8 PRI8"i"
#define PRIiLEAST8 PRILEAST8"i"
#define PRIiFAST8 PRIFAST8"i"
#define PRIi16 PRI16"i"
#define PRIiLEAST16 PRILEAST16"i"
#define PRIiFAST16 PRIFAST16"i"
#define PRIi32 PRI32"i"
#define PRIiLEAST32 PRILEAST32"i"
#define PRIiFAST32 PRIFAST32"i"
#ifdef PRI64
#define PRIi64 PRI64"i"
#define PRIiLEAST64 PRILEAST64"i"
#define PRIiFAST64 PRIFAST64"i"
#endif
#define PRIiMAX PRIMAX"i"
#define PRIiPTR PRIPTR"i"
#define PRIo8 PRI8"o"
#define PRIoLEAST8 PRILEAST8"o"
#define PRIoFAST8 PRIFAST8"o"
#define PRIo16 PRI16"o"
#define PRIoLEAST16 PRILEAST16"o"
#define PRIoFAST16 PRIFAST16"o"
#define PRIo32 PRI32"o"
#define PRIoLEAST32 PRILEAST32"o"
#define PRIoFAST32 PRIFAST32"o"
#ifdef PRI64
#define PRIo64 PRI64"o"
#define PRIoLEAST64 PRILEAST64"o"
#define PRIoFAST64 PRIFAST64"o"
#endif
#define PRIoMAX PRIMAX"o"
#define PRIoPTR PRIPTR"o"
#define PRIu8 PRI8"u"
#define PRIuLEAST8 PRILEAST8"u"
#define PRIuFAST8 PRIFAST8"u"
#define PRIu16 PRI16"u"
#define PRIuLEAST16 PRILEAST16"u"
#define PRIuFAST16 PRIFAST16"u"
#define PRIu32 PRI32"u"
#define PRIuLEAST32 PRILEAST32"u"
#define PRIuFAST32 PRIFAST32"u"
#ifdef PRI64
#define PRIu64 PRI64"u"
#define PRIuLEAST64 PRILEAST64"u"
#define PRIuFAST64 PRIFAST64"u"
#endif
#define PRIuMAX PRIMAX"u"
#define PRIuPTR PRIPTR"u"
#define PRIx8 PRI8"x"
#define PRIxLEAST8 PRILEAST8"x"
#define PRIxFAST8 PRIFAST8"x"
#define PRIx16 PRI16"x"
#define PRIxLEAST16 PRILEAST16"x"
#define PRIxFAST16 PRIFAST16"x"
#define PRIx32 PRI32"x"
#define PRIxLEAST32 PRILEAST32"x"
#define PRIxFAST32 PRIFAST32"x"
#ifdef PRI64
#define PRIx64 PRI64"x"
#define PRIxLEAST64 PRILEAST64"x"
#define PRIxFAST64 PRIFAST64"x"
#endif
#define PRIxMAX PRIMAX"x"
#define PRIxPTR PRIPTR"x"
#define PRIX8 PRI8"X"
#define PRIXLEAST8 PRILEAST8"X"
#define PRIXFAST8 PRIFAST8"X"
#define PRIX16 PRI16"X"
#define PRIXLEAST16 PRILEAST16"X"
#define PRIXFAST16 PRIFAST16"X"
#define PRIX32 PRI32"X"
#define PRIXLEAST32 PRILEAST32"X"
#define PRIXFAST32 PRIFAST32"X"
#ifdef PRI64
#define PRIX64 PRI64"X"
#define PRIXLEAST64 PRILEAST64"X"
#define PRIXFAST64 PRIFAST64"X"
#endif
#define PRIXMAX PRIMAX"X"
#define PRIXPTR PRIPTR"X"
/* Macros to scan integers with fscanf(), nonstandard first group. */
#define SCN8 "hh"
#define SCNLEAST8 "hh"
#define SCNFAST8 ""
#define SCN16 "h"
#define SCNLEAST16 "h"
#define SCNFAST16 ""
#if _WORD_SIZE == 2
#define SCN32 "l"
#define SCNLEAST32 "l"
#define SCNFAST32 "l"
#else
#define SCN32 ""
#define SCNLEAST32 ""
#define SCNFAST32 ""
#endif
#if _WORD_SIZE > 2 && __L64
#define SCN64 "l"
#define SCNLEAST64 "l"
#define SCNFAST64 "l"
#endif
/* Macros for fscanf, the ones defined by the standard. */
#define SCNd8 SCN8"d"
#define SCNdLEAST8 SCNLEAST8"d"
#define SCNdFAST8 SCNFAST8"d"
#define SCNd16 SCN16"d"
#define SCNdLEAST16 SCNLEAST16"d"
#define SCNdFAST16 SCNFAST16"d"
#define SCNd32 SCN32"d"
#define SCNdLEAST32 SCNLEAST32"d"
#define SCNdFAST32 SCNFAST32"d"
#if _WORD_SIZE > 2 && __L64
#define SCNd64 SCN64"d"
#define SCNdLEAST64 SCNLEAST64"d"
#define SCNdFAST64 SCNFAST64"d"
#endif
#define SCNi8 SCN8"i"
#define SCNiLEAST8 SCNLEAST8"i"
#define SCNiFAST8 SCNFAST8"i"
#define SCNi16 SCN16"i"
#define SCNiLEAST16 SCNLEAST16"i"
#define SCNiFAST16 SCNFAST16"i"
#define SCNi32 SCN32"i"
#define SCNiLEAST32 SCNLEAST32"i"
#define SCNiFAST32 SCNFAST32"i"
#if _WORD_SIZE > 2 && __L64
#define SCNi64 SCN64"i"
#define SCNiLEAST64 SCNLEAST64"i"
#define SCNiFAST64 SCNFAST64"i"
#endif
#define SCNo8 SCN8"o"
#define SCNoLEAST8 SCNLEAST8"o"
#define SCNoFAST8 SCNFAST8"o"
#define SCNo16 SCN16"o"
#define SCNoLEAST16 SCNLEAST16"o"
#define SCNoFAST16 SCNFAST16"o"
#define SCNo32 SCN32"o"
#define SCNoLEAST32 SCNLEAST32"o"
#define SCNoFAST32 SCNFAST32"o"
#if _WORD_SIZE > 2 && __L64
#define SCNo64 SCN64"o"
#define SCNoLEAST64 SCNLEAST64"o"
#define SCNoFAST64 SCNFAST64"o"
#endif
#define SCNu8 SCN8"u"
#define SCNuLEAST8 SCNLEAST8"u"
#define SCNuFAST8 SCNFAST8"u"
#define SCNu16 SCN16"u"
#define SCNuLEAST16 SCNLEAST16"u"
#define SCNuFAST16 SCNFAST16"u"
#define SCNu32 SCN32"u"
#define SCNuLEAST32 SCNLEAST32"u"
#define SCNuFAST32 SCNFAST32"u"
#if _WORD_SIZE > 2 && __L64
#define SCNu64 SCN64"u"
#define SCNuLEAST64 SCNLEAST64"u"
#define SCNuFAST64 SCNFAST64"u"
#endif
#define SCNx8 SCN8"x"
#define SCNxLEAST8 SCNLEAST8"x"
#define SCNxFAST8 SCNFAST8"x"
#define SCNx16 SCN16"x"
#define SCNxLEAST16 SCNLEAST16"x"
#define SCNxFAST16 SCNFAST16"x"
#define SCNx32 SCN32"x"
#define SCNxLEAST32 SCNLEAST32"x"
#define SCNxFAST32 SCNFAST32"x"
#if _WORD_SIZE > 2 && __L64
#define SCNx64 SCN64"x"
#define SCNxLEAST64 SCNLEAST64"x"
#define SCNxFAST64 SCNFAST64"x"
#endif
#endif /* !__cplusplus || __STDC_FORMAT_MACROS */
/* Integer conversion functions for [u]intmax_t. */
#ifdef __LONG_LONG_SUPPORTED
#define stroimax(nptr, endptr, base) strtoll(nptr, endptr, base)
#define stroumax(nptr, endptr, base) strtoull(nptr, endptr, base)
#else
#define stroimax(nptr, endptr, base) strtol(nptr, endptr, base)
#define stroumax(nptr, endptr, base) strtoul(nptr, endptr, base)
#endif
#endif /* _INTTYPES_H */
#endif /* !_INTTYPES_H_ */