uclibc: Remove 0.9.33 recipes

git recipes are stable enough and contains the fixes needed
to run with modern systems e.g. systemd etc. Drop 0.9.33
We already use git as default.

(From OE-Core rev: 05ae8f181e4e1699cf8e5d8bc20b3cbd4b532edf)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Khem Raj 2013-06-30 18:37:45 -07:00 committed by Richard Purdie
parent 0188270f8c
commit 0ab7cfc8e9
19 changed files with 0 additions and 7358 deletions

View File

@ -1,23 +0,0 @@
SRCREV = "fec308fdfaf9f557ef5fb17c308c48259012b825"
PR = "${INC_PR}.3"
SRC_URI = "git://uclibc.org/uClibc.git;branch=${PV};protocol=git \
file://uClibc.machine \
file://uClibc.distro \
file://uclibc_enable_log2_test.patch \
file://ldso_use_arm_dl_linux_resolve_in_thumb_mode.patch \
file://powerpc_copysignl.patch \
file://argp-support.patch \
file://argp-headers.patch \
file://remove_attribute_optimize_Os.patch \
file://compile-arm-fork-with-O2.patch \
file://uclibc-execvpe.patch \
file://orign_path.patch \
file://dup3.patch \
file://define-MSG_CMSG_CLOEXEC.patch \
file://posix_fallocate.patch \
file://mount.h-update.patch \
"
S = "${WORKDIR}/git"

View File

@ -1,583 +0,0 @@
Added headers file needed by argp sources.
Signed-off-by: Salvatore Cro <salvatore.cro at st.com>
---
include/argp.h | 566 ++++++++++++++++++++++++++++++++++++++++++++
libc/argp/argp-fmtstream.h | 314 ++++++++++++++++++++++++
2 files changed, 880 insertions(+), 0 deletions(-)
create mode 100644 include/argp.h
create mode 100644 libc/argp/argp-fmtstream.h
Upstream-Status: Pending
Index: git/include/argp.h
===================================================================
--- /dev/null
+++ git/include/argp.h
@@ -0,0 +1,566 @@
+/* Hierarchial argument parsing, layered over getopt.
+ Copyright (C) 1995-1999, 2003, 2004, 2005, 2006, 2007, 2009
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Written by Miles Bader <miles at gnu.ai.mit.edu>.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA.
+
+ Modified for uClibc by: Salvatore Cro <salvatore.cro at st.com>
+*/
+
+#ifndef _ARGP_H
+#define _ARGP_H
+
+#include <stdio.h>
+#include <ctype.h>
+#include <limits.h>
+
+#define __need_error_t
+#include <errno.h>
+
+#ifndef __const
+# define __const const
+#endif
+
+#ifndef __THROW
+# define __THROW
+#endif
+#ifndef __NTH
+# define __NTH(fct) fct __THROW
+#endif
+
+#ifndef __attribute__
+/* This feature is available in gcc versions 2.5 and later. */
+# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || defined(__STRICT_ANSI__)
+# define __attribute__(Spec) /* empty */
+# endif
+/* The __-protected variants of `format' and `printf' attributes
+ are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
+# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) || defined(__STRICT_ANSI__)
+# define __format__ format
+# define __printf__ printf
+# endif
+#endif
+
+/* GCC 2.95 and later have "__restrict"; C99 compilers have
+ "restrict", and "configure" may have defined "restrict". */
+#ifndef __restrict
+# if ! (2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__))
+# if defined restrict || 199901L <= __STDC_VERSION__
+# define __restrict restrict
+# else
+# define __restrict
+# endif
+# endif
+#endif
+
+#ifndef __error_t_defined
+typedef int error_t;
+# define __error_t_defined
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* A description of a particular option. A pointer to an array of
+ these is passed in the OPTIONS field of an argp structure. Each option
+ entry can correspond to one long option and/or one short option; more
+ names for the same option can be added by following an entry in an option
+ array with options having the OPTION_ALIAS flag set. */
+struct argp_option
+{
+ /* The long option name. For more than one name for the same option, you
+ can use following options with the OPTION_ALIAS flag set. */
+ __const char *name;
+
+ /* What key is returned for this option. If > 0 and printable, then it's
+ also accepted as a short option. */
+ int key;
+
+ /* If non-NULL, this is the name of the argument associated with this
+ option, which is required unless the OPTION_ARG_OPTIONAL flag is set. */
+ __const char *arg;
+
+ /* OPTION_ flags. */
+ int flags;
+
+ /* The doc string for this option. If both NAME and KEY are 0, This string
+ will be printed outdented from the normal option column, making it
+ useful as a group header (it will be the first thing printed in its
+ group); in this usage, it's conventional to end the string with a `:'. */
+ __const char *doc;
+
+ /* The group this option is in. In a long help message, options are sorted
+ alphabetically within each group, and the groups presented in the order
+ 0, 1, 2, ..., n, -m, ..., -2, -1. Every entry in an options array with
+ if this field 0 will inherit the group number of the previous entry, or
+ zero if it's the first one, unless its a group header (NAME and KEY both
+ 0), in which case, the previous entry + 1 is the default. Automagic
+ options such as --help are put into group -1. */
+ int group;
+};
+
+/* The argument associated with this option is optional. */
+#define OPTION_ARG_OPTIONAL 0x1
+
+/* This option isn't displayed in any help messages. */
+#define OPTION_HIDDEN 0x2
+
+/* This option is an alias for the closest previous non-alias option. This
+ means that it will be displayed in the same help entry, and will inherit
+ fields other than NAME and KEY from the aliased option. */
+#define OPTION_ALIAS 0x4
+
+/* This option isn't actually an option (and so should be ignored by the
+ actual option parser), but rather an arbitrary piece of documentation that
+ should be displayed in much the same manner as the options. If this flag
+ is set, then the option NAME field is displayed unmodified (e.g., no `--'
+ prefix is added) at the left-margin (where a *short* option would normally
+ be displayed), and the documentation string in the normal place. For
+ purposes of sorting, any leading whitespace and punctuation is ignored,
+ except that if the first non-whitespace character is not `-', this entry
+ is displayed after all options (and OPTION_DOC entries with a leading `-')
+ in the same group. */
+#define OPTION_DOC 0x8
+
+/* This option shouldn't be included in `long' usage messages (but is still
+ included in help messages). This is mainly intended for options that are
+ completely documented in an argp's ARGS_DOC field, in which case including
+ the option in the generic usage list would be redundant. For instance,
+ if ARGS_DOC is "FOO BAR\n-x BLAH", and the `-x' option's purpose is to
+ distinguish these two cases, -x should probably be marked
+ OPTION_NO_USAGE. */
+#define OPTION_NO_USAGE 0x10
+
+struct argp; /* fwd declare this type */
+struct argp_state; /* " */
+struct argp_child; /* " */
+
+/* The type of a pointer to an argp parsing function. */
+typedef error_t (*argp_parser_t) (int __key, char *__arg,
+ struct argp_state *__state);
+
+/* What to return for unrecognized keys. For special ARGP_KEY_ keys, such
+ returns will simply be ignored. For user keys, this error will be turned
+ into EINVAL (if the call to argp_parse is such that errors are propagated
+ back to the user instead of exiting); returning EINVAL itself would result
+ in an immediate stop to parsing in *all* cases. */
+#define ARGP_ERR_UNKNOWN E2BIG /* Hurd should never need E2BIG. XXX */
+
+/* Special values for the KEY argument to an argument parsing function.
+ ARGP_ERR_UNKNOWN should be returned if they aren't understood.
+
+ The sequence of keys to a parsing function is either (where each
+ uppercased word should be prefixed by `ARGP_KEY_' and opt is a user key):
+
+ INIT opt... NO_ARGS END SUCCESS -- No non-option arguments at all
+ or INIT (opt | ARG)... END SUCCESS -- All non-option args parsed
+ or INIT (opt | ARG)... SUCCESS -- Some non-option arg unrecognized
+
+ The third case is where every parser returned ARGP_KEY_UNKNOWN for an
+ argument, in which case parsing stops at that argument (returning the
+ unparsed arguments to the caller of argp_parse if requested, or stopping
+ with an error message if not).
+
+ If an error occurs (either detected by argp, or because the parsing
+ function returned an error value), then the parser is called with
+ ARGP_KEY_ERROR, and no further calls are made. */
+
+/* This is not an option at all, but rather a command line argument. If a
+ parser receiving this key returns success, the fact is recorded, and the
+ ARGP_KEY_NO_ARGS case won't be used. HOWEVER, if while processing the
+ argument, a parser function decrements the NEXT field of the state it's
+ passed, the option won't be considered processed; this is to allow you to
+ actually modify the argument (perhaps into an option), and have it
+ processed again. */
+#define ARGP_KEY_ARG 0
+/* There are remaining arguments not parsed by any parser, which may be found
+ starting at (STATE->argv + STATE->next). If success is returned, but
+ STATE->next left untouched, it's assumed that all arguments were consume,
+ otherwise, the parser should adjust STATE->next to reflect any arguments
+ consumed. */
+#define ARGP_KEY_ARGS 0x1000006
+/* There are no more command line arguments at all. */
+#define ARGP_KEY_END 0x1000001
+/* Because it's common to want to do some special processing if there aren't
+ any non-option args, user parsers are called with this key if they didn't
+ successfully process any non-option arguments. Called just before
+ ARGP_KEY_END (where more general validity checks on previously parsed
+ arguments can take place). */
+#define ARGP_KEY_NO_ARGS 0x1000002
+/* Passed in before any parsing is done. Afterwards, the values of each
+ element of the CHILD_INPUT field, if any, in the state structure is
+ copied to each child's state to be the initial value of the INPUT field. */
+#define ARGP_KEY_INIT 0x1000003
+/* Use after all other keys, including SUCCESS & END. */
+#define ARGP_KEY_FINI 0x1000007
+/* Passed in when parsing has successfully been completed (even if there are
+ still arguments remaining). */
+#define ARGP_KEY_SUCCESS 0x1000004
+/* Passed in if an error occurs. */
+#define ARGP_KEY_ERROR 0x1000005
+
+/* An argp structure contains a set of options declarations, a function to
+ deal with parsing one, documentation string, a possible vector of child
+ argp's, and perhaps a function to filter help output. When actually
+ parsing options, getopt is called with the union of all the argp
+ structures chained together through their CHILD pointers, with conflicts
+ being resolved in favor of the first occurrence in the chain. */
+struct argp
+{
+ /* An array of argp_option structures, terminated by an entry with both
+ NAME and KEY having a value of 0. */
+ __const struct argp_option *options;
+
+ /* What to do with an option from this structure. KEY is the key
+ associated with the option, and ARG is any associated argument (NULL if
+ none was supplied). If KEY isn't understood, ARGP_ERR_UNKNOWN should be
+ returned. If a non-zero, non-ARGP_ERR_UNKNOWN value is returned, then
+ parsing is stopped immediately, and that value is returned from
+ argp_parse(). For special (non-user-supplied) values of KEY, see the
+ ARGP_KEY_ definitions below. */
+ argp_parser_t parser;
+
+ /* A string describing what other arguments are wanted by this program. It
+ is only used by argp_usage to print the `Usage:' message. If it
+ contains newlines, the strings separated by them are considered
+ alternative usage patterns, and printed on separate lines (lines after
+ the first are prefix by ` or: ' instead of `Usage:'). */
+ __const char *args_doc;
+
+ /* If non-NULL, a string containing extra text to be printed before and
+ after the options in a long help message (separated by a vertical tab
+ `\v' character). */
+ __const char *doc;
+
+ /* A vector of argp_children structures, terminated by a member with a 0
+ argp field, pointing to child argps should be parsed with this one. Any
+ conflicts are resolved in favor of this argp, or early argps in the
+ CHILDREN list. This field is useful if you use libraries that supply
+ their own argp structure, which you want to use in conjunction with your
+ own. */
+ __const struct argp_child *children;
+
+ /* If non-zero, this should be a function to filter the output of help
+ messages. KEY is either a key from an option, in which case TEXT is
+ that option's help text, or a special key from the ARGP_KEY_HELP_
+ defines, below, describing which other help text TEXT is. The function
+ should return either TEXT, if it should be used as-is, a replacement
+ string, which should be malloced, and will be freed by argp, or NULL,
+ meaning `print nothing'. The value for TEXT is *after* any translation
+ has been done, so if any of the replacement text also needs translation,
+ that should be done by the filter function. INPUT is either the input
+ supplied to argp_parse, or NULL, if argp_help was called directly. */
+ char *(*help_filter) (int __key, __const char *__text, void *__input);
+
+ /* If non-zero the strings used in the argp library are translated using
+ the domain described by this string. Otherwise the currently installed
+ default domain is used. */
+ const char *argp_domain;
+};
+
+/* Possible KEY arguments to a help filter function. */
+#define ARGP_KEY_HELP_PRE_DOC 0x2000001 /* Help text preceeding options. */
+#define ARGP_KEY_HELP_POST_DOC 0x2000002 /* Help text following options. */
+#define ARGP_KEY_HELP_HEADER 0x2000003 /* Option header string. */
+#define ARGP_KEY_HELP_EXTRA 0x2000004 /* After all other documentation;
+ TEXT is NULL for this key. */
+/* Explanatory note emitted when duplicate option arguments have been
+ suppressed. */
+#define ARGP_KEY_HELP_DUP_ARGS_NOTE 0x2000005
+#define ARGP_KEY_HELP_ARGS_DOC 0x2000006 /* Argument doc string. */
+
+/* When an argp has a non-zero CHILDREN field, it should point to a vector of
+ argp_child structures, each of which describes a subsidiary argp. */
+struct argp_child
+{
+ /* The child parser. */
+ __const struct argp *argp;
+
+ /* Flags for this child. */
+ int flags;
+
+ /* If non-zero, an optional header to be printed in help output before the
+ child options. As a side-effect, a non-zero value forces the child
+ options to be grouped together; to achieve this effect without actually
+ printing a header string, use a value of "". */
+ __const char *header;
+
+ /* Where to group the child options relative to the other (`consolidated')
+ options in the parent argp; the values are the same as the GROUP field
+ in argp_option structs, but all child-groupings follow parent options at
+ a particular group level. If both this field and HEADER are zero, then
+ they aren't grouped at all, but rather merged with the parent options
+ (merging the child's grouping levels with the parents). */
+ int group;
+};
+
+/* Parsing state. This is provided to parsing functions called by argp,
+ which may examine and, as noted, modify fields. */
+struct argp_state
+{
+ /* The top level ARGP being parsed. */
+ __const struct argp *root_argp;
+
+ /* The argument vector being parsed. May be modified. */
+ int argc;
+ char **argv;
+
+ /* The index in ARGV of the next arg that to be parsed. May be modified. */
+ int next;
+
+ /* The flags supplied to argp_parse. May be modified. */
+ unsigned flags;
+
+ /* While calling a parsing function with a key of ARGP_KEY_ARG, this is the
+ number of the current arg, starting at zero, and incremented after each
+ such call returns. At all other times, this is the number of such
+ arguments that have been processed. */
+ unsigned arg_num;
+
+ /* If non-zero, the index in ARGV of the first argument following a special
+ `--' argument (which prevents anything following being interpreted as an
+ option). Only set once argument parsing has proceeded past this point. */
+ int quoted;
+
+ /* An arbitrary pointer passed in from the user. */
+ void *input;
+ /* Values to pass to child parsers. This vector will be the same length as
+ the number of children for the current parser. */
+ void **child_inputs;
+
+ /* For the parser's use. Initialized to 0. */
+ void *hook;
+
+ /* The name used when printing messages. This is initialized to ARGV[0],
+ or PROGRAM_INVOCATION_NAME if that is unavailable. */
+ char *name;
+
+ /* Streams used when argp prints something. */
+ FILE *err_stream; /* For errors; initialized to stderr. */
+ FILE *out_stream; /* For information; initialized to stdout. */
+
+ void *pstate; /* Private, for use by argp. */
+};
+
+/* Flags for argp_parse (note that the defaults are those that are
+ convenient for program command line parsing): */
+
+/* Don't ignore the first element of ARGV. Normally (and always unless
+ ARGP_NO_ERRS is set) the first element of the argument vector is
+ skipped for option parsing purposes, as it corresponds to the program name
+ in a command line. */
+#define ARGP_PARSE_ARGV0 0x01
+
+/* Don't print error messages for unknown options to stderr; unless this flag
+ is set, ARGP_PARSE_ARGV0 is ignored, as ARGV[0] is used as the program
+ name in the error messages. This flag implies ARGP_NO_EXIT (on the
+ assumption that silent exiting upon errors is bad behaviour). */
+#define ARGP_NO_ERRS 0x02
+
+/* Don't parse any non-option args. Normally non-option args are parsed by
+ calling the parse functions with a key of ARGP_KEY_ARG, and the actual arg
+ as the value. Since it's impossible to know which parse function wants to
+ handle it, each one is called in turn, until one returns 0 or an error
+ other than ARGP_ERR_UNKNOWN; if an argument is handled by no one, the
+ argp_parse returns prematurely (but with a return value of 0). If all
+ args have been parsed without error, all parsing functions are called one
+ last time with a key of ARGP_KEY_END. This flag needn't normally be set,
+ as the normal behavior is to stop parsing as soon as some argument can't
+ be handled. */
+#define ARGP_NO_ARGS 0x04
+
+/* Parse options and arguments in the same order they occur on the command
+ line -- normally they're rearranged so that all options come first. */
+#define ARGP_IN_ORDER 0x08
+
+/* Don't provide the standard long option --help, which causes usage and
+ option help information to be output to stdout, and exit (0) called. */
+#define ARGP_NO_HELP 0x10
+
+/* Don't exit on errors (they may still result in error messages). */
+#define ARGP_NO_EXIT 0x20
+
+/* Use the gnu getopt `long-only' rules for parsing arguments. */
+#define ARGP_LONG_ONLY 0x40
+
+/* Turns off any message-printing/exiting options. */
+#define ARGP_SILENT (ARGP_NO_EXIT | ARGP_NO_ERRS | ARGP_NO_HELP)
+
+/* Parse the options strings in ARGC & ARGV according to the options in ARGP.
+ FLAGS is one of the ARGP_ flags above. If ARG_INDEX is non-NULL, the
+ index in ARGV of the first unparsed option is returned in it. If an
+ unknown option is present, ARGP_ERR_UNKNOWN is returned; if some parser
+ routine returned a non-zero value, it is returned; otherwise 0 is
+ returned. This function may also call exit unless the ARGP_NO_HELP flag
+ is set. INPUT is a pointer to a value to be passed in to the parser. */
+extern error_t argp_parse (__const struct argp *__restrict __argp,
+ int __argc, char **__restrict __argv,
+ unsigned __flags, int *__restrict __arg_index,
+ void *__restrict __input);
+
+/* Global variables. */
+
+/* If defined or set by the user program to a non-zero value, then a default
+ option --version is added (unless the ARGP_NO_HELP flag is used), which
+ will print this string followed by a newline and exit (unless the
+ ARGP_NO_EXIT flag is used). Overridden by ARGP_PROGRAM_VERSION_HOOK. */
+extern __const char *argp_program_version;
+
+/* If defined or set by the user program to a non-zero value, then a default
+ option --version is added (unless the ARGP_NO_HELP flag is used), which
+ calls this function with a stream to print the version to and a pointer to
+ the current parsing state, and then exits (unless the ARGP_NO_EXIT flag is
+ used). This variable takes precedent over ARGP_PROGRAM_VERSION. */
+extern void (*argp_program_version_hook) (FILE *__restrict __stream,
+ struct argp_state *__restrict
+ __state);
+
+/* If defined or set by the user program, it should point to string that is
+ the bug-reporting address for the program. It will be printed by
+ argp_help if the ARGP_HELP_BUG_ADDR flag is set (as it is by various
+ standard help messages), embedded in a sentence that says something like
+ `Report bugs to ADDR.'. */
+extern __const char *argp_program_bug_address;
+
+/* The exit status that argp will use when exiting due to a parsing error.
+ If not defined or set by the user program, this defaults to EX_USAGE from
+ <sysexits.h>. */
+extern error_t argp_err_exit_status;
+
+/* Flags for argp_help. */
+#define ARGP_HELP_USAGE 0x01 /* a Usage: message. */
+#define ARGP_HELP_SHORT_USAGE 0x02 /* " but don't actually print options. */
+#define ARGP_HELP_SEE 0x04 /* a `Try ... for more help' message. */
+#define ARGP_HELP_LONG 0x08 /* a long help message. */
+#define ARGP_HELP_PRE_DOC 0x10 /* doc string preceding long help. */
+#define ARGP_HELP_POST_DOC 0x20 /* doc string following long help. */
+#define ARGP_HELP_DOC (ARGP_HELP_PRE_DOC | ARGP_HELP_POST_DOC)
+#define ARGP_HELP_BUG_ADDR 0x40 /* bug report address */
+#define ARGP_HELP_LONG_ONLY 0x80 /* modify output appropriately to
+ reflect ARGP_LONG_ONLY mode. */
+
+/* These ARGP_HELP flags are only understood by argp_state_help. */
+#define ARGP_HELP_EXIT_ERR 0x100 /* Call exit(1) instead of returning. */
+#define ARGP_HELP_EXIT_OK 0x200 /* Call exit(0) instead of returning. */
+
+/* The standard thing to do after a program command line parsing error, if an
+ error message has already been printed. */
+#define ARGP_HELP_STD_ERR \
+ (ARGP_HELP_SEE | ARGP_HELP_EXIT_ERR)
+/* The standard thing to do after a program command line parsing error, if no
+ more specific error message has been printed. */
+#define ARGP_HELP_STD_USAGE \
+ (ARGP_HELP_SHORT_USAGE | ARGP_HELP_SEE | ARGP_HELP_EXIT_ERR)
+/* The standard thing to do in response to a --help option. */
+#define ARGP_HELP_STD_HELP \
+ (ARGP_HELP_SHORT_USAGE | ARGP_HELP_LONG | ARGP_HELP_EXIT_OK \
+ | ARGP_HELP_DOC | ARGP_HELP_BUG_ADDR)
+
+/* Output a usage message for ARGP to STREAM. FLAGS are from the set
+ ARGP_HELP_*. */
+extern void argp_help (__const struct argp *__restrict __argp,
+ FILE *__restrict __stream,
+ unsigned __flags, char *__restrict __name);
+
+/* The following routines are intended to be called from within an argp
+ parsing routine (thus taking an argp_state structure as the first
+ argument). They may or may not print an error message and exit, depending
+ on the flags in STATE -- in any case, the caller should be prepared for
+ them *not* to exit, and should return an appropiate error after calling
+ them. [argp_usage & argp_error should probably be called argp_state_...,
+ but they're used often enough that they should be short] */
+
+/* Output, if appropriate, a usage message for STATE to STREAM. FLAGS are
+ from the set ARGP_HELP_*. */
+extern void argp_state_help (__const struct argp_state *__restrict __state,
+ FILE *__restrict __stream,
+ unsigned int __flags);
+/* Possibly output the standard usage message for ARGP to stderr and exit. */
+extern void argp_usage (__const struct argp_state *__state);
+
+/* If appropriate, print the printf string FMT and following args, preceded
+ by the program name and `:', to stderr, and followed by a `Try ... --help'
+ message, then exit (1). */
+extern void argp_error (__const struct argp_state *__restrict __state,
+ __const char *__restrict __fmt, ...)
+ __attribute__ ((__format__ (__printf__, 2, 3)));
+/* Similar to the standard gnu error-reporting function error(), but will
+ respect the ARGP_NO_EXIT and ARGP_NO_ERRS flags in STATE, and will print
+ to STATE->err_stream. This is useful for argument parsing code that is
+ shared between program startup (when exiting is desired) and runtime
+ option parsing (when typically an error code is returned instead). The
+ difference between this function and argp_error is that the latter is for
+ *parsing errors*, and the former is for other problems that occur during
+ parsing but don't reflect a (syntactic) problem with the input. */
+extern void argp_failure (__const struct argp_state *__restrict __state,
+ int __status, int __errnum,
+ __const char *__restrict __fmt, ...)
+ __attribute__ ((__format__ (__printf__, 4, 5)));
+/* Returns true if the option OPT is a valid short option. */
+extern int _option_is_short (__const struct argp_option *__opt) __THROW;
+extern int __option_is_short (__const struct argp_option *__opt) __THROW;
+
+/* Returns true if the option OPT is in fact the last (unused) entry in an
+ options array. */
+extern int _option_is_end (__const struct argp_option *__opt) __THROW;
+extern int __option_is_end (__const struct argp_option *__opt) __THROW;
+
+/* Return the input field for ARGP in the parser corresponding to STATE; used
+ by the help routines. */
+/* We think this should not be exported */
+extern void *__argp_input (__const struct argp *__restrict __argp,
+ __const struct argp_state *__restrict __state)
+ __THROW;
+
+#ifdef __USE_EXTERN_INLINES
+
+# ifndef ARGP_EI
+# define ARGP_EI __extern_inline
+# endif
+
+ARGP_EI void
+argp_usage (__const struct argp_state *__state)
+{
+ argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE);
+}
+
+ARGP_EI int
+__NTH (__option_is_short (__const struct argp_option *__opt))
+{
+ if (__opt->flags & OPTION_DOC)
+ return 0;
+ else
+ {
+ int __key = __opt->key;
+ return __key > 0 && __key <= UCHAR_MAX && isprint (__key);
+ }
+}
+
+ARGP_EI int
+__NTH (__option_is_end (__const struct argp_option *__opt))
+{
+ return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
+}
+#endif /* Use extern inlines. */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* argp.h */

File diff suppressed because it is too large Load Diff

View File

@ -1,21 +0,0 @@
When compiling in thumb mode for arm with -Os gcc gives up since it can not find registers
to spill. So we use -O2 option for compiling fork.c It may be addressable in gcc.
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Upstream-Status: Pending
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch
index 329d8a9..41e3646 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch
@@ -30,3 +30,9 @@ CFLAGS-OMIT-libc-lowlevellock.c = -DNOT_IN_libc -DIS_IN_libpthread
# This macro should be alternatively implemented in THUMB
# assembly.
ASFLAGS-vfork.S = -marm
+
+# For arm fork.c does not compile with -Os when in compiling
+# in thumb1 mode
+ifeq ($(COMPILE_IN_THUMB_MODE),y)
+CFLAGS-fork.c = -O2
+endif

View File

@ -1,25 +0,0 @@
Add definition of MSG_WAITFORONE and MSG_CMSG_CLOEXEC
Upstream-Status: Pending
Index: git/libc/sysdeps/linux/common/bits/socket.h
===================================================================
--- git.orig/libc/sysdeps/linux/common/bits/socket.h 2012-01-26 23:23:21.537456132 -0800
+++ git/libc/sysdeps/linux/common/bits/socket.h 2012-01-26 23:25:10.125461388 -0800
@@ -235,8 +235,15 @@
#define MSG_ERRQUEUE MSG_ERRQUEUE
MSG_NOSIGNAL = 0x4000, /* Do not generate SIGPIPE. */
#define MSG_NOSIGNAL MSG_NOSIGNAL
- MSG_MORE = 0x8000 /* Sender will send more. */
+ MSG_MORE = 0x8000, /* Sender will send more. */
#define MSG_MORE MSG_MORE
+ MSG_WAITFORONE = 0x10000, /* Wait for at least one packet to return.*/
+#define MSG_WAITFORONE MSG_WAITFORONE
+
+ MSG_CMSG_CLOEXEC = 0x40000000 /* Set close_on_exit for file
+ descriptor received through
+ SCM_RIGHTS. */
+#define MSG_CMSG_CLOEXEC MSG_CMSG_CLOEXEC
};

View File

@ -1,37 +0,0 @@
Implement dup3()
Upstream-Status: Pending
Index: git/libc/sysdeps/linux/common/dup3.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ git/libc/sysdeps/linux/common/dup3.c 2012-01-27 07:40:52.802900849 -0800
@@ -0,0 +1,15 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * dup3() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+
+
+_syscall3(int, dup3, int, oldfd, int, newfd, int, flags)
+libc_hidden_def(dup3)
Index: git/include/unistd.h
===================================================================
--- git.orig/include/unistd.h 2012-01-27 01:19:17.521792781 -0800
+++ git/include/unistd.h 2012-01-27 07:40:03.106898447 -0800
@@ -512,6 +512,8 @@
/* Duplicate FD to FD2, closing FD2 and making it open on the same file. */
extern int dup2 (int __fd, int __fd2) __THROW;
libc_hidden_proto(dup2)
+extern int dup3 (int __fd, int __fd2, int __flags) __THROW;
+libc_hidden_proto(dup3)
/* NULL-terminated array of "NAME=VALUE" environment variables. */
extern char **__environ;

View File

@ -1,27 +0,0 @@
resolver code should always be in arm mode
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Upstream-Status: Pending
Index: uClibc/ldso/ldso/arm/resolve.S
===================================================================
--- uClibc.orig/ldso/ldso/arm/resolve.S 2009-03-20 12:03:32.000000000 -0700
+++ uClibc/ldso/ldso/arm/resolve.S 2009-03-20 12:04:23.000000000 -0700
@@ -97,7 +97,6 @@
.text
.align 4 @ 16 byte boundary and there are 32 bytes below (arm case)
- #if !defined(__thumb__) || defined(__thumb2__)
.arm
.globl _dl_linux_resolve
.type _dl_linux_resolve,%function
@@ -129,7 +128,7 @@
#else
mov pc,ip
#endif
-#else
+#if 0
@ In the thumb case _dl_linux_resolver is thumb. If a bl is used
@ from arm code the linker will insert a stub call which, with
@ binutils 2.16, is not PIC. Since this code is accessed by an

View File

@ -1,23 +0,0 @@
Avoid build warnings
Upstream-Status: Pending
Index: git/include/libc-symbols.h
===================================================================
--- git.orig/include/libc-symbols.h 2011-07-05 17:04:41.171219323 -0700
+++ git/include/libc-symbols.h 2011-07-05 22:50:36.851661478 -0700
@@ -48,10 +48,12 @@
*/
-#include <bits/uClibc_arch_features.h>
-
/* Enable declarations of GNU extensions, since we are compiling them. */
#define _GNU_SOURCE 1
+#define __need_uClibc_config_h
+#include <bits/uClibc_config.h>
+#undef __need_uClibc_config_h
+#include <bits/uClibc_arch_features.h>
/* Prepare for the case that `__builtin_expect' is not available. */
#if defined __GNUC__ && __GNUC__ == 2 && __GNUC_MINOR__ < 96

View File

@ -1,83 +0,0 @@
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Upstream-Status: Pending
sync mount.h with glibc
Index: git/include/sys/mount.h
===================================================================
--- git.orig/include/sys/mount.h 2012-08-23 21:26:51.038825295 -0700
+++ git/include/sys/mount.h 2012-08-23 21:27:09.914826014 -0700
@@ -1,5 +1,5 @@
/* Header file for mounting/unmount Linux filesystems.
- Copyright (C) 1996,1997,1998,1999,2000,2004 Free Software Foundation, Inc.
+ Copyright (C) 1996-2000, 2004, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -47,23 +47,46 @@
#define MS_REMOUNT MS_REMOUNT
MS_MANDLOCK = 64, /* Allow mandatory locks on an FS. */
#define MS_MANDLOCK MS_MANDLOCK
- S_WRITE = 128, /* Write on file/directory/symlink. */
-#define S_WRITE S_WRITE
- S_APPEND = 256, /* Append-only file. */
-#define S_APPEND S_APPEND
- S_IMMUTABLE = 512, /* Immutable file. */
-#define S_IMMUTABLE S_IMMUTABLE
+ MS_DIRSYNC = 128, /* Directory modifications are synchronous. */
+#define MS_DIRSYNC MS_DIRSYNC
MS_NOATIME = 1024, /* Do not update access times. */
#define MS_NOATIME MS_NOATIME
MS_NODIRATIME = 2048, /* Do not update directory access times. */
#define MS_NODIRATIME MS_NODIRATIME
MS_BIND = 4096, /* Bind directory at different place. */
#define MS_BIND MS_BIND
+ MS_MOVE = 8192,
+#define MS_MOVE MS_MOVE
+ MS_REC = 16384,
+#define MS_REC MS_REC
+ MS_SILENT = 32768,
+#define MS_SILENT MS_SILENT
+ MS_POSIXACL = 1 << 16, /* VFS does not apply the umask. */
+#define MS_POSIXACL MS_POSIXACL
+ MS_UNBINDABLE = 1 << 17, /* Change to unbindable. */
+#define MS_UNBINDABLE MS_UNBINDABLE
+ MS_PRIVATE = 1 << 18, /* Change to private. */
+#define MS_PRIVATE MS_PRIVATE
+ MS_SLAVE = 1 << 19, /* Change to slave. */
+#define MS_SLAVE MS_SLAVE
+ MS_SHARED = 1 << 20, /* Change to shared. */
+#define MS_SHARED MS_SHARED
+ MS_RELATIME = 1 << 21, /* Update atime relative to mtime/ctime. */
+#define MS_RELATIME MS_RELATIME
+ MS_KERNMOUNT = 1 << 22, /* This is a kern_mount call. */
+#define MS_KERNMOUNT MS_KERNMOUNT
+ MS_I_VERSION = 1 << 23, /* Update inode I_version field. */
+#define MS_I_VERSION MS_I_VERSION
+ MS_STRICTATIME = 1 << 24, /* Always perform atime updates. */
+#define MS_STRICTATIME MS_STRICTATIME
+ MS_ACTIVE = 1 << 30,
+#define MS_ACTIVE MS_ACTIVE
+ MS_NOUSER = 1 << 31
+#define MS_NOUSER MS_NOUSER
};
/* Flags that can be altered by MS_REMOUNT */
-#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_NOATIME \
- |MS_NODIRATIME)
+#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION)
/* Magic mount flag number. Has to be or-ed to the flag values. */
@@ -100,8 +123,10 @@
#define MNT_FORCE MNT_FORCE
MNT_DETACH = 2, /* Just detach from the tree. */
#define MNT_DETACH MNT_DETACH
- MNT_EXPIRE = 4 /* Mark for expiry. */
+ MNT_EXPIRE = 4, /* Mark for expiry. */
#define MNT_EXPIRE MNT_EXPIRE
+ UMOUNT_NOFOLLOW = 8 /* Don't follow symlink on umount. */
+#define UMOUNT_NOFOLLOW UMOUNT_NOFOLLOW
};

View File

@ -1,185 +0,0 @@
Patch is backported from
http://lists.busybox.net/pipermail/uclibc/2011-March/045003.html
Upstream-Status: Pending
Index: git/ldso/ldso/dl-elf.c
===================================================================
--- git.orig/ldso/ldso/dl-elf.c 2012-01-23 19:18:58.000000000 -0800
+++ git/ldso/ldso/dl-elf.c 2012-01-23 21:52:06.144646590 -0800
@@ -133,53 +133,60 @@
* in uClibc/ldso/util/ldd.c */
static struct elf_resolve *
search_for_named_library(const char *name, unsigned rflags, const char *path_list,
- struct dyn_elf **rpnt)
+ struct dyn_elf **rpnt, const char* origin)
{
- char *path, *path_n, *mylibname;
+ char *mylibname;
+ const char *p, *pn;
struct elf_resolve *tpnt;
- int done;
+ int plen;
if (path_list==NULL)
return NULL;
- /* We need a writable copy of this string, but we don't
- * need this allocated permanently since we don't want
- * to leak memory, so use alloca to put path on the stack */
- done = _dl_strlen(path_list);
- path = alloca(done + 1);
-
/* another bit of local storage */
mylibname = alloca(2050);
- _dl_memcpy(path, path_list, done+1);
-
/* Unlike ldd.c, don't bother to eliminate double //s */
/* Replace colons with zeros in path_list */
/* : at the beginning or end of path maps to CWD */
/* :: anywhere maps CWD */
/* "" maps to CWD */
- done = 0;
- path_n = path;
- do {
- if (*path == 0) {
- *path = ':';
- done = 1;
+ for (p = path_list; p != NULL; p = pn) {
+ pn = _dl_strchr(p + 1, ':');
+ if (pn != NULL) {
+ plen = pn - p;
+ pn++;
+ } else
+ plen = _dl_strlen(p);
+
+ if (plen >= 7 && _dl_memcmp(p, "$ORIGIN", 7) == 0) {
+ int olen;
+ if (rflags && plen != 7)
+ continue;
+ if (origin == NULL)
+ continue;
+ for (olen = _dl_strlen(origin) - 1; olen >= 0 && origin[olen] != '/'; olen--)
+ ;
+ if (olen <= 0)
+ continue;
+ _dl_memcpy(&mylibname[0], origin, olen);
+ _dl_memcpy(&mylibname[olen], p + 7, plen - 7);
+ mylibname[olen + plen - 7] = 0;
+ } else if (plen != 0) {
+ _dl_memcpy(mylibname, p, plen);
+ mylibname[plen] = 0;
+ } else {
+ _dl_strcpy(mylibname, ".");
}
- if (*path == ':') {
- *path = 0;
- if (*path_n)
- _dl_strcpy(mylibname, path_n);
- else
- _dl_strcpy(mylibname, "."); /* Assume current dir if empty path */
- _dl_strcat(mylibname, "/");
- _dl_strcat(mylibname, name);
- if ((tpnt = _dl_load_elf_shared_library(rflags, rpnt, mylibname)) != NULL)
- return tpnt;
- path_n = path+1;
- }
- path++;
- } while (!done);
+ _dl_strcat(mylibname, "/");
+ _dl_strcat(mylibname, name);
+
+ tpnt = _dl_load_elf_shared_library(rflags, rpnt, mylibname);
+ if (tpnt != NULL)
+ return tpnt;
+ }
+
return NULL;
}
@@ -231,8 +238,10 @@
if (pnt) {
pnt += (unsigned long) tpnt->dynamic_info[DT_STRTAB];
_dl_if_debug_dprint("\tsearching RPATH='%s'\n", pnt);
- if ((tpnt1 = search_for_named_library(libname, rflags, pnt, rpnt)) != NULL)
+ if ((tpnt1 = search_for_named_library(libname, rflags, pnt, rpnt,
+ tpnt->libname)) != NULL)
return tpnt1;
+
}
#endif
@@ -240,7 +249,7 @@
/* Check in LD_{ELF_}LIBRARY_PATH, if specified and allowed */
if (_dl_library_path) {
_dl_if_debug_dprint("\tsearching LD_LIBRARY_PATH='%s'\n", _dl_library_path);
- if ((tpnt1 = search_for_named_library(libname, rflags, _dl_library_path, rpnt)) != NULL)
+ if ((tpnt1 = search_for_named_library(libname, rflags, _dl_library_path, rpnt, NULL)) != NULL)
{
return tpnt1;
}
@@ -254,7 +263,7 @@
if (pnt) {
pnt += (unsigned long) tpnt->dynamic_info[DT_STRTAB];
_dl_if_debug_dprint("\tsearching RUNPATH='%s'\n", pnt);
- if ((tpnt1 = search_for_named_library(libname, rflags, pnt, rpnt)) != NULL)
+ if ((tpnt1 = search_for_named_library(libname, rflags, pnt, rpnt, NULL)) != NULL)
return tpnt1;
}
#endif
@@ -288,7 +297,7 @@
/* Look for libraries wherever the shared library loader
* was installed */
_dl_if_debug_dprint("\tsearching ldso dir='%s'\n", _dl_ldsopath);
- tpnt1 = search_for_named_library(libname, rflags, _dl_ldsopath, rpnt);
+ tpnt1 = search_for_named_library(libname, rflags, _dl_ldsopath, rpnt, NULL);
if (tpnt1 != NULL)
return tpnt1;
#endif
@@ -301,7 +310,7 @@
#ifndef __LDSO_CACHE_SUPPORT__
":" UCLIBC_RUNTIME_PREFIX "usr/X11R6/lib"
#endif
- , rpnt);
+ , rpnt, NULL);
if (tpnt1 != NULL)
return tpnt1;
Index: git/ldso/ldso/ldso.c
===================================================================
--- git.orig/ldso/ldso/ldso.c 2012-01-23 19:18:58.000000000 -0800
+++ git/ldso/ldso/ldso.c 2012-01-23 21:34:11.152594621 -0800
@@ -407,6 +407,20 @@
return p - list;
}
+static void _dl_setup_progname(const char *argv0)
+{
+ char image[PATH_MAX];
+ ssize_t s;
+
+ s = _dl_readlink("/proc/self/exe", image, sizeof(image));
+ if (s > 0 && image[0] == '/') {
+ image[s] = 0;
+ _dl_progname = _dl_strdup(image);
+ } else if (argv0) {
+ _dl_progname = argv0;
+ }
+}
+
void *_dl_get_ready_to_run(struct elf_resolve *tpnt, DL_LOADADDR_TYPE load_addr,
ElfW(auxv_t) auxvt[AT_EGID + 1], char **envp, char **argv
DL_GET_READY_TO_RUN_EXTRA_PARMS)
@@ -458,9 +472,7 @@
* been fixed up by now. Still no function calls outside of this
* library, since the dynamic resolver is not yet ready.
*/
- if (argv[0]) {
- _dl_progname = argv[0];
- }
+ _dl_setup_progname(argv[0]);
#ifndef __LDSO_STANDALONE_SUPPORT__
if (_start == (void *) auxvt[AT_ENTRY].a_un.a_val) {

View File

@ -1,407 +0,0 @@
Delivered-To: raj.khem@gmail.com
Received: by 10.152.129.134 with SMTP id nw6csp47712lab;
Tue, 17 Apr 2012 00:30:48 -0700 (PDT)
Received: by 10.68.216.167 with SMTP id or7mr34112133pbc.140.1334647840512;
Tue, 17 Apr 2012 00:30:40 -0700 (PDT)
Return-Path: <uclibc-bounces@uclibc.org>
Received: from hemlock.osuosl.org (hemlock.osuosl.org. [140.211.166.133])
by mx.google.com with ESMTP id gr10si13305623pbc.339.2012.04.17.00.30.39;
Tue, 17 Apr 2012 00:30:40 -0700 (PDT)
Received-SPF: neutral (google.com: 140.211.166.133 is neither permitted nor denied by best guess record for domain of uclibc-bounces@uclibc.org) client-ip=140.211.166.133;
Authentication-Results: mx.google.com; spf=neutral (google.com: 140.211.166.133 is neither permitted nor denied by best guess record for domain of uclibc-bounces@uclibc.org) smtp.mail=uclibc-bounces@uclibc.org; dkim=neutral (body hash did not verify) header.i=@gmail.com
Received: from localhost (localhost [127.0.0.1])
by hemlock.osuosl.org (Postfix) with ESMTP id 7C494A0277;
Tue, 17 Apr 2012 07:30:39 +0000 (UTC)
X-Virus-Scanned: amavisd-new at osuosl.org
Received: from hemlock.osuosl.org ([127.0.0.1])
by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id ZsSp5xE48GwC; Tue, 17 Apr 2012 07:30:34 +0000 (UTC)
Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34])
by hemlock.osuosl.org (Postfix) with ESMTP id 1C4F5A0274;
Tue, 17 Apr 2012 07:30:33 +0000 (UTC)
X-Original-To: uclibc@lists.busybox.net
Delivered-To: uclibc@osuosl.org
Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137])
by ash.osuosl.org (Postfix) with ESMTP id 17FDE8F75B
for <uclibc@lists.busybox.net>; Tue, 17 Apr 2012 07:30:32 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
by fraxinus.osuosl.org (Postfix) with ESMTP id 07B491016A1
for <uclibc@lists.busybox.net>; Tue, 17 Apr 2012 07:30:32 +0000 (UTC)
X-Virus-Scanned: amavisd-new at osuosl.org
Received: from fraxinus.osuosl.org ([127.0.0.1])
by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id XKP7jhcUijp4 for <uclibc@lists.busybox.net>;
Tue, 17 Apr 2012 07:30:27 +0000 (UTC)
X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6
Received: from mail-we0-f174.google.com (mail-we0-f174.google.com
[74.125.82.174])
by fraxinus.osuosl.org (Postfix) with ESMTPS id 2CC0B100190
for <uclibc@uclibc.org>; Tue, 17 Apr 2012 07:30:26 +0000 (UTC)
Received: by wejx9 with SMTP id x9so5218587wej.33
for <uclibc@uclibc.org>; Tue, 17 Apr 2012 00:30:25 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
h=from:to:cc:subject:date:message-id:x-mailer;
bh=vadTQ1GL81XLDadHLtwCrcdL0YvVNNbIuISfTaQphgg=;
b=KkyW95PC1TUTmwGt+iBJ8p0FfGtTPAsTlXmul/1iH2p21itEpWkU+WcVd2jBH+jc6L
gzf4d6K1pmmfscdbPY3OkpFfvO/v/E4KYN7JmeI+fX1NY+gLBSHhExAVhM1Opue9z09V
54MrEMtlIA9Wo/5QPd1+W7o9gXHYEnMkoqYYZLmfPlG3+pCXZ6RP36fOZnSV44BQgOFz
KBqn7XLo6nxgP5X/+JuEe4stvCrI9/66nX30u/Sh77a9poj5pp8hQZmtIpbbm3xRKGnM
Fi72jNCq/0nHh3M7eMqn+rvwi1JQjk/90zWNv8v5ShAKqSJVrfqLVN72KjTJtXfLOqbL
e2qA==
Received: by 10.216.133.72 with SMTP id p50mr8903959wei.78.1334647825412;
Tue, 17 Apr 2012 00:30:25 -0700 (PDT)
Received: from s42.loc (85-127-86-115.dynamic.xdsl-line.inode.at.
[85.127.86.115])
by mx.google.com with ESMTPS id n20sm40466274wiw.5.2012.04.17.00.30.23
(version=TLSv1/SSLv3 cipher=OTHER);
Tue, 17 Apr 2012 00:30:24 -0700 (PDT)
Received: from cow by s42.loc with local (Exim 4.77)
(envelope-from <rep.dot.nop@gmail.com>)
id 1SK2rm-0008Pl-V3; Tue, 17 Apr 2012 09:30:23 +0200
From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
To: uclibc@uclibc.org
Subject: [PATCH,CFT] libc: add posix_fallocate()
Date: Tue, 17 Apr 2012 09:30:15 +0200
Message-Id: <1334647815-32315-1-git-send-email-rep.dot.nop@gmail.com>
X-Mailer: git-send-email 1.7.9.1
X-BeenThere: uclibc@uclibc.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Discussion and development of uClibc \(the embedded C library\)"
<uclibc.uclibc.org>
List-Unsubscribe: <http://lists.busybox.net/mailman/options/uclibc>,
<mailto:uclibc-request@uclibc.org?subject=unsubscribe>
List-Archive: <http://lists.busybox.net/pipermail/uclibc>
List-Post: <mailto:uclibc@uclibc.org>
List-Help: <mailto:uclibc-request@uclibc.org?subject=help>
List-Subscribe: <http://lists.busybox.net/mailman/listinfo/uclibc>,
<mailto:uclibc-request@uclibc.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: uclibc-bounces@uclibc.org
Sender: uclibc-bounces@uclibc.org
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Upstream-Status: Pending
---
include/fcntl.h | 4 +-
libc/sysdeps/linux/common/Makefile.in | 3 +-
libc/sysdeps/linux/common/bits/kernel-features.h | 8 ++
libc/sysdeps/linux/common/posix_fallocate.c | 43 ++++++++
libc/sysdeps/linux/common/posix_fallocate64.c | 39 +++++++
libc/sysdeps/linux/common/stubs.c | 4 +
test/.gitignore | 1 +
test/unistd/Makefile.in | 3 +
test/unistd/tst-posix_fallocate.c | 121 ++++++++++++++++++++++
9 files changed, 222 insertions(+), 4 deletions(-)
create mode 100644 libc/sysdeps/linux/common/posix_fallocate.c
create mode 100644 libc/sysdeps/linux/common/posix_fallocate64.c
create mode 100644 test/unistd/tst-posix_fallocate.c
Index: git/include/fcntl.h
===================================================================
--- git.orig/include/fcntl.h 2012-09-02 17:00:26.000000000 -0700
+++ git/include/fcntl.h 2012-09-02 17:01:51.567076705 -0700
@@ -210,9 +210,7 @@
#endif
-#if 0 /* && defined __UCLIBC_HAS_ADVANCED_REALTIME__ */
-
-/* FIXME -- uClibc should probably implement these... */
+#if defined __UCLIBC_HAS_ADVANCED_REALTIME__
/* Reserve storage for the data of the file associated with FD.
Index: git/libc/sysdeps/linux/common/Makefile.in
===================================================================
--- git.orig/libc/sysdeps/linux/common/Makefile.in 2012-09-02 17:00:26.000000000 -0700
+++ git/libc/sysdeps/linux/common/Makefile.in 2012-09-02 17:03:02.739079369 -0700
@@ -81,7 +81,7 @@
sched_get_priority_max.c sched_get_priority_min.c sched_getscheduler.c \
sched_rr_get_interval.c sched_setparam.c sched_setscheduler.c sigqueue.c
# clock_getcpuclockid|clock_nanosleep|mq_timedreceive|mq_timedsend|posix_fadvise|posix_fallocate|posix_madvise|posix_memalign|posix_mem_offset|posix_spawnattr_destroy|posix_spawnattr_init|posix_spawnattr_getflags|posix_spawnattr_setflags|posix_spawnattr_getpgroup|posix_spawnattr_setpgroup|posix_spawnattr_getschedparam|posix_spawnattr_setschedparam|posix_spawnattr_getschedpolicy|posix_spawnattr_setschedpolicy|posix_spawnattr_getsigdefault|posix_spawnattr_setsigdefault|posix_spawnattr_getsigmask|posix_spawnattr_setsigmask|posix_spawnattr_init|posix_spawnattr_setflags|posix_spawnattr_setpgroup|posix_spawnattr_setschedparam|posix_spawnattr_setschedpolicy|posix_spawnattr_setsigdefault|posix_spawnattr_setsigmask|posix_spawn_file_actions_addclose|posix_spawn_file_actions_addopen|posix_spawn_file_actions_adddup2|posix_spawn_file_actions_addopen|posix_spawn_file_actions_destroy|posix_spawn_file_actions_init|posix_spawn_file_actions_init|posix_spawn|posix_spawnp|posix_spawnp|posix_typed_mem_get_info|pthread_mutex_timedlock|sem_timedwait
-CSRC-$(UCLIBC_HAS_ADVANCED_REALTIME) += posix_fadvise64.c posix_fadvise.c posix_madvise.c
+CSRC-$(UCLIBC_HAS_ADVANCED_REALTIME) += posix_fadvise64.c posix_fadvise.c posix_madvise.c posix_fallocate.c posix_fallocate64.c
CSRC-$(UCLIBC_SUSV4_LEGACY) += utime.c
CSRC-$(UCLIBC_HAS_EPOLL) += epoll.c
CSRC-$(UCLIBC_HAS_XATTR) += xattr.c
Index: git/libc/sysdeps/linux/common/bits/kernel-features.h
===================================================================
--- git.orig/libc/sysdeps/linux/common/bits/kernel-features.h 2012-09-02 17:00:26.000000000 -0700
+++ git/libc/sysdeps/linux/common/bits/kernel-features.h 2012-09-02 17:01:51.567076705 -0700
@@ -494,6 +494,14 @@
# define __ASSUME_PRIVATE_FUTEX 1
#endif
+/* Support for fallocate was added in 2.6.23,
+ on s390 only after 2.6.23-rc1, on alpha only after 2.6.33-rc1. */
+#if __LINUX_KERNEL_VERSION >= 0x020617 \
+ && (!defined __s390__ || __LINUX_KERNEL_VERSION >= 0x020618) \
+ && (!defined __alpha__ || __LINUX_KERNEL_VERSION >= 0x020621)
+# define __ASSUME_FALLOCATE 1
+#endif
+
/* getcpu is a syscall for x86-64 since 3.1. */
#if defined __x86_64__ && __LINUX_KERNEL_VERSION >= 0x030100
# define __ASSUME_GETCPU_SYSCALL 1
Index: git/libc/sysdeps/linux/common/posix_fallocate.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ git/libc/sysdeps/linux/common/posix_fallocate.c 2012-09-02 17:01:51.579076667 -0700
@@ -0,0 +1,43 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * posix_fallocate() for uClibc
+ * http://www.opengroup.org/onlinepubs/9699919799/functions/posix_fallocate.html
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <fcntl.h>
+#include <bits/kernel-features.h>
+#include <stdint.h>
+
+#if defined __NR_fallocate
+int posix_fallocate(int fd, __off_t offset, __off_t len)
+{
+ int ret;
+
+# if __WORDSIZE == 32
+ uint32_t off_low = offset;
+ uint32_t len_low = len;
+ /* may assert that these >>31 are 0 */
+ uint32_t zero = 0;
+ INTERNAL_SYSCALL_DECL(err);
+ ret = (int) (INTERNAL_SYSCALL(fallocate, err, 6, fd, 0,
+ __LONG_LONG_PAIR (zero, off_low),
+ __LONG_LONG_PAIR (zero, len_low)));
+# elif __WORDSIZE == 64
+ INTERNAL_SYSCALL_DECL(err);
+ ret = (int) (INTERNAL_SYSCALL(fallocate, err, 4, fd, 0, offset, len));
+# else
+# error your machine is neither 32 bit or 64 bit ... it must be magical
+#endif
+ if (unlikely(INTERNAL_SYSCALL_ERROR_P (ret, err)))
+ return INTERNAL_SYSCALL_ERRNO (ret, err);
+ return 0;
+}
+# if defined __UCLIBC_HAS_LFS__ && __WORDSIZE == 64
+strong_alias(posix_fallocate,posix_fallocate64)
+# endif
+#endif
Index: git/libc/sysdeps/linux/common/posix_fallocate64.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ git/libc/sysdeps/linux/common/posix_fallocate64.c 2012-09-02 17:01:51.579076667 -0700
@@ -0,0 +1,39 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * posix_fallocate() for uClibc
+ * http://www.opengroup.org/onlinepubs/9699919799/functions/posix_fallocate.html
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <fcntl.h>
+#include <bits/kernel-features.h>
+#include <stdint.h>
+
+#if defined __NR_fallocate
+
+# if __WORDSIZE == 64
+/* Can use normal posix_fallocate() */
+# elif __WORDSIZE == 32
+int posix_fallocate64(int fd, __off64_t offset, __off64_t len)
+{
+ int ret;
+ uint32_t off_low = offset & 0xffffffff;
+ uint32_t off_high = offset >> 32;
+ uint32_t len_low = len & 0xffffffff;
+ uint32_t len_high = len >> 32;
+ INTERNAL_SYSCALL_DECL(err);
+ ret = (int) (INTERNAL_SYSCALL(fallocate, err, 6, fd, 0,
+ __LONG_LONG_PAIR (off_high, off_low),
+ __LONG_LONG_PAIR (len_high, len_low)));
+ if (unlikely(INTERNAL_SYSCALL_ERROR_P (ret, err)))
+ return INTERNAL_SYSCALL_ERRNO (ret, err);
+ return 0;
+}
+# else
+# error your machine is neither 32 bit or 64 bit ... it must be magical
+# endif
+#endif
Index: git/libc/sysdeps/linux/common/stubs.c
===================================================================
--- git.orig/libc/sysdeps/linux/common/stubs.c 2012-09-02 17:00:26.000000000 -0700
+++ git/libc/sysdeps/linux/common/stubs.c 2012-09-02 17:01:51.579076667 -0700
@@ -209,6 +209,10 @@
make_stub(madvise)
#endif
+#if !defined __NR_fallocate && defined __UCLIBC_HAS_ADVANCED_REALTIME__
+make_ret_stub(posix_fallocate)
+#endif
+
#if !defined __NR_modify_ldt && defined __UCLIBC_LINUX_SPECIFIC__
make_stub(modify_ldt)
#endif
Index: git/test/.gitignore
===================================================================
--- git.orig/test/.gitignore 2012-09-02 17:00:26.000000000 -0700
+++ git/test/.gitignore 2012-09-02 17:01:51.579076667 -0700
@@ -302,6 +302,7 @@
unistd/getopt
unistd/getopt_long
unistd/tstgetopt
+unistd/tst-posix_fallocate
unistd/tst-preadwrite
unistd/tst-preadwrite64
unistd/vfork
Index: git/test/unistd/Makefile.in
===================================================================
--- git.orig/test/unistd/Makefile.in 2012-09-02 17:00:26.000000000 -0700
+++ git/test/unistd/Makefile.in 2012-09-02 17:01:51.579076667 -0700
@@ -4,6 +4,9 @@
ifeq ($(UCLIBC_HAS_LFS),)
TESTS_DISABLED := tst-preadwrite64
endif
+ifeq ($(UCLIBC_HAS_ADVANCED_REALTIME),)
+TESTS_DISABLED := tst-posix_fallocate
+endif
OPTS_getopt := -abcXXX -9
OPTS_getopt_long := --add XXX --delete YYY --verbose
ifeq ($(UCLIBC_HAS_GNU_GETOPT),y)
Index: git/test/unistd/tst-posix_fallocate.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ git/test/unistd/tst-posix_fallocate.c 2012-09-02 17:01:51.579076667 -0700
@@ -0,0 +1,121 @@
+#include <fcntl.h>
+#include <sys/stat.h>
+
+static void do_prepare (void);
+#define PREPARE(argc, argv) do_prepare ()
+static int do_test (void);
+#define TEST_FUNCTION do_test ()
+#include <test-skeleton.c>
+
+static int fd;
+#ifndef O_LARGEFILE
+# error no O_LARGEFILE
+#endif
+static void
+do_prepare (void)
+{
+ fd = create_temp_file ("tst-posix_fallocate.", NULL);
+ if (fd == -1)
+ {
+ printf ("cannot create temporary file: %m\n");
+ exit (1);
+ }
+}
+
+
+static int
+do_test (void)
+{
+ struct stat64 st;
+
+ if (fstat64 (fd, &st) != 0)
+ {
+ puts ("1st fstat failed");
+ return 1;
+ }
+
+ if (st.st_size != 0)
+ {
+ puts ("file not created with size 0");
+ return 1;
+ }
+
+ if (posix_fallocate (fd, 512, 768) != 0)
+ {
+ puts ("1st posix_fallocate call failed");
+ return 1;
+ }
+
+ if (fstat64 (fd, &st) != 0)
+ {
+ puts ("2nd fstat failed");
+ return 1;
+ }
+
+ if (st.st_size != 512 + 768)
+ {
+ printf ("file size after 1st posix_fallocate call is %llu, expected %u\n",
+ (unsigned long long int) st.st_size, 512u + 768u);
+ return 1;
+ }
+
+ if (posix_fallocate (fd, 0, 1024) != 0)
+ {
+ puts ("2nd posix_fallocate call failed");
+ return 1;
+ }
+
+ if (fstat64 (fd, &st) != 0)
+ {
+ puts ("3rd fstat failed");
+ return 1;
+ }
+
+ if (st.st_size != 512 + 768)
+ {
+ puts ("file size changed in 2nd posix_fallocate");
+ return 1;
+ }
+
+ if (posix_fallocate (fd, 2048, 64) != 0)
+ {
+ puts ("3rd posix_fallocate call failed");
+ return 1;
+ }
+
+ if (fstat64 (fd, &st) != 0)
+ {
+ puts ("4th fstat failed");
+ return 1;
+ }
+
+ if (st.st_size != 2048 + 64)
+ {
+ printf ("file size after 3rd posix_fallocate call is %llu, expected %u\n",
+ (unsigned long long int) st.st_size, 2048u + 64u);
+ return 1;
+ }
+
+ if (posix_fallocate64 (fd, 4097ULL, 4294967295ULL + 2ULL) != 0)
+ {
+ puts ("4th posix_fallocate call failed");
+ return 1;
+ }
+
+ if (fstat64 (fd, &st) != 0)
+ {
+ puts ("5th fstat failed");
+ return 1;
+ }
+
+ if (st.st_size != 4097ULL + 4294967295ULL + 2ULL)
+ {
+ printf ("file size after 4th posix_fallocate call is %llu, expected %u\n",
+ (unsigned long long int) st.st_size, 4097ULL + 4294967295ULL + 2ULL);
+ return 1;
+ }
+
+ close (fd);
+
+ return 0;
+}

View File

@ -1,113 +0,0 @@
Add ppc copysignl implementation
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Index: git/libc/sysdeps/linux/powerpc/Makefile.arch
===================================================================
--- git.orig/libc/sysdeps/linux/powerpc/Makefile.arch
+++ git/libc/sysdeps/linux/powerpc/Makefile.arch
@@ -5,7 +5,7 @@
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
-CSRC := __syscall_error.c pread_write.c ioctl.c
+CSRC := __syscall_error.c pread_write.c ioctl.c copysignl.c
ifeq ($(UCLIBC_HAS_ADVANCED_REALTIME),y)
CSRC += posix_fadvise.c posix_fadvise64.c
Index: git/libc/sysdeps/linux/powerpc/copysignl.c
===================================================================
--- /dev/null
+++ git/libc/sysdeps/linux/powerpc/copysignl.c
@@ -0,0 +1,89 @@
+/* s_copysignl.c -- long double version of s_copysign.c.
+ * Conversion to long double by Ulrich Drepper,
+ * Cygnus Support, drepper@cygnus.com.
+ */
+
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+/*
+ * copysignl(long double x, long double y)
+ * copysignl(x,y) returns a value with the magnitude of x and
+ * with the sign bit of y.
+ */
+
+#include <endian.h>
+#include <stdint.h>
+
+#if __FLOAT_WORD_ORDER == BIG_ENDIAN
+
+typedef union
+{
+ long double value;
+ struct
+ {
+ int sign_exponent:16;
+ unsigned int empty:16;
+ uint32_t msw;
+ uint32_t lsw;
+ } parts;
+} ieee_long_double_shape_type;
+
+#endif
+
+#if __FLOAT_WORD_ORDER == LITTLE_ENDIAN
+
+typedef union
+{
+ long double value;
+ struct
+ {
+ uint32_t lsw;
+ uint32_t msw;
+ int sign_exponent:16;
+ unsigned int empty:16;
+ } parts;
+} ieee_long_double_shape_type;
+
+#endif
+
+/* Get int from the exponent of a long double. */
+
+#define GET_LDOUBLE_EXP(exp,d) \
+do { \
+ ieee_long_double_shape_type ge_u; \
+ ge_u.value = (d); \
+ (exp) = ge_u.parts.sign_exponent; \
+} while (0)
+
+/* Set exponent of a long double from an int. */
+
+#define SET_LDOUBLE_EXP(d,exp) \
+do { \
+ ieee_long_double_shape_type se_u; \
+ se_u.value = (d); \
+ se_u.parts.sign_exponent = (exp); \
+ (d) = se_u.value; \
+} while (0)
+
+long double copysignl(long double x, long double y);
+libc_hidden_proto(copysignl);
+
+long double copysignl(long double x, long double y)
+{
+ uint32_t es1,es2;
+ GET_LDOUBLE_EXP(es1,x);
+ GET_LDOUBLE_EXP(es2,y);
+ SET_LDOUBLE_EXP(x,(es1&0x7fff)|(es2&0x8000));
+ return x;
+}
+
+libc_hidden_def(copysignl);

View File

@ -1,179 +0,0 @@
Dont support localised optimizations this helps to have a global -O level
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Upstream-Status: Pending
Index: git/libpthread/nptl/pthread_mutex_timedlock.c
===================================================================
--- git.orig/libpthread/nptl/pthread_mutex_timedlock.c
+++ git/libpthread/nptl/pthread_mutex_timedlock.c
@@ -29,7 +29,9 @@
* error: can't find a register in class GENERAL_REGS while reloading asm
*/
int
+#ifndef __OPTIMIZE__
attribute_optimize("Os")
+#endif
pthread_mutex_timedlock (
pthread_mutex_t *mutex,
const struct timespec *abstime)
Index: git/libc/sysdeps/linux/powerpc/bits/mathinline.h
===================================================================
--- git.orig/libc/sysdeps/linux/powerpc/bits/mathinline.h
+++ git/libc/sysdeps/linux/powerpc/bits/mathinline.h
@@ -27,7 +27,7 @@
#ifdef __cplusplus
# define __MATH_INLINE __inline
#else
-# define __MATH_INLINE extern __inline
+# define __MATH_INLINE __extern_inline
#endif /* __cplusplus */
#if defined __GNUC__ && !defined _SOFT_FLOAT
Index: git/libc/sysdeps/linux/alpha/bits/mathinline.h
===================================================================
--- git.orig/libc/sysdeps/linux/alpha/bits/mathinline.h
+++ git/libc/sysdeps/linux/alpha/bits/mathinline.h
@@ -25,7 +25,7 @@
#ifdef __cplusplus
# define __MATH_INLINE __inline
#else
-# define __MATH_INLINE extern __inline
+# define __MATH_INLINE __extern_inline
#endif
#if defined __USE_ISOC99 && defined __GNUC__ && !__GNUC_PREREQ(3,0)
Index: git/libc/sysdeps/linux/common/bits/socket.h
===================================================================
--- git.orig/libc/sysdeps/linux/common/bits/socket.h
+++ git/libc/sysdeps/linux/common/bits/socket.h
@@ -302,7 +302,7 @@ extern struct cmsghdr *__cmsg_nxthdr (st
libc_hidden_proto(__cmsg_nxthdr)
#ifdef __USE_EXTERN_INLINES
# ifndef _EXTERN_INLINE
-# define _EXTERN_INLINE extern __inline
+# define _EXTERN_INLINE __extern_inline
# endif
_EXTERN_INLINE struct cmsghdr *
__NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
Index: git/libc/sysdeps/linux/i386/bits/mathinline.h
===================================================================
--- git.orig/libc/sysdeps/linux/i386/bits/mathinline.h
+++ git/libc/sysdeps/linux/i386/bits/mathinline.h
@@ -26,7 +26,7 @@
#ifdef __cplusplus
# define __MATH_INLINE __inline
#else
-# define __MATH_INLINE extern __inline
+# define __MATH_INLINE __extern_inline
#endif
Index: git/libc/sysdeps/linux/ia64/bits/mathinline.h
===================================================================
--- git.orig/libc/sysdeps/linux/ia64/bits/mathinline.h
+++ git/libc/sysdeps/linux/ia64/bits/mathinline.h
@@ -24,7 +24,7 @@
#ifdef __cplusplus
# define __MATH_INLINE __inline
#else
-# define __MATH_INLINE extern __inline
+# define __MATH_INLINE __extern_inline
#endif
#if defined __USE_ISOC99 && defined __GNUC__ && __GNUC__ >= 2
Index: git/libc/sysdeps/linux/m68k/bits/mathinline.h
===================================================================
--- git.orig/libc/sysdeps/linux/m68k/bits/mathinline.h
+++ git/libc/sysdeps/linux/m68k/bits/mathinline.h
@@ -92,7 +92,7 @@
# ifdef __cplusplus
# define __m81_inline __inline
# else
-# define __m81_inline extern __inline
+# define __m81_inline __extern_inline
# endif
# define __M81_MATH_INLINES 1
#endif
@@ -351,14 +351,14 @@ __inline_functions (long double,l)
/* Note that there must be no whitespace before the argument passed for
NAME, to make token pasting work correctly with -traditional. */
# define __inline_forward_c(rettype, name, args1, args2) \
-extern __inline rettype __attribute__((__const__)) \
+__extern_inline rettype __attribute__((__const__)) \
name args1 \
{ \
return __CONCAT(__,name) args2; \
}
# define __inline_forward(rettype, name, args1, args2) \
-extern __inline rettype name args1 \
+__extern_inline rettype name args1 \
{ \
return __CONCAT(__,name) args2; \
}
Index: git/libc/sysdeps/linux/mips/bits/socket.h
===================================================================
--- git.orig/libc/sysdeps/linux/mips/bits/socket.h
+++ git/libc/sysdeps/linux/mips/bits/socket.h
@@ -307,7 +307,7 @@ extern struct cmsghdr *__cmsg_nxthdr (st
libc_hidden_proto(__cmsg_nxthdr)
#ifdef __USE_EXTERN_INLINES
# ifndef _EXTERN_INLINE
-# define _EXTERN_INLINE extern __inline
+# define _EXTERN_INLINE __extern_inline
# endif
_EXTERN_INLINE struct cmsghdr *
__NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
Index: git/libc/sysdeps/linux/mips/sys/tas.h
===================================================================
--- git.orig/libc/sysdeps/linux/mips/sys/tas.h
+++ git/libc/sysdeps/linux/mips/sys/tas.h
@@ -30,7 +30,7 @@ extern int _test_and_set (int *p, int v)
#ifdef __USE_EXTERN_INLINES
# ifndef _EXTERN_INLINE
-# define _EXTERN_INLINE extern __inline
+# define _EXTERN_INLINE __extern_inline
# endif
_EXTERN_INLINE int
Index: git/libc/sysdeps/linux/sparc/bits/mathinline.h
===================================================================
--- git.orig/libc/sysdeps/linux/sparc/bits/mathinline.h
+++ git/libc/sysdeps/linux/sparc/bits/mathinline.h
@@ -131,7 +131,7 @@
# ifdef __cplusplus
# define __MATH_INLINE __inline
# else
-# define __MATH_INLINE extern __inline
+# define __MATH_INLINE __extern_inline
# endif /* __cplusplus */
/* The gcc, version 2.7 or below, has problems with all this inlining
Index: git/libc/sysdeps/linux/sparc/bits/socket.h
===================================================================
--- git.orig/libc/sysdeps/linux/sparc/bits/socket.h
+++ git/libc/sysdeps/linux/sparc/bits/socket.h
@@ -292,7 +292,7 @@ extern struct cmsghdr *__cmsg_nxthdr (st
libc_hidden_proto(__cmsg_nxthdr)
#ifdef __USE_EXTERN_INLINES
# ifndef _EXTERN_INLINE
-# define _EXTERN_INLINE extern __inline
+# define _EXTERN_INLINE __extern_inline
# endif
_EXTERN_INLINE struct cmsghdr *
__NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
Index: git/libc/sysdeps/linux/x86_64/bits/mathinline.h
===================================================================
--- git.orig/libc/sysdeps/linux/x86_64/bits/mathinline.h
+++ git/libc/sysdeps/linux/x86_64/bits/mathinline.h
@@ -25,7 +25,7 @@
#ifdef __cplusplus
# define __MATH_INLINE __inline
#else
-# define __MATH_INLINE extern __inline
+# define __MATH_INLINE __extern_inline
#endif

View File

@ -1,190 +0,0 @@
#
# General Library Settings
#
# HAVE_NO_PIC is not set
# DOPIC is not set
# HAVE_NO_SHARED is not set
# ARCH_HAS_NO_LDSO is not set
HAVE_SHARED=y
# FORCE_SHAREABLE_TEXT_SEGMENTS is not set
LDSO_LDD_SUPPORT=y
LDSO_CACHE_SUPPORT=y
# LDSO_PRELOAD_FILE_SUPPORT is not set
LDSO_BASE_FILENAME="ld.so"
# UCLIBC_STATIC_LDCONFIG is not set
LDSO_RUNPATH=y
UCLIBC_CTOR_DTOR=y
LDSO_GNU_HASH_SUPPORT=y
# HAS_NO_THREADS is not set
UCLIBC_HAS_THREADS=y
UCLIBC_HAS_THREADS_NATIVE=y
PTHREADS_DEBUG_SUPPORT=y
# LINUXTHREADS_OLD is not set
UCLIBC_HAS_LFS=y
# MALLOC is not set
# MALLOC_SIMPLE is not set
MALLOC_STANDARD=y
MALLOC_GLIBC_COMPAT=y
UCLIBC_DYNAMIC_ATEXIT=y
COMPAT_ATEXIT=y
UCLIBC_SUSV3_LEGACY=y
UCLIBC_SUSV3_LEGACY_MACROS=y
UCLIBC_SUSV4_LEGACY=y
UCLIBC_HAS_SHADOW=y
UCLIBC_HAS_PROGRAM_INVOCATION_NAME=y
UCLIBC_HAS___PROGNAME=y
UNIX98PTY_ONLY=y
ASSUME_DEVPTS=y
UCLIBC_HAS_LIBUTIL=y
UCLIBC_HAS_TM_EXTENSIONS=y
UCLIBC_HAS_TZ_CACHING=y
UCLIBC_HAS_TZ_FILE=y
UCLIBC_HAS_TZ_FILE_READ_MANY=y
UCLIBC_TZ_FILE_PATH="/etc/TZ"
#
# Advanced Library Settings
#
UCLIBC_PWD_BUFFER_SIZE=256
UCLIBC_GRP_BUFFER_SIZE=256
#
# Networking Support
#
UCLIBC_HAS_IPV6=y
UCLIBC_HAS_RPC=y
UCLIBC_HAS_FULL_RPC=y
# UCLIBC_HAS_REENTRANT_RPC is not set
UCLIBC_USE_NETLINK=y
UCLIBC_SUPPORT_AI_ADDRCONFIG=y
UCLIBC_HAS_BSD_RES_CLOSE=y
UCLIBC_HAS_LIBRESOLV_STUB=y
UCLIBC_HAS_LIBNSL_STUB=y
#
# String and Stdio Support
#
UCLIBC_HAS_STRING_GENERIC_OPT=y
UCLIBC_HAS_STRING_ARCH_OPT=y
UCLIBC_HAS_CTYPE_TABLES=y
UCLIBC_HAS_CTYPE_SIGNED=y
# UCLIBC_HAS_CTYPE_UNSAFE is not set
UCLIBC_HAS_CTYPE_CHECKED=y
# UCLIBC_HAS_CTYPE_ENFORCED is not set
UCLIBC_HAS_WCHAR=y
# UCLIBC_HAS_LOCALE is not set
UCLIBC_HAS_HEXADECIMAL_FLOATS=y
UCLIBC_HAS_GLIBC_CUSTOM_PRINTF=y
UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9
UCLIBC_HAS_SCANF_GLIBC_A_FLAG=y
# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set
UCLIBC_HAS_STDIO_BUFSIZ_256=y
# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set
# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set
# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set
# UCLIBC_HAS_STDIO_BUFSIZ_4096 is not set
# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set
UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y
# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set
# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set
# UCLIBC_HAS_STDIO_SHUTDOWN_ON_ABORT is not set
UCLIBC_HAS_STDIO_GETC_MACRO=y
UCLIBC_HAS_STDIO_PUTC_MACRO=y
UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y
# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set
UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE=y
UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y
UCLIBC_HAS_PRINTF_M_SPEC=y
UCLIBC_HAS_ERRNO_MESSAGES=y
# UCLIBC_HAS_SYS_ERRLIST is not set
UCLIBC_HAS_SIGNUM_MESSAGES=y
# UCLIBC_HAS_SYS_SIGLIST is not set
UCLIBC_HAS_GNU_GETOPT=y
UCLIBC_HAS_GNU_GETSUBOPT=y
#
# Big and Tall
#
UCLIBC_HAS_REGEX=y
# UCLIBC_HAS_REGEX_OLD is not set
UCLIBC_HAS_FNMATCH=y
# UCLIBC_HAS_FNMATCH_OLD is not set
UCLIBC_HAS_WORDEXP=y
UCLIBC_HAS_NFTW=y
UCLIBC_HAS_FTW=y
UCLIBC_HAS_FTS=y
UCLIBC_HAS_GLOB=y
UCLIBC_HAS_GNU_GLOB=y
#
# Library Installation Options
#
SHARED_LIB_LOADER_PREFIX="/lib"
RUNTIME_PREFIX="/"
DEVEL_PREFIX="//usr"
#
# Security options
#
# UCLIBC_BUILD_PIE is not set
# UCLIBC_HAS_ARC4RANDOM is not set
# HAVE_NO_SSP is not set
# UCLIBC_HAS_SSP is not set
UCLIBC_BUILD_RELRO=y
UCLIBC_BUILD_NOW=y
UCLIBC_BUILD_NOEXECSTACK=y
#
# uClibc development/debugging options
#
CROSS_COMPILER_PREFIX=""
UCLIBC_EXTRA_CFLAGS=""
# DODEBUG is not set
# DODEBUG_PT is not set
# DOSTRIP is not set
# DOASSERTS is not set
# SUPPORT_LD_DEBUG is not set
# SUPPORT_LD_DEBUG_EARLY is not set
# UCLIBC_MALLOC_DEBUGGING is not set
UCLIBC_HAS_BACKTRACE=y
WARNINGS="-Wall"
# EXTRA_WARNINGS is not set
# DOMULTI is not set
# UCLIBC_MJN3_ONLY is not set
# math stuff for perl
DO_C99_MATH=y
UCLIBC_HAS_LONG_DOUBLE_MATH=y
UCLIBC_HAS_FENV=y
UCLIBC_LINUX_SPECIFIC=y
UCLIBC_HAS_REALTIME=y
UCLIBC_HAS_ADVANCED_REALTIME=y
UCLIBC_HAS_NETWORK_SUPPORT=y
UCLIBC_HAS_SOCKET=y
UCLIBC_HAS_BSD_ERR=y
UCLIBC_HAS_SYSLOG=y
UCLIBC_HAS_CRYPT=y
UCLIBC_HAS_CRYPT_IMPL=y
UCLIBC_HAS_GNU_ERROR=y
UCLIBC_HAS_PTY=y
UCLIBC_BSD_SPECIFIC=y
UCLIBC_HAS_EPOLL=y
UCLIBC_HAS_FLOATS=y
# The below option is needed for ARM since depending
# upong what intruction set is chosen this will be
# enabled. As such it is harmless and will be punted
# by menuconfig for other arches.
# COMPILE_IN_THUMB_MODE is not set
# needed by systemd
UCLIBC_HAS_UTMPX=y
UCLIBC_LINUX_MODULE_26=y
UCLIBC_HAS_RESOLVER_SUPPORT=y
# needed for LTP
UCLIBC_SUSV4_LEGACY=y
UCLIBC_HAS_OBSOLETE_BSD_SIGNAL=y
DO_XSI_MATH=y
UCLIBC_SV4_DEPRECATED=y

View File

@ -1,14 +0,0 @@
#
# Automatically generated make config: don't edit
# Version: 0.9.32-git
# Mon Jul 19 01:34:29 2010
#
#
# Using ELF file format
#
FORCE_OPTIONS_FOR_ARCH=y
ARCH_HAS_MMU=y
ARCH_USE_MMU=y
KERNEL_HEADERS="/usr/include"
HAVE_DOT_CONFIG=y

View File

@ -1,163 +0,0 @@
From d20556adadea03bff0bba051172caf0314a35471 Mon Sep 17 00:00:00 2001
From: Henning Heinold <heinold@inf.fu-berlin.de>
Date: Sat, 4 Jun 2011 21:23:15 +0200
Subject: [PATCH 2/2] libc: add non standard execvpe function
Signed-off-by: Henning Heinold <heinold@inf.fu-berlin.de>
---
include/unistd.h | 6 ++++++
libc/unistd/exec.c | 38 +++++++++++++++++++++++++++++++++-----
libc/unistd/execvpe.c | 7 +++++++
3 files changed, 46 insertions(+), 5 deletions(-)
create mode 100644 libc/unistd/execvpe.c
Upstream-Status: Pending
diff --git a/include/unistd.h b/include/unistd.h
index 9568790..070e4f2 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -557,6 +557,12 @@ extern int execvp (__const char *__file, char *__const __argv[])
__THROW __nonnull ((1));
libc_hidden_proto(execvp)
+/* Execute FILE, searching in the `PATH' environment variable if it contains
+ no slashes, with arguments ARGV and environment from a pointer */
+extern int execvpe (__const char *__file, char *__const __argv[], char *__const __envp[])
+ __THROW __nonnull ((1));
+libc_hidden_proto(execvpe)
+
/* Execute FILE, searching in the `PATH' environment variable if
it contains no slashes, with all arguments after FILE until a
NULL pointer and environment from `environ'. */
diff --git a/libc/unistd/exec.c b/libc/unistd/exec.c
index 7d24072..802a174 100644
--- a/libc/unistd/exec.c
+++ b/libc/unistd/exec.c
@@ -32,6 +32,8 @@
/**********************************************************************/
#define EXEC_FUNC_COMMON 0
#define EXEC_FUNC_EXECVP 1
+#define EXEC_FUNC_EXECVPE 2
+
#if defined(__ARCH_USE_MMU__)
/* We have an MMU, so use alloca() to grab space for buffers and arg lists. */
@@ -58,6 +60,7 @@
* execle(a) -> execve(-)
* execv(-) -> execve(-)
* execvp(a) -> execve(-)
+ * execvpe(a) -> execve(-)
*/
# define EXEC_ALLOC_SIZE(VAR) /* nothing to do */
@@ -219,15 +222,18 @@ libc_hidden_def(execlp)
#endif
/**********************************************************************/
-#ifdef L_execvp
+#if defined (L_execvp) || defined(L_execvpe)
/* Use a default path that matches glibc behavior, since SUSv3 says
* this is implementation-defined. The default is current working dir,
* /bin, and then /usr/bin. */
static const char default_path[] = ":/bin:/usr/bin";
-
+#if defined (L_execvp)
int execvp(const char *path, char *const argv[])
+#elif defined (L_execvpe)
+int execvpe(const char *path, char *const argv[], char *const envp[])
+#endif
{
char *buf = NULL;
char *p;
@@ -245,7 +251,11 @@ int execvp(const char *path, char *const argv[])
}
if (strchr(path, '/')) {
+#if defined (L_execvp)
execve(path, argv, __environ);
+#elif defined (L_execvpe)
+ execve(path, argv, envp);
+#endif
if (errno == ENOEXEC) {
char **nargv;
EXEC_ALLOC_SIZE(size2) /* Do NOT add a semicolon! */
@@ -254,11 +264,19 @@ int execvp(const char *path, char *const argv[])
/* Need the dimension - 1. We omit counting the trailing
* NULL but we actually omit the first entry. */
for (n=0 ; argv[n] ; n++) {}
+#if defined (L_execvp)
nargv = (char **) EXEC_ALLOC((n+2) * sizeof(char *), size2, EXEC_FUNC_EXECVP);
+#elif defined (L_execvpe)
+ nargv = (char **) EXEC_ALLOC((n+2) * sizeof(char *), size2, EXEC_FUNC_EXECVPE);
+#endif
nargv[0] = argv[0];
nargv[1] = (char *)path;
memcpy(nargv+2, argv+1, n*sizeof(char *));
+#if defined (L_execvp)
execve("/bin/sh", nargv, __environ);
+#elif defined (L_execvpe)
+ execve("/bin/sh", nargv, envp);
+#endif
EXEC_FREE(nargv, size2);
}
} else {
@@ -277,8 +295,11 @@ int execvp(const char *path, char *const argv[])
return -1;
}
len = (FILENAME_MAX - 1) - plen;
-
+#if defined (L_execvp)
buf = EXEC_ALLOC(FILENAME_MAX, size, EXEC_FUNC_EXECVP);
+#elif defined (L_execvpe)
+ buf = EXEC_ALLOC(FILENAME_MAX, size, EXEC_FUNC_EXECVPE);
+#endif
{
int seen_small = 0;
s0 = buf + len;
@@ -300,8 +321,11 @@ int execvp(const char *path, char *const argv[])
s[plen-1] = '/';
}
+#if defined (L_execvp)
execve(s, argv, __environ);
-
+#elif defined (L_execvpe)
+ execve(s, argv, envp);
+#endif
seen_small = 1;
if (errno == ENOEXEC) {
@@ -325,7 +349,11 @@ int execvp(const char *path, char *const argv[])
return -1;
}
+#if defined (L_execvp)
libc_hidden_def(execvp)
-
+#elif defined (L_execvpe)
+libc_hidden_def(execvpe)
#endif
+
+#endif /* #if defined (L_execvp) || defined(L_execvpe) */
/**********************************************************************/
diff --git a/libc/unistd/execvpe.c b/libc/unistd/execvpe.c
new file mode 100644
index 0000000..5c1ce06
--- /dev/null
+++ b/libc/unistd/execvpe.c
@@ -0,0 +1,7 @@
+/* Copyright (C) 2011 Hennning Heinold <heinold@inf.fu-berlin.de>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#define L_execvpe
+#include "exec.c"
--
1.7.5.3

View File

@ -1,35 +0,0 @@
uclibc now has log2 so enable the tests
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Upstream-Status: Pending
Index: uClibc/test/math/libm-test.inc
===================================================================
--- uClibc/test/math/libm-test.inc (revision 23784)
+++ uClibc/test/math/libm-test.inc (working copy)
@@ -3414,7 +3414,6 @@
}
-#if 0
static void
log2_test (void)
{
@@ -3444,7 +3443,6 @@
END (log2);
}
-#endif
static void
@@ -4967,9 +4965,7 @@
log_test ();
log10_test ();
log1p_test ();
-#if 0
log2_test ();
-#endif
logb_test ();
modf_test ();
ilogb_test ();

View File

@ -1,36 +0,0 @@
SECTION = "base"
require uclibc.inc
require uclibc-${PV}.inc
DEPENDS = "linux-libc-headers ncurses-native virtual/${TARGET_PREFIX}gcc-initial"
PROVIDES = "virtual/${TARGET_PREFIX}libc-initial"
PACKAGES = ""
PACKAGES_DYNAMIC = ""
STAGINGCC = "gcc-cross-initial"
STAGINGCC_class-nativesdk = "gcc-crosssdk-initial"
do_install() {
# Install initial headers into the cross dir
make PREFIX=${D} DEVEL_PREFIX=${prefix}/ RUNTIME_PREFIX=/ \
install_headers install_startfiles
# add links to linux-libc-headers: final uclibc build need this.
for t in linux asm asm-generic; do
if [ -d ${D}${includedir}/$t ]; then
rm -rf ${D}${includedir}/$t
fi
ln -sf ${STAGING_DIR_TARGET}${includedir}/$t ${D}${includedir}/
done
}
do_compile() {
:
}
do_siteconfig () {
:
}
do_populate_sysroot[sstate-outputdirs] = "${STAGING_DIR_TCBOOTSTRAP}/"

View File

@ -1,22 +0,0 @@
SRCREV="7810e4f8027b5c4c8ceec6fefec4eb779362ebb5"
require uclibc.inc
require uclibc-package.inc
require uclibc-${PV}.inc
STAGINGCC = "gcc-cross-initial"
STAGINGCC_class-nativesdk = "gcc-crosssdk-initial"
DEPENDS = "virtual/${TARGET_PREFIX}binutils \
virtual/${TARGET_PREFIX}gcc-initial \
virtual/${TARGET_PREFIX}libc-initial \
linux-libc-headers ncurses-native"
PROVIDES += "virtual/libc virtual/${TARGET_PREFIX}libc-for-gcc"
RDEPENDS_${PN}-dev = "linux-libc-headers-dev"
RPROVIDES_${PN}-dev += "libc-dev virtual-libc-dev"
# uclibc does not really have libsegfault but then using the one from glibc is also not
# going to work. So we pretend that we have it to make bitbake not pull other recipes
# to satisfy this dependency for the images/tasks
RPROVIDES_${PN} += "libsegfault rtld(GNU_HASH)"