mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-09 14:50:05 +00:00
(CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
This commit is contained in:
parent
0ecb606cb6
commit
a334319f65
14
BUGS
14
BUGS
@ -1,7 +1,7 @@
|
||||
List of known bugs (certainly very incomplete)
|
||||
----------------------------------------------
|
||||
|
||||
Time-stamp: <2005-09-23 13:25:42 drepper>
|
||||
Time-stamp: <02/09/30 13:49:48 drepper>
|
||||
|
||||
This following list contains those bugs which I'm aware of. Please
|
||||
make sure that bugs you report are not listed here. If you can fix one
|
||||
@ -10,7 +10,7 @@ of these bugs/limitations I'll certainly be glad to receive a patch.
|
||||
Another source of information about bugs is the problem data base of the
|
||||
GNU project. There is an easy to use WWW interface available at
|
||||
|
||||
http://sourceware.org/bugzilla/
|
||||
http://www-gnats.gnu.org:8080/cgi-bin/wwwgnats.pl
|
||||
|
||||
I would appreciate it very much if you could verify the problem was not
|
||||
reported before by looking through the database. To make the information
|
||||
@ -27,9 +27,19 @@ Severity: [ *] to [***]
|
||||
[ **] Closing shared objects in statically linked binaries most of the
|
||||
times leads to crashes during the dlopen(). Hard to fix.
|
||||
|
||||
[ **] There are problems with signal handling when using LinuxThreads.
|
||||
|
||||
[ **] The RPC code is not 64 bit clean. This is getting slowly fixed
|
||||
but expect incompatible changes on 64 bit platforms like Alpha.
|
||||
|
||||
[ **] If a DSO is using implicitly libpthread and the application itself
|
||||
does not there is a name lookup problem. E.g., the function fork()
|
||||
will be found in the libc.so instead of libpthread since the thread
|
||||
library is behind the libc. To correct this problem it must *not*
|
||||
be relied on the currently still enabled handling of weak symbols
|
||||
in the dynamic linker. Instead explicit tests for the availability
|
||||
of the libpthread version are needed. [PR libc/2325]
|
||||
|
||||
[ *] The precision of the `sinhl' and/or `asinhl' function do not seem
|
||||
to be the best.
|
||||
|
||||
|
21
ChangeLog.11
21
ChangeLog.11
@ -1352,11 +1352,6 @@
|
||||
* sysdeps/unix/sysv/linux/mips/sys/tas.h: Add missing .mips0 at the
|
||||
end of inline assembler code.
|
||||
|
||||
2000-10-02 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
* sunrpc/svc_udp.c (svcudp_recv): Set msg_controllen to all
|
||||
remaining xp_pad space.
|
||||
|
||||
2000-10-02 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* include/features.h [__USE_FILE_OFFSET && !__REDIRECT]: Define
|
||||
@ -9285,12 +9280,6 @@
|
||||
syscall.
|
||||
* sysdeps/unix/sysv/linux/mips/truncate64.c: Likewise.
|
||||
|
||||
2000-05-30 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
* resolv/res_query.c (res_nsearch): Remove unused variable
|
||||
root_on_list. If dots >= statp->ndots and as is querydomain
|
||||
fails, keep searching.
|
||||
|
||||
2000-05-30 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* sysdeps/unix/sysv/linux/alpha/oldglob.c (__old_glob): Loose __P.
|
||||
@ -9491,11 +9480,6 @@
|
||||
* sysdeps/i386/fpu/bits/mathinline.h: Define expm1 inline only if
|
||||
__FAST_MATH__ is defined.
|
||||
|
||||
2000-05-22 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
* sysdeps/i386/fpu/bits/mathinline.h (__expm1_code): Avoid using ?:
|
||||
with omitted middle operand.
|
||||
|
||||
2000-05-22 Andreas Jaeger <aj@suse.de>
|
||||
|
||||
* math/Makefile: Add -D__FAST_MATH__ to CFLAGS-test-ifloat.c,
|
||||
@ -9734,11 +9718,6 @@
|
||||
* manual/arith.texi (Parsing of Integers): Fix typo.
|
||||
Closes PR libc/1744, reported by blp@gnu.org.
|
||||
|
||||
2000-05-17 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
* inet/rcmd.c (rcmd_af): If *ahost cannot be resolved, include
|
||||
unresolved hostname in the message.
|
||||
|
||||
2000-05-17 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
* sysdeps/arm/bits/huge_val.h (HUGE_VAL, HUGE_VALF): Add
|
||||
|
12
ChangeLog.12
12
ChangeLog.12
@ -7729,13 +7729,6 @@
|
||||
|
||||
* Versions.def [ld]: Add GLIBC_2.2.1.
|
||||
|
||||
2001-01-10 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
* malloc/memusage.c (me): If not SUID/SGID, allow creating new
|
||||
$MEMUSAGE_OUTPUT file.
|
||||
* sysdeps/generic/segfault.c (segfault.c): If not SUID/SGID, allow
|
||||
creating new $SEGFAULT_OUTPUT_NAME file.
|
||||
|
||||
2001-01-10 H.J. Lu <hjl@gnu.org>
|
||||
|
||||
* elf/dl-libc.c (do_dlopen): Call DL_STATIC_INIT for static binaries.
|
||||
@ -8137,11 +8130,6 @@
|
||||
* sysdeps/powerpc/soft-fp/Versions: Likewise.
|
||||
* sysdeps/sparc/sparc64/soft-fp/Versions: Likewise.
|
||||
|
||||
2001-01-02 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
* locale/setlocale.c (setlocale): Don't allocate/free category name
|
||||
unnecessarily.
|
||||
|
||||
2001-01-02 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
|
||||
|
||||
* sysdeps/powerpc/dl-machine.c (__process_machine_rela): Fix typo.
|
||||
|
5525
ChangeLog.15
5525
ChangeLog.15
File diff suppressed because it is too large
Load Diff
13478
ChangeLog.16
13478
ChangeLog.16
File diff suppressed because it is too large
Load Diff
@ -6911,9 +6911,9 @@ Sat Sep 30 11:47:05 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
|
||||
Fri Sep 29 15:07:10 1995 Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de>
|
||||
|
||||
* sysdeps/unix/sysv/linux/adjtime.c (__adjtime):
|
||||
Change name of field `mode' in `struct timex' to `modes'.
|
||||
Linux-1.3.28 updates this name according to RFC 1589.
|
||||
* sysdeps/unix/sysv/linux/adjtime.c (__adjtime):
|
||||
Change name of field `mode' in `struct timex' to `modes'.
|
||||
Linux-1.3.28 updates this name according to RFC 1489.
|
||||
|
||||
Thu Sep 28 13:05:54 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
|
||||
|
16
FAQ
16
FAQ
@ -48,8 +48,6 @@ please let me know.
|
||||
malloc/libmemprof.so. How can I fix this?
|
||||
1.20. Which tools should I use for MIPS?
|
||||
1.21. Which compiler should I use for powerpc64?
|
||||
1.22. `make' fails when running rpcgen the first time,
|
||||
what is going on? How do I fix this?
|
||||
|
||||
2. Installation and configuration issues
|
||||
|
||||
@ -575,20 +573,6 @@ For details check also my page <http://www.suse.de/~aj/glibc-mips.html>.
|
||||
{SM} You want to use at least gcc 3.2 (together with the right versions
|
||||
of all the other tools, of course).
|
||||
|
||||
|
||||
1.22. `make' fails when running rpcgen the first time,
|
||||
what is going on? How do I fix this?
|
||||
|
||||
{CO} The first invocation of rpcgen is also the first use of the recently
|
||||
compiled dynamic loader. If there is any problem with the dynamic loader
|
||||
it will more than likely fail to run rpcgen properly. This could be due to
|
||||
any number of problems.
|
||||
|
||||
The only real solution is to debug the loader and determine the problem
|
||||
yourself. Please remember that for each architecture there may be various
|
||||
patches required to get glibc HEAD into a runnable state. The best course
|
||||
of action is to determine if you have all the required patches.
|
||||
|
||||
|
||||
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|
||||
|
||||
|
13
FAQ.in
13
FAQ.in
@ -374,19 +374,6 @@ For details check also my page <http://www.suse.de/~aj/glibc-mips.html>.
|
||||
{SM} You want to use at least gcc 3.2 (together with the right versions
|
||||
of all the other tools, of course).
|
||||
|
||||
?? `make' fails when running rpcgen the first time,
|
||||
what is going on? How do I fix this?
|
||||
|
||||
{CO} The first invocation of rpcgen is also the first use of the recently
|
||||
compiled dynamic loader. If there is any problem with the dynamic loader
|
||||
it will more than likely fail to run rpcgen properly. This could be due to
|
||||
any number of problems.
|
||||
|
||||
The only real solution is to debug the loader and determine the problem
|
||||
yourself. Please remember that for each architecture there may be various
|
||||
patches required to get glibc HEAD into a runnable state. The best course
|
||||
of action is to determine if you have all the required patches.
|
||||
|
||||
? Installation and configuration issues
|
||||
|
||||
?? Can I replace the libc on my Linux system with GNU libc?
|
||||
|
178
INSTALL
178
INSTALL
@ -1,5 +1,5 @@
|
||||
Installing the GNU C Library
|
||||
****************************
|
||||
Appendix A Installing the GNU C Library
|
||||
***************************************
|
||||
|
||||
Before you do anything else, you should read the file `FAQ' located at
|
||||
the top level of the source tree. This file answers common questions
|
||||
@ -9,37 +9,46 @@ installation. It is updated more frequently than this manual.
|
||||
Features can be added to GNU Libc via "add-on" bundles. These are
|
||||
separate tar files, which you unpack into the top level of the source
|
||||
tree. Then you give `configure' the `--enable-add-ons' option to
|
||||
activate them, and they will be compiled into the library.
|
||||
activate them, and they will be compiled into the library. As of the
|
||||
2.2 release, one important component of glibc is distributed as
|
||||
"official" add-ons: the linuxthreads add-on. Unless you are doing an
|
||||
unusual installation, you should get this.
|
||||
|
||||
Support for POSIX threads is maintained by someone else, so it's in a
|
||||
separate package. It is only available for GNU/Linux systems, but this
|
||||
will change in the future. Get it from the same place you got the main
|
||||
bundle; the file is `glibc-linuxthreads-VERSION.tar.gz'.
|
||||
|
||||
You will need recent versions of several GNU tools: definitely GCC
|
||||
and GNU Make, and possibly others. *Note Tools for Compilation::,
|
||||
below.
|
||||
|
||||
Configuring and compiling GNU Libc
|
||||
==================================
|
||||
A.1 Configuring and compiling GNU Libc
|
||||
======================================
|
||||
|
||||
GNU libc cannot be compiled in the source directory. You must build it
|
||||
in a separate build directory. For example, if you have unpacked the
|
||||
glibc sources in `/src/gnu/glibc-2.4', create a directory
|
||||
GNU libc can be compiled in the source directory, but we strongly advise
|
||||
building it in a separate build directory. For example, if you have
|
||||
unpacked the glibc sources in `/src/gnu/glibc-2.3', create a directory
|
||||
`/src/gnu/glibc-build' to put the object files in. This allows
|
||||
removing the whole build directory in case an error occurs, which is
|
||||
the safest way to get a fresh start and should always be done.
|
||||
removing the whole build directory in case an error occurs, which is the
|
||||
safest way to get a fresh start and should always be done.
|
||||
|
||||
From your object directory, run the shell script `configure' located
|
||||
at the top level of the source tree. In the scenario above, you'd type
|
||||
|
||||
$ ../glibc-2.4/configure ARGS...
|
||||
$ ../glibc-2.3/configure ARGS...
|
||||
|
||||
Please note that even though you're building in a separate build
|
||||
Please note that even if you're building in a separate build
|
||||
directory, the compilation needs to modify a few files in the source
|
||||
directory, especially some files in the manual subdirectory.
|
||||
|
||||
`configure' takes many options, but the only one that is usually
|
||||
mandatory is `--prefix'. This option tells `configure' where you want
|
||||
glibc installed. This defaults to `/usr/local', but the normal setting
|
||||
to install as the standard system library is `--prefix=/usr' for
|
||||
GNU/Linux systems and `--prefix=' (an empty prefix) for GNU/Hurd
|
||||
systems.
|
||||
`configure' takes many options, but you can get away with knowing only
|
||||
two: `--prefix' and `--enable-add-ons'. The `--prefix' option tells
|
||||
`configure' where you want glibc installed. This defaults to
|
||||
`/usr/local'. The `--enable-add-ons' option tells `configure' to use
|
||||
all the add-on bundles it finds in the source directory. Since
|
||||
important functionality is provided in add-ons, you should always
|
||||
specify this option.
|
||||
|
||||
It may also be useful to set the CC and CFLAGS variables in the
|
||||
environment when running `configure'. CC selects the C compiler that
|
||||
@ -71,16 +80,12 @@ will be used, and CFLAGS sets optimization options for the compiler.
|
||||
ones found in `/usr/include'.
|
||||
|
||||
`--enable-add-ons[=LIST]'
|
||||
Specify add-on packages to include in the build. If this option is
|
||||
Enable add-on packages in your source tree. If this option is
|
||||
specified with no list, it enables all the add-on packages it
|
||||
finds in the main source directory; this is the default behavior.
|
||||
You may specify an explicit list of add-ons to use in LIST,
|
||||
separated by spaces or commas (if you use spaces, remember to
|
||||
quote them from the shell). Each add-on in LIST can be an
|
||||
absolute directory name or can be a directory name relative to the
|
||||
main source directory, or relative to the build directory (that
|
||||
is, the current working directory). For example,
|
||||
`--enable-add-ons=nptl,../glibc-libidn-2.4'.
|
||||
finds. If you do not wish to use some add-on packages that you
|
||||
have present in your source tree, give this option a list of the
|
||||
add-ons that you _do_ want used, like this:
|
||||
`--enable-add-ons=linuxthreads'
|
||||
|
||||
`--enable-kernel=VERSION'
|
||||
This option is currently only useful on GNU/Linux systems. The
|
||||
@ -163,10 +168,11 @@ produce a lot of output, some of which may look like errors from `make'
|
||||
but isn't. Look for error messages from `make' containing `***'.
|
||||
Those indicate that something is seriously wrong.
|
||||
|
||||
The compilation process can take a long time, depending on the
|
||||
configuration and the speed of your machine. Some complex modules may
|
||||
take a very long time to compile, as much as several minutes on slower
|
||||
machines. Do not panic if the compiler appears to hang.
|
||||
The compilation process can take several hours. Expect at least two
|
||||
hours for the default configuration on i586 for GNU/Linux. For Hurd,
|
||||
times are much longer. Some complex modules may take a very long time
|
||||
to compile, as much as several minutes on slower machines. Do not
|
||||
panic if the compiler appears to hang.
|
||||
|
||||
If you want to run a parallel make, simply pass the `-j' option with
|
||||
an appropriate numeric parameter to `make'. You need a recent GNU
|
||||
@ -208,8 +214,8 @@ library. You may need to set `AR' and `RANLIB' to cross-compiling
|
||||
versions of `ar' and `ranlib' if the native tools are not configured to
|
||||
work with object files for the target you configured for.
|
||||
|
||||
Installing the C Library
|
||||
========================
|
||||
A.2 Installing the C Library
|
||||
============================
|
||||
|
||||
To install the library and its header files, and the Info files of the
|
||||
manual, type `env LANGUAGE=C LC_ALL=C make install'. This will build
|
||||
@ -282,8 +288,8 @@ which is in `/usr/share/zoneinfo' to the file `/etc/localtime'. For
|
||||
Germany, you might execute `ln -s /usr/share/zoneinfo/Europe/Berlin
|
||||
/etc/localtime'.
|
||||
|
||||
Recommended Tools for Compilation
|
||||
=================================
|
||||
A.3 Recommended Tools for Compilation
|
||||
=====================================
|
||||
|
||||
We recommend installing the following GNU tools before attempting to
|
||||
build the GNU C library:
|
||||
@ -296,18 +302,11 @@ build the GNU C library:
|
||||
recommend GNU `make' version 3.79. All earlier versions have
|
||||
severe bugs or lack features.
|
||||
|
||||
* GCC 3.4 or newer, GCC 4.1 recommended
|
||||
* GCC 3.2 or newer
|
||||
|
||||
The GNU C library can only be compiled with the GNU C compiler
|
||||
family. For the 2.3 releases, GCC 3.2 or higher is required; GCC
|
||||
3.4 is the compiler we advise to use for 2.3 versions. For the
|
||||
2.4 release, GCC 3.4 or higher is required; as of this writing,
|
||||
GCC 4.1 is the compiler we advise to use for current versions. On
|
||||
certain machines including `powerpc64', compilers prior to GCC 4.0
|
||||
have bugs that prevent them compiling the C library code in the
|
||||
2.4 release. On other machines, GCC 4.1 is required to build the C
|
||||
library with support for the correct `long double' type format;
|
||||
these include `powerpc' (32 bit), `s390' and `s390x'.
|
||||
family. As of the 2.3 release, GCC 3.2 or higher is required. As
|
||||
of this writing, GCC 3.2 is the compiler we advise to use.
|
||||
|
||||
You can use whatever compiler you like to compile programs that
|
||||
use GNU libc, but be aware that both GCC 2.7 and 2.8 have bugs in
|
||||
@ -317,7 +316,7 @@ build the GNU C library:
|
||||
Check the FAQ for any special compiler issues on particular
|
||||
platforms.
|
||||
|
||||
* GNU `binutils' 2.15 or later
|
||||
* GNU `binutils' 2.13 or later
|
||||
|
||||
You must use GNU `binutils' (as and ld) to build the GNU C library.
|
||||
No other assembler or linker has the necessary functionality at the
|
||||
@ -331,10 +330,11 @@ build the GNU C library:
|
||||
installation mechanism for the info files is not present or works
|
||||
differently.
|
||||
|
||||
* GNU `awk' 3.0, or higher
|
||||
* GNU `awk' 3.0, or some other POSIX awk
|
||||
|
||||
`Awk' is used in several places to generate files. `gawk' 3.0 is
|
||||
known to work.
|
||||
`Awk' is used in several places to generate files. The scripts
|
||||
should work with any POSIX-compliant `awk' implementation; `gawk'
|
||||
3.0 and `mawk' 1.3 are known to work.
|
||||
|
||||
* Perl 5
|
||||
|
||||
@ -362,8 +362,80 @@ and if you change any of the message translation files you will need
|
||||
You may also need these packages if you upgrade your source tree using
|
||||
patches, although we try to avoid this.
|
||||
|
||||
Specific advice for GNU/Linux systems
|
||||
=====================================
|
||||
A.4 Supported Configurations
|
||||
============================
|
||||
|
||||
The GNU C Library currently supports configurations that match the
|
||||
following patterns:
|
||||
|
||||
alpha*-*-linux
|
||||
arm-*-linux
|
||||
cris-*-linux
|
||||
hppa-*-linux
|
||||
iX86-*-gnu
|
||||
iX86-*-linux
|
||||
ia64-*-linux
|
||||
m68k-*-linux
|
||||
mips*-*-linux
|
||||
powerpc-*-linux
|
||||
s390-*-linux
|
||||
s390x-*-linux
|
||||
sparc-*-linux
|
||||
sparc64-*-linux
|
||||
x86_64-*-linux
|
||||
|
||||
Former releases of this library (version 2.1 and/or 2.0) used to run
|
||||
on the following configurations:
|
||||
|
||||
arm-*-linuxaout
|
||||
arm-*-none
|
||||
|
||||
Very early releases (version 1.09.1 and perhaps earlier versions)
|
||||
used to run on the following configurations:
|
||||
|
||||
alpha-dec-osf1
|
||||
alpha-*-linuxecoff
|
||||
iX86-*-bsd4.3
|
||||
iX86-*-isc2.2
|
||||
iX86-*-isc3.N
|
||||
iX86-*-sco3.2
|
||||
iX86-*-sco3.2v4
|
||||
iX86-*-sysv
|
||||
iX86-*-sysv4
|
||||
iX86-force_cpu386-none
|
||||
iX86-sequent-bsd
|
||||
i960-nindy960-none
|
||||
m68k-hp-bsd4.3
|
||||
m68k-mvme135-none
|
||||
m68k-mvme136-none
|
||||
m68k-sony-newsos3
|
||||
m68k-sony-newsos4
|
||||
m68k-sun-sunos4.N
|
||||
mips-dec-ultrix4.N
|
||||
mips-sgi-irix4.N
|
||||
sparc-sun-solaris2.N
|
||||
sparc-sun-sunos4.N
|
||||
|
||||
Since no one has volunteered to test and fix these configurations,
|
||||
they are not supported at the moment. They probably don't compile;
|
||||
they definitely don't work anymore. Porting the library is not hard.
|
||||
If you are interested in doing a port, please contact the glibc
|
||||
maintainers. Start at `http://www.gnu.org/software/libc/' and read the
|
||||
references there on how to go about getting involved and contacting the
|
||||
developers.
|
||||
|
||||
Valid cases of `iX86' include `i386', `i486', `i586', and `i686'.
|
||||
All of those configurations produce a library that can run on this
|
||||
processor and newer processors. The GCC compiler by default generates
|
||||
code that's optimized for the machine it's configured for and will use
|
||||
the instructions available on that machine. For example if your GCC is
|
||||
configured for `i686', gcc will optimize for `i686' and might issue
|
||||
some `i686' specific instructions. To generate code for other models,
|
||||
you have to configure for that model and give GCC the appropriate
|
||||
`-march=' and `-mcpu=' compiler switches via CFLAGS.
|
||||
|
||||
A.5 Specific advice for GNU/Linux systems
|
||||
=========================================
|
||||
|
||||
If you are installing GNU libc on a GNU/Linux system, you need to have
|
||||
the header files from a 2.2 or newer kernel around for reference. For
|
||||
@ -417,8 +489,8 @@ kernel-side thread support. `nscd' happens to hit these bugs
|
||||
particularly hard, but you might have problems with any threaded
|
||||
program.
|
||||
|
||||
Reporting Bugs
|
||||
==============
|
||||
A.6 Reporting Bugs
|
||||
==================
|
||||
|
||||
There are probably bugs in the GNU C library. There are certainly
|
||||
errors and omissions in this manual. If you report them, they will get
|
||||
|
189
MakeTAGS
Normal file
189
MakeTAGS
Normal file
@ -0,0 +1,189 @@
|
||||
# Make the TAGS files.
|
||||
# Copyright (C) 1992,1994,1995,1996,1998,2002,2003
|
||||
# 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
|
||||
# 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.
|
||||
|
||||
# Make this the default goal.
|
||||
TAGS:
|
||||
|
||||
ifdef subdir
|
||||
.. := ../
|
||||
endif
|
||||
|
||||
include $(..)Makeconfig
|
||||
|
||||
# Pass these to $(MAKE) calls to avoid source generation and such.
|
||||
sub-make-vars = generating=t no_deps=t
|
||||
|
||||
ifndef tags_sources
|
||||
ifeq ($(subdir),ctype)
|
||||
# In most cases, we want the C source files to come before
|
||||
# the header files so tags for optimizing #define's in the
|
||||
# headers won't be put in the tags files, but for ctype,
|
||||
# the functions are just backup for the #define's in the header.
|
||||
tags_sources = $(all-headers) $(all-sources) $(all-dist)
|
||||
else # Not ctype.
|
||||
tags_sources = $(all-sources) $(all-headers) $(all-dist)
|
||||
endif # ctype
|
||||
endif # No tags_sources
|
||||
|
||||
sysdep-dirs := $(full_config_sysdirs)
|
||||
|
||||
ifndef sysdep_dirs
|
||||
# Find all sysdep directories.
|
||||
sysdep_dirs := $(shell find $(..)sysdeps \
|
||||
$(wildcard \
|
||||
$(patsubst %,$(..)%/sysdeps,$(add-ons))) \
|
||||
-type d ! -name RCS ! -name CVS \
|
||||
! -name SCCS -print)
|
||||
endif
|
||||
|
||||
# Find all sysdep dirs there are, but putting the ones
|
||||
# we are configured to use first and preserving their order.
|
||||
all-dirs := $(subdir-dirs) \
|
||||
$(objdir) \
|
||||
$(sysdep-dirs) \
|
||||
$(source_dirs) \
|
||||
$(filter-out $(sysdep-dirs),$(sysdep_dirs))
|
||||
|
||||
# Find all the subdirs there are, but putting the ones
|
||||
# we are configured to use first and preserving their order.
|
||||
ifndef subdir
|
||||
subdirs := $(subdirs) \
|
||||
$(filter-out $(subdirs),\
|
||||
$(sort \
|
||||
$(shell sed -e 's/\#.*$$//' \
|
||||
$(wildcard $(addsuffix /Subdirs,\
|
||||
$(all-dirs)))\
|
||||
/dev/null)))
|
||||
all-dist = $(foreach Dist,$(wildcard $(all-dirs:%=%/Dist)),\
|
||||
$(addprefix $(Dist:%/Dist=%)/,\
|
||||
$(filter %.c %.h %.S %.s,\
|
||||
$(shell cat $(Dist)))))
|
||||
tags_sources = $(all-sources) $(all-headers) $(all-dist)
|
||||
else
|
||||
all-dist = $(distribute)
|
||||
endif
|
||||
|
||||
# sources and headers must be simply expanded variables
|
||||
sources := $(sources) $(filter %.c %.s %.S,$(all-dist))
|
||||
headers := $(headers) $(filter %.h,$(all-dist))
|
||||
all-dist := $(filter-out %.h %.c %.s %.S,$(all-dist))
|
||||
|
||||
sources += $(foreach lib,$(extra-libs),$($(lib)-routines:=.c))
|
||||
|
||||
# All different versions of $(sources), preserving the configured sysdep
|
||||
# directory order.
|
||||
# Files that are found in the current directory cannot occur in
|
||||
# sysdep directories, so don't bother searching them.
|
||||
sysdep-sources := $(filter-out $(wildcard $(sources)), $(sources))
|
||||
all-sources = $(wildcard $(sort $(sources) $(sources:.c=.S) $(sources:.c=.s) \
|
||||
$(others:=.c) $(tests:=.c) $(xtests:=.c) \
|
||||
$(test-srcs:=.c))) \
|
||||
$(foreach dir,$(all-dirs),\
|
||||
$(wildcard \
|
||||
$(addprefix $(dir)/,\
|
||||
$(sort $(sysdep-sources) \
|
||||
$(sysdep-sources:.c=.S) \
|
||||
$(sysdep-sources:.c=.s)))))
|
||||
|
||||
sysdep-headers := $(filter-out $(wildcard $(headers)), $(headers))
|
||||
all-headers = $(wildcard $(headers)) \
|
||||
$(foreach dir,$(all-dirs),\
|
||||
$(wildcard $(addprefix $(dir)/,$(sysdep-headers))))
|
||||
|
||||
tags_sources := $(strip $(tags_sources))
|
||||
|
||||
TAGS: $(tags_sources)
|
||||
ifdef subdir
|
||||
ifdef tags_sources
|
||||
$(ETAGS) -o $@ $^
|
||||
else
|
||||
# No sources. Create a dummy file.
|
||||
touch $@
|
||||
endif # tags_sources
|
||||
else # parent
|
||||
TAGS: subdir_TAGS
|
||||
# Note that this uses the -i switch, and thus requires v19 etags.
|
||||
$(ETAGS) -o $@ \
|
||||
$(subdirs:%=-i %/TAGS) \
|
||||
$(filter-out subdir_TAGS,$^)
|
||||
|
||||
.PHONY: subdir_TAGS $(subdirs:%=%/TAGS)
|
||||
subdir_TAGS: $(subdirs:%=%/TAGS)
|
||||
$(subdirs:%=%/TAGS):
|
||||
$(MAKE) -C $(@D) $(sub-make-vars) $(@F)
|
||||
|
||||
endif # subdir
|
||||
|
||||
ifndef XGETTEXT
|
||||
XGETTEXT = xgettext
|
||||
endif
|
||||
|
||||
P = $(..)po
|
||||
|
||||
ifdef subdir
|
||||
domain = $(subdir)
|
||||
else
|
||||
domain = libc-top
|
||||
endif
|
||||
|
||||
define extract
|
||||
@rm -f $@.new
|
||||
$(XGETTEXT) --keyword=_ --keyword=N_ --add-comments=TRANS --sort-by-file \
|
||||
--omit-header -E -n -d - $(XGETTEXTFLAGS-$(@F)) > $@.new $^
|
||||
mv -f $@.new $@
|
||||
endef
|
||||
|
||||
text-srcs := $(filter %.c %.h %.cc %.C,$(tags_sources))
|
||||
$P/$(domain).pot: $(text-srcs)
|
||||
ifeq (,$(text-srcs))
|
||||
cp /dev/null $@
|
||||
else
|
||||
$(extract)
|
||||
endif
|
||||
|
||||
all-pot = $P/libc-top.pot $P/subdirs.pot
|
||||
|
||||
ifndef subdir
|
||||
# Collect all the subdir messages, massaging the file names in comments
|
||||
# to include the subdir name.
|
||||
$P/subdirs.pot: $(subdirs:%=$P/%.pot)
|
||||
@rm -f $@.new
|
||||
(for d in $(subdirs); \
|
||||
do sed "/^#:/s% % $$d/%g" $P/$$d.pot; done) > $@.new
|
||||
mv -f $@.new $@
|
||||
|
||||
# Combine all the messages into the final sorted template translation file.
|
||||
# The following code requires GNU date.
|
||||
$P/libc.pot: $(all-pot)
|
||||
@rm -f $@.new
|
||||
set `date -R`; disp="$$6"; \
|
||||
sed -e 's/VERSION/$(version)/' \
|
||||
-e "s/DATE/`date +'%Y-%m-%d %H:%M'$$disp`/" \
|
||||
po/header.pot > $@.new
|
||||
$(XGETTEXT) -d - --omit-header -E -n $^ >> $@.new
|
||||
mv -f $@.new $@
|
||||
ifeq ($(with-cvs),yes)
|
||||
test ! -d CVS || cvs $(CVSOPTS) ci -m'Regenerated from source files' $@
|
||||
endif
|
||||
|
||||
$(subdirs:%=$P/%.pot): $P/%.pot: FORCE
|
||||
$(MAKE) -C $* $(sub-make-vars) ../$@
|
||||
FORCE:
|
||||
endif
|
234
Makeconfig
234
Makeconfig
@ -1,4 +1,4 @@
|
||||
# Copyright (C) 1991-2003,2004,2005,2006 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1991-2003, 2004 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
|
||||
@ -99,21 +99,7 @@ binfmt-subdir = aout
|
||||
endif
|
||||
|
||||
# Complete path to sysdep dirs.
|
||||
# `configure' writes a definition of `config-sysdirs' in `config.make'.
|
||||
sysdirs := $(foreach D,$(config-sysdirs),$(firstword $(filter /%,$D) $(..)$D))
|
||||
|
||||
# Add-ons that contribute sysdeps trees get added to the include list
|
||||
# after sysdeps/generic. This makes #include <sysdeps/...> work right
|
||||
# to find specific add-on files without assuming the add-on directory name.
|
||||
# It also means that headers can go into an add-on's base directory
|
||||
# instead of the add-on needing a sysdeps/generic of its own.
|
||||
sysdeps-srcdirs := $(foreach add-on,$(sysdeps-add-ons),\
|
||||
$(firstword $(filter /%,$(add-on)) \
|
||||
$(..)$(add-on)))
|
||||
+sysdep_dirs = $(sysdirs) $(sysdeps-srcdirs)
|
||||
ifdef objdir
|
||||
+sysdep_dirs := $(objdir) $(+sysdep_dirs)
|
||||
endif
|
||||
export full_config_sysdirs := $(addprefix $(..),$(config-sysdirs))
|
||||
|
||||
# Run config.status to update config.make and config.h. We don't show the
|
||||
# dependence of config.h to Make, because it is only touched when it
|
||||
@ -127,16 +113,16 @@ $(common-objpfx)config.make: $(common-objpfx)config.status \
|
||||
# Find all the add-on and sysdeps configure fragments, to make sure we
|
||||
# re-run configure when any of them changes.
|
||||
$(common-objpfx)config.status: $(..)version.h $(..)configure \
|
||||
$(foreach dir,$(sysdirs),\
|
||||
$(wildcard $(dir)/Implies) \
|
||||
$(foreach dir,$(full_config_sysdirs),\
|
||||
$(wildcard \
|
||||
$(dir)/Implies) \
|
||||
$(patsubst %.in,%,\
|
||||
$(firstword $(wildcard \
|
||||
$(addprefix $(dir)/,configure configure.in))))) \
|
||||
$(patsubst %.in,%,\
|
||||
$(foreach add-on,$(add-ons),\
|
||||
$(foreach dir,$(add-ons),\
|
||||
$(firstword $(wildcard \
|
||||
$(addprefix $(firstword $(filter /%,$(add-on)) $(..)$(add-on))/,\
|
||||
configure configure.in)))))
|
||||
$(addprefix $(..)$(dir)/,configure configure.in)))))
|
||||
@cd $(@D); if test -f $(@F); then exec $(SHELL) $(@F) --recheck; else \
|
||||
echo The GNU C library has not been configured. >&2; \
|
||||
echo Run \`configure\' to configure it before building. >&2; \
|
||||
@ -413,20 +399,11 @@ LDFLAGS.so += $(relro-LDFLAGS)
|
||||
LDFLAGS-rtld += $(relro-LDFLAGS)
|
||||
endif
|
||||
|
||||
ifeq (yes,$(have-hash-style))
|
||||
# For the time being we unconditionally use 'both'. At some time we
|
||||
# should declare statically linked code as 'out of luck' and compile
|
||||
# with --hash-style=gnu only.
|
||||
hashstyle-LDFLAGS = -Wl,--hash-style=both
|
||||
LDFLAGS.so += $(hashstyle-LDFLAGS)
|
||||
LDFLAGS-rtld += $(hashstyle-LDFLAGS)
|
||||
endif
|
||||
|
||||
# Command for linking programs with the C library.
|
||||
ifndef +link
|
||||
+link = $(CC) -nostdlib -nostartfiles -o $@ \
|
||||
$(sysdep-LDFLAGS) $(config-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F)) \
|
||||
$(combreloc-LDFLAGS) $(relro-LDFLAGS) $(hashstyle-LDFLAGS) \
|
||||
$(combreloc-LDFLAGS) $(relro-LDFLAGS) \
|
||||
$(addprefix $(csu-objpfx),$(start-installed-name)) \
|
||||
$(+preinit) $(+prector) \
|
||||
$(filter-out $(addprefix $(csu-objpfx),start.o \
|
||||
@ -438,7 +415,7 @@ endif
|
||||
# Command for statically linking programs with the C library.
|
||||
ifndef +link-static
|
||||
+link-static = $(CC) -nostdlib -nostartfiles -static -o $@ \
|
||||
$(sysdep-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F)) \
|
||||
$(sysdep-LDFLAGS) $(LDFLAGS) \
|
||||
$(addprefix $(csu-objpfx),$(static-start-installed-name)) \
|
||||
$(+preinit) $(+prector) \
|
||||
$(filter-out $(addprefix $(csu-objpfx),start.o \
|
||||
@ -503,21 +480,32 @@ default-rpath = $(libdir)
|
||||
endif
|
||||
|
||||
ifndef link-extra-libs
|
||||
link-extra-libs = $(LDLIBS-$(@F))
|
||||
link-extra-libs-static = $(link-extra-libs)
|
||||
link-extra-libs-bounded = $(link-extra-libs)
|
||||
ifeq (yes,$(build-shared))
|
||||
ifneq ($(common-objpfx),$(objpfx))
|
||||
link-extra-libs = $(foreach lib,$(LDLIBS-$(@F)),\
|
||||
$(wildcard $(common-objpfx)$(lib).so$($(notdir $(lib)).so-version) \
|
||||
$(objpfx)$(lib).so$($(notdir $(lib)).so-version)))
|
||||
else
|
||||
link-extra-libs = $(foreach lib,$(LDLIBS-$(@F)),$(common-objpfx)$(lib).so$($(notdir $(lib)).so-version))
|
||||
endif
|
||||
else
|
||||
link-extra-libs = $(foreach lib,$(LDLIBS-$(@F)),$(common-objpfx)$(lib).a)
|
||||
endif
|
||||
endif
|
||||
|
||||
# The static libraries.
|
||||
ifeq (yes,$(build-static))
|
||||
link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(common-objpfx)libc.a
|
||||
link-extra-libs-static = $(foreach lib,$(LDLIBS-$(@F)),$(common-objpfx)$(lib).a)
|
||||
else
|
||||
ifeq (yes,$(build-shared))
|
||||
# We can try to link the programs with lib*_pic.a...
|
||||
link-libc-static = $(static-gnulib) $(common-objpfx)libc_pic.a
|
||||
link-extra-libs-static = $(link-extra-libs)
|
||||
endif
|
||||
endif
|
||||
link-libc-bounded = $(common-objpfx)libc_b.a $(gnulib) $(common-objpfx)libc_b.a
|
||||
link-extra-libs-bounded = $(foreach lib,$(LDLIBS-$(@F:%-bp=%)),$(common-objpfx)$(lib)_b.a)
|
||||
|
||||
ifndef gnulib
|
||||
ifneq ($(have-cc-with-libunwind),yes)
|
||||
@ -575,15 +563,10 @@ endif
|
||||
|
||||
# Extra flags to pass to GCC.
|
||||
ifeq ($(all-warnings),yes)
|
||||
+gccwarn := -Wall -Wwrite-strings -Winline -Wcast-qual -Wbad-function-cast -Wmissing-noreturn -Wmissing-prototypes -Wmissing-declarations -Wcomment -Wcomments -Wtrigraphs -Wsign-compare -Wfloat-equal -Wmultichar
|
||||
+gccwarn := -Wall -Wwrite-strings -Winline -Wstrict-prototypes -Wcast-qual -Wbad-function-cast -Wmissing-noreturn -Wmissing-prototypes -Wmissing-declarations -Wcomment -Wcomments -Wtrigraphs -Wsign-compare -Wfloat-equal -Wmultichar
|
||||
else
|
||||
+gccwarn := -Wall -Wwrite-strings -Winline
|
||||
+gccwarn := -Wall -Wwrite-strings -Winline -Wstrict-prototypes
|
||||
endif
|
||||
+gccwarn-c = -Wstrict-prototypes
|
||||
|
||||
# We do not depend on the address of constants in different files to be
|
||||
# actually different, so allow the compiler to merge them all.
|
||||
+merge-constants = -fmerge-all-constants
|
||||
|
||||
# This is the program that generates makefile dependencies from C source files.
|
||||
# The -MP flag tells GCC >= 3.2 (which we now require) to produce dummy
|
||||
@ -595,11 +578,6 @@ endif
|
||||
# The program that makes Emacs-style TAGS files.
|
||||
ETAGS := etags
|
||||
|
||||
# The `xgettext' program for producing .pot files from sources.
|
||||
ifndef XGETTEXT
|
||||
XGETTEXT = xgettext
|
||||
endif
|
||||
|
||||
# The `m4' macro processor; this is used by sysdeps/sparc/Makefile (and
|
||||
# perhaps others) to preprocess assembly code in some cases.
|
||||
M4 = m4
|
||||
@ -644,21 +622,21 @@ ifeq "$(strip $(+cflags))" ""
|
||||
+cflags := $(default_cflags)
|
||||
endif # $(+cflags) == ""
|
||||
|
||||
+cflags += $(addprefix -mcpu=,$(with-cpu)) $(+gccwarn) $(+merge-constants)
|
||||
+cflags := $(+cflags) $(+gccwarn)
|
||||
+gcc-nowarn := -w
|
||||
|
||||
# Don't duplicate options if we inherited variables from the parent.
|
||||
+cflags := $(sort $(+cflags))
|
||||
|
||||
|
||||
# These are flags given to the C compiler to tell it to look for
|
||||
# include files (including ones given in angle brackets) in the parent
|
||||
# library source directory, in the include directory, and in the
|
||||
# current directory.
|
||||
+sysdep-includes = $(addprefix -I,$(+sysdep_dirs))
|
||||
+includes = -I$(..)include $(if $(subdir),$(objpfx:%/=-I%)) \
|
||||
$(+sysdep-includes) $(includes) \
|
||||
$(patsubst %/,-I%,$(..)) $(libio-include) -I. $(sysincludes)
|
||||
# These are flags given to the C compiler to tell it to look for include
|
||||
# files (including ones given in angle brackets) in the current directory,
|
||||
# in the parent library source directory and in the include directory.
|
||||
# `+sysdep-includes' will be defined by Makerules.
|
||||
+includes = -I$(..)include -I. \
|
||||
$(patsubst %/,-I%,$(objpfx)) $(patsubst %/,-I%,$(..)) \
|
||||
$(libio-include) $(includes) \
|
||||
$(+sysdep-includes) $(sysincludes)
|
||||
|
||||
# Since libio has several internal header files, we use a -I instead
|
||||
# of many little headers in the include directory.
|
||||
@ -675,12 +653,8 @@ CPPFLAGS = $($(subdir)-CPPFLAGS) $(+includes) $(defines) \
|
||||
$(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
|
||||
$(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
|
||||
override CFLAGS = -std=gnu99 \
|
||||
$(filter-out %frame-pointer,$(+cflags)) $(+gccwarn-c) \
|
||||
$(sysdep-CFLAGS) $(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) \
|
||||
$(CFLAGS-$(@F))
|
||||
override CXXFLAGS = $(c++-sysincludes) \
|
||||
$(filter-out %frame-pointer,$(+cflags)) $(sysdep-CFLAGS) \
|
||||
$(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) $(CFLAGS-$(@F))
|
||||
$(filter-out %frame-pointer,$(+cflags)) $(sysdep-CFLAGS) \
|
||||
$(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) $(CFLAGS-$(@F))
|
||||
|
||||
# If everything is compiled with -fPIC (implicitly) we must tell this by
|
||||
# defining the PIC symbol.
|
||||
@ -769,16 +743,20 @@ endif
|
||||
endif
|
||||
ASFLAGS += $(ASFLAGS-config)
|
||||
|
||||
+gnu-stabs = $(shell echo>&2 '*** BARF ON ME')
|
||||
|
||||
ifndef BUILD_CC
|
||||
BUILD_CC = $(CC)
|
||||
endif
|
||||
|
||||
move-if-change = $(SHELL) $(..)scripts/move-if-change
|
||||
|
||||
-include $(common-objpfx)sysd-dirs
|
||||
|
||||
ifeq ($(sysd-dirs-done),t)
|
||||
-include $(common-objpfx)sysd-sorted
|
||||
subdirs = $(sorted-subdirs)
|
||||
subdir-srcdirs = $(foreach dir,$(subdirs),\
|
||||
$(firstword $($(dir)-srcdir) $(..)$(dir)))
|
||||
endif
|
||||
|
||||
ifeq (yes, $(build-shared))
|
||||
|
||||
@ -792,7 +770,8 @@ ifeq (yes, $(build-shared))
|
||||
# (but no commands).
|
||||
%.v.i: $(common-objpfx)config.h
|
||||
sed '/^[ ]*#/d;s/^[ ]*%/#/' $(filter-out FORCE %.h,$^) \
|
||||
| $(CC) -E -undef $(CPPFLAGS) -x assembler-with-cpp - \
|
||||
| $(CC) -E -undef $(CPPFLAGS) \
|
||||
-DASSEMBLER -x assembler-with-cpp - \
|
||||
> $@T
|
||||
mv -f $@T $@
|
||||
%.v: %.v.i
|
||||
@ -808,8 +787,9 @@ ifndef avoid-generated
|
||||
# This lets add-ons give more-specific matches that override defaults
|
||||
# in the top-level file.
|
||||
$(common-objpfx)shlib-versions.v.i: \
|
||||
$(wildcard $(+sysdep_dirs:=/shlib-versions) \
|
||||
$(subdir-srcdirs:=/shlib-versions)) \
|
||||
$(wildcard $(patsubst %, $(..)%/shlib-versions,$(add-ons) \
|
||||
$(config-sysdirs) \
|
||||
$(subdirs))) \
|
||||
$(..)shlib-versions
|
||||
|
||||
soversions-default-setname = $(patsubst %, %,\
|
||||
@ -818,16 +798,11 @@ soversions-default-setname = $(patsubst %, %,\
|
||||
$(common-objpfx)soversions.i: $(..)scripts/soversions.awk \
|
||||
$(common-objpfx)shlib-versions.v
|
||||
$(AWK) -v default_setname='$(soversions-default-setname)' \
|
||||
-v cpu='$(config-machine)' \
|
||||
-v vendor='$(config-vendor)' \
|
||||
-v os='$(config-os)' \
|
||||
-v config='$(config-machine)-$(config-vendor)-$(config-os)' \
|
||||
-f $^ > $@T
|
||||
mv -f $@T $@
|
||||
$(common-objpfx)soversions.mk: $(common-objpfx)soversions.i $(..)Makeconfig
|
||||
(seen_DEFAULT=0; seen_WORDSIZE32=0; seen_WORDSIZE64=0; \
|
||||
while read which lib number setname; do \
|
||||
eval seen_$$which=1; \
|
||||
test x"$$which" = xDEFAULT || continue; \
|
||||
$(common-objpfx)soversions.mk: $(common-objpfx)soversions.i
|
||||
(while read lib number setname; do \
|
||||
case $$number in \
|
||||
[0-9]*) echo "$$lib.so-version=.$$number"; \
|
||||
echo "all-sonames+=$$lib=$$lib.so\$$($$lib.so-version)";;\
|
||||
@ -835,12 +810,6 @@ $(common-objpfx)soversions.mk: $(common-objpfx)soversions.i $(..)Makeconfig
|
||||
echo "all-sonames+=$$lib=\$$($$lib.so-version)";;\
|
||||
esac; \
|
||||
done; \
|
||||
case "$$seen_DEFAULT$$seen_WORDSIZE32$$seen_WORDSIZE64" in \
|
||||
100) echo biarch = no;; \
|
||||
101) echo biarch = 32;; \
|
||||
?1?) echo biarch = 64;; \
|
||||
*) echo >&2 BUG; exit 2;; \
|
||||
esac; \
|
||||
echo soversions.mk-done = t;) < $< > $@T; exit 0
|
||||
mv -f $@T $@
|
||||
endif
|
||||
@ -854,11 +823,31 @@ postclean-generated += soversions.mk soversions.i \
|
||||
before-compile += $(common-objpfx)gnu/lib-names.h
|
||||
ifeq ($(soversions.mk-done),t)
|
||||
$(common-objpfx)gnu/lib-names.h: $(common-objpfx)gnu/lib-names.stmp; @:
|
||||
$(common-objpfx)gnu/lib-names.stmp: $(..)scripts/lib-names.awk \
|
||||
$(common-objpfx)soversions.i
|
||||
$(common-objpfx)gnu/lib-names.stmp: $(common-objpfx)soversions.mk
|
||||
$(make-target-directory)
|
||||
@rm -f ${@:stmp=T} $@
|
||||
$(AWK) -f $^ > ${@:stmp=T}
|
||||
(echo '/* This file is automatically generated.';\
|
||||
echo ' It defines macros to allow user program to find the shared';\
|
||||
echo ' library files which come as part of GNU libc. */';\
|
||||
echo '#ifndef __GNU_LIB_NAMES_H'; \
|
||||
echo '#define __GNU_LIB_NAMES_H 1'; \
|
||||
echo; \
|
||||
(libs='$(all-sonames)';\
|
||||
for l in $$libs; do \
|
||||
name=`echo $$l | sed 's/.*=//'`; \
|
||||
upname=`echo $$l | sed 's/=.*//' | \
|
||||
tr 'abcdefghijklmnopqrstuvwxyz-' \
|
||||
'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`; \
|
||||
upname2=`echo $$name | sed 's/[.]so.*//' | \
|
||||
tr 'abcdefghijklmnopqrstuvwxyz-' \
|
||||
'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`; \
|
||||
echo "#define $${upname}_SO \"$$name\""; \
|
||||
if test $$upname != $$upname2; then \
|
||||
echo "#define $${upname2}_SO \"$$name\""; \
|
||||
fi; \
|
||||
done;) | sort; \
|
||||
echo; \
|
||||
echo '#endif /* gnu/lib-names.h */';) > ${@:stmp=T}
|
||||
$(move-if-change) ${@:stmp=T} ${@:stmp=h}
|
||||
touch $@
|
||||
endif
|
||||
@ -909,39 +898,80 @@ endif
|
||||
|
||||
# These are the subdirectories containing the library source. The order
|
||||
# is more or less arbitrary. The sorting step will take care of the
|
||||
# dependencies.
|
||||
# dependencies. Only the $(binfmt-subdir) should always be kept at the
|
||||
# end of the list.
|
||||
all-subdirs = csu assert ctype locale intl catgets math setjmp signal \
|
||||
stdlib stdio-common libio malloc string wcsmbs time dirent \
|
||||
stdlib stdio-common libio malloc string wcsmbs time dirent \
|
||||
grp pwd posix io termios resource misc socket sysvipc gmon \
|
||||
gnulib iconv iconvdata wctype manual shadow po argp \
|
||||
crypt nss localedata timezone rt conform debug \
|
||||
$(add-on-subdirs) $(dlfcn) $(binfmt-subdir)
|
||||
crypt $(add-ons) nss localedata timezone rt conform debug \
|
||||
$(sysdep-subdirs) $(dlfcn) $(binfmt-subdir)
|
||||
all-subdirs := $(filter-out $(sysdep-inhibit-subdirs),$(all-subdirs))
|
||||
|
||||
# The mach and hurd subdirectories have many generated header files which
|
||||
# much of the rest of the library depends on, so it is best to build them
|
||||
# first (and mach before hurd, at that). The before-compile additions in
|
||||
# sysdeps/{mach,hurd}/Makefile should make it reliably work for these files
|
||||
# not to exist when making in other directories, but it will be slower that
|
||||
# way with more somewhat expensive `make' invocations.
|
||||
subdirs := $(filter mach,$(subdirs)) $(filter hurd,$(subdirs)) \
|
||||
$(filter-out mach hurd,$(subdirs))
|
||||
|
||||
ifndef avoid-generated
|
||||
all-Depend-files := $(wildcard $(foreach dir,$(all-subdirs),\
|
||||
$(firstword $($(dir)-srcdir) \
|
||||
$(..)$(dir))/Depend))
|
||||
$(common-objpfx)sysd-sorted: $(..)scripts/gen-sorted.awk \
|
||||
$(common-objpfx)config.make $(..)Makeconfig \
|
||||
$(wildcard $(sysdirs:=/Subdirs)) \
|
||||
$(all-Depend-files)
|
||||
$(AWK) -f $< \
|
||||
-v subdirs='$(all-subdirs)' \
|
||||
-v srcpfx='$(..)' \
|
||||
$(filter %/Subdirs %/Depend,$^) > $@-tmp
|
||||
all-Subdirs-files = $(wildcard $(config-sysdirs:%=$(..)%/Subdirs))
|
||||
$(common-objpfx)sysd-dirs: $(common-objpfx)config.make $(all-Subdirs-files)
|
||||
$(AWK) 'BEGIN { subdirs = ""; inhibit = "" }; \
|
||||
/^#/ { next }; \
|
||||
/^[^-]/ { subdirs = subdirs " " $$0 }; \
|
||||
/^-/ { inhibit = inhibit " " substr($$0, 2) }; \
|
||||
END { printf "sysdep-subdirs =%s\n", subdirs; \
|
||||
printf "sysdep-inhibit-subdirs =%s\n", inhibit; \
|
||||
print "sysd-dirs-done = t" }' \
|
||||
$(patsubst $<,/dev/null,$^) > $@-tmp
|
||||
mv -f $@-tmp $@
|
||||
|
||||
all-Depend-files = $(wildcard $(..)*/Depend)
|
||||
$(common-objpfx)sysd-sorted: $(..)scripts/gen-sorted.awk $(all-Depend-files) \
|
||||
$(common-objpfx)sysd-dirs $(..)Makeconfig
|
||||
{ { dirs='$(patsubst $(..)%/Depend,%,$(filter %/Depend,$^))'; \
|
||||
for d in $$dirs; do \
|
||||
while read on; do \
|
||||
echo "depend $$d $$on"; \
|
||||
done < $(..)$$d/Depend; \
|
||||
done; \
|
||||
for f in $(all-subdirs); do \
|
||||
echo $$f; \
|
||||
done; \
|
||||
} | $(AWK) -f $< && \
|
||||
echo sysd-sorted-done = t; \
|
||||
} > $@-tmp
|
||||
mv -f $@-tmp $@
|
||||
$(all-Depend-files): ;
|
||||
endif
|
||||
|
||||
# Let sysdeps/ subdirs contain a Makeconfig fragment for us to include here.
|
||||
sysdep-makeconfigs := $(wildcard $(+sysdep_dirs:=/Makeconfig))
|
||||
sysdep-makeconfigs := $(wildcard $(patsubst %,$(..)%/Makeconfig,\
|
||||
$(config-sysdirs) $(add-ons)))
|
||||
|
||||
ifneq (,$(sysdep-makeconfigs))
|
||||
include $(sysdep-makeconfigs)
|
||||
Makeconfig-doing-sysdep := $(sysdep-makeconfigs)
|
||||
# Before each one, include ourselves again to do the bit below that
|
||||
# will set `Makeconfig-add-on' in an add-on's Makeconfig fragment.
|
||||
include $(foreach M,$(sysdep-makeconfigs),$(..)Makeconfig $M)
|
||||
endif
|
||||
|
||||
|
||||
endif # Makeconfig not yet included
|
||||
|
||||
# The whole body above didn't run when we are included as a subroutine
|
||||
# of ourselves in the sysdep-makeconfigs include line. This bit runs.
|
||||
ifneq (,$(Makeconfig-doing-sysdep))
|
||||
sysdep-Makeconfig := $(firstword $(Makeconfig-doing-sysdep))
|
||||
Makeconfig-doing-sysdep := $(filter-out $(sysdep-Makeconfig),\
|
||||
$(Makeconfig-doing-sysdep))
|
||||
Makeconfig-add-on := $(filter $(add-ons),$(patsubst $(..)%/Makeconfig,%,\
|
||||
$(sysdep-Makeconfig)))
|
||||
endif
|
||||
|
||||
# Local Variables:
|
||||
# mode: makefile
|
||||
# End:
|
||||
|
120
Makefile
120
Makefile
@ -1,4 +1,4 @@
|
||||
# Copyright (C) 1991-2002,2003,2004,2005,2006 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1991-2002, 2003, 2004 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
|
||||
@ -50,7 +50,6 @@ endef
|
||||
|
||||
configure: configure.in aclocal.m4; $(autoconf-it)
|
||||
%/configure: %/configure.in aclocal.m4; $(autoconf-it)
|
||||
%/preconfigure: %/preconfigure.in aclocal.m4; $(autoconf-it)
|
||||
|
||||
endif # $(AUTOCONF) = no
|
||||
|
||||
@ -65,7 +64,7 @@ endif # $(AUTOCONF) = no
|
||||
subdir_update-abi subdir_check-abi \
|
||||
subdir_echo-headers \
|
||||
subdir_install \
|
||||
subdir_objs subdir_stubs subdir_testclean \
|
||||
subdir_testclean \
|
||||
$(addprefix install-, no-libc.a bin lib data headers others)
|
||||
|
||||
headers := limits.h values.h features.h gnu-versions.h bits/libc-lock.h \
|
||||
@ -158,26 +157,13 @@ others: $(common-objpfx)testrun.sh
|
||||
|
||||
subdir-stubs := $(foreach dir,$(subdirs),$(common-objpfx)$(dir)/stubs)
|
||||
|
||||
ifeq ($(biarch),no)
|
||||
installed-stubs = $(inst_includedir)/gnu/stubs.h
|
||||
else
|
||||
installed-stubs = $(inst_includedir)/gnu/stubs-$(biarch).h
|
||||
|
||||
$(inst_includedir)/gnu/stubs.h: include/stubs-biarch.h $(+force)
|
||||
$(make-target-directory)
|
||||
$(INSTALL_DATA) $< $@
|
||||
|
||||
install-others-nosubdir: $(installed-stubs)
|
||||
endif
|
||||
|
||||
|
||||
# Since stubs.h is never needed when building the library, we simplify the
|
||||
# hairy installation process by producing it in place only as the last part
|
||||
# of the top-level `make install'. It depends on subdir_install, which
|
||||
# iterates over all the subdirs; subdir_install in each subdir depends on
|
||||
# the subdir's stubs file. Having more direct dependencies would result in
|
||||
# extra iterations over the list for subdirs and many recursive makes.
|
||||
$(installed-stubs): include/stubs-prologue.h subdir_install
|
||||
$(inst_includedir)/gnu/stubs.h: include/stubs-prologue.h subdir_install
|
||||
$(make-target-directory)
|
||||
@rm -f $(objpfx)stubs.h
|
||||
(sed '/^@/d' $<; LC_ALL=C sort $(subdir-stubs)) > $(objpfx)stubs.h
|
||||
@ -203,13 +189,7 @@ all-subdirs-targets := $(foreach dir,$(subdirs),\
|
||||
# The action for each of those is to cd into the directory and make the
|
||||
# target there.
|
||||
$(all-subdirs-targets):
|
||||
$(MAKE) $(PARALLELMFLAGS) $(subdir-target-args) $(@F)
|
||||
|
||||
define subdir-target-args
|
||||
subdir=$(@D)$(if $($(@D)-srcdir),\
|
||||
-C $($(@D)-srcdir) ..=`pwd`/,\
|
||||
-C $(@D) ..=../)
|
||||
endef
|
||||
$(MAKE) $(PARALLELMFLAGS) -C $(@D) $(@F)
|
||||
|
||||
.PHONY: $(+subdir_targets) $(all-subdirs-targets)
|
||||
|
||||
@ -243,14 +223,14 @@ mostlyclean: parent-mostlyclean
|
||||
tests-clean:
|
||||
@$(MAKE) subdir_testclean no_deps=t
|
||||
|
||||
tests: $(objpfx)c++-types-check.out $(objpfx)check-local-headers.out
|
||||
tests: $(objpfx)c++-types-check.out
|
||||
ifneq ($(CXX),no)
|
||||
check-data := $(firstword $(wildcard \
|
||||
$(foreach M,$(config-machine) $(base-machine),\
|
||||
scripts/data/c++-types-$M-$(config-os).data)))
|
||||
ifneq (,$(check-data))
|
||||
$(objpfx)c++-types-check.out: $(check-data) scripts/check-c++-types.sh
|
||||
scripts/check-c++-types.sh $< $(CXX) $(filter-out -std=gnu99 -Wstrict-prototypes,$(CFLAGS)) $(CPPFLAGS) > $@
|
||||
$(objpfx)c++-types-check.out: $(check-data)
|
||||
scripts/check-c++-types.sh $^ $(CXX) $(filter-out -std=gnu99 -Wstrict-prototypes,$(CFLAGS)) $(CPPFLAGS) > $@
|
||||
else
|
||||
$(objpfx)c++-types-check.out:
|
||||
@echo 'WARNING C++ tests not run; create a c++-types-XXX file'
|
||||
@ -258,59 +238,6 @@ $(objpfx)c++-types-check.out:
|
||||
endif
|
||||
endif
|
||||
|
||||
$(objpfx)check-local-headers.out: scripts/check-local-headers.sh
|
||||
scripts/check-local-headers.sh "$(includedir)" "$(objpfx)" > $@
|
||||
|
||||
ifneq ($(PERL),no)
|
||||
installed-headers = argp/argp.h assert/assert.h catgets/nl_types.h \
|
||||
crypt/crypt.h ctype/ctype.h debug/execinfo.h \
|
||||
dirent/dirent.h dlfcn/dlfcn.h elf/elf.h elf/link.h \
|
||||
gmon/sys/gmon.h gmon/sys/gmon_out.h gmon/sys/profil.h \
|
||||
grp/grp.h iconv/iconv.h iconv/gconv.h \
|
||||
$(wildcard inet/netinet/*.h) \
|
||||
$(wildcard inet/arpa/*.h inet/protocols/*.h) \
|
||||
inet/aliases.h inet/ifaddrs.h inet/netinet/ip6.h \
|
||||
inet/netinet/icmp6.h intl/libintl.h io/sys/stat.h \
|
||||
io/sys/statfs.h io/sys/vfs.h io/sys/statvfs.h \
|
||||
io/fcntl.h io/sys/fcntl.h io/poll.h io/sys/poll.h \
|
||||
io/utime.h io/ftw.h io/fts.h io/sys/sendfile.h \
|
||||
libio/stdio.h libio/libio.h locale/locale.h \
|
||||
locale/langinfo.h locale/xlocale.h login/utmp.h \
|
||||
login/lastlog.h login/pty.h malloc/malloc.h \
|
||||
malloc/obstack.h malloc/mcheck.h math/math.h \
|
||||
math/complex.h math/fenv.h math/tgmath.h misc/sys/uio.h \
|
||||
$(wildcard nis/rpcsvc/*.h) nptl_db/thread_db.h \
|
||||
nptl/sysdeps/pthread/pthread.h nptl/semaphore.h \
|
||||
nss/nss.h posix/sys/utsname.h posix/sys/times.h \
|
||||
posix/sys/wait.h posix/sys/types.h posix/unistd.h \
|
||||
posix/glob.h posix/regex.h posix/wordexp.h posix/fnmatch.h\
|
||||
posix/getopt.h posix/tar.h posix/sys/unistd.h \
|
||||
posix/sched.h posix/re_comp.h posix/wait.h \
|
||||
posix/cpio.h posix/spawn.h pwd/pwd.h resolv/resolv.h \
|
||||
resolv/netdb.h $(wildcard resolv/arpa/*.h) \
|
||||
resource/sys/resource.h resource/sys/vlimit.h \
|
||||
resource/sys/vtimes.h resource/ulimit.h rt/aio.h \
|
||||
rt/mqueue.h setjmp/setjmp.h shadow/shadow.h \
|
||||
signal/signal.h signal/sys/signal.h socket/sys/socket.h \
|
||||
socket/sys/un.h stdio-common/printf.h \
|
||||
stdio-common/stdio_ext.h stdlib/stdlib.h stdlib/alloca.h \
|
||||
stdlib/monetary.h stdlib/fmtmsg.h stdlib/ucontext.h \
|
||||
sysdeps/generic/inttypes.h sysdeps/generic/stdint.h \
|
||||
stdlib/errno.h stdlib/sys/errno.h string/string.h \
|
||||
string/strings.h string/memory.h string/endian.h \
|
||||
string/argz.h string/envz.h string/byteswap.h \
|
||||
$(wildcard sunrpc/rpc/*.h sunrpc/rpcsvc/*.h) \
|
||||
sysvipc/sys/ipc.h sysvipc/sys/msg.h sysvipc/sys/sem.h \
|
||||
sysvipc/sys/shm.h termios/termios.h \
|
||||
termios/sys/termios.h termios/sys/ttychars.h time/time.h \
|
||||
time/sys/time.h time/sys/timeb.h wcsmbs/wchar.h \
|
||||
wctype/wctype.h
|
||||
|
||||
tests: $(objpfx)begin-end-check.out
|
||||
$(objpfx)begin-end-check.out: scripts/begin-end-check.pl
|
||||
$(PERL) scripts/begin-end-check.pl $(installed-headers) > $@
|
||||
endif
|
||||
|
||||
# The realclean target is just like distclean for the parent, but we want
|
||||
# the subdirs to know the difference in case they care.
|
||||
realclean distclean: parent-clean
|
||||
@ -332,15 +259,6 @@ ifdef objdir
|
||||
endif
|
||||
-rm -f $(sysdep-$(distclean-1))
|
||||
|
||||
# Make the TAGS file for Emacs users.
|
||||
|
||||
.PHONY: TAGS
|
||||
TAGS:
|
||||
scripts/list-sources.sh | sed -n '/Makefile/p;\
|
||||
$(foreach S,[chsSyl] cxx sh bash pl,\
|
||||
$(subst .,\.,/.$S\(.in\)*$$/p;))' \
|
||||
| $(ETAGS) -o $@ -
|
||||
|
||||
# Make the distribution tarfile.
|
||||
.PHONY: dist tag-for-dist
|
||||
|
||||
@ -358,30 +276,26 @@ endif
|
||||
files-for-dist := README FAQ INSTALL NOTES configure
|
||||
|
||||
tag-of-stem = glibc-$(subst .,_,$*)
|
||||
dist-selector = -r $(tag-of-stem)
|
||||
|
||||
# Add-ons in the main repository but distributed in their own tar files.
|
||||
dist-separate = libidn
|
||||
dist-separate = libidn linuxthreads
|
||||
|
||||
# Directories in each add-on.
|
||||
dist-separate-libidn = libidn
|
||||
dist-separate-linuxthreads = linuxthreads linuxthreads_db
|
||||
|
||||
glibc-%.tar $(dist-separate:%=glibc-%-%.tar): $(files-for-dist) \
|
||||
$(foreach D,$(dist-separate),\
|
||||
$D/configure)
|
||||
@rm -fr glibc-$*
|
||||
$(MAKE) -q `find sysdeps $(addsuffix /sysdeps,$(sysdeps-add-ons)) \
|
||||
-name configure`
|
||||
cvs $(CVSOPTS) -Q export -d glibc-$* $(dist-selector) libc
|
||||
# Touch all the configure scripts going into the tarball since cvs export
|
||||
# might have delivered configure.in newer than configure.
|
||||
find glibc-$* -name configure -print | xargs touch
|
||||
cvs $(CVSOPTS) -Q export -d glibc-$* -r $(tag-of-stem) libc
|
||||
$(dist-do-separate-dirs)
|
||||
tar cf glibc-$*.tar glibc-$*
|
||||
rm -fr glibc-$*
|
||||
define dist-do-separate-dirs
|
||||
$(foreach dir,$(dist-separate),
|
||||
@rm -fr glibc-$(dir)-$*
|
||||
mv glibc-$*/$(dir) glibc-$(dir)-$*
|
||||
tar cf glibc-$(dir)-$*.tar glibc-$(dir)-$*
|
||||
rm -fr glibc-$(dir)-$*
|
||||
tar cf glibc-$(dir)-$*.tar -C glibc-$* $(dist-separate-$(dir))
|
||||
rm -rf $(addprefix glibc-$*/,$(dist-separate-$(dir)))
|
||||
)
|
||||
endef
|
||||
|
||||
@ -399,7 +313,7 @@ tag-%: $(files-for-dist)
|
||||
|
||||
define format-me
|
||||
@rm -f $@
|
||||
makeinfo --no-validate --plaintext --no-number-sections $< -o $@
|
||||
makeinfo --no-validate --no-warn --no-headers $< -o $@
|
||||
-chmod a-w $@
|
||||
endef
|
||||
INSTALL: manual/install.texi; $(format-me)
|
||||
@ -413,7 +327,7 @@ ifeq ($(with-cvs),yes)
|
||||
endif
|
||||
FORCE:
|
||||
|
||||
iconvdata/% localedata/% po/% manual/%: FORCE
|
||||
iconvdata/% localedata/% po/% manual/%:
|
||||
$(MAKE) $(PARALLELMFLAGS) -C $(@D) $(@F)
|
||||
|
||||
# glibc 2.0 contains some header files which aren't used with glibc 2.1
|
||||
|
@ -1,3 +1,5 @@
|
||||
# Generated from $Id$.
|
||||
|
||||
srcdir = @srcdir@
|
||||
|
||||
# Uncomment the line below if you want to do parallel build.
|
||||
|
305
Makerules
305
Makerules
@ -1,4 +1,4 @@
|
||||
# Copyright (C) 1991-2002,2003,2004,2005,2006 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1991-2002, 2003, 2004 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
|
||||
@ -56,6 +56,22 @@ ifndef +included-Makeconfig
|
||||
include $(..)Makeconfig
|
||||
endif
|
||||
|
||||
# `configure' writes a definition of `config-sysdirs' in `config.make'.
|
||||
sysdirs = $(strip $(full_config_sysdirs))
|
||||
|
||||
+sysdir_pfx = $(common-objpfx)
|
||||
|
||||
export sysdirs := $(sysdirs)
|
||||
|
||||
+sysdep_dirs := $(full_config_sysdirs)
|
||||
ifdef objdir
|
||||
+sysdep_dirs := $(objdir) $(+sysdep_dirs)
|
||||
endif
|
||||
|
||||
# Add -I switches to get the right sysdep directories.
|
||||
# `+includes' in Makeconfig references $(+sysdep-includes).
|
||||
+sysdep-includes := $(addprefix -I,$(+sysdep_dirs))
|
||||
|
||||
# This variable is used in ``include $(o-iterator)'' after defining
|
||||
# $(o-iterator-doit) to produce some desired rule using $o for the object
|
||||
# suffix, and setting $(object-suffixes-left) to $(object-suffixes); a copy
|
||||
@ -78,7 +94,7 @@ vpath %.x $(subst $(empty) ,:,$(strip $(common-objpfx) $(objpfx) \
|
||||
# being included individually by a subdir makefile (hurd/Makefile needs this).
|
||||
in-Makerules := yes
|
||||
|
||||
sysdep-makefiles := $(wildcard $(sysdirs:=/Makefile))
|
||||
sysdep-makefiles := $(wildcard $(full_config_sysdirs:=/Makefile))
|
||||
ifneq (,$(sysdep-makefiles))
|
||||
include $(sysdep-makefiles)
|
||||
endif
|
||||
@ -149,7 +165,7 @@ ifndef subdir
|
||||
$(common-objpfx)%.make: $(..)%.make.c $(..)Makerules $(common-before-compile)
|
||||
rm -f $@T $@.dT
|
||||
(echo '# Generated from $*.make.c by Makerules.'; \
|
||||
$(CC) $(CFLAGS) $(CPPFLAGS) -E -DASSEMBLER $< \
|
||||
$(CC) $(CFLAGS) $(CPPFLAGS) -E $< \
|
||||
-MD -MP -MT '$$(common-objpfx)$*.make' -MF $@.dT \
|
||||
| sed -n '/@@@/{s/@@@[ ]*\(.*\)@@@/\1/;s/[ ]*$$//p;}'; \
|
||||
echo 'common-generated += $(@F)'; \
|
||||
@ -167,7 +183,6 @@ sed-remove-dotdot := -e 's@ *\([^ \/$$][^ \]*\)@ $$(..)\1@g' \
|
||||
endif
|
||||
|
||||
|
||||
ifdef gen-as-const-headers
|
||||
# Generating headers for assembly constants.
|
||||
# We need this defined early to get into before-compile before
|
||||
# it's used in sysd-rules, below.
|
||||
@ -186,16 +201,6 @@ $(common-objpfx)%.h $(common-objpfx)%.h.d: $(..)scripts/gen-as-const.awk \
|
||||
mv -f $(@:.h.d=.h)T $(@:.h.d=.h)
|
||||
vpath %.sym $(sysdirs)
|
||||
before-compile += $(gen-as-const-headers:%.sym=$(common-objpfx)%.h)
|
||||
|
||||
tests += $(gen-as-const-headers:%.sym=test-as-const-%)
|
||||
generated += $(gen-as-const-headers:%.sym=test-as-const-%.c)
|
||||
$(objpfx)test-as-const-%.c: $(..)scripts/gen-as-const.awk $(..)Makerules \
|
||||
%.sym $(common-objpfx)%.h
|
||||
($(AWK) '{ sub(/^/, "asconst_", $$2); print; }' $(filter %.h,$^); \
|
||||
$(AWK) -v test=1 -f $< $(filter %.sym,$^); \
|
||||
echo '#include "$(..)test-skeleton.c"') > $@T
|
||||
mv -f $@T $@
|
||||
endif
|
||||
|
||||
# Generate an ordered list of implicit rules which find the source files in
|
||||
# each sysdep directory. The old method was to use vpath to search all the
|
||||
@ -203,71 +208,11 @@ endif
|
||||
# later directory would be chosen over a .c file in an earlier directory,
|
||||
# which does not preserve the desired sysdeps ordering behavior.
|
||||
|
||||
# System-dependent makefiles can put in `inhibit-sysdep-asm' wildcard
|
||||
# patterns matching sysdep directories whose assembly source files should
|
||||
# be suppressed.
|
||||
ifdef inhibit-sysdep-asm
|
||||
define open-check-inhibit-asm
|
||||
case $$sysdir in $(subst $(empty) ,|,$(inhibit-sysdep-asm))) : ;; *)
|
||||
endef
|
||||
close-check-inhibit-asm = ;; esac ;
|
||||
endif
|
||||
|
||||
-include $(common-objpfx)sysd-rules
|
||||
ifneq ($(sysd-rules-sysdirs),$(config-sysdirs))
|
||||
# The value of $(+sysdep_dirs) the sysd-rules was computed for
|
||||
# differs from the one we are using now. So force a rebuild of sysd-rules.
|
||||
sysd-rules-force = FORCE
|
||||
FORCE:
|
||||
endif
|
||||
$(common-objpfx)sysd-rules: $(common-objpfx)config.make $(..)Makerules \
|
||||
$(sysdep-makefiles) $(sysd-rules-force)
|
||||
-@rm -f $@T
|
||||
(echo 'sysd-rules-sysdirs := $(config-sysdirs)'; \
|
||||
for dir in $(config-sysdirs); do \
|
||||
case "$$dir" in \
|
||||
/*) ;; \
|
||||
*) dir="\$$(..)$$dir" ;; \
|
||||
esac; \
|
||||
for o in $(all-object-suffixes); do \
|
||||
$(open-check-inhibit-asm) \
|
||||
echo "\$$(objpfx)%$$o: $$dir/%.S \$$(before-compile); \
|
||||
\$$(compile-command.S)"; \
|
||||
echo "\$$(objpfx)%$$o: $$dir/%.s \$$(before-compile); \
|
||||
\$$(compile-command.s)"; \
|
||||
echo "\$$(objpfx)rtld-%$$o: $$dir/%.S \$$(before-compile); \
|
||||
\$$(compile-command.S)"; \
|
||||
echo "\$$(objpfx)rtld-%$$o: $$dir/%.s \$$(before-compile); \
|
||||
\$$(compile-command.s)"; \
|
||||
echo "\$$(objpfx)ptw-%$$o: $$dir/%.S \$$(before-compile); \
|
||||
\$$(compile-command.S)"; \
|
||||
echo "\$$(objpfx)ptw-%$$o: $$dir/%.s \$$(before-compile); \
|
||||
\$$(compile-command.s)"; \
|
||||
echo "\$$(objpfx)m_%$$o: $$dir/s_%.S \$$(before-compile); \
|
||||
\$$(compile-command.S)"; \
|
||||
echo "\$$(objpfx)m_%$$o: $$dir/s_%.s \$$(before-compile); \
|
||||
\$$(compile-command.s)"; \
|
||||
$(close-check-inhibit-asm) \
|
||||
echo "\$$(objpfx)%$$o: $$dir/%.c \$$(before-compile); \
|
||||
\$$(compile-command.c)"; \
|
||||
echo "\$$(objpfx)rtld-%$$o: $$dir/%.c \$$(before-compile); \
|
||||
\$$(compile-command.c)"; \
|
||||
echo "\$$(objpfx)ptw-%$$o: $$dir/%.c \$$(before-compile); \
|
||||
\$$(compile-command.c)"; \
|
||||
echo "\$$(objpfx)m_%$$o: $$dir/s_%.c \$$(before-compile); \
|
||||
\$$(compile-command.c)"; \
|
||||
done; \
|
||||
echo "\$$(inst_includedir)/%.h: $$dir/%.h \$$(+force); \
|
||||
\$$(do-install)"; \
|
||||
done; \
|
||||
echo 'sysd-rules-done = t') > $@T
|
||||
mv -f $@T $@
|
||||
|
||||
ifndef sysd-rules-done
|
||||
# Don't do deps until this exists, because it provides rules to make the deps.
|
||||
no_deps=t
|
||||
endif
|
||||
|
||||
# It matters that this set of rules, for compiling from sources in
|
||||
# the current directory (the $srcdir/$subdir) come before the
|
||||
# generated sysdep rules in included from sysd-rules below. When
|
||||
# compiling in the source tree, generated sources go into the current
|
||||
# directory, and those should be chosen before any sources in sysdeps.
|
||||
define o-iterator-doit
|
||||
$(objpfx)%$o: %.S $(before-compile); $$(compile-command.S)
|
||||
endef
|
||||
@ -286,12 +231,6 @@ endef
|
||||
object-suffixes-left := $(all-object-suffixes)
|
||||
include $(o-iterator)
|
||||
|
||||
define o-iterator-doit
|
||||
$(objpfx)%$o: %.cc $(before-compile); $$(compile-command.cc)
|
||||
endef
|
||||
object-suffixes-left := $(all-object-suffixes)
|
||||
include $(o-iterator)
|
||||
|
||||
# Omit the objpfx rules when building in the source tree, because
|
||||
# objpfx is empty and so these rules just override the ones above.
|
||||
ifdef objpfx
|
||||
@ -316,6 +255,69 @@ object-suffixes-left := $(all-object-suffixes)
|
||||
include $(o-iterator)
|
||||
endif
|
||||
|
||||
# System-dependent makefiles can put in `inhibit-sysdep-asm' wildcard
|
||||
# patterns matching sysdep directories whose assembly source files should
|
||||
# be suppressed.
|
||||
ifdef inhibit-sysdep-asm
|
||||
define open-check-inhibit-asm
|
||||
case $$sysdir in $(subst $(empty) ,|,$(inhibit-sysdep-asm))) : ;; *)
|
||||
endef
|
||||
close-check-inhibit-asm = ;; esac ;
|
||||
endif
|
||||
|
||||
-include $(+sysdir_pfx)sysd-rules
|
||||
ifneq ($(sysd-rules-sysdirs),$(config-sysdirs))
|
||||
# The value of $(+sysdep_dirs) the sysd-rules was computed for
|
||||
# differs from the one we are using now. So force a rebuild of sysd-rules.
|
||||
sysd-rules-force = FORCE
|
||||
FORCE:
|
||||
endif
|
||||
$(+sysdir_pfx)sysd-rules: $(+sysdir_pfx)config.make $(..)Makerules \
|
||||
$(wildcard $(foreach dir,$(sysdirs),\
|
||||
$(dir)/Makefile))\
|
||||
$(sysd-rules-force)
|
||||
-@rm -f $@T
|
||||
(echo 'sysd-rules-sysdirs := $(config-sysdirs)'; \
|
||||
for dir in $(config-sysdirs:%='$$(..)%'); do \
|
||||
for o in $(all-object-suffixes); do \
|
||||
$(open-check-inhibit-asm) \
|
||||
echo "\$$(objpfx)%$$o: $$dir/%.S \$$(before-compile); \
|
||||
\$$(compile-command.S)"; \
|
||||
echo "\$$(objpfx)%$$o: $$dir/%.s \$$(before-compile); \
|
||||
\$$(compile-command.s)"; \
|
||||
echo "\$$(objpfx)rtld-%$$o: $$dir/%.S \$$(before-compile); \
|
||||
\$$(compile-command.S)"; \
|
||||
echo "\$$(objpfx)rtld-%$$o: $$dir/%.s \$$(before-compile); \
|
||||
\$$(compile-command.s)"; \
|
||||
echo "\$$(objpfx)ptw-%$$o: $$dir/%.S \$$(before-compile); \
|
||||
\$$(compile-command.S)"; \
|
||||
echo "\$$(objpfx)ptw-%$$o: $$dir/%.s \$$(before-compile); \
|
||||
\$$(compile-command.s)"; \
|
||||
$(close-check-inhibit-asm) \
|
||||
echo "\$$(objpfx)%$$o: $$dir/%.c \$$(before-compile); \
|
||||
\$$(compile-command.c)"; \
|
||||
echo "\$$(objpfx)rtld-%$$o: $$dir/%.c \$$(before-compile); \
|
||||
\$$(compile-command.c)"; \
|
||||
echo "\$$(objpfx)ptw-%$$o: $$dir/%.c \$$(before-compile); \
|
||||
\$$(compile-command.c)"; \
|
||||
done; \
|
||||
echo "\$$(objpfx)m_%.S: $$dir/s_%.S; \$$(+make-include-of-dep)"; \
|
||||
echo "\$$(objpfx)m_%.c: $$dir/s_%.c; \$$(+make-include-of-dep)"; \
|
||||
done; \
|
||||
echo 'sysd-rules-done = t') > $@T
|
||||
mv -f $@T $@
|
||||
|
||||
ifndef sysd-rules-done
|
||||
# Don't do deps until this exists, because it provides rules to make the deps.
|
||||
no_deps=t
|
||||
endif
|
||||
|
||||
# This is used by the m_%.[Sc] pattern rules in sysd-rules.
|
||||
define +make-include-of-dep
|
||||
echo '#include <$<>' > $@T
|
||||
mv -f $@T $@
|
||||
endef
|
||||
|
||||
# Generate version maps, but wait until sysdep-subdirs is known
|
||||
ifeq ($(sysd-sorted-done),t)
|
||||
ifeq ($(versioning),yes)
|
||||
@ -326,7 +328,7 @@ postclean-generated += sysd-versions Versions.all abi-versions.h \
|
||||
Versions.def.v.i Versions.def.v Versions.v.i Versions.v
|
||||
|
||||
ifndef avoid-generated
|
||||
ifneq ($(sysd-versions-subdirs),$(sorted-subdirs) $(config-sysdirs))
|
||||
ifneq ($(sysd-versions-subdirs),$(all-subdirs) $(config-sysdirs))
|
||||
sysd-versions-force = FORCE
|
||||
FORCE:
|
||||
endif
|
||||
@ -336,22 +338,21 @@ $(common-objpfx)Versions.def.v.i: $(..)Versions.def \
|
||||
$(common-objpfx)Versions.all: $(..)scripts/firstversions.awk \
|
||||
$(common-objpfx)soversions.i \
|
||||
$(common-objpfx)Versions.def.v
|
||||
{ while read which lib version setname; do \
|
||||
test x"$$which" = xDEFAULT || continue; \
|
||||
{ while read lib version setname; do \
|
||||
test -z "$$setname" || echo "$$lib : $$setname"; \
|
||||
done < $(word 2,$^); \
|
||||
cat $(word 3,$^); \
|
||||
} | LC_ALL=C $(AWK) -f $< > $@T
|
||||
mv -f $@T $@
|
||||
# See %.v/%.v.i implicit rules in Makeconfig.
|
||||
$(common-objpfx)Versions.v.i: $(wildcard $(subdirs:%=$(..)%/Versions)) \
|
||||
$(common-objpfx)Versions.v.i: $(wildcard $(all-subdirs:%=$(..)%/Versions)) \
|
||||
$(wildcard $(sysdirs:%=%/Versions)) \
|
||||
$(common-objpfx)abi-versions.h \
|
||||
$(sysd-versions-force)
|
||||
$(common-objpfx)sysd-versions: $(common-objpfx)Versions.all \
|
||||
$(common-objpfx)Versions.v \
|
||||
$(..)scripts/versions.awk
|
||||
( echo 'sysd-versions-subdirs = $(subdirs) $(config-sysdirs)' ; \
|
||||
( echo 'sysd-versions-subdirs = $(all-subdirs) $(config-sysdirs)' ; \
|
||||
cat $(word 2,$^) \
|
||||
| LC_ALL=C $(AWK) -v buildroot=$(common-objpfx) -v defsfile=$< \
|
||||
-v move_if_change='$(move-if-change)' \
|
||||
@ -367,11 +368,9 @@ compile-mkdep-flags = -MD -MP -MF $@.dt -MT $@
|
||||
compile-command.S = $(compile.S) $(OUTPUT_OPTION) $(compile-mkdep-flags)
|
||||
compile-command.s = $(COMPILE.s) $< $(OUTPUT_OPTION) $(compile-mkdep-flags)
|
||||
compile-command.c = $(compile.c) $(OUTPUT_OPTION) $(compile-mkdep-flags)
|
||||
compile-command.cc = $(compile.cc) $(OUTPUT_OPTION) $(compile-mkdep-flags)
|
||||
|
||||
# GCC can grok options after the file name, and it looks nicer that way.
|
||||
compile.c = $(CC) $< -c $(CFLAGS) $(CPPFLAGS)
|
||||
compile.cc = $(CXX) $< -c $(CXXFLAGS) $(CPPFLAGS)
|
||||
compile.S = $(CC) $< -c $(CPPFLAGS) $(S-CPPFLAGS) \
|
||||
$(ASFLAGS) $(ASFLAGS-$(suffix $@))
|
||||
COMPILE.S = $(CC) -c $(CPPFLAGS) $(S-CPPFLAGS) \
|
||||
@ -487,18 +486,12 @@ $(common-objpfx)shlib.lds: $(common-objpfx)config.make $(..)Makerules
|
||||
-Wl,--verbose 2>&1 | \
|
||||
sed > $@T \
|
||||
-e '/^=========/,/^=========/!d;/^=========/d' \
|
||||
$(if $(filter yes,$(have-hash-style)), \
|
||||
-e 's/^.*\.gnu\.hash[ ]*:.*$$/ .note.ABI-tag : { *(.note.ABI-tag) } &/' \
|
||||
-e '/^[ ]*\.hash[ ]*:.*$$/{h;d;}' \
|
||||
-e '/DATA_SEGMENT_ALIGN/{H;g}' \
|
||||
, \
|
||||
-e 's/^.*\.hash[ ]*:.*$$/ .note.ABI-tag : { *(.note.ABI-tag) } &/' \
|
||||
) \
|
||||
-e 's/^.*\.hash[ ]*:.*$$/ .note.ABI-tag : { *(.note.ABI-tag) } &/' \
|
||||
-e 's/^.*\*(\.dynbss).*$$/& \
|
||||
PROVIDE(__start___libc_freeres_ptrs = .); \
|
||||
*(__libc_freeres_ptrs) \
|
||||
PROVIDE(__stop___libc_freeres_ptrs = .);/'\
|
||||
-e 's@^.*\*(\.jcr).*$$@& \
|
||||
-e 's/^.*\*(\.jcr).*$$/& \
|
||||
PROVIDE(__start___libc_subfreeres = .);\
|
||||
__libc_subfreeres : { *(__libc_subfreeres) }\
|
||||
PROVIDE(__stop___libc_subfreeres = .);\
|
||||
@ -507,8 +500,7 @@ $(common-objpfx)shlib.lds: $(common-objpfx)config.make $(..)Makerules
|
||||
PROVIDE(__stop___libc_atexit = .);\
|
||||
PROVIDE(__start___libc_thread_subfreeres = .);\
|
||||
__libc_thread_subfreeres : { *(__libc_thread_subfreeres) }\
|
||||
PROVIDE(__stop___libc_thread_subfreeres = .);\
|
||||
/DISCARD/ : { *(.gnu.glibc-stub.*) }@'
|
||||
PROVIDE(__stop___libc_thread_subfreeres = .);/'
|
||||
mv -f $@T $@
|
||||
common-generated += shlib.lds
|
||||
|
||||
@ -558,11 +550,6 @@ define build-module
|
||||
$(build-module-helper) -o $@ -T $(common-objpfx)shlib.lds \
|
||||
$(csu-objpfx)abi-note.o $(build-module-objlist)
|
||||
endef
|
||||
define build-module-asneeded
|
||||
$(build-module-helper) -o $@ -T $(common-objpfx)shlib.lds \
|
||||
$(csu-objpfx)abi-note.o \
|
||||
-Wl,--as-needed $(build-module-objlist) -Wl,--no-as-needed
|
||||
endef
|
||||
else
|
||||
ifneq (,$(findstring aix,$(config-os)))
|
||||
define build-module
|
||||
@ -676,25 +663,18 @@ include $(patsubst %,$(..)extra-lib.mk,$(extra-libs))
|
||||
endif
|
||||
|
||||
|
||||
# The makefile may define $(modules-names) to build additional modules.
|
||||
# These are built with $(build-module), except any in $(modules-names-nobuild).
|
||||
# The makefile may define $(modules-names) # to build additional
|
||||
# modules.
|
||||
ifdef modules-names
|
||||
# extra-lib.mk is included once for each extra lib to define rules
|
||||
# to build it, and to add its objects to the various variables.
|
||||
# During its evaluation, $(lib) is set to the name of the library.
|
||||
extra-modules-left := $(modules-names)
|
||||
include $(patsubst %,$(..)extra-modules.mk,$(modules-names))
|
||||
|
||||
extra-modules-build := $(filter-out $(modules-names-nobuild),$(modules-names))
|
||||
$(extra-modules-build:%=$(objpfx)%.so): $(objpfx)%.so: \
|
||||
$(objpfx)%.os $(common-objpfx)shlib.lds \
|
||||
$(common-objpfx)libc.so $(common-objpfx)libc_nonshared.a
|
||||
$(build-module)
|
||||
endif
|
||||
|
||||
+depfiles := $(sources:.c=.d) \
|
||||
$(patsubst %.o,%.d,$(filter %.o,$(extra-objs:.os=.o))) \
|
||||
$(patsubst %.o,%.d,$(filter %.o,$(extra-test-objs:.os=.o))) \
|
||||
$(addsuffix .d,$(tests) $(xtests) $(test-srcs))
|
||||
ifeq ($(build-programs),yes)
|
||||
+depfiles += $(addsuffix .d,$(others) $(sysdep-others))
|
||||
@ -990,7 +970,7 @@ $(inst_libdir)/libc.so: $(common-objpfx)format.lds \
|
||||
cat $<; \
|
||||
echo 'GROUP ( $(slibdir)/libc.so$(libc.so-version)' \
|
||||
'$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)$(libc-name))'\
|
||||
' AS_NEEDED (' $(slibdir)/$(rtld-installed-name) ') )' \
|
||||
')' \
|
||||
) > $@.new
|
||||
mv -f $@.new $@
|
||||
|
||||
@ -1113,21 +1093,8 @@ $(addprefix $(inst_datadir)/,$(install-data)): $(inst_datadir)/%: % $(+force)
|
||||
endif
|
||||
headers := $(strip $(headers))
|
||||
ifdef headers
|
||||
# This implicit rule installs headers from the source directory.
|
||||
# It may be ignored in preference to rules from sysd-rules to find
|
||||
# headers in the sysdeps tree.
|
||||
$(inst_includedir)/%.h: $(objpfx)%.h $(+force)
|
||||
$(addprefix $(inst_includedir)/,$(headers)): $(inst_includedir)/%: % $(+force)
|
||||
$(do-install)
|
||||
$(inst_includedir)/%.h: %.h $(+force)
|
||||
$(do-install)
|
||||
$(inst_includedir)/%.h: $(..)include/%.h $(+force)
|
||||
$(do-install)
|
||||
headers-nonh := $(filter-out %.h,$(headers))
|
||||
ifdef headers-nonh
|
||||
$(addprefix $(inst_includedir)/,$(headers-nonh)): $(inst_includedir)/%: \
|
||||
% $(+force)
|
||||
$(do-install)
|
||||
endif # headers-nonh
|
||||
endif # headers
|
||||
|
||||
.PHONY: install-bin-nosubdir install-bin-script-nosubdir \
|
||||
@ -1193,9 +1160,9 @@ xcheck: xtests
|
||||
|
||||
all-nonlib = $(strip $(tests) $(xtests) $(test-srcs) $(test-extras) $(others))
|
||||
ifneq (,$(all-nonlib))
|
||||
cpp-srcs-left = $(all-nonlib:=.c) $(all-nonlib:=.cc)
|
||||
cpp-srcs-left = $(all-nonlib:=.c)
|
||||
lib := nonlib
|
||||
include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
|
||||
include $(patsubst %,$(..)cppflags-iterator.mk,$(all-nonlib))
|
||||
endif
|
||||
|
||||
# The include magic above causes those files to use this variable for flags.
|
||||
@ -1294,12 +1261,18 @@ endif
|
||||
|
||||
endif
|
||||
|
||||
# These will have been set by sysdeps/posix/Makefile.
|
||||
L_tmpnam ?= 1
|
||||
TMP_MAX ?= 0
|
||||
L_ctermid ?= 1
|
||||
L_cuserid ?= 1
|
||||
|
||||
# There's no good place to put this - here will do.
|
||||
ifeq ($(filter %posix, $(sysdirs)),)
|
||||
L_tmpnam = 1
|
||||
TMP_MAX = 0
|
||||
L_ctermid = 1
|
||||
L_cuserid = 1
|
||||
else
|
||||
L_tmpnam = 20
|
||||
TMP_MAX = 238328
|
||||
L_ctermid = 9
|
||||
L_cuserid = 9
|
||||
endif
|
||||
stdio_lim = $(common-objpfx)bits/stdio_lim.h
|
||||
|
||||
$(stdio_lim:lim.h=%.h) $(stdio_lim:lim.h=%.d): $(stdio_lim:lim.h=%.st); @:
|
||||
@ -1342,8 +1315,15 @@ ifndef no_deps
|
||||
endif
|
||||
common-generated += bits/stdio_lim.h bits/stdio_lim.d bits/stdio_lim.st
|
||||
|
||||
.PHONY: TAGS
|
||||
TAGS: $(objpfx)distinfo $(..)MakeTAGS
|
||||
$(MAKE) $(addprefix -f ,$^) $@
|
||||
|
||||
$(..)po/%.pot: $(objpfx)distinfo $(..)MakeTAGS FORCE
|
||||
$(MAKE) $(addprefix -f ,$(filter-out FORCE,$^)) $@
|
||||
FORCE:
|
||||
|
||||
|
||||
.PHONY: echo-headers
|
||||
echo-headers:
|
||||
@echo $(headers)
|
||||
@ -1376,8 +1356,8 @@ common-mostlyclean:
|
||||
$(test-srcs)) \
|
||||
$(addsuffix -bp.out,$(tests) $(xtests) \
|
||||
$(test-srcs)))
|
||||
-rm -f $(addprefix $(objpfx),$(extra-objs) $(extra-test-objs) \
|
||||
$(install-lib) $(install-lib.so) \
|
||||
-rm -f $(addprefix $(objpfx),$(extra-objs) $(install-lib) \
|
||||
$(install-lib.so) \
|
||||
$(install-lib.so:%.so=%_pic.a))
|
||||
-rm -f core
|
||||
-rm -f $(objpfx)rtld-*.os
|
||||
@ -1393,6 +1373,7 @@ common-clean: common-mostlyclean
|
||||
-rm -f $(objpfx)*.d $(objpfx)*.dt
|
||||
-rm -fr $(addprefix $(objpfx),$(generated-dirs))
|
||||
-rm -f $(addprefix $(common-objpfx),$(common-generated))
|
||||
-rm -f $(objpfx)distinfo
|
||||
|
||||
# Produce a file `stubs' which contains `#define __stub_FUNCTION'
|
||||
# for each function which is a stub. We grovel over all the .d files
|
||||
@ -1403,20 +1384,44 @@ ifdef objpfx
|
||||
.PHONY: stubs # The parent Makefile calls this target.
|
||||
stubs: $(objpfx)stubs
|
||||
endif
|
||||
objs-for-stubs := $(foreach o,$(object-suffixes-for-libc),$(o-objects)) \
|
||||
$(addprefix $(objpfx),$(extra-objs))
|
||||
$(objpfx)stubs: $(objs-for-stubs)
|
||||
ifneq (,$(strip $(objs-for-stubs)))
|
||||
(cd $(objpfx).; $(OBJDUMP) -h $(patsubst $(objpfx)%,%,$^)) | \
|
||||
$(AWK) '/\.gnu\.glibc-stub\./ { \
|
||||
sub(/\.gnu\.glibc-stub\./, "", $$2); \
|
||||
stubs[$$2] = 1; } \
|
||||
END { for (s in stubs) print "#define __stub_" s }' > $@T
|
||||
$(objpfx)stubs: $(+depfiles)
|
||||
ifneq (,$(strip $(+depfiles)))
|
||||
# Use /dev/null since `...` might expand to empty.
|
||||
c=`($(patsubst %/,cd % &&,$(objpfx)) \
|
||||
sed -n -e 's@\$$(common-objpfx)@$(common-objpfx)@g' \
|
||||
-e 's@\$$(objpfx)@$(objpfx)@g' \
|
||||
-e '/stub-tag\.h/{; g; s/./&/p; }' \
|
||||
-e '/:/{x; s/^.*$$//; x; }' \
|
||||
-e 's/^.*://;s/\\$$//;s/^ *\([^ ][^ ]*\) .*$$/\1/' \
|
||||
-e '/^[^ ][^ ]*$$/{G;s/^.*\n\(..*\)/\1/;s/\n//;h; }' \
|
||||
$(patsubst $(objpfx)%,%,$^)) | sort | uniq`; \
|
||||
sed -n 's/^stub_warning *(\([^)]*\).*$$/#define __stub_\1/p' \
|
||||
$$c /dev/null > $@T
|
||||
mv -f $@T $@
|
||||
else
|
||||
> $@
|
||||
endif
|
||||
|
||||
# This information is not used for making distributions any more.
|
||||
# But it's used by MakeTAGS for making TAGS files and the .pot files.
|
||||
$(objpfx)distinfo: Makefile $(..)Makerules \
|
||||
$(wildcard $(foreach dir,$(sysdirs),$(dir)/Makefile))
|
||||
$(make-target-directory)
|
||||
$(distinfo-vars)
|
||||
mv -f $@.new $@
|
||||
|
||||
define distinfo-vars
|
||||
rm -f $@.new
|
||||
echo > $@.new 'subdir := $(subdir)'
|
||||
$(foreach var,subdir-dirs sources elided-routines sysdep_routines \
|
||||
headers sysdep_headers distribute dont_distribute generated \
|
||||
others tests xtests test-srcs extra-libs versioned \
|
||||
$(extra-libs:%=%-routines) \
|
||||
$(addprefix install-,lib lib.so data bin bin-script sbin others),
|
||||
echo >> $@.new '$(subdir)-$(var) := $($(var))'
|
||||
echo >> $@.new '$(var) = $$($(subdir)-$(var))')
|
||||
endef
|
||||
|
||||
ifneq (,$(strip $(gpl2lgpl)))
|
||||
ifneq (,$(wildcard $(..)gpl2lgpl.sed))
|
||||
# Snarf from the master source and frob the copying notice.
|
||||
|
111
NEWS
111
NEWS
@ -1,114 +1,10 @@
|
||||
GNU C Library NEWS -- history of user-visible changes. 2006-09-29
|
||||
Copyright (C) 1992-2002,2003,2004,2005,2006 Free Software Foundation, Inc.
|
||||
GNU C Library NEWS -- history of user-visible changes. 2004-12-19
|
||||
Copyright (C) 1992-2002,2003,2004 Free Software Foundation, Inc.
|
||||
See the end for copying conditions.
|
||||
|
||||
Please send GNU C library bug reports via <http://sources.redhat.com/bugzilla/>
|
||||
using `glibc' in the "product" field.
|
||||
|
||||
Version 2.5
|
||||
|
||||
* For Linux, the sorting of addresses returned by getaddrinfo now also
|
||||
handles rules 3, 4, and 7 from RFC 3484. I.e., all rules are handled.
|
||||
Implemented by Ulrich Drepper.
|
||||
|
||||
* Allow system admin to configure getaddrinfo with the /etc/gai.conf file.
|
||||
Implemented by Ulrich Drepper.
|
||||
|
||||
* New Linux interfaces: splice, tee, sync_file_range, vmsplice.
|
||||
|
||||
* New iconv module for MIK. Contributed by Alexander Shopov.
|
||||
|
||||
* For sites with broken group and/or passwd database, the auto-propagate
|
||||
option of nscd can prevent creating ID lookup entries from the results
|
||||
of a name lookup and vice versa. This usually is no problem but some
|
||||
site might have problems with the default behavior.
|
||||
Implemented by Ulrich Drepper.
|
||||
|
||||
* Iterating over entire database in NIS can be slow. With the
|
||||
SETENT_BATCH_READ option in /etc/default/nss a system admin can decide
|
||||
to trade time for memory. The entire database will be read at once.
|
||||
Implemented by Ulrich Drepper.
|
||||
|
||||
* The interfaces introduced in RFC 3542 have been implemented by
|
||||
Ulrich Drepper.
|
||||
|
||||
* Support for the new ELF hash table format was added by Ulrich Drepper.
|
||||
|
||||
* Support for priority inheritance mutexes added by Jakub Jelinek and
|
||||
Ulrich Drepper.
|
||||
|
||||
* Support for priority protected mutexes added by Jakub Jelinek.
|
||||
|
||||
* New locales: nr_ZA, pa_PK, ca_AD, ca_FR, ca_IT, el_CY, tr_CY, as_IN,
|
||||
or_IN, csb_PL, fy_NL, sr_ME.
|
||||
|
||||
Version 2.4
|
||||
|
||||
* More overflow detection functions.
|
||||
|
||||
* New iconv converters for IBM1025, IBM1122, IBM1137, IBM1153,
|
||||
IBM1154, IBM1155, IBM1156, IBM1157, and IBM1158 contributed by Jiro Sekiba.
|
||||
|
||||
More converters for IBM803, IBM901, IBM902, IBM921, IBM1008, IBM1097,
|
||||
IBM1112, IBM1123, IBM1130, IBM1140, IBM1141, IBM1142, IBM1143, IBM1144,
|
||||
IBM1145, IBM1146, IBM1147, IBM1148, IBM1149, IBM1166, IBM1167, IBM4517,
|
||||
IBM4899, IBM4909, IBM4971, IBM5347, IBM9030, IBM9066, IBM9448, IBM12712,
|
||||
IBM16804, IBM1364, IBM1371, IBM1388, IBM1390, and IBM1399 contributed
|
||||
by Masahide Washizawa.
|
||||
|
||||
* It is now possible to install audit libraries for the dynamic linker using
|
||||
LD_AUDIT. Implemented by Ulrich Drepper.
|
||||
|
||||
* The LinuxThreads add-on, providing pthreads on Linux 2.4 kernels, is no
|
||||
longer supported. The new NPTL implementation requires Linux 2.6 kernels.
|
||||
For a libc and libpthread that works well on Linux 2.4 kernels, we
|
||||
recommend using the stable 2.3 branch.
|
||||
|
||||
* The new function open_wmemstream acts like open_memstream,
|
||||
but uses a wchar_t wide character buffer.
|
||||
|
||||
* The new function ppoll is an improved version of poll, similar to pselect.
|
||||
|
||||
* New interfaces: fdopendir, openat, fstatat, fchmodat, fchownat,
|
||||
futimesat, faccessat, mkdirat, mkfifoat, mknodat,
|
||||
renameat, unlinkat, linkat, symlinkat, readlinkat.
|
||||
|
||||
* New Linux kernel system calls: unshare,
|
||||
inotify_init, inotify_add_watch, inotify_rm_watch.
|
||||
|
||||
* The euidaccess function is now also known by the alias eaccess,
|
||||
for compatibility with some other systems.
|
||||
|
||||
* Timezone data updated to 2006b version.
|
||||
|
||||
Version 2.3.6
|
||||
|
||||
* The following bugs are resolved with this release:
|
||||
|
||||
38, 253, 549, 622, 653, 721, 758, 851, 877, 915, 934, 955, 961,
|
||||
1016, 1037, 1076, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086,
|
||||
1087, 1088, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098,
|
||||
1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109,
|
||||
1110, 1111, 1112, 1113, 1125, 1137, 1138, 1249, 1250, 1251, 1252,
|
||||
1253, 1254, 1350, 1358, 1394, 1438, 1498, 1534
|
||||
|
||||
Visit <http://sources.redhat.com/bugzilla/> for the details of each bug.
|
||||
|
||||
* As of this release, GCC 4 can be used to compile the C Library.
|
||||
|
||||
* Timezone data updated to 2005m version.
|
||||
|
||||
Version 2.3.5
|
||||
|
||||
* The following bugs are resolved with this release:
|
||||
|
||||
284, 592, 602, 626, 633, 640, 650, 661, 671, 681, 693, 700, 710, 719,
|
||||
722, 723, 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736,
|
||||
737, 738, 739, 740, 741, 742, 743, 744, 745, 765, 767, 768, 769, 776,
|
||||
777, 787, 821, 822, 823, 825
|
||||
|
||||
Visit <http://sources.redhat.com/bugzilla/> for the details of each bug.
|
||||
|
||||
Version 2.3.4
|
||||
|
||||
* Support for RFC 3678. Real implementations exist only for Linux so far.
|
||||
@ -1588,8 +1484,7 @@ Version 1.04
|
||||
----------------------------------------------------------------------
|
||||
Copyright information:
|
||||
|
||||
Copyright (C) 1992-1999,2000,2001,2002,2003,2004,2005,2006
|
||||
Free Software Foundation, Inc.
|
||||
Copyright (C) 1992-1999,2000,2001,2002 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to anyone to make or distribute verbatim copies
|
||||
of this document as received, in any medium, provided that the
|
||||
|
58
NOTES
58
NOTES
@ -1,8 +1,8 @@
|
||||
Feature Test Macros
|
||||
-------------------
|
||||
|
||||
The exact set of features available when you compile a source file is
|
||||
controlled by which "feature test macros" you define.
|
||||
The exact set of features available when you compile a source file
|
||||
is controlled by which "feature test macros" you define.
|
||||
|
||||
If you compile your programs using `gcc -ansi', you get only the
|
||||
ISO C library features, unless you explicitly request additional
|
||||
@ -32,7 +32,7 @@ limited standard. It is insufficient for this purpose, as it will not
|
||||
protect you from including header files outside the standard, or
|
||||
relying on semantics undefined within the standard.
|
||||
|
||||
-- Macro: _POSIX_SOURCE
|
||||
- Macro: _POSIX_SOURCE
|
||||
If you define this macro, then the functionality from the POSIX.1
|
||||
standard (IEEE Standard 1003.1) is available, as well as all of the
|
||||
ISO C facilities.
|
||||
@ -40,7 +40,7 @@ relying on semantics undefined within the standard.
|
||||
The state of `_POSIX_SOURCE' is irrelevant if you define the macro
|
||||
`_POSIX_C_SOURCE' to a positive integer.
|
||||
|
||||
-- Macro: _POSIX_C_SOURCE
|
||||
- Macro: _POSIX_C_SOURCE
|
||||
Define this macro to a positive integer to control which POSIX
|
||||
functionality is made available. The greater the value of this
|
||||
macro, the more functionality is made available.
|
||||
@ -65,7 +65,12 @@ relying on semantics undefined within the standard.
|
||||
greater than or equal to `199506L', then the functionality from
|
||||
the 1996 edition is made available.
|
||||
|
||||
-- Macro: _BSD_SOURCE
|
||||
The Single Unix Specification specify that setting this macro to
|
||||
the value `199506L' selects all the values specified by the POSIX
|
||||
standards plus those of the Single Unix Specification, i.e., is the
|
||||
same as if `_XOPEN_SOURCE' is set to `500' (see below).
|
||||
|
||||
- Macro: _BSD_SOURCE
|
||||
If you define this macro, functionality derived from 4.3 BSD Unix
|
||||
is included as well as the ISO C, POSIX.1, and POSIX.2 material.
|
||||
|
||||
@ -83,15 +88,15 @@ relying on semantics undefined within the standard.
|
||||
must give the option `-lbsd-compat' to the compiler or linker when
|
||||
linking the program, to tell it to find functions in this special
|
||||
compatibility library before looking for them in the normal C
|
||||
library.
|
||||
library.
|
||||
|
||||
-- Macro: _SVID_SOURCE
|
||||
- Macro: _SVID_SOURCE
|
||||
If you define this macro, functionality derived from SVID is
|
||||
included as well as the ISO C, POSIX.1, POSIX.2, and X/Open
|
||||
material.
|
||||
|
||||
-- Macro: _XOPEN_SOURCE
|
||||
-- Macro: _XOPEN_SOURCE_EXTENDED
|
||||
- Macro: _XOPEN_SOURCE
|
||||
- Macro: _XOPEN_SOURCE_EXTENDED
|
||||
If you define this macro, functionality described in the X/Open
|
||||
Portability Guide is included. This is a superset of the POSIX.1
|
||||
and POSIX.2 functionality and in fact `_POSIX_SOURCE' and
|
||||
@ -108,10 +113,10 @@ relying on semantics undefined within the standard.
|
||||
functionality described so far plus some new definitions from the
|
||||
Single Unix Specification, version 2.
|
||||
|
||||
-- Macro: _LARGEFILE_SOURCE
|
||||
- Macro: _LARGEFILE_SOURCE
|
||||
If this macro is defined some extra functions are available which
|
||||
rectify a few shortcomings in all previous standards.
|
||||
Specifically, the functions `fseeko' and `ftello' are available.
|
||||
rectify a few shortcomings in all previous standards. More
|
||||
concrete the functions `fseeko' and `ftello' are available.
|
||||
Without these functions the difference between the ISO C interface
|
||||
(`fseek', `ftell') and the low-level POSIX interface (`lseek')
|
||||
would lead to problems.
|
||||
@ -119,8 +124,8 @@ relying on semantics undefined within the standard.
|
||||
This macro was introduced as part of the Large File Support
|
||||
extension (LFS).
|
||||
|
||||
-- Macro: _LARGEFILE64_SOURCE
|
||||
If you define this macro an additional set of functions is made
|
||||
- Macro: _LARGEFILE64_SOURCE
|
||||
If you define this macro an additional set of function is made
|
||||
available which enables 32 bit systems to use files of sizes beyond
|
||||
the usual limit of 2GB. This interface is not available if the
|
||||
system does not support files that large. On systems where the
|
||||
@ -133,13 +138,13 @@ relying on semantics undefined within the standard.
|
||||
`off64_t' and `fseeko' vs. `fseeko64'.
|
||||
|
||||
This macro was introduced as part of the Large File Support
|
||||
extension (LFS). It is a transition interface for the period when
|
||||
64 bit offsets are not generally used (see `_FILE_OFFSET_BITS').
|
||||
extension (LFS). It is a transition interface for the time 64 bit
|
||||
offsets are not generally used (see `_FILE_OFFSET_BITS'.
|
||||
|
||||
-- Macro: _FILE_OFFSET_BITS
|
||||
- Macro: _FILE_OFFSET_BITS
|
||||
This macro determines which file system interface shall be used,
|
||||
one replacing the other. Whereas `_LARGEFILE64_SOURCE' makes the
|
||||
64 bit interface available as an additional interface,
|
||||
one replacing the other. While `_LARGEFILE64_SOURCE' makes the
|
||||
64 bit interface available as an additional interface
|
||||
`_FILE_OFFSET_BITS' allows the 64 bit interface to replace the old
|
||||
interface.
|
||||
|
||||
@ -149,10 +154,9 @@ relying on semantics undefined within the standard.
|
||||
|
||||
If the macro is defined to the value `64', the large file interface
|
||||
replaces the old interface. I.e., the functions are not made
|
||||
available under different names (as they are with
|
||||
`_LARGEFILE64_SOURCE'). Instead the old function names now
|
||||
reference the new functions, e.g., a call to `fseeko' now indeed
|
||||
calls `fseeko64'.
|
||||
available under different names as `_LARGEFILE64_SOURCE' does.
|
||||
Instead the old function names now reference the new functions,
|
||||
e.g., a call to `fseeko' now indeed calls `fseeko64'.
|
||||
|
||||
This macro should only be selected if the system provides
|
||||
mechanisms for handling large files. On 64 bit systems this macro
|
||||
@ -162,13 +166,13 @@ relying on semantics undefined within the standard.
|
||||
This macro was introduced as part of the Large File Support
|
||||
extension (LFS).
|
||||
|
||||
-- Macro: _ISOC99_SOURCE
|
||||
- Macro: _ISOC99_SOURCE
|
||||
Until the revised ISO C standard is widely adopted the new features
|
||||
are not automatically enabled. The GNU libc nevertheless has a
|
||||
complete implementation of the new standard and to enable the new
|
||||
features the macro `_ISOC99_SOURCE' should be defined.
|
||||
|
||||
-- Macro: _GNU_SOURCE
|
||||
- Macro: _GNU_SOURCE
|
||||
If you define this macro, everything is included: ISO C89,
|
||||
ISO C99, POSIX.1, POSIX.2, BSD, SVID, X/Open, LFS, and GNU
|
||||
extensions. In the cases where POSIX.1 conflicts with BSD, the
|
||||
@ -187,8 +191,8 @@ relying on semantics undefined within the standard.
|
||||
compiler or linker. *Note:* If you forget to do this, you may get
|
||||
very strange errors at run time.
|
||||
|
||||
-- Macro: _REENTRANT
|
||||
-- Macro: _THREAD_SAFE
|
||||
- Macro: _REENTRANT
|
||||
- Macro: _THREAD_SAFE
|
||||
If you define one of these macros, reentrant versions of several
|
||||
functions get declared. Some of the functions are specified in
|
||||
POSIX.1c but many others are only available on a few other systems
|
||||
|
115
README
115
README
@ -1,84 +1,49 @@
|
||||
This directory contains the version 2.5 release of the GNU C Library.
|
||||
This directory contains the version 2.3.4 release of the GNU C Library.
|
||||
Many bugs have been fixed since the last release.
|
||||
Some bugs surely remain.
|
||||
|
||||
The GNU C Library is the standard system C library for all GNU systems,
|
||||
and is an important part of what makes up a GNU system. It provides the
|
||||
system API for all programs written in C and C-compatible languages such
|
||||
as C++ and Objective C; the runtime facilities of other programming
|
||||
languages use the C library to access the underlying operating system.
|
||||
As of this release, the GNU C library is known to run on the following
|
||||
configurations:
|
||||
|
||||
In GNU/Linux systems, the C library works with the Linux kernel to
|
||||
implement the operating system behavior seen by user applications.
|
||||
In GNU/Hurd systems, it works with a microkernel and Hurd servers.
|
||||
*-*-gnu GNU Hurd
|
||||
i[3456]86-*-linux-gnu Linux-2.x on Intel
|
||||
m68k-*-linux-gnu Linux-2.x on Motorola 680x0
|
||||
alpha*-*-linux-gnu Linux-2.x on DEC Alpha
|
||||
powerpc-*-linux-gnu Linux and MkLinux on PowerPC systems
|
||||
powerpc64-*-linux-gnu Linux-2.4.19+ on 64-bit PowerPC systems
|
||||
sparc-*-linux-gnu Linux-2.x on SPARC
|
||||
sparc64-*-linux-gnu Linux-2.x on UltraSPARC 64-bit
|
||||
arm-*-none ARM standalone systems
|
||||
arm-*-linux Linux-2.x on ARM
|
||||
arm-*-linuxaout Linux-2.x on ARM using a.out binaries
|
||||
mips*-*-linux-gnu Linux-2.x on MIPS
|
||||
ia64-*-linux-gnu Linux-2.x on ia64
|
||||
s390-*-linux-gnu Linux-2.x on IBM S/390
|
||||
s390x-*-linux-gnu Linux-2.4+ on IBM S/390 64-bit
|
||||
sh-*-linux-gnu Linux-2.x on Super Hitachi
|
||||
x86-64-*-linux-gnu Linux-2.4+ on x86-64
|
||||
|
||||
The GNU C Library implements much of the POSIX.1 functionality in the
|
||||
GNU/Hurd system, using configurations i[34567]86-*-gnu.
|
||||
Past releases of this library ran on a variety of configurations that are
|
||||
no longer supported. Porting the library is not hard. If you are
|
||||
interested in doing a port, please contact the glibc maintainers;
|
||||
see http://www.gnu.org/software/libc/ for more information.
|
||||
|
||||
When working with Linux kernels, the GNU C Library version 2.4 is
|
||||
intended primarily for use with Linux kernel version 2.6.0 and later.
|
||||
We only support using the NPTL implementation of pthreads, which is now
|
||||
the default configuration. Most of the C library will continue to work
|
||||
on older Linux kernels and many programs will not require a 2.6 kernel
|
||||
to run correctly. However, pthreads and related functionality will not
|
||||
work at all on old kernels and we do not recommend using glibc 2.4 with
|
||||
any Linux kernel prior to 2.6.
|
||||
There are some add-ons which can be used together with GNU libc. They
|
||||
are designed in a way to ease the installation by integrating them in
|
||||
the libc source tree. Simply get the add-ons you need and use the
|
||||
--enable-add-ons option of the `configure' script to tell where the
|
||||
add-ons are found. Please read the FAQ file for more details.
|
||||
|
||||
All Linux kernel versions prior to 2.6.16 are known to have some bugs that
|
||||
may cause some of the tests related to pthreads in "make check" to fail.
|
||||
If you see such problems, please try the test suite on the most recent
|
||||
Linux kernel version that you can use, before pursuing those bugs further.
|
||||
See the file INSTALL to find out how to configure, build, install, and port
|
||||
the GNU C library. You might also consider reading the WWW pages for the
|
||||
GNU libc at http://www.gnu.org/software/libc/libc.html.
|
||||
|
||||
The old LinuxThreads add-on implementation of pthreads for older Linux
|
||||
kernels is no longer supported, and we are not distributing it with this
|
||||
release. Someone has volunteered to revive its maintenance unofficially
|
||||
for at least a short time for the benefit of those using Linux kernels
|
||||
older than 2.6, but a working version is not presently available. When
|
||||
it is in working condition, we will make it available alongside future
|
||||
glibc releases. LinuxThreads will not be supported.
|
||||
|
||||
The GNU C Library supports these configurations for using Linux kernels:
|
||||
|
||||
i[34567]86-*-linux-gnu
|
||||
x86_64-*-linux-gnu
|
||||
powerpc-*-linux-gnu
|
||||
powerpc64-*-linux-gnu
|
||||
s390-*-linux-gnu
|
||||
s390x-*-linux-gnu
|
||||
ia64-*-linux-gnu
|
||||
sparc*-*-linux-gnu
|
||||
sparc64*-*-linux-gnu
|
||||
|
||||
alpha*-*-linux-gnu Requires Linux 2.6.9 for NPTL
|
||||
sh[34]-*-linux-gnu Requires Linux 2.6.11
|
||||
|
||||
The code for other CPU configurations supported by volunteers outside of
|
||||
the core glibc maintenance effort is contained in the separate `ports'
|
||||
add-on. You can find glibc-ports-2.5 distributed separately in the
|
||||
same place where you got the main glibc distribution files.
|
||||
Currently these configurations are known to work using the `ports' add-on:
|
||||
|
||||
arm-*-linux-gnu Requires Linux 2.6.15 for NPTL, no SMP support
|
||||
arm-*-linux-gnueabi Requires Linux 2.6.16-rc1 for NPTL, no SMP
|
||||
mips-*-linux-gnu Requires Linux 2.6.12 for NPTL
|
||||
mips64-*-linux-gnu Requires Linux 2.6.12 for NPTL
|
||||
|
||||
The ports distribution also contains code for other configurations that
|
||||
do not work or have not been maintained recently, but will be of use to
|
||||
anyone trying to make a new configuration work. If you are interested
|
||||
in doing a port, please contact the glibc maintainers; see
|
||||
http://www.gnu.org/software/libc/ for more information.
|
||||
|
||||
See the file INSTALL to find out how to configure, build, and install
|
||||
the GNU C Library. You might also consider reading the WWW pages for
|
||||
the C library at http://www.gnu.org/software/libc/.
|
||||
|
||||
The GNU C Library is (almost) completely documented by the Texinfo manual
|
||||
found in the `manual/' subdirectory. The manual is still being updated
|
||||
and contains some known errors and omissions; we regret that we do not
|
||||
have the resources to work on the manual as much as we would like. For
|
||||
corrections to the manual, please file a bug in the `manual' component,
|
||||
following the bug-reporting instructions below. Please be sure to check
|
||||
the manual in the current development sources to see if your problem has
|
||||
already been corrected.
|
||||
The GNU C Library is completely documented by the Texinfo manual found
|
||||
in the `manual/' subdirectory. The manual is still being updated and
|
||||
contains some known errors and omissions; we regret that we do not
|
||||
have the resources to work on the manual as much as we would like.
|
||||
Please send comments on the manual to <bug-glibc-manual@gnu.org>, and
|
||||
not to the library bug-reporting address.
|
||||
|
||||
The file NOTES contains a description of the feature-test macros used
|
||||
in the GNU C library, explaining how you can tell the library what
|
||||
|
@ -486,7 +486,7 @@ sqrt
|
||||
* Bit by bit method using integer arithmetic. (Slow, but portable)
|
||||
* 1. Normalization
|
||||
* Scale x to y in [1,4) with even powers of 2:
|
||||
* find an integer k such that 1 <= (y=x*2^(-2k)) < 4, then
|
||||
* find an integer k such that 1 <= (y=x*2^(2k)) < 4, then
|
||||
* sqrt(x) = 2^k * sqrt(y)
|
||||
* 2. Bit by bit computation
|
||||
* Let q = sqrt(y) truncated to i bit after binary point (q = 1),
|
||||
|
113
README.template
113
README.template
@ -1,84 +1,49 @@
|
||||
This directory contains the version VERSION release of the GNU C Library.
|
||||
Many bugs have been fixed since the last release.
|
||||
Some bugs surely remain.
|
||||
|
||||
The GNU C Library is the standard system C library for all GNU systems,
|
||||
and is an important part of what makes up a GNU system. It provides the
|
||||
system API for all programs written in C and C-compatible languages such
|
||||
as C++ and Objective C; the runtime facilities of other programming
|
||||
languages use the C library to access the underlying operating system.
|
||||
As of this release, the GNU C library is known to run on the following
|
||||
configurations:
|
||||
|
||||
In GNU/Linux systems, the C library works with the Linux kernel to
|
||||
implement the operating system behavior seen by user applications.
|
||||
In GNU/Hurd systems, it works with a microkernel and Hurd servers.
|
||||
*-*-gnu GNU Hurd
|
||||
i[3456]86-*-linux-gnu Linux-2.x on Intel
|
||||
m68k-*-linux-gnu Linux-2.x on Motorola 680x0
|
||||
alpha*-*-linux-gnu Linux-2.x on DEC Alpha
|
||||
powerpc-*-linux-gnu Linux and MkLinux on PowerPC systems
|
||||
powerpc64-*-linux-gnu Linux-2.4.19+ on 64-bit PowerPC systems
|
||||
sparc-*-linux-gnu Linux-2.x on SPARC
|
||||
sparc64-*-linux-gnu Linux-2.x on UltraSPARC 64-bit
|
||||
arm-*-none ARM standalone systems
|
||||
arm-*-linux Linux-2.x on ARM
|
||||
arm-*-linuxaout Linux-2.x on ARM using a.out binaries
|
||||
mips*-*-linux-gnu Linux-2.x on MIPS
|
||||
ia64-*-linux-gnu Linux-2.x on ia64
|
||||
s390-*-linux-gnu Linux-2.x on IBM S/390
|
||||
s390x-*-linux-gnu Linux-2.4+ on IBM S/390 64-bit
|
||||
sh-*-linux-gnu Linux-2.x on Super Hitachi
|
||||
x86-64-*-linux-gnu Linux-2.4+ on x86-64
|
||||
|
||||
The GNU C Library implements much of the POSIX.1 functionality in the
|
||||
GNU/Hurd system, using configurations i[34567]86-*-gnu.
|
||||
Past releases of this library ran on a variety of configurations that are
|
||||
no longer supported. Porting the library is not hard. If you are
|
||||
interested in doing a port, please contact the glibc maintainers;
|
||||
see http://www.gnu.org/software/libc/ for more information.
|
||||
|
||||
When working with Linux kernels, the GNU C Library version 2.4 is
|
||||
intended primarily for use with Linux kernel version 2.6.0 and later.
|
||||
We only support using the NPTL implementation of pthreads, which is now
|
||||
the default configuration. Most of the C library will continue to work
|
||||
on older Linux kernels and many programs will not require a 2.6 kernel
|
||||
to run correctly. However, pthreads and related functionality will not
|
||||
work at all on old kernels and we do not recommend using glibc 2.4 with
|
||||
any Linux kernel prior to 2.6.
|
||||
There are some add-ons which can be used together with GNU libc. They
|
||||
are designed in a way to ease the installation by integrating them in
|
||||
the libc source tree. Simply get the add-ons you need and use the
|
||||
--enable-add-ons option of the `configure' script to tell where the
|
||||
add-ons are found. Please read the FAQ file for more details.
|
||||
|
||||
All Linux kernel versions prior to 2.6.16 are known to have some bugs that
|
||||
may cause some of the tests related to pthreads in "make check" to fail.
|
||||
If you see such problems, please try the test suite on the most recent
|
||||
Linux kernel version that you can use, before pursuing those bugs further.
|
||||
See the file INSTALL to find out how to configure, build, install, and port
|
||||
the GNU C library. You might also consider reading the WWW pages for the
|
||||
GNU libc at http://www.gnu.org/software/libc/libc.html.
|
||||
|
||||
The old LinuxThreads add-on implementation of pthreads for older Linux
|
||||
kernels is no longer supported, and we are not distributing it with this
|
||||
release. Someone has volunteered to revive its maintenance unofficially
|
||||
for at least a short time for the benefit of those using Linux kernels
|
||||
older than 2.6, but a working version is not presently available. When
|
||||
it is in working condition, we will make it available alongside future
|
||||
glibc releases. LinuxThreads will not be supported.
|
||||
|
||||
The GNU C Library supports these configurations for using Linux kernels:
|
||||
|
||||
i[34567]86-*-linux-gnu
|
||||
x86_64-*-linux-gnu
|
||||
powerpc-*-linux-gnu
|
||||
powerpc64-*-linux-gnu
|
||||
s390-*-linux-gnu
|
||||
s390x-*-linux-gnu
|
||||
ia64-*-linux-gnu
|
||||
sparc*-*-linux-gnu
|
||||
sparc64*-*-linux-gnu
|
||||
|
||||
alpha*-*-linux-gnu Requires Linux 2.6.9 for NPTL
|
||||
sh[34]-*-linux-gnu Requires Linux 2.6.11
|
||||
|
||||
The code for other CPU configurations supported by volunteers outside of
|
||||
the core glibc maintenance effort is contained in the separate `ports'
|
||||
add-on. You can find glibc-ports-VERSION distributed separately in the
|
||||
same place where you got the main glibc distribution files.
|
||||
Currently these configurations are known to work using the `ports' add-on:
|
||||
|
||||
arm-*-linux-gnu Requires Linux 2.6.15 for NPTL, no SMP support
|
||||
arm-*-linux-gnueabi Requires Linux 2.6.16-rc1 for NPTL, no SMP
|
||||
mips-*-linux-gnu Requires Linux 2.6.12 for NPTL
|
||||
mips64-*-linux-gnu Requires Linux 2.6.12 for NPTL
|
||||
|
||||
The ports distribution also contains code for other configurations that
|
||||
do not work or have not been maintained recently, but will be of use to
|
||||
anyone trying to make a new configuration work. If you are interested
|
||||
in doing a port, please contact the glibc maintainers; see
|
||||
http://www.gnu.org/software/libc/ for more information.
|
||||
|
||||
See the file INSTALL to find out how to configure, build, and install
|
||||
the GNU C Library. You might also consider reading the WWW pages for
|
||||
the C library at http://www.gnu.org/software/libc/.
|
||||
|
||||
The GNU C Library is (almost) completely documented by the Texinfo manual
|
||||
found in the `manual/' subdirectory. The manual is still being updated
|
||||
and contains some known errors and omissions; we regret that we do not
|
||||
have the resources to work on the manual as much as we would like. For
|
||||
corrections to the manual, please file a bug in the `manual' component,
|
||||
following the bug-reporting instructions below. Please be sure to check
|
||||
the manual in the current development sources to see if your problem has
|
||||
already been corrected.
|
||||
The GNU C Library is completely documented by the Texinfo manual found
|
||||
in the `manual/' subdirectory. The manual is still being updated and
|
||||
contains some known errors and omissions; we regret that we do not
|
||||
have the resources to work on the manual as much as we would like.
|
||||
Please send comments on the manual to <bug-glibc-manual@gnu.org>, and
|
||||
not to the library bug-reporting address.
|
||||
|
||||
The file NOTES contains a description of the feature-test macros used
|
||||
in the GNU C library, explaining how you can tell the library what
|
||||
|
12
Rules
12
Rules
@ -1,5 +1,4 @@
|
||||
# Copyright (C) 1991-2000,2002,2003,2004,2005,2006
|
||||
# Free Software Foundation, Inc.
|
||||
# Copyright (C) 1991-2000,2002,2003, 2004 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
|
||||
@ -27,7 +26,7 @@ endif
|
||||
|
||||
all: # Don't let the default goal come from Makeconfig.
|
||||
|
||||
include $(firstword $(..) ../)Makeconfig
|
||||
include ../Makeconfig
|
||||
|
||||
ifndef subdir
|
||||
Each subdirectory makefile must define the `subdir' variable.
|
||||
@ -65,7 +64,7 @@ endif
|
||||
# See below. This must be set before Makerules processes it.
|
||||
before-compile += $(common-objpfx)bits/stdio_lim.h
|
||||
|
||||
include $(..)Makerules
|
||||
include ../Makerules
|
||||
|
||||
.PHONY: subdir_lib
|
||||
subdir_lib: lib-noranlib
|
||||
@ -166,9 +165,8 @@ distclean: clean
|
||||
.PHONY: subdir_install
|
||||
subdir_install: install-no-libc.a lib-noranlib stubs
|
||||
|
||||
.PHONY: subdir_objs subdir_stubs
|
||||
subdir_objs: objs
|
||||
subdir_stubs: stubs
|
||||
.PHONY: subdir_TAGS
|
||||
subdir_TAGS: TAGS
|
||||
|
||||
# Target required by the Hurd to ensure that all the MiG-generated
|
||||
# headers are in place before building a subdirectory.
|
||||
|
@ -20,8 +20,6 @@ libc {
|
||||
GLIBC_2.3.2
|
||||
GLIBC_2.3.3
|
||||
GLIBC_2.3.4
|
||||
GLIBC_2.4
|
||||
GLIBC_2.5
|
||||
%ifdef USE_IN_LIBIO
|
||||
HURD_CTHREADS_0.3
|
||||
%endif
|
||||
@ -37,7 +35,6 @@ libdl {
|
||||
GLIBC_2.0
|
||||
GLIBC_2.1
|
||||
GLIBC_2.3.3
|
||||
GLIBC_2.3.4
|
||||
}
|
||||
libm {
|
||||
GLIBC_2.0
|
||||
@ -45,7 +42,6 @@ libm {
|
||||
GLIBC_2.2
|
||||
GLIBC_2.2.3
|
||||
GLIBC_2.3.4
|
||||
GLIBC_2.4
|
||||
}
|
||||
libnsl {
|
||||
GLIBC_2.0
|
||||
@ -81,7 +77,6 @@ libpthread {
|
||||
GLIBC_2.3.2
|
||||
GLIBC_2.3.3
|
||||
GLIBC_2.3.4
|
||||
GLIBC_2.4
|
||||
GLIBC_PRIVATE
|
||||
}
|
||||
libresolv {
|
||||
@ -95,8 +90,6 @@ librt {
|
||||
GLIBC_2.2
|
||||
GLIBC_2.3
|
||||
GLIBC_2.3.3
|
||||
GLIBC_2.3.4
|
||||
GLIBC_2.4
|
||||
}
|
||||
libutil {
|
||||
GLIBC_2.0
|
||||
@ -105,7 +98,6 @@ ld {
|
||||
GLIBC_2.0
|
||||
GLIBC_2.1
|
||||
GLIBC_2.3
|
||||
GLIBC_2.4
|
||||
GLIBC_PRIVATE
|
||||
}
|
||||
libthread_db {
|
||||
|
45
WUR-REPORT
45
WUR-REPORT
@ -1,45 +0,0 @@
|
||||
<unistd.h>:
|
||||
|
||||
lssek: Probably should be __wur but lseek(fd,SEEK_SET,0) will succeed if
|
||||
the descriptor is fine.
|
||||
lseek64: same
|
||||
|
||||
setuid: will always succeed given correct privileges, so there might
|
||||
be places which don't check for it.
|
||||
setreuid: same
|
||||
seteuid: same
|
||||
setgid: same
|
||||
setregid: same
|
||||
setegid: same
|
||||
setresuid: same
|
||||
setresgid: same
|
||||
|
||||
|
||||
<stdio.h>:
|
||||
|
||||
setvbuf: if stream and buffer are fine and other parameters constant,
|
||||
it cannot really fail.
|
||||
fseek: see lseek
|
||||
fseeko: likewise
|
||||
fgetpos: similarly
|
||||
fsetpos: likewise
|
||||
|
||||
|
||||
<stdlib.h>:
|
||||
|
||||
atexit: it is guaranteed that a certain number of handlers can be
|
||||
registered, so some calls might need not be checked
|
||||
on_exit: same
|
||||
random functions: one might want to discard a number of results. In any
|
||||
case, no security problem
|
||||
|
||||
|
||||
putenv: probably SHOULD be marked, but we'll wait a bit.
|
||||
setenv: likewise
|
||||
unsetenv: likewise
|
||||
clearenv: likewise
|
||||
|
||||
mbstowcs: probably SHOULD be marked
|
||||
wcstombs: likewise
|
||||
|
||||
ptsname_r: probably SHOULD be marked
|
4
abi-tags
4
abi-tags
@ -24,9 +24,5 @@
|
||||
|
||||
.*-.*-freebsd.*-gnu.* 3 4.0.0 # earliest compatible kernel version
|
||||
|
||||
.*-.*-knetbsd.*-gnu.* 4 1.6.0 # earliest compatible kernel version
|
||||
|
||||
.*-.*-syllable.* 5 2.0.0 # just an arbitrary value
|
||||
|
||||
# There is no catch-all default here because every supported OS that uses
|
||||
# ELF must have its own unique ABI tag.
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Copyright (C) 1997, 2002, 2003, 2006, 2007 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1997, 2002, 2003 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
|
||||
@ -26,12 +26,10 @@ distribute = argp-fmtstream.h argp-namefrob.h
|
||||
routines = $(addprefix argp-, ba fmtstream fs-xinl help parse pv \
|
||||
pvh xinl eexst)
|
||||
|
||||
tests = argp-test tst-argp1 bug-argp1 tst-argp2
|
||||
tests = argp-test tst-argp1
|
||||
|
||||
CFLAGS-argp-help.c = $(uses-callbacks) -fexceptions
|
||||
CFLAGS-argp-parse.c = $(uses-callbacks)
|
||||
CFLAGS-argp-fmtstream.c = -fexceptions
|
||||
|
||||
bug-argp1-ARGS = -- --help
|
||||
|
||||
include ../Rules
|
||||
|
@ -19,7 +19,7 @@
|
||||
02111-1307 USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <sysexits.h>
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Word-wrapping and line-truncating streams
|
||||
Copyright (C) 1997-1999,2001,2002,2003,2005 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997,1998,1999,2001,2002,2003 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Written by Miles Bader <miles@gnu.ai.mit.edu>.
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
don't have that. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
@ -102,10 +102,11 @@ __argp_fmtstream_free (argp_fmtstream_t fs)
|
||||
if (fs->p > fs->buf)
|
||||
{
|
||||
#ifdef USE_IN_LIBIO
|
||||
__fxprintf (fs->stream, "%.*s", (int) (fs->p - fs->buf), fs->buf);
|
||||
#else
|
||||
fwrite_unlocked (fs->buf, 1, fs->p - fs->buf, fs->stream);
|
||||
if (_IO_fwide (fs->stream, 0) > 0)
|
||||
__fwprintf (fs->stream, L"%.*s", (int) (fs->p - fs->buf), fs->buf);
|
||||
else
|
||||
#endif
|
||||
fwrite_unlocked (fs->buf, 1, fs->p - fs->buf, fs->stream);
|
||||
}
|
||||
free (fs->buf);
|
||||
free (fs);
|
||||
@ -290,15 +291,17 @@ __argp_fmtstream_update (argp_fmtstream_t fs)
|
||||
else
|
||||
/* Output the first line so we can use the space. */
|
||||
{
|
||||
#ifdef _LIBC
|
||||
__fxprintf (fs->stream, "%.*s\n",
|
||||
(int) (nl - fs->buf), fs->buf);
|
||||
#else
|
||||
if (nl > fs->buf)
|
||||
fwrite_unlocked (fs->buf, 1, nl - fs->buf, fs->stream);
|
||||
putc_unlocked ('\n', fs->stream);
|
||||
#ifdef USE_IN_LIBIO
|
||||
if (_IO_fwide (fs->stream, 0) > 0)
|
||||
__fwprintf (fs->stream, L"%.*s\n",
|
||||
(int) (nl - fs->buf), fs->buf);
|
||||
else
|
||||
#endif
|
||||
|
||||
{
|
||||
if (nl > fs->buf)
|
||||
fwrite_unlocked (fs->buf, 1, nl - fs->buf, fs->stream);
|
||||
putc_unlocked ('\n', fs->stream);
|
||||
}
|
||||
len += buf - fs->buf;
|
||||
nl = buf = fs->buf;
|
||||
}
|
||||
@ -357,12 +360,15 @@ __argp_fmtstream_ensure (struct argp_fmtstream *fs, size_t amount)
|
||||
/* Flush FS's buffer. */
|
||||
__argp_fmtstream_update (fs);
|
||||
|
||||
#ifdef _LIBC
|
||||
__fxprintf (fs->stream, "%.*s", (int) (fs->p - fs->buf), fs->buf);
|
||||
wrote = fs->p - fs->buf;
|
||||
#else
|
||||
wrote = fwrite_unlocked (fs->buf, 1, fs->p - fs->buf, fs->stream);
|
||||
#ifdef USE_IN_LIBIO
|
||||
if (_IO_fwide (fs->stream, 0) > 0)
|
||||
{
|
||||
__fwprintf (fs->stream, L"%.*s", (int) (fs->p - fs->buf), fs->buf);
|
||||
wrote = fs->p - fs->buf;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
wrote = fwrite_unlocked (fs->buf, 1, fs->p - fs->buf, fs->stream);
|
||||
if (wrote == fs->p - fs->buf)
|
||||
{
|
||||
fs->p = fs->buf;
|
||||
|
@ -26,6 +26,10 @@
|
||||
#ifndef _ARGP_FMTSTREAM_H
|
||||
#define _ARGP_FMTSTREAM_H
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
@ -19,7 +19,7 @@
|
||||
02111-1307 USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#define ARGP_FS_EI
|
||||
|
193
argp/argp-help.c
193
argp/argp-help.c
@ -1,6 +1,5 @@
|
||||
/* Hierarchial argument parsing help output
|
||||
Copyright (C) 1995-2003, 2004, 2005, 2006, 2007
|
||||
Free Software Foundation, Inc.
|
||||
Copyright (C) 1995-2003, 2004 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Written by Miles Bader <miles@gnu.ai.mit.edu>.
|
||||
|
||||
@ -49,8 +48,7 @@ char *alloca ();
|
||||
#include <stdarg.h>
|
||||
#include <ctype.h>
|
||||
#include <limits.h>
|
||||
#ifdef _LIBC
|
||||
# include <../libio/libioP.h>
|
||||
#ifdef USE_IN_LIBIO
|
||||
# include <wchar.h>
|
||||
#endif
|
||||
|
||||
@ -129,37 +127,40 @@ struct uparams
|
||||
int header_col;
|
||||
int usage_indent;
|
||||
int rmargin;
|
||||
|
||||
int valid; /* True when the values in here are valid. */
|
||||
};
|
||||
|
||||
/* This is a global variable, as user options are only ever read once. */
|
||||
static struct uparams uparams = {
|
||||
DUP_ARGS, DUP_ARGS_NOTE,
|
||||
SHORT_OPT_COL, LONG_OPT_COL, DOC_OPT_COL, OPT_DOC_COL, HEADER_COL,
|
||||
USAGE_INDENT, RMARGIN
|
||||
USAGE_INDENT, RMARGIN,
|
||||
0
|
||||
};
|
||||
|
||||
/* A particular uparam, and what the user name is. */
|
||||
struct uparam_name
|
||||
{
|
||||
const char name[14]; /* User name. */
|
||||
bool is_bool; /* Whether it's `boolean'. */
|
||||
uint8_t uparams_offs; /* Location of the (int) field in UPARAMS. */
|
||||
const char *name; /* User name. */
|
||||
int is_bool; /* Whether it's `boolean'. */
|
||||
size_t uparams_offs; /* Location of the (int) field in UPARAMS. */
|
||||
};
|
||||
|
||||
/* The name-field mappings we know about. */
|
||||
static const struct uparam_name uparam_names[] =
|
||||
{
|
||||
{ "dup-args", true, offsetof (struct uparams, dup_args) },
|
||||
{ "dup-args-note", true, offsetof (struct uparams, dup_args_note) },
|
||||
{ "short-opt-col", false, offsetof (struct uparams, short_opt_col) },
|
||||
{ "long-opt-col", false, offsetof (struct uparams, long_opt_col) },
|
||||
{ "doc-opt-col", false, offsetof (struct uparams, doc_opt_col) },
|
||||
{ "opt-doc-col", false, offsetof (struct uparams, opt_doc_col) },
|
||||
{ "header-col", false, offsetof (struct uparams, header_col) },
|
||||
{ "usage-indent", false, offsetof (struct uparams, usage_indent) },
|
||||
{ "rmargin", false, offsetof (struct uparams, rmargin) }
|
||||
{ "dup-args", 1, offsetof (struct uparams, dup_args) },
|
||||
{ "dup-args-note", 1, offsetof (struct uparams, dup_args_note) },
|
||||
{ "short-opt-col", 0, offsetof (struct uparams, short_opt_col) },
|
||||
{ "long-opt-col", 0, offsetof (struct uparams, long_opt_col) },
|
||||
{ "doc-opt-col", 0, offsetof (struct uparams, doc_opt_col) },
|
||||
{ "opt-doc-col", 0, offsetof (struct uparams, opt_doc_col) },
|
||||
{ "header-col", 0, offsetof (struct uparams, header_col) },
|
||||
{ "usage-indent", 0, offsetof (struct uparams, usage_indent) },
|
||||
{ "rmargin", 0, offsetof (struct uparams, rmargin) },
|
||||
{ 0 }
|
||||
};
|
||||
#define nuparam_names (sizeof (uparam_names) / sizeof (uparam_names[0]))
|
||||
|
||||
/* Read user options from the environment, and fill in UPARAMS appropiately. */
|
||||
static void
|
||||
@ -215,27 +216,22 @@ fill_in_uparams (const struct argp_state *state)
|
||||
SKIPWS (arg);
|
||||
}
|
||||
|
||||
un = uparam_names;
|
||||
size_t u;
|
||||
for (u = 0; u < nuparam_names; ++un, ++u)
|
||||
for (un = uparam_names; un->name; un++)
|
||||
if (strlen (un->name) == var_len
|
||||
&& strncmp (var, un->name, var_len) == 0)
|
||||
{
|
||||
if (unspec && !un->is_bool)
|
||||
__argp_failure (state, 0, 0,
|
||||
dgettext (state == NULL ? NULL
|
||||
: state->root_argp->argp_domain,
|
||||
"\
|
||||
dgettext (state->root_argp->argp_domain, "\
|
||||
%.*s: ARGP_HELP_FMT parameter requires a value"),
|
||||
(int) var_len, var);
|
||||
else
|
||||
*(int *)((char *)&uparams + un->uparams_offs) = val;
|
||||
break;
|
||||
}
|
||||
if (u == nuparam_names)
|
||||
if (! un->name)
|
||||
__argp_failure (state, 0, 0,
|
||||
dgettext (state == NULL ? NULL
|
||||
: state->root_argp->argp_domain, "\
|
||||
dgettext (state->root_argp->argp_domain, "\
|
||||
%.*s: Unknown ARGP_HELP_FMT parameter"),
|
||||
(int) var_len, var);
|
||||
|
||||
@ -246,8 +242,7 @@ fill_in_uparams (const struct argp_state *state)
|
||||
else if (*var)
|
||||
{
|
||||
__argp_failure (state, 0, 0,
|
||||
dgettext (state == NULL ? NULL
|
||||
: state->root_argp->argp_domain,
|
||||
dgettext (state->root_argp->argp_domain,
|
||||
"Garbage in ARGP_HELP_FMT: %s"), var);
|
||||
break;
|
||||
}
|
||||
@ -673,9 +668,9 @@ hol_cluster_cmp (const struct hol_cluster *cl1, const struct hol_cluster *cl2)
|
||||
{
|
||||
/* If one cluster is deeper than the other, use its ancestor at the same
|
||||
level, so that finding the common ancestor is straightforward. */
|
||||
while (cl1->depth > cl2->depth)
|
||||
while (cl1->depth < cl2->depth)
|
||||
cl1 = cl1->parent;
|
||||
while (cl2->depth > cl1->depth)
|
||||
while (cl2->depth < cl1->depth)
|
||||
cl2 = cl2->parent;
|
||||
|
||||
/* Now reduce both clusters to their ancestors at the point where both have
|
||||
@ -763,9 +758,9 @@ hol_entry_cmp (const struct hol_entry *entry1,
|
||||
const char *long2 = hol_entry_first_long (entry2);
|
||||
|
||||
if (doc1)
|
||||
doc1 = long1 != NULL && canon_doc_option (&long1);
|
||||
doc1 = canon_doc_option (&long1);
|
||||
if (doc2)
|
||||
doc2 = long2 != NULL && canon_doc_option (&long2);
|
||||
doc2 = canon_doc_option (&long2);
|
||||
|
||||
if (doc1 != doc2)
|
||||
/* `documentation' options always follow normal options (or
|
||||
@ -988,7 +983,7 @@ static const char *
|
||||
filter_doc (const char *doc, int key, const struct argp *argp,
|
||||
const struct argp_state *state)
|
||||
{
|
||||
if (argp && argp->help_filter)
|
||||
if (argp->help_filter)
|
||||
/* We must apply a user filter to this output. */
|
||||
{
|
||||
void *input = __argp_input (argp, state);
|
||||
@ -1106,9 +1101,7 @@ hol_entry_help (struct hol_entry *entry, const struct argp_state *state,
|
||||
__argp_fmtstream_putc (stream, '-');
|
||||
__argp_fmtstream_putc (stream, *so);
|
||||
if (!have_long_opt || uparams.dup_args)
|
||||
arg (real, " %s", "[%s]",
|
||||
state == NULL ? NULL : state->root_argp->argp_domain,
|
||||
stream);
|
||||
arg (real, " %s", "[%s]", state->root_argp->argp_domain, stream);
|
||||
else if (real->arg)
|
||||
hhstate->suppressed_dup_arg = 1;
|
||||
}
|
||||
@ -1128,22 +1121,26 @@ hol_entry_help (struct hol_entry *entry, const struct argp_state *state,
|
||||
have been done on the original; but documentation options
|
||||
should be pretty rare anyway... */
|
||||
__argp_fmtstream_puts (stream,
|
||||
dgettext (state == NULL ? NULL
|
||||
: state->root_argp->argp_domain,
|
||||
dgettext (state->root_argp->argp_domain,
|
||||
opt->name));
|
||||
}
|
||||
}
|
||||
else
|
||||
/* A real long option. */
|
||||
{
|
||||
int first_long_opt = 1;
|
||||
|
||||
__argp_fmtstream_set_wmargin (stream, uparams.long_opt_col);
|
||||
for (opt = real, num = entry->num; num > 0; opt++, num--)
|
||||
if (opt->name && ovisible (opt))
|
||||
{
|
||||
comma (uparams.long_opt_col, &pest);
|
||||
__argp_fmtstream_printf (stream, "--%s", opt->name);
|
||||
arg (real, "=%s", "[=%s]",
|
||||
state == NULL ? NULL : state->root_argp->argp_domain, stream);
|
||||
if (first_long_opt || uparams.dup_args)
|
||||
arg (real, "=%s", "[=%s]", state->root_argp->argp_domain,
|
||||
stream);
|
||||
else if (real->arg)
|
||||
hhstate->suppressed_dup_arg = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1162,8 +1159,7 @@ hol_entry_help (struct hol_entry *entry, const struct argp_state *state,
|
||||
}
|
||||
else
|
||||
{
|
||||
const char *tstr = real->doc ? dgettext (state == NULL ? NULL
|
||||
: state->root_argp->argp_domain,
|
||||
const char *tstr = real->doc ? dgettext (state->root_argp->argp_domain,
|
||||
real->doc) : 0;
|
||||
const char *fstr = filter_doc (tstr, real->key, entry->argp, state);
|
||||
if (fstr && *fstr)
|
||||
@ -1211,8 +1207,7 @@ hol_help (struct hol *hol, const struct argp_state *state,
|
||||
|
||||
if (hhstate.suppressed_dup_arg && uparams.dup_args_note)
|
||||
{
|
||||
const char *tstr = dgettext (state == NULL ? NULL
|
||||
: state->root_argp->argp_domain, "\
|
||||
const char *tstr = dgettext (state->root_argp->argp_domain, "\
|
||||
Mandatory or optional arguments to long options are also mandatory or \
|
||||
optional for any corresponding short options.");
|
||||
const char *fstr = filter_doc (tstr, ARGP_KEY_HELP_DUP_ARGS_NOTE,
|
||||
@ -1559,7 +1554,8 @@ _help (const struct argp *argp, const struct argp_state *state, FILE *stream,
|
||||
__flockfile (stream);
|
||||
#endif
|
||||
|
||||
fill_in_uparams (state);
|
||||
if (! uparams.valid)
|
||||
fill_in_uparams (state);
|
||||
|
||||
fs = __argp_make_fmtstream (stream, 0, uparams.rmargin, 0);
|
||||
if (! fs)
|
||||
@ -1767,26 +1763,33 @@ __argp_error (const struct argp_state *state, const char *fmt, ...)
|
||||
|
||||
va_start (ap, fmt);
|
||||
|
||||
#ifdef _LIBC
|
||||
char *buf;
|
||||
#ifdef USE_IN_LIBIO
|
||||
if (_IO_fwide (stream, 0) > 0)
|
||||
{
|
||||
char *buf;
|
||||
|
||||
if (_IO_vasprintf (&buf, fmt, ap) < 0)
|
||||
buf = NULL;
|
||||
if (__asprintf (&buf, fmt, ap) < 0)
|
||||
buf = NULL;
|
||||
|
||||
__fxprintf (stream, "%s: %s\n",
|
||||
state ? state->name : __argp_short_program_name (), buf);
|
||||
__fwprintf (stream, L"%s: %s\n",
|
||||
state ? state->name : __argp_short_program_name (),
|
||||
buf);
|
||||
|
||||
free (buf);
|
||||
#else
|
||||
fputs_unlocked (state ? state->name : __argp_short_program_name (),
|
||||
stream);
|
||||
putc_unlocked (':', stream);
|
||||
putc_unlocked (' ', stream);
|
||||
|
||||
vfprintf (stream, fmt, ap);
|
||||
|
||||
putc_unlocked ('\n', stream);
|
||||
free (buf);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
fputs_unlocked (state
|
||||
? state->name : __argp_short_program_name (),
|
||||
stream);
|
||||
putc_unlocked (':', stream);
|
||||
putc_unlocked (' ', stream);
|
||||
|
||||
vfprintf (stream, fmt, ap);
|
||||
|
||||
putc_unlocked ('\n', stream);
|
||||
}
|
||||
|
||||
__argp_state_help (state, stream, ARGP_HELP_STD_ERR);
|
||||
|
||||
@ -1824,34 +1827,41 @@ __argp_failure (const struct argp_state *state, int status, int errnum,
|
||||
__flockfile (stream);
|
||||
#endif
|
||||
|
||||
#ifdef _LIBC
|
||||
__fxprintf (stream, "%s",
|
||||
state ? state->name : __argp_short_program_name ());
|
||||
#else
|
||||
fputs_unlocked (state ? state->name : __argp_short_program_name (),
|
||||
stream);
|
||||
#ifdef USE_IN_LIBIO
|
||||
if (_IO_fwide (stream, 0) > 0)
|
||||
__fwprintf (stream, L"%s",
|
||||
state ? state->name : __argp_short_program_name ());
|
||||
else
|
||||
#endif
|
||||
fputs_unlocked (state
|
||||
? state->name : __argp_short_program_name (),
|
||||
stream);
|
||||
|
||||
if (fmt)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
va_start (ap, fmt);
|
||||
#ifdef _LIBC
|
||||
char *buf;
|
||||
#ifdef USE_IN_LIBIO
|
||||
if (_IO_fwide (stream, 0) > 0)
|
||||
{
|
||||
char *buf;
|
||||
|
||||
if (_IO_vasprintf (&buf, fmt, ap) < 0)
|
||||
buf = NULL;
|
||||
if (__asprintf (&buf, fmt, ap) < 0)
|
||||
buf = NULL;
|
||||
|
||||
__fxprintf (stream, ": %s", buf);
|
||||
__fwprintf (stream, L": %s", buf);
|
||||
|
||||
free (buf);
|
||||
#else
|
||||
putc_unlocked (':', stream);
|
||||
putc_unlocked (' ', stream);
|
||||
|
||||
vfprintf (stream, fmt, ap);
|
||||
free (buf);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
putc_unlocked (':', stream);
|
||||
putc_unlocked (' ', stream);
|
||||
|
||||
vfprintf (stream, fmt, ap);
|
||||
}
|
||||
|
||||
va_end (ap);
|
||||
}
|
||||
@ -1860,18 +1870,21 @@ __argp_failure (const struct argp_state *state, int status, int errnum,
|
||||
{
|
||||
char buf[200];
|
||||
|
||||
#ifdef _LIBC
|
||||
__fxprintf (stream, ": %s",
|
||||
__strerror_r (errnum, buf, sizeof (buf)));
|
||||
#else
|
||||
putc_unlocked (':', stream);
|
||||
putc_unlocked (' ', stream);
|
||||
# ifdef HAVE_STRERROR_R
|
||||
fputs (__strerror_r (errnum, buf, sizeof (buf)), stream);
|
||||
# else
|
||||
fputs (strerror (errnum), stream);
|
||||
# endif
|
||||
#ifdef USE_IN_LIBIO
|
||||
if (_IO_fwide (stream, 0) > 0)
|
||||
__fwprintf (stream, L": %s",
|
||||
__strerror_r (errnum, buf, sizeof (buf)));
|
||||
else
|
||||
#endif
|
||||
{
|
||||
putc_unlocked (':', stream);
|
||||
putc_unlocked (' ', stream);
|
||||
#if defined _LIBC || defined HAVE_STRERROR_R
|
||||
fputs (__strerror_r (errnum, buf, sizeof (buf)), stream);
|
||||
#else
|
||||
fputs (strerror (errnum), stream);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef USE_IN_LIBIO
|
||||
|
@ -19,7 +19,7 @@
|
||||
02111-1307 USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#if defined _LIBC || defined HAVE_FEATURES_H
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Hierarchial argument parsing, layered over getopt.
|
||||
Copyright (C) 1995-1999,2003,2004,2005,2006 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995-1999,2003,2004 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Written by Miles Bader <miles@gnu.ai.mit.edu>.
|
||||
|
||||
@ -24,7 +24,6 @@
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <getopt.h>
|
||||
#include <limits.h>
|
||||
|
||||
#define __need_error_t
|
||||
#include <errno.h>
|
||||
@ -562,7 +561,7 @@ extern void *__argp_input (__const struct argp *__restrict __argp,
|
||||
# endif
|
||||
|
||||
ARGP_EI void
|
||||
__argp_usage (__const struct argp_state *__state)
|
||||
__NTH (__argp_usage (__const struct argp_state *__state))
|
||||
{
|
||||
__argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE);
|
||||
}
|
||||
@ -575,7 +574,7 @@ __NTH (__option_is_short (__const struct argp_option *__opt))
|
||||
else
|
||||
{
|
||||
int __key = __opt->key;
|
||||
return __key > 0 && __key <= UCHAR_MAX && isprint (__key);
|
||||
return __key > 0 && isprint (__key);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,26 +0,0 @@
|
||||
#include <argp.h>
|
||||
|
||||
|
||||
static const struct argp_option test_options[] =
|
||||
{
|
||||
{ NULL, 'a', NULL, OPTION_DOC, NULL },
|
||||
{ NULL, 'b', NULL, OPTION_DOC, NULL },
|
||||
{ NULL, 0, NULL, 0, NULL }
|
||||
};
|
||||
|
||||
static struct argp test_argp =
|
||||
{
|
||||
test_options
|
||||
};
|
||||
|
||||
|
||||
static int
|
||||
do_test (int argc, char *argv[])
|
||||
{
|
||||
int i;
|
||||
argp_parse (&test_argp, argc, argv, 0, &i, NULL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define TEST_FUNCTION do_test (argc, argv)
|
||||
#include "../test-skeleton.c"
|
101
argp/tst-argp2.c
101
argp/tst-argp2.c
@ -1,101 +0,0 @@
|
||||
/* Copyright (C) 2007 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Jakub Jelinek <jakub@redhat.com>, 2007.
|
||||
|
||||
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. */
|
||||
|
||||
#include <argp.h>
|
||||
|
||||
static const struct argp_option opt1[] =
|
||||
{
|
||||
{ "opt1", '1', "NUMBER", 0, "Option 1" },
|
||||
{ NULL, 0, NULL, 0, NULL }
|
||||
};
|
||||
|
||||
static const struct argp_option opt2[] =
|
||||
{
|
||||
{ "opt2", '2', "NUMBER", 0, "Option 2" },
|
||||
{ NULL, 0, NULL, 0, NULL }
|
||||
};
|
||||
|
||||
static const struct argp_option opt3[] =
|
||||
{
|
||||
{ "opt3", '3', "NUMBER", 0, "Option 3" },
|
||||
{ NULL, 0, NULL, 0, NULL }
|
||||
};
|
||||
|
||||
static const struct argp_option opt4[] =
|
||||
{
|
||||
{ "opt4", '4', "NUMBER", 0, "Option 4" },
|
||||
{ NULL, 0, NULL, 0, NULL }
|
||||
};
|
||||
|
||||
static const struct argp_option opt5[] =
|
||||
{
|
||||
{ "opt5", '5', "NUMBER", 0, "Option 5" },
|
||||
{ NULL, 0, NULL, 0, NULL }
|
||||
};
|
||||
|
||||
static struct argp argp5 =
|
||||
{
|
||||
opt5, NULL, "args doc5", "doc5", NULL, NULL, NULL
|
||||
};
|
||||
|
||||
static struct argp argp4 =
|
||||
{
|
||||
opt4, NULL, "args doc4", "doc4", NULL, NULL, NULL
|
||||
};
|
||||
|
||||
static struct argp argp3 =
|
||||
{
|
||||
opt3, NULL, "args doc3", "doc3", NULL, NULL, NULL
|
||||
};
|
||||
|
||||
static struct argp_child children2[] =
|
||||
{
|
||||
{ &argp4, 0, "child3", 3 },
|
||||
{ &argp5, 0, "child4", 4 },
|
||||
{ NULL, 0, NULL, 0 }
|
||||
};
|
||||
|
||||
static struct argp argp2 =
|
||||
{
|
||||
opt2, NULL, "args doc2", "doc2", children2, NULL, NULL
|
||||
};
|
||||
|
||||
static struct argp_child children1[] =
|
||||
{
|
||||
{ &argp2, 0, "child1", 1 },
|
||||
{ &argp3, 0, "child2", 2 },
|
||||
{ NULL, 0, NULL, 0 }
|
||||
};
|
||||
|
||||
static struct argp argp1 =
|
||||
{
|
||||
opt1, NULL, "args doc1", "doc1", children1, NULL, NULL
|
||||
};
|
||||
|
||||
|
||||
static int
|
||||
do_test (void)
|
||||
{
|
||||
argp_help (&argp1, stdout, ARGP_HELP_LONG, (char *) "tst-argp2");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
#define TEST_FUNCTION do_test ()
|
||||
#include "../test-skeleton.c"
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1994-1998,2001,2002,2005 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1994-1998,2001,2002 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
|
||||
@ -61,7 +61,13 @@ __assert_perror_fail (int errnum,
|
||||
__strerror_r (errnum, errbuf, sizeof errbuf)) >= 0)
|
||||
{
|
||||
/* Print the message. */
|
||||
(void) __fxprintf (NULL, "%s", buf);
|
||||
#ifdef USE_IN_LIBIO
|
||||
if (_IO_fwide (stderr, 0) > 0)
|
||||
(void) __fwprintf (stderr, L"%s", buf);
|
||||
else
|
||||
#endif
|
||||
(void) fputs (buf, stderr);
|
||||
|
||||
(void) fflush (stderr);
|
||||
|
||||
/* We have to free the buffer since the appplication might catch the
|
||||
|
@ -1,5 +1,4 @@
|
||||
/* Copyright (C) 1991,1994-1996,1998,2001,2002,2005
|
||||
Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1991,1994-1996,1998,2001,2002 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
|
||||
@ -61,7 +60,13 @@ __assert_fail (const char *assertion, const char *file, unsigned int line,
|
||||
assertion) >= 0)
|
||||
{
|
||||
/* Print the message. */
|
||||
(void) __fxprintf (NULL, "%s", buf);
|
||||
#ifdef USE_IN_LIBIO
|
||||
if (_IO_fwide (stderr, 0) > 0)
|
||||
(void) __fwprintf (stderr, L"%s", buf);
|
||||
else
|
||||
#endif
|
||||
(void) fputs (buf, stderr);
|
||||
|
||||
(void) fflush (stderr);
|
||||
|
||||
/* We have to free the buffer since the application might catch the
|
||||
|
@ -84,18 +84,16 @@ extern void __assert (const char *__assertion, const char *__file, int __line)
|
||||
|
||||
__END_DECLS
|
||||
|
||||
# define assert(expr) \
|
||||
((expr) \
|
||||
? __ASSERT_VOID_CAST (0) \
|
||||
: (__assert_fail (__STRING(expr), __FILE__, __LINE__, __ASSERT_FUNCTION), \
|
||||
__ASSERT_VOID_CAST (0)))
|
||||
# define assert(expr) \
|
||||
(__ASSERT_VOID_CAST ((expr) ? 0 : \
|
||||
(__assert_fail (__STRING(expr), __FILE__, __LINE__, \
|
||||
__ASSERT_FUNCTION), 0)))
|
||||
|
||||
# ifdef __USE_GNU
|
||||
# define assert_perror(errnum) \
|
||||
(!(errnum) \
|
||||
? __ASSERT_VOID_CAST (0) \
|
||||
: (__assert_perror_fail ((errnum), __FILE__, __LINE__, __ASSERT_FUNCTION), \
|
||||
__ASSERT_VOID_CAST (0)))
|
||||
# define assert_perror(errnum) \
|
||||
(__ASSERT_VOID_CAST (!(errnum) ? 0 : \
|
||||
(__assert_perror_fail ((errnum), __FILE__, __LINE__, \
|
||||
__ASSERT_FUNCTION), 0)))
|
||||
# endif
|
||||
|
||||
/* Version 2.4 and later of GCC define a magical variable `__PRETTY_FUNCTION__'
|
||||
|
6
bare/.cvsignore
Normal file
6
bare/.cvsignore
Normal file
@ -0,0 +1,6 @@
|
||||
*.d *.o *.so *.po *.go stamp.* *.stamp *.ustamp *.udeps
|
||||
*.gz *.Z *.tar *.tgz
|
||||
=*
|
||||
TODO COPYING* AUTHORS copyr-* copying.*
|
||||
glibc-*
|
||||
distinfo
|
55
bare/Makefile
Normal file
55
bare/Makefile
Normal file
@ -0,0 +1,55 @@
|
||||
# Copyright (C) 1994, 1997 Free Software Foundation, Inc.
|
||||
# This file is part of the GNU C Library.
|
||||
# Contributed by Joel Sherrill (jsherril@redstone-emh2.army.mil),
|
||||
# On-Line Applications Research Corporation.
|
||||
#
|
||||
|
||||
# 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.
|
||||
|
||||
subdir := bare
|
||||
|
||||
bare-routines := brdinit console strtsupp
|
||||
routines = $(bare-routines)
|
||||
elided-routines = $(bare-routines)
|
||||
extra-objs = $(bare-routines:%=%.o)
|
||||
|
||||
install-lib = lib$(config-vendor).a
|
||||
|
||||
include ../Rules
|
||||
|
||||
#
|
||||
# For bare targets, the $(config-vendor) is the name of the board.
|
||||
# We will place the board dependent code ONLY in a library which
|
||||
# is board dependent. This way many target boards can share a
|
||||
# single libc.a. To resolve all symbols and successfully link
|
||||
# a program, the application must link against libc.a and libMY_TARGET.a.
|
||||
# For example, the target specific library for the Motorola MVME135
|
||||
# board will be named libmvme135.a. To link a program for the
|
||||
# MVME135, one must link against -lc and -lmvme135.
|
||||
#
|
||||
|
||||
lib: $(objpfx)lib$(config-vendor).a
|
||||
|
||||
$(objpfx)lib$(config-vendor).a: $(bare-routines:%=$(objpfx)%.o)
|
||||
# This library is small enough that it's simplest to recreate the archive
|
||||
# from scratch each time.
|
||||
rm -f $@
|
||||
ifdef objdir
|
||||
cd $(objpfx); $(AR) cq$(verbose) $(@:$(objpfx)%=%) $(^:$(objpfx)%=%)
|
||||
else
|
||||
$(AR) cq$(verbose) $@ $^
|
||||
endif
|
||||
$(RANLIB) $@
|
@ -1,5 +1,5 @@
|
||||
/* Macros to swap the order of bytes in integer values.
|
||||
Copyright (C) 1997,1998,2000,2001,2002,2005 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 1998, 2000, 2001, 2002 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
|
||||
@ -25,35 +25,32 @@
|
||||
#define _BITS_BYTESWAP_H 1
|
||||
|
||||
/* Swap bytes in 16 bit value. */
|
||||
#define __bswap_constant_16(x) \
|
||||
((((x) >> 8) & 0xffu) | (((x) & 0xffu) << 8))
|
||||
|
||||
#ifdef __GNUC__
|
||||
# define __bswap_16(x) \
|
||||
(__extension__ \
|
||||
({ unsigned short int __bsx = (x); __bswap_constant_16 (__bsx); }))
|
||||
({ unsigned short int __bsx = (x); \
|
||||
((((__bsx) >> 8) & 0xff) | (((__bsx) & 0xff) << 8)); }))
|
||||
#else
|
||||
static __inline unsigned short int
|
||||
__bswap_16 (unsigned short int __bsx)
|
||||
{
|
||||
return __bswap_constant_16 (__bsx);
|
||||
return ((((__bsx) >> 8) & 0xff) | (((__bsx) & 0xff) << 8));
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Swap bytes in 32 bit value. */
|
||||
#define __bswap_constant_32(x) \
|
||||
((((x) & 0xff000000u) >> 24) | (((x) & 0x00ff0000u) >> 8) | \
|
||||
(((x) & 0x0000ff00u) << 8) | (((x) & 0x000000ffu) << 24))
|
||||
|
||||
#ifdef __GNUC__
|
||||
# define __bswap_32(x) \
|
||||
(__extension__ \
|
||||
({ register unsigned int __bsx = (x); __bswap_constant_32 (__bsx); }))
|
||||
(__extension__ \
|
||||
({ unsigned int __bsx = (x); \
|
||||
((((__bsx) & 0xff000000) >> 24) | (((__bsx) & 0x00ff0000) >> 8) | \
|
||||
(((__bsx) & 0x0000ff00) << 8) | (((__bsx) & 0x000000ff) << 24)); }))
|
||||
#else
|
||||
static __inline unsigned int
|
||||
__bswap_32 (unsigned int __bsx)
|
||||
{
|
||||
return __bswap_constant_32 (__bsx);
|
||||
return ((((__bsx) & 0xff000000) >> 24) | (((__bsx) & 0x00ff0000) >> 8) |
|
||||
(((__bsx) & 0x0000ff00) << 8) | (((__bsx) & 0x000000ff) << 24));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1 +1,4 @@
|
||||
#error "Architecture-specific definition needed."
|
||||
struct link_map_machine
|
||||
{
|
||||
/* empty by default */
|
||||
};
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Definitions for BSD-style memory management.
|
||||
Copyright (C) 1994-1998,2000,01,02,05 Free Software Foundation, Inc.
|
||||
Copyright (C) 1994-1998,2000,01,02 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
|
||||
@ -85,12 +85,6 @@
|
||||
#define MS_SYNC 0 /* Synchronous memory sync. */
|
||||
#define MS_INVALIDATE 2 /* Invalidate the caches. */
|
||||
|
||||
/* Flags for `mremap'. */
|
||||
#ifdef __USE_GNU
|
||||
# define MREMAP_MAYMOVE 1 /* Mapping address may change. */
|
||||
# define MREMAP_FIXED 2 /* Fifth argument sets new address. */
|
||||
#endif
|
||||
|
||||
/* Flags for `mlockall' (can be OR'd together). */
|
||||
#define MCL_CURRENT 1 /* Lock all currently mapped pages. */
|
||||
#define MCL_FUTURE 2 /* Lock all additions to address
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Bit values & structures for resource limits. 4.4 BSD/generic GNU version.
|
||||
Copyright (C) 1994,1996,1997,1998,2006 Free Software Foundation, Inc.
|
||||
Copyright (C) 1994, 1996, 1997, 1998 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
|
||||
@ -63,14 +63,6 @@ enum __rlimit_resource
|
||||
RLIMIT_NOFILE = RLIMIT_OFILE, /* Another name for the same thing. */
|
||||
#define RLIMIT_OFILE RLIMIT_OFILE
|
||||
#define RLIMIT_NOFILE RLIMIT_NOFILE
|
||||
/* Maximum size of all socket buffers. */
|
||||
RLIMIT_SBSIZE,
|
||||
#define RLIMIT_SBSIZE RLIMIT_SBSIZE
|
||||
/* Maximum size in bytes of the process address space. */
|
||||
RLIMIT_AS,
|
||||
RLIMIT_VMEM = RLIMIT_AS, /* Another name for the same thing. */
|
||||
#define RLIMIT_AS RLIMIT_AS
|
||||
#define RLIMIT_VMEM RLIMIT_AS
|
||||
|
||||
RLIMIT_NLIMITS, /* Number of limit flavors. */
|
||||
RLIM_NLIMITS = RLIMIT_NLIMITS /* Traditional name for same. */
|
||||
|
@ -76,7 +76,7 @@ enum
|
||||
{
|
||||
ILL_ILLOPC = 1, /* Illegal opcode. */
|
||||
# define ILL_ILLOPC ILL_ILLOPC
|
||||
ILL_ILLOPN, /* Illegal operand. */
|
||||
ILL_ILL_OPN, /* Illegal operand. */
|
||||
# define ILL_ILLOPN ILL_ILLOPN
|
||||
ILL_ILLADR, /* Illegal addressing mode. */
|
||||
# define ILL_ILLADR ILL_ILLADR
|
||||
|
@ -1,29 +0,0 @@
|
||||
/* <bits/syslog-path.h> -- _PATH_LOG definition
|
||||
Copyright (C) 2006 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
|
||||
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. */
|
||||
|
||||
#ifndef _SYS_SYSLOG_H
|
||||
# error "Never include this file directly. Use <sys/syslog.h> instead"
|
||||
#endif
|
||||
|
||||
#ifndef _BITS_SYSLOG_PATH_H
|
||||
#define _BITS_SYSLOG_PATH_H 1
|
||||
|
||||
#define _PATH_LOG "/dev/log"
|
||||
|
||||
#endif /* bits/syslog-path.h */
|
11
bits/types.h
11
bits/types.h
@ -1,5 +1,5 @@
|
||||
/* bits/types.h -- definitions of __*_t types underlying *_t types.
|
||||
Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2003, 2004 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
|
||||
@ -114,9 +114,6 @@ typedef struct
|
||||
# define __ULONG32_TYPE unsigned long int
|
||||
# define __S64_TYPE __quad_t
|
||||
# define __U64_TYPE __u_quad_t
|
||||
/* We want __extension__ before typedef's that use nonstandard base types
|
||||
such as `long long' in C89 mode. */
|
||||
# define __STD_TYPE __extension__ typedef
|
||||
#elif __WORDSIZE == 64
|
||||
# define __SQUAD_TYPE long int
|
||||
# define __UQUAD_TYPE unsigned long int
|
||||
@ -126,13 +123,15 @@ typedef struct
|
||||
# define __ULONG32_TYPE unsigned int
|
||||
# define __S64_TYPE long int
|
||||
# define __U64_TYPE unsigned long int
|
||||
/* No need to mark the typedef with __extension__. */
|
||||
# define __STD_TYPE typedef
|
||||
#else
|
||||
# error
|
||||
#endif
|
||||
#include <bits/typesizes.h> /* Defines __*_T_TYPE macros. */
|
||||
|
||||
/* We want __extension__ before typedef's that use nonstandard base types
|
||||
such as `long long' in C89 mode. */
|
||||
#define __STD_TYPE __extension__ typedef
|
||||
|
||||
|
||||
__STD_TYPE __DEV_T_TYPE __dev_t; /* Type of device numbers. */
|
||||
__STD_TYPE __UID_T_TYPE __uid_t; /* Type of user identifications. */
|
||||
|
@ -1 +0,0 @@
|
||||
The C stubs add-on version 2.1.2.
|
@ -1,482 +0,0 @@
|
||||
GNU LIBRARY GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the library GPL. It is
|
||||
numbered 2 because it goes with version 2 of the ordinary GPL.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Library General Public License, applies to some
|
||||
specially designated Free Software Foundation software, and to any
|
||||
other libraries whose authors decide to use it. You can use it for
|
||||
your libraries, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if
|
||||
you distribute copies of the library, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link a program with the library, you must provide
|
||||
complete object files to the recipients so that they can relink them
|
||||
with the library, after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
Our method of protecting your rights has two steps: (1) copyright
|
||||
the library, and (2) offer you this license which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
Also, for each distributor's protection, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
library. If the library is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original
|
||||
version, so that any problems introduced by others will not reflect on
|
||||
the original authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that companies distributing free
|
||||
software will individually obtain patent licenses, thus in effect
|
||||
transforming the program into proprietary software. To prevent this,
|
||||
we have made it clear that any patent must be licensed for everyone's
|
||||
free use or not licensed at all.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the ordinary
|
||||
GNU General Public License, which was designed for utility programs. This
|
||||
license, the GNU Library General Public License, applies to certain
|
||||
designated libraries. This license is quite different from the ordinary
|
||||
one; be sure to read it in full, and don't assume that anything in it is
|
||||
the same as in the ordinary license.
|
||||
|
||||
The reason we have a separate public license for some libraries is that
|
||||
they blur the distinction we usually make between modifying or adding to a
|
||||
program and simply using it. Linking a program with a library, without
|
||||
changing the library, is in some sense simply using the library, and is
|
||||
analogous to running a utility program or application program. However, in
|
||||
a textual and legal sense, the linked executable is a combined work, a
|
||||
derivative of the original library, and the ordinary General Public License
|
||||
treats it as such.
|
||||
|
||||
Because of this blurred distinction, using the ordinary General
|
||||
Public License for libraries did not effectively promote software
|
||||
sharing, because most developers did not use the libraries. We
|
||||
concluded that weaker conditions might promote sharing better.
|
||||
|
||||
However, unrestricted linking of non-free programs would deprive the
|
||||
users of those programs of all benefit from the free status of the
|
||||
libraries themselves. This Library General Public License is intended to
|
||||
permit developers of non-free programs to use free libraries, while
|
||||
preserving your freedom as a user of such programs to change the free
|
||||
libraries that are incorporated in them. (We have not seen how to achieve
|
||||
this as regards changes in header files, but we have achieved it as regards
|
||||
changes in the actual functions of the Library.) The hope is that this
|
||||
will lead to faster development of free libraries.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, while the latter only
|
||||
works together with the library.
|
||||
|
||||
Note that it is possible for a library to be covered by the ordinary
|
||||
General Public License rather than by this special one.
|
||||
|
||||
GNU LIBRARY GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library which
|
||||
contains a notice placed by the copyright holder or other authorized
|
||||
party saying it may be distributed under the terms of this Library
|
||||
General Public License (also called "this License"). Each licensee is
|
||||
addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also compile or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
c) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
d) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the source code distributed need not include anything that is normally
|
||||
distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Library General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
Appendix: How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
@ -1,46 +0,0 @@
|
||||
2006-03-01 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
* configure (libc_add_on_canonical, libc_add_on_subdir): Set.
|
||||
|
||||
2001-08-07 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
* gconv_stubs.c (__gconv_lookup_alias): Remove.
|
||||
(__gconv_NOOP, __gconv_compare_alias, __gconv_release_cache,
|
||||
__gconv_release_step): New.
|
||||
|
||||
2001-06-07 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
* gconv_stubs.c (__gconv_lookup_alias): New.
|
||||
|
||||
2000-02-27 Cristian Gafton <gafton@redhat.com>
|
||||
|
||||
* gconv_stubs.c: Return __gconv_OK for:
|
||||
__gconv_transform_ascii_internal
|
||||
__gconv_transform_ucs2little_internal
|
||||
__gconv_transform_utf16_internal
|
||||
__gconv_transform_utf8_internal
|
||||
__gconv_transform_ucs2_internal
|
||||
|
||||
2000-02-25 Cristian Gafton <gafton@redhat.com>
|
||||
|
||||
* gconv_stubs.c: add __c_stubs_is_compiled_in so we can detect when
|
||||
the library is linked in.
|
||||
|
||||
Wed Dec 8 13:47:25 1999 Ivan Brunello <ivan.brunello@tiscalinet.it>
|
||||
|
||||
* Makefile (extra-objs): Changed stubs.o to gconv_stubs.o.
|
||||
|
||||
Sun Dec 5 11:32:17 1999 H.J. Lu <hjl@gnu.org>
|
||||
|
||||
* gconv_stubs.c: Renamed from stubs.c.
|
||||
Support glibc 2.1.x.
|
||||
|
||||
Mon Aug 23 16:42:05 1999 H.J. Lu <hjl@gnu.org>
|
||||
|
||||
* Banner: New.
|
||||
* COPYING.LIB: Likewise.
|
||||
* Makefile: Likewise.
|
||||
* README: Likewise.
|
||||
* configure: Likewise.
|
||||
* stubs.c: Likewise.
|
||||
* test-stdio.c: Likewise.
|
@ -1,46 +0,0 @@
|
||||
# Copyright (C) 1999 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
|
||||
# modify it under the terms of the GNU Library General Public License as
|
||||
# published by the Free Software Foundation; either version 2 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
|
||||
# Library General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU Library General Public
|
||||
# License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
# write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
# Boston, MA 02111-1307, USA.
|
||||
|
||||
#
|
||||
# Sub-makefile for the C stub add-on library.
|
||||
#
|
||||
subdir := c_stubs
|
||||
|
||||
tests-static := test-stdio
|
||||
tests := $(tests-static)
|
||||
|
||||
libc_stubs-objs := gconv_stubs.o
|
||||
|
||||
install-lib := libc_stubs.a
|
||||
non-lib.a := libc_stubs.a
|
||||
|
||||
extra-objs := gconv_stubs.o libc_stubs.a
|
||||
|
||||
include ../Makeconfig
|
||||
|
||||
CPPFLAGS += -I../iconv
|
||||
|
||||
include ../Rules
|
||||
|
||||
$(objpfx)libc_stubs.a: $(addprefix $(objpfx), $(libc_stubs-objs))
|
||||
-rm -f $@
|
||||
$(CC) -nostdlib -nostartfiles -r -o $@ $^
|
||||
|
||||
lib: $(objpfx)libc_stubs.a
|
||||
|
||||
$(objpfx)test-stdio: $(objpfx)libc_stubs.a
|
@ -1,8 +0,0 @@
|
||||
This is a stub add-on library for the GNU C library version 2.1.2 and
|
||||
above. It is used to create the smaller static binaries by stubbing
|
||||
out the gconv related functions. The resulting binaries may not have
|
||||
all the functionalities.
|
||||
|
||||
H.J. Lu
|
||||
hjl@gnu.org
|
||||
12/05/1999
|
5
c_stubs/configure
vendored
5
c_stubs/configure
vendored
@ -1,5 +0,0 @@
|
||||
# This is only to keep the GNU C library configure mechanism happy.
|
||||
# This is a shell script fragment sourced by the main configure script.
|
||||
|
||||
libc_add_on_canonical=
|
||||
libc_add_on_subdirs=.
|
@ -1,126 +0,0 @@
|
||||
/* Provide gconv stub functions for the minimum static binaries.
|
||||
Copyright (C) 1999, 2001, 2003, 2004 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
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <features.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include <bits/libc-lock.h>
|
||||
#if __GNUC_PREREQ(3, 3)
|
||||
# include <gconv_int.h>
|
||||
#else
|
||||
# include <gconv.h>
|
||||
#endif
|
||||
|
||||
__libc_lock_define_initialized (, __gconv_lock)
|
||||
|
||||
/* hack for self identification */
|
||||
int __c_stubs_is_compiled_in;
|
||||
|
||||
/* Don't drag in the dynamic linker. */
|
||||
void *__libc_stack_end;
|
||||
|
||||
int attribute_hidden
|
||||
__gconv_OK (void)
|
||||
{
|
||||
#if __GLIBC__ > 2 || __GLIBC_MINOR__ > 1
|
||||
return __GCONV_OK;
|
||||
#else
|
||||
return GCONV_OK;
|
||||
#endif
|
||||
}
|
||||
|
||||
int attribute_hidden
|
||||
__gconv_NOCONV (void)
|
||||
{
|
||||
#if __GLIBC__ > 2 || __GLIBC_MINOR__ > 1
|
||||
return __GCONV_NOCONV;
|
||||
#else
|
||||
return GCONV_NOCONV;
|
||||
#endif
|
||||
}
|
||||
|
||||
void attribute_hidden
|
||||
__gconv_NOOP (void)
|
||||
{
|
||||
}
|
||||
|
||||
int
|
||||
internal_function
|
||||
__gconv_compare_alias (const char *name1, const char *name2)
|
||||
{
|
||||
return strcmp (name1, name2);
|
||||
}
|
||||
|
||||
wint_t
|
||||
__gconv_btwoc_ascii (struct __gconv_step *step, unsigned char c)
|
||||
{
|
||||
if (c < 0x80)
|
||||
return c;
|
||||
else
|
||||
return WEOF;
|
||||
}
|
||||
|
||||
|
||||
#if __GNUC_PREREQ(3, 3)
|
||||
# undef strong_alias
|
||||
# define strong_alias(impl, name) \
|
||||
__typeof (name) name __attribute__ ((alias (#impl)))
|
||||
#endif
|
||||
|
||||
strong_alias (__gconv_OK,
|
||||
__gconv_close_transform);
|
||||
strong_alias (__gconv_OK,
|
||||
__gconv_close);
|
||||
|
||||
strong_alias (__gconv_NOCONV,
|
||||
__gconv);
|
||||
strong_alias (__gconv_NOCONV,
|
||||
__gconv_find_transform);
|
||||
strong_alias (__gconv_NOCONV,
|
||||
__gconv_open);
|
||||
|
||||
/* These transformations should not fail in normal conditions */
|
||||
strong_alias (__gconv_OK,
|
||||
__gconv_transform_ascii_internal);
|
||||
strong_alias (__gconv_OK,
|
||||
__gconv_transform_utf16_internal);
|
||||
strong_alias (__gconv_OK,
|
||||
__gconv_transform_utf8_internal);
|
||||
strong_alias (__gconv_OK,
|
||||
__gconv_transform_ucs2_internal);
|
||||
|
||||
/* We can assume no conversion for these ones */
|
||||
strong_alias (__gconv_NOCONV,
|
||||
__gconv_transform_internal_ascii);
|
||||
strong_alias (__gconv_NOCONV,
|
||||
__gconv_transform_internal_ucs2);
|
||||
strong_alias (__gconv_NOCONV,
|
||||
__gconv_transform_internal_ucs4);
|
||||
strong_alias (__gconv_NOCONV,
|
||||
__gconv_transform_internal_utf16);
|
||||
strong_alias (__gconv_NOCONV,
|
||||
__gconv_transform_internal_utf8);
|
||||
|
||||
strong_alias (__gconv_NOCONV,
|
||||
__gconv_transliterate);
|
||||
|
||||
strong_alias (__gconv_NOOP,
|
||||
__gconv_release_cache);
|
||||
strong_alias (__gconv_NOOP,
|
||||
__gconv_release_step);
|
@ -1,8 +0,0 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
printf ("Hello world\n");
|
||||
return 0;
|
||||
}
|
@ -1,22 +1,24 @@
|
||||
/* Copyright (C) 1996-2005, 2006 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1996-2002, 2003, 2004 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@redhat.com>, 1996.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License version 2 as
|
||||
published by the Free Software Foundation.
|
||||
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.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
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 General Public License for more details.
|
||||
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 General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
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. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <argp.h>
|
||||
@ -246,7 +248,7 @@ print_version (FILE *stream, struct argp_state *state)
|
||||
Copyright (C) %s Free Software Foundation, Inc.\n\
|
||||
This is free software; see the source for copying conditions. There is NO\n\
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
|
||||
"), "2006");
|
||||
"), "2004");
|
||||
fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper");
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* @configure_input@ -*- C -*-
|
||||
Generated from $Id$.
|
||||
|
||||
This is used only by the generic `uname' function for systems with no real
|
||||
`uname' call. If this data is not correct, it does not matter much. */
|
||||
|
38
config.h.in
38
config.h.in
@ -8,6 +8,11 @@
|
||||
# error "glibc must not be compiled with -ffast-math"
|
||||
#endif
|
||||
|
||||
/* Define if using GNU ld, with support for weak symbols in a.out,
|
||||
and for symbol set and warning messages extensions in a.out and ELF.
|
||||
This implies HAVE_WEAK_SYMBOLS; set by --with-gnu-ld. */
|
||||
#undef HAVE_GNU_LD
|
||||
|
||||
/* Define if using ELF, which supports weak symbols.
|
||||
This implies HAVE_ASM_WEAK_DIRECTIVE and NO_UNDERSCORES; set by
|
||||
--with-elf. */
|
||||
@ -16,12 +21,6 @@
|
||||
/* Define if building with SELinux support. Set by --with-selinux. */
|
||||
#undef HAVE_SELINUX
|
||||
|
||||
/* Defined if building with SELinux support & audit libs are detected. */
|
||||
#undef HAVE_LIBAUDIT
|
||||
|
||||
/* Defined if building with SELinux support & libcap libs are detected. */
|
||||
#undef HAVE_LIBCAP
|
||||
|
||||
/* Define if using XCOFF. Set by --with-xcoff. */
|
||||
#undef HAVE_XCOFF
|
||||
|
||||
@ -48,6 +47,9 @@
|
||||
/* Define if __attribute__((section("foo"))) puts quotes around foo. */
|
||||
#undef HAVE_SECTION_QUOTES
|
||||
|
||||
/* Define if using the GNU assembler, gas. */
|
||||
#undef HAVE_GNU_AS
|
||||
|
||||
/* Define if the assembler supports the `.set' directive. */
|
||||
#undef HAVE_ASM_SET_DIRECTIVE
|
||||
|
||||
@ -92,6 +94,13 @@
|
||||
/* Define if static NSS modules are wanted. */
|
||||
#undef DO_STATIC_NSS
|
||||
|
||||
/* Define if gcc uses DWARF2 unwind information for exception support. */
|
||||
#undef HAVE_DWARF2_UNWIND_INFO
|
||||
|
||||
/* Define if gcc uses DWARF2 unwind information for exception support
|
||||
with static variable. */
|
||||
#undef HAVE_DWARF2_UNWIND_INFO_STATIC
|
||||
|
||||
/* Define if the compiler supports __builtin_expect. */
|
||||
#undef HAVE_BUILTIN_EXPECT
|
||||
|
||||
@ -146,6 +155,10 @@
|
||||
/* Define if binutils support TLS handling. */
|
||||
#undef HAVE_TLS_SUPPORT
|
||||
|
||||
/* Define if the linker supports .preinit_array/.init_array/.fini_array
|
||||
sections. */
|
||||
#undef HAVE_INITFINI_ARRAY
|
||||
|
||||
/* Define if the compiler's exception support is based on libunwind. */
|
||||
#undef HAVE_CC_WITH_LIBUNWIND
|
||||
|
||||
@ -170,6 +183,10 @@
|
||||
/* Override abi-tags ABI version if necessary. */
|
||||
#undef __ABI_TAG_VERSION
|
||||
|
||||
/* An extension in gcc 2.96 and up allows the subtraction of two
|
||||
local labels. */
|
||||
#undef HAVE_SUBTRACT_LOCAL_LABELS
|
||||
|
||||
/* bash 2.0 introduced the _XXX_GNU_nonoption_argv_flags_ variable to help
|
||||
getopt determine whether a parameter is a flag or not. This features
|
||||
was disabled later since it caused trouble. We are by default therefore
|
||||
@ -200,15 +217,6 @@
|
||||
/* Define if inlined system calls are available. */
|
||||
#undef HAVE_INLINED_SYSCALLS
|
||||
|
||||
/* Define if your assembler and linker support R_PPC_REL16* relocs. */
|
||||
#undef HAVE_ASM_PPC_REL16
|
||||
|
||||
/* Define if your compiler defaults to -msecure-plt mode on ppc. */
|
||||
#undef HAVE_PPC_SECURE_PLT
|
||||
|
||||
/* Define if __stack_chk_guard canary should be randomized at program startup. */
|
||||
#undef ENABLE_STACKGUARD_RANDOMIZE
|
||||
|
||||
/*
|
||||
*/
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
# @configure_input@
|
||||
# From $Id$.
|
||||
# Don't edit this file. Put configuration parameters in configparms instead.
|
||||
|
||||
version = @VERSION@
|
||||
@ -30,11 +31,9 @@ base-machine = @base_machine@
|
||||
config-vendor = @host_vendor@
|
||||
config-os = @host_os@
|
||||
config-sysdirs = @sysnames@
|
||||
with-cpu = @submachine@
|
||||
|
||||
defines = @DEFINES@
|
||||
sysincludes = @SYSINCLUDES@
|
||||
c++-sysincludes = @CXX_SYSINCLUDES@
|
||||
all-warnings = @all_warnings@
|
||||
|
||||
elf = @elf@
|
||||
@ -54,18 +53,15 @@ with-fp = @with_fp@
|
||||
with-cvs = @with_cvs@
|
||||
old-glibc-headers = @old_glibc_headers@
|
||||
unwind-find-fde = @libc_cv_gcc_unwind_find_fde@
|
||||
have-initfini-array = @libc_cv_initfinit_array@
|
||||
have-cpp-asm-debuginfo = @libc_cv_cpp_asm_debuginfo@
|
||||
enable-check-abi = @enable_check_abi@
|
||||
have-forced-unwind = @libc_cv_forced_unwind@
|
||||
have-fpie = @libc_cv_fpie@
|
||||
have-ssp = @libc_cv_ssp@
|
||||
have-selinux = @have_selinux@
|
||||
have-libaudit = @have_libaudit@
|
||||
have-libcap = @have_libcap@
|
||||
have-cc-with-libunwind = @libc_cv_cc_with_libunwind@
|
||||
fno-unit-at-a-time = @fno_unit_at_a_time@
|
||||
bind-now = @bindnow@
|
||||
have-hash-style = @libc_cv_hashstyle@
|
||||
|
||||
static-libgcc = @libc_cv_gcc_static_libgcc@
|
||||
|
||||
@ -73,6 +69,7 @@ versioning = @VERSIONING@
|
||||
oldest-abi = @oldest_abi@
|
||||
no-whole-archive = @no_whole_archive@
|
||||
exceptions = @exceptions@
|
||||
have_doors = @linux_doors@
|
||||
|
||||
mach-interface-list = @mach_interface_list@
|
||||
|
||||
@ -82,6 +79,8 @@ have-ksh = @libc_cv_have_ksh@
|
||||
sizeof-long-double = @sizeof_long_double@
|
||||
|
||||
# Configuration options.
|
||||
gnu-as = @gnu_as@
|
||||
gnu-ld = @gnu_ld@
|
||||
build-static = @static@
|
||||
build-shared = @shared@
|
||||
build-pic-default= @pic_default@
|
||||
@ -90,8 +89,6 @@ build-omitfp = @omitfp@
|
||||
build-bounded = @bounded@
|
||||
build-static-nss = @static_nss@
|
||||
add-ons = @add_ons@
|
||||
add-on-subdirs = @add_on_subdirs@
|
||||
sysdeps-add-ons = @sysdeps_add_ons@
|
||||
cross-compiling = @cross_compiling@
|
||||
force-install = @force_install@
|
||||
|
||||
|
552
configure.in
552
configure.in
@ -13,6 +13,18 @@ fi
|
||||
# This will get text that should go into config.make.
|
||||
config_vars=
|
||||
|
||||
# Check for a --with-gmp argument and set gmp-srcdir in config.make.
|
||||
AC_ARG_WITH([gmp],
|
||||
AC_HELP_STRING([--with-gmp=DIRECTORY],
|
||||
[find GMP source code in DIRECTORY (not needed)]),
|
||||
[
|
||||
case "$with_gmp" in
|
||||
yes) AC_MSG_ERROR([--with-gmp requires an argument; use --with-gmp=DIRECTORY]) ;;
|
||||
''|no) ;;
|
||||
*) config_vars="$config_vars
|
||||
gmp-srcdir = $withval" ;;
|
||||
esac
|
||||
])
|
||||
# Check for a --with-gd argument and set libgd-LDFLAGS in config.make.
|
||||
AC_ARG_WITH([gd],
|
||||
AC_HELP_STRING([--with-gd=DIR],
|
||||
@ -162,21 +174,18 @@ else
|
||||
fi
|
||||
AC_SUBST(oldest_abi)
|
||||
|
||||
AC_ARG_ENABLE([stackguard-randomization],
|
||||
AC_HELP_STRING([--enable-stackguard-randomization],
|
||||
[initialize __stack_chk_guard canary with a random number at program start]),
|
||||
[enable_stackguard_randomize=$enableval],
|
||||
[enable_stackguard_randomize=no])
|
||||
if test "$enable_stackguard_randomize" = yes; then
|
||||
AC_DEFINE(ENABLE_STACKGUARD_RANDOMIZE)
|
||||
fi
|
||||
|
||||
dnl Generic infrastructure for drop-in additions to libc.
|
||||
AC_ARG_ENABLE([add-ons],
|
||||
AC_HELP_STRING([--enable-add-ons@<:@=DIRS...@:>@],
|
||||
[configure and build add-ons in DIR1,DIR2,...
|
||||
search for add-ons if no parameter given]),
|
||||
, [enable_add_ons=yes])
|
||||
[configure and build add-ons in DIR1,DIR2,... search for add-ons if no parameter given]),
|
||||
[case "$enableval" in
|
||||
yes) add_ons=`cd $srcdir && echo */configure | sed -e 's!/configure!!g'`
|
||||
add_ons_automatic=yes
|
||||
test "$add_ons" = "*" && add_ons= ;;
|
||||
*) add_ons=`echo "$enableval" | sed 's/,/ /g'`
|
||||
add_ons_automatic=no ;;
|
||||
esac],
|
||||
[add_ons= add_ons_automatic=no])
|
||||
|
||||
dnl Let the user avoid using TLS. Don't know why but...
|
||||
AC_ARG_WITH([tls],
|
||||
@ -280,6 +289,11 @@ config_os="`echo $config_os | sed 's/^unknown-//'`"
|
||||
|
||||
# Some configurations imply other options.
|
||||
case "$host_os" in
|
||||
gnu* | linux* | bsd4.4* | netbsd* | freebsd*)
|
||||
# These systems always use GNU tools.
|
||||
gnu_ld=yes gnu_as=yes ;;
|
||||
esac
|
||||
case "$host_os" in
|
||||
# i586-linuxaout is mangled into i586-pc-linux-gnuaout
|
||||
linux*ecoff* | linux*aout* | gnu*aout* | gnu*ecoff*)
|
||||
;;
|
||||
@ -314,19 +328,8 @@ case "$machine-$host_os" in
|
||||
;;
|
||||
esac
|
||||
|
||||
submachine=
|
||||
AC_ARG_WITH([cpu],
|
||||
AS_HELP_STRING([--with-cpu=CPU], [select code for CPU variant]),
|
||||
[dnl
|
||||
case "$withval" in
|
||||
yes|'') AC_MSG_ERROR([--with-cpu requires an argument]) ;;
|
||||
no) ;;
|
||||
*) submachine="$withval" ;;
|
||||
esac
|
||||
])
|
||||
|
||||
|
||||
# An add-on can set this when it wants to disable the sanity check below.
|
||||
# An add-on can set this when it the tuple to disable the sanity check below.
|
||||
libc_config_ok=no
|
||||
|
||||
dnl Having this here, though empty, makes sure that if add-ons' fragments
|
||||
@ -334,18 +337,6 @@ dnl do AC_CONFIG_SUBDIRS([some-dir]), which just sets $subdirs, then
|
||||
dnl our AC_OUTPUT will actually use it.
|
||||
AC_CONFIG_SUBDIRS()
|
||||
|
||||
case "$enable_add_ons" in
|
||||
''|no) add_ons= ;;
|
||||
yes|'*')
|
||||
add_ons=`cd $srcdir && ls -d 2> /dev/null */configure */sysdeps |
|
||||
sed 's@/[[^/]]*$@@' | sort | uniq`
|
||||
add_ons_automatic=yes
|
||||
;;
|
||||
*) add_ons=`echo "$enable_add_ons" | sed 's/,/ /g'`
|
||||
add_ons_automatic=no ;;
|
||||
esac
|
||||
|
||||
configured_add_ons=
|
||||
add_ons_sfx=
|
||||
add_ons_pfx=
|
||||
if test x"$add_ons" != x; then
|
||||
@ -367,6 +358,11 @@ if test x"$add_ons" != x; then
|
||||
*** \`localedata' add-on.])
|
||||
;;
|
||||
esac
|
||||
|
||||
# Test whether such a subdir really exists.
|
||||
test -d $srcdir/$f || {
|
||||
AC_MSG_ERROR(add-on directory \"$f\" does not exist)
|
||||
}
|
||||
done
|
||||
|
||||
# Now source each add-on's configure fragment.
|
||||
@ -376,81 +372,23 @@ if test x"$add_ons" != x; then
|
||||
# whether it goes into the list to be actually used in the build.
|
||||
use_add_ons=
|
||||
for libc_add_on in $add_ons; do
|
||||
# Test whether such a directory really exists.
|
||||
# It can be absolute, or relative to $srcdir, or relative to the build dir.
|
||||
case "$libc_add_on" in
|
||||
/*)
|
||||
libc_add_on_srcdir=$libc_add_on
|
||||
;;
|
||||
*)
|
||||
test -d "$srcdir/$libc_add_on" || {
|
||||
if test -d "$libc_add_on"; then
|
||||
libc_add_on="`pwd`/$libc_add_on"
|
||||
else
|
||||
AC_MSG_ERROR(add-on directory \"$libc_add_on\" does not exist)
|
||||
fi
|
||||
}
|
||||
libc_add_on_srcdir=$srcdir/$libc_add_on
|
||||
;;
|
||||
esac
|
||||
|
||||
libc_add_on_frag=$libc_add_on_srcdir/configure
|
||||
libc_add_on_canonical=
|
||||
if test -r "$libc_add_on_frag"; then
|
||||
AC_MSG_NOTICE(running configure fragment for add-on $libc_add_on)
|
||||
libc_add_on_canonical=unknown
|
||||
libc_add_on_subdirs=
|
||||
. "$libc_add_on_frag"
|
||||
test -z "$libc_add_on" || {
|
||||
configured_add_ons="$configured_add_ons $libc_add_on"
|
||||
if test "x$libc_add_on_canonical" = xunknown; then
|
||||
AC_MSG_ERROR(fragment must set \$libc_add_on_canonical)
|
||||
fi
|
||||
for d in $libc_add_on_subdirs; do
|
||||
case "$libc_add_on" in
|
||||
/*) subdir_srcdir="$libc_add_on" ;;
|
||||
*) subdir_srcdir="\$(..)$libc_add_on" ;;
|
||||
esac
|
||||
case "$d" in
|
||||
.)
|
||||
d="${libc_add_on_canonical:-$libc_add_on}"
|
||||
;;
|
||||
/*)
|
||||
subdir_srcdir="$d"
|
||||
;;
|
||||
*)
|
||||
subdir_srcdir="$subdir_srcdir/$d"
|
||||
;;
|
||||
esac
|
||||
d=`echo "$d" | sed 's@/*$@@;s@^.*/@@'`
|
||||
add_on_subdirs="$add_on_subdirs $d"
|
||||
test "$subdir_srcdir" = "\$(..)$d" || config_vars="$config_vars
|
||||
$d-srcdir = $subdir_srcdir"
|
||||
done
|
||||
}
|
||||
libc_add_on_frag=$srcdir/$libc_add_on/configure
|
||||
if test -r $libc_add_on_frag; then
|
||||
AC_MSG_RESULT(running configure fragment for add-on $libc_add_on)
|
||||
. $libc_add_on_frag
|
||||
else
|
||||
AC_MSG_WARN(add-on fragment $libc_add_on_frag missing)
|
||||
fi
|
||||
if test -n "$libc_add_on"; then
|
||||
if frags=`ls -d $libc_add_on_srcdir/sysdeps/*/preconfigure 2> /dev/null`
|
||||
then
|
||||
AC_MSG_CHECKING(add-on $libc_add_on for preconfigure fragments)
|
||||
for frag in $frags; do
|
||||
name=`echo "$frag" | sed 's@/[[^/]]*$@@;s@^.*/@@'`
|
||||
echo $ECHO_N "$name $ECHO_C" >&AS_MESSAGE_FD
|
||||
. "$frag"
|
||||
done
|
||||
AC_MSG_RESULT()
|
||||
fi
|
||||
use_add_ons="$use_add_ons $libc_add_on"
|
||||
add_ons_pfx="$add_ons_pfx $libc_add_on/"
|
||||
test -z "$libc_add_on_canonical" ||
|
||||
add_ons_sfx="$add_ons_sfx /$libc_add_on_canonical"
|
||||
add_ons_sfx="$add_ons_sfx /$libc_add_on"
|
||||
fi
|
||||
done
|
||||
# Use echo to strip excess whitespace.
|
||||
add_ons="`echo $use_add_ons`"
|
||||
fi
|
||||
AC_SUBST(add_ons)
|
||||
AC_SUBST(add_on_subdirs)
|
||||
|
||||
|
||||
###
|
||||
@ -485,12 +423,44 @@ changequote(,)dnl
|
||||
test -n "$base_machine" || case "$machine" in
|
||||
a29k | am29000) base_machine=a29k machine=a29k ;;
|
||||
alpha*) base_machine=alpha machine=alpha/$machine ;;
|
||||
arm*) base_machine=arm machine=arm/arm32/$machine ;;
|
||||
c3[012]) base_machine=cx0 machine=cx0/c30 ;;
|
||||
c4[04]) base_machine=cx0 machine=cx0/c40 ;;
|
||||
hppa*64*) base_machine=hppa machine=hppa/hppa64 ;;
|
||||
hppa*) base_machine=hppa machine=hppa/hppa1.1 ;;
|
||||
i[34567]86) base_machine=i386 machine=i386/$machine ;;
|
||||
ia64) base_machine=ia64 machine=ia64 ;;
|
||||
m680?0) base_machine=m68k machine=m68k/$machine ;;
|
||||
m68k) base_machine=m68k machine=m68k/m68020 ;;
|
||||
m88???) base_machine=m88k machine=m88k/$machine ;;
|
||||
m88k) base_machine=m88k machine=m88k/m88100 ;;
|
||||
mips64*) base_machine=mips64
|
||||
case "$CC $CFLAGS $CPPFLAGS " in
|
||||
*" -mabi=n32 "*) mips_cc_abi=n32 ;;
|
||||
*" -mabi=64 "*|*" -mabi=n64 "*) mips_cc_abi=64 ;;
|
||||
*" -mabi=32 "*|*" -mabi=o32 "*) mips_cc_abi=32 ;;
|
||||
*) mips_cc_abi=default ;;
|
||||
esac
|
||||
case $config_os in
|
||||
*abin32*) mips_config_abi=n32 ;;
|
||||
*abi64*|*abin64*) mips_config_abi=64 ;;
|
||||
*abi32*|*abio32*) mips_config_abi=32 ;;
|
||||
*) mips_config_abi=$mips_cc_abi ;;
|
||||
esac
|
||||
case $mips_config_abi in
|
||||
default) machine=mips/mips64/n32 mips_config_abi=n32 ;;
|
||||
n32) machine=mips/mips64/n32 ;;
|
||||
64) machine=mips/mips64/n64 ;;
|
||||
32) machine=mips/mips32/kern64 ;;
|
||||
esac
|
||||
machine=$machine/$config_machine
|
||||
if test $mips_config_abi != $mips_cc_abi; then
|
||||
# This won't make it to config.make, but we want to
|
||||
# set this in case configure tests depend on it.
|
||||
CPPFLAGS="$CPPFLAGS -mabi=$mips_config_abi"
|
||||
fi
|
||||
;;
|
||||
mips*) base_machine=mips machine=mips/mips32/$machine ;;
|
||||
powerpc) base_machine=powerpc machine=powerpc/powerpc32 ;;
|
||||
powerpc64) base_machine=powerpc machine=powerpc/powerpc64 ;;
|
||||
s390) base_machine=s390 machine=s390/s390-32 ;;
|
||||
@ -504,15 +474,12 @@ sparcv8 | supersparc | hypersparc)
|
||||
sparcv8plus | sparcv8plusa | sparcv9)
|
||||
base_machine=sparc machine=sparc/sparc32/sparcv9 ;;
|
||||
sparcv8plusb | sparcv9b)
|
||||
base_machine=sparc machine=sparc/sparc32/sparcv9/sparcv9b ;;
|
||||
sparcv9v)
|
||||
base_machine=sparc machine=sparc/sparc32/sparcv9/sparcv9v ;;
|
||||
sparc64)
|
||||
base_machine=sparc machine=sparc/sparc32/sparcv9b ;;
|
||||
sparc64 | ultrasparc)
|
||||
base_machine=sparc machine=sparc/sparc64 ;;
|
||||
sparc64b)
|
||||
sparc64b | ultrasparc3)
|
||||
base_machine=sparc machine=sparc/sparc64/sparcv9b ;;
|
||||
sparc64v)
|
||||
base_machine=sparc machine=sparc/sparc64/sparcv9v ;;
|
||||
thumb*) base_machine=thumb machine=arm/thumb/$machine ;;
|
||||
*) base_machine=$machine ;;
|
||||
esac
|
||||
changequote([,])dnl
|
||||
@ -582,7 +549,7 @@ done
|
||||
|
||||
# For sparc/sparc32, try sparc/sparc32 and then sparc.
|
||||
mach=
|
||||
tail=$machine${submachine:+/$submachine}
|
||||
tail=$machine
|
||||
while m=`echo $tail | sed 's@^\(.*\)/\([^/]*\)$@& \1@'`; test -n "$m"; do
|
||||
set $m
|
||||
# Prepend the machine's FPU directory unless --without-fp.
|
||||
@ -599,38 +566,25 @@ dnl We are done with glob and regexp uses of [ and ]; return to autoconf.
|
||||
changequote([,])dnl
|
||||
|
||||
# Find what sysdep directories exist.
|
||||
sysnames_add_ons=
|
||||
sysnames=
|
||||
for b in $base ''; do
|
||||
for m0 in $mach ''; do
|
||||
for v in /$vendor ''; do
|
||||
test "$v" = / && continue
|
||||
for o in /$ostry ''; do
|
||||
test "$o" = / && continue
|
||||
for m in $mach ''; do
|
||||
for d in $add_ons_pfx ''; do
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
|
||||
for d in $add_ons_pfx ''; do
|
||||
for b in $base ''; do
|
||||
for m0 in $mach ''; do
|
||||
for v in /$vendor ''; do
|
||||
test "$v" = / && continue
|
||||
for o in /$ostry ''; do
|
||||
test "$o" = / && continue
|
||||
for m in $mach ''; do
|
||||
for a in $add_ons_sfx ''; do
|
||||
if test -n "$m0$m0sub$b$v$o$m$msub"; then
|
||||
try_srcdir="${srcdir}/"
|
||||
case "$d" in
|
||||
/*) try_srcdir= ;;
|
||||
esac
|
||||
try="${d}sysdeps$m0$m0sub$b$v$o$m$msub$a"
|
||||
if test "$m0$b$v$o$m"; then
|
||||
try="${d}sysdeps$m0$b$v$o$m$a"
|
||||
test -n "$enable_debug_configure" &&
|
||||
echo "$0 [DEBUG]: try $try" >&2
|
||||
if test -d "$try_srcdir$try"; then
|
||||
if test -d $srcdir/$try; then
|
||||
sysnames="$sysnames $try"
|
||||
{ test -n "$o" || test -n "$b"; } && os_used=t
|
||||
{ test -n "$m" || test -n "$m0"; } && machine_used=t
|
||||
case x${m0:-$m} in
|
||||
x*/$submachine) submachine_used=t ;;
|
||||
esac
|
||||
if test -n "$d"; then
|
||||
case "$sysnames_add_ons" in
|
||||
*" $d "*) ;;
|
||||
*|'') sysnames_add_ons="$sysnames_add_ons $d" ;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
@ -640,6 +594,7 @@ for b in $base ''; do
|
||||
done
|
||||
done
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
|
||||
if test -z "$os_used" && test "$os" != none; then
|
||||
AC_MSG_ERROR(Operating system $os is not supported.)
|
||||
@ -647,10 +602,6 @@ fi
|
||||
if test -z "$machine_used" && test "$machine" != none; then
|
||||
AC_MSG_ERROR(The $machine is not supported.)
|
||||
fi
|
||||
if test -z "$submachine_used" && test -n "$submachine"; then
|
||||
AC_MSG_ERROR(The $submachine subspecies of $host_cpu is not supported.)
|
||||
fi
|
||||
AC_SUBST(submachine)
|
||||
|
||||
# We have now validated the configuration.
|
||||
|
||||
@ -720,10 +671,6 @@ while test $# -gt 0; do
|
||||
then
|
||||
implied="$implied $try"
|
||||
found=yes
|
||||
case "$sysnames_add_ons" in
|
||||
*" $d "*) ;;
|
||||
*|'') sysnames_add_ons="$sysnames_add_ons $d" ;;
|
||||
esac
|
||||
fi
|
||||
done
|
||||
if test $found = no; then
|
||||
@ -763,61 +710,6 @@ AC_SUBST(sysnames)
|
||||
# The other names were emitted during the scan.
|
||||
AC_MSG_RESULT($default_sysnames)
|
||||
|
||||
# Collect the list of add-ons that supply partial sysdeps trees.
|
||||
sysdeps_add_ons=
|
||||
for add_on in $add_ons; do
|
||||
case "$add_on" in
|
||||
/*) xsrcdir= ;;
|
||||
*) xsrcdir="$srcdir/" ;;
|
||||
esac
|
||||
|
||||
test -d "$xsrcdir$add_on/sysdeps" || {
|
||||
case "$configured_add_ons " in
|
||||
*" $add_on "*) ;;
|
||||
*|'')
|
||||
AC_MSG_ERROR(add-on $add_on has no configure fragment or sysdeps tree)
|
||||
;;
|
||||
esac
|
||||
continue
|
||||
}
|
||||
|
||||
sysdeps_add_ons="$sysdeps_add_ons $add_on"
|
||||
case "$sysnames_add_ons" in
|
||||
*" $add_on/ "*) ;;
|
||||
*|'')
|
||||
AC_MSG_WARN(add-on $add_on contributed no sysdeps directories)
|
||||
continue ;;
|
||||
esac
|
||||
|
||||
found=no
|
||||
for d in $sysnames; do
|
||||
case "$d" in
|
||||
$add_on/sysdeps/*) ;;
|
||||
*) continue ;;
|
||||
esac
|
||||
(cd "$xsrcdir$d" && for f in *[[!~]]; do
|
||||
case "$f" in
|
||||
sys|bits)
|
||||
for ff in $f/*.h; do
|
||||
test -d "$ff" || { test -e "$ff" && exit 88; }
|
||||
done
|
||||
;;
|
||||
*)
|
||||
test -d "$f" || { test -e "$f" && exit 88; }
|
||||
;;
|
||||
esac
|
||||
done)
|
||||
if test $? -eq 88; then
|
||||
found=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test $found = no; then
|
||||
AC_MSG_WARN(add-on $add_on contributed no useful sysdeps directories)
|
||||
fi
|
||||
done
|
||||
AC_SUBST(sysdeps_add_ons)
|
||||
|
||||
|
||||
### Locate tools.
|
||||
|
||||
@ -860,7 +752,7 @@ fi
|
||||
# These programs are version sensitive.
|
||||
AC_CHECK_TOOL_PREFIX
|
||||
AC_CHECK_PROG_VER(CC, ${ac_tool_prefix}gcc ${ac_tool_prefix}cc, -v,
|
||||
[version \([egcygnustpi-]*[0-9.]*\)], [3.4* | 4.[0-9]* ],
|
||||
[version \([egcygnustpi-]*[0-9.]*\)], [3.[2-9]* | 4.[0-9]* ],
|
||||
critic_missing="$critic_missing gcc")
|
||||
AC_CHECK_PROG_VER(MAKE, gnumake gmake make, --version,
|
||||
[GNU Make[^0-9]*\([0-9][0-9.]*\)],
|
||||
@ -914,16 +806,8 @@ if test -n "$sysheaders"; then
|
||||
ccheaders=`$CC -print-file-name=include`
|
||||
SYSINCLUDES="-nostdinc -isystem $ccheaders \
|
||||
-isystem `echo $sysheaders | sed 's/:/ -isystem /g'`"
|
||||
if test -n "$CXX"; then
|
||||
cxxversion=`$CXX -dumpversion 2>&AS_MESSAGE_LOG_FD` &&
|
||||
cxxmachine=`$CXX -dumpmachine 2>&AS_MESSAGE_LOG_FD` &&
|
||||
cxxheaders=`$CXX -print-file-name=../../../../include/c++/`"$cxxversion" &&
|
||||
CXX_SYSINCLUDES="-isystem $cxxheaders \
|
||||
-isystem $cxxheaders/$cxxmachine -isystem $cxxheaders/backward"
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(SYSINCLUDES)
|
||||
AC_SUBST(CXX_SYSINCLUDES)
|
||||
|
||||
# check if ranlib is necessary
|
||||
AC_CACHE_CHECK(whether ranlib is necessary, libc_cv_ranlib_necessary, [dnl
|
||||
@ -1334,12 +1218,12 @@ EOF
|
||||
AC_DEFINE(HAVE_BROKEN_ALIAS_ATTRIBUTE)
|
||||
fi
|
||||
|
||||
if test $libc_cv_visibility_attribute = yes; then
|
||||
if test $libc_cv_visibility_attribute = yes -a $gnu_ld = yes; then
|
||||
AC_CACHE_CHECK(whether to put _rtld_local into .sdata section,
|
||||
libc_cv_have_sdata_section,
|
||||
[echo "int i;" > conftest.c
|
||||
libc_cv_have_sdata_section=no
|
||||
if ${CC-cc} $LDFLAGS -fPIC -shared -Wl,--verbose conftest.c -o conftest.so 2>&1 \
|
||||
if ${CC-cc} $LDFLAGS -shared -Wl,--verbose conftest.c -o conftest.so 2>&1 \
|
||||
| grep '\.sdata' >/dev/null; then
|
||||
libc_cv_have_sdata_section=yes
|
||||
fi
|
||||
@ -1351,7 +1235,7 @@ EOF
|
||||
fi
|
||||
|
||||
AC_CACHE_CHECK(for .preinit_array/.init_array/.fini_array support,
|
||||
libc_cv_initfini_array, [dnl
|
||||
libc_cv_initfinit_array, [dnl
|
||||
cat > conftest.c <<EOF
|
||||
int _start (void) { return 0; }
|
||||
int __start (void) { return 0; }
|
||||
@ -1362,16 +1246,17 @@ EOF
|
||||
-static -nostartfiles -nostdlib 1>&AS_MESSAGE_LOG_FD])
|
||||
then
|
||||
if readelf -S conftest | fgrep INIT_ARRAY > /dev/null; then
|
||||
libc_cv_initfini_array=yes
|
||||
libc_cv_initfinit_array=yes
|
||||
else
|
||||
libc_cv_initfini_array=no
|
||||
libc_cv_initfinit_array=no
|
||||
fi
|
||||
else
|
||||
libc_cv_initfini_array=no
|
||||
libc_cv_initfinit_array=no
|
||||
fi
|
||||
rm -f conftest*])
|
||||
if test $libc_cv_initfini_array != yes; then
|
||||
AC_MSG_ERROR([Need linker with .init_array/.fini_array support.])
|
||||
AC_SUBST(libc_cv_initfinit_array)
|
||||
if test $libc_cv_initfinit_array = yes; then
|
||||
AC_DEFINE(HAVE_INITFINI_ARRAY)
|
||||
fi
|
||||
|
||||
AC_CACHE_CHECK(for libunwind-support in compiler,
|
||||
@ -1397,7 +1282,7 @@ EOF
|
||||
int _start (void) { return 42; }
|
||||
EOF
|
||||
if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
|
||||
-fPIC -shared -o conftest.so conftest.c
|
||||
-shared -o conftest.so conftest.c
|
||||
-nostartfiles -nostdlib
|
||||
-Wl,--enable-new-dtags,-z,nodelete 1>&AS_MESSAGE_LOG_FD])
|
||||
then
|
||||
@ -1414,7 +1299,7 @@ EOF
|
||||
int _start (void) { return 42; }
|
||||
EOF
|
||||
if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
|
||||
-fPIC -shared -o conftest.so conftest.c
|
||||
-shared -o conftest.so conftest.c
|
||||
-nostartfiles -nostdlib
|
||||
-Wl,--enable-new-dtags,-z,nodlopen 1>&AS_MESSAGE_LOG_FD])
|
||||
then
|
||||
@ -1431,7 +1316,7 @@ EOF
|
||||
int _start (void) { return 42; }
|
||||
EOF
|
||||
if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
|
||||
-fPIC -shared -o conftest.so conftest.c
|
||||
-shared -o conftest.so conftest.c
|
||||
-nostartfiles -nostdlib
|
||||
-Wl,--enable-new-dtags,-z,initfirst 1>&AS_MESSAGE_LOG_FD])
|
||||
then
|
||||
@ -1463,7 +1348,7 @@ EOF
|
||||
int _start (void) { return 42; }
|
||||
EOF
|
||||
if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
|
||||
-fPIC -shared -o conftest.so conftest.c
|
||||
-shared -o conftest.so conftest.c
|
||||
-Wl,-Bgroup -nostdlib 1>&AS_MESSAGE_LOG_FD])
|
||||
then
|
||||
libc_cv_Bgroup=yes
|
||||
@ -1480,7 +1365,7 @@ int main (void) { return 0; }
|
||||
EOF
|
||||
changequote(,)dnl
|
||||
libc_cv_libgcc_s_suffix=`${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
|
||||
-fPIC -shared -shared-libgcc -o conftest.so \
|
||||
-shared -shared-libgcc -o conftest.so \
|
||||
conftest.c -v 2>&1 >/dev/null \
|
||||
| sed -n 's/^.* -lgcc_s\([^ ]*\) .*$/\1/p'`
|
||||
changequote([,])dnl
|
||||
@ -1493,7 +1378,7 @@ changequote([,])dnl
|
||||
int main (void) { return 0; }
|
||||
EOF
|
||||
if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
|
||||
-fPIC -shared -o conftest.so conftest.c
|
||||
-shared -o conftest.so conftest.c
|
||||
-lgcc_s$libc_cv_libgcc_s_suffix -Wl,--as-needed
|
||||
-nostdlib 1>&AS_MESSAGE_LOG_FD])
|
||||
then
|
||||
@ -1534,7 +1419,7 @@ extern int mumble;
|
||||
int foo (void) { return bar (mumble); }
|
||||
EOF
|
||||
if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
|
||||
-fPIC -shared -o conftest.so conftest.c
|
||||
-shared -o conftest.so conftest.c
|
||||
-nostdlib -nostartfiles
|
||||
-Wl,-z,combreloc 1>&AS_MESSAGE_LOG_FD])
|
||||
then
|
||||
@ -1563,7 +1448,7 @@ dnl look for a section named .rel.dyn.
|
||||
int _start (void) { return 42; }
|
||||
EOF
|
||||
if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
|
||||
-fPIC -shared -o conftest.so conftest.c
|
||||
-shared -o conftest.so conftest.c
|
||||
-Wl,-z,execstack -nostdlib
|
||||
1>&AS_MESSAGE_LOG_FD])
|
||||
then
|
||||
@ -1589,58 +1474,25 @@ EOF
|
||||
rm -f conftest*])
|
||||
|
||||
AC_SUBST(libc_cv_fpie)
|
||||
|
||||
AC_CACHE_CHECK(for --hash-style option,
|
||||
libc_cv_hashstyle, [dnl
|
||||
cat > conftest.c <<EOF
|
||||
int _start (void) { return 42; }
|
||||
EOF
|
||||
if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
|
||||
-fPIC -shared -o conftest.so conftest.c
|
||||
-Wl,--hash-style=both -nostdlib 1>&AS_MESSAGE_LOG_FD])
|
||||
then
|
||||
libc_cv_hashstyle=yes
|
||||
else
|
||||
libc_cv_hashstyle=no
|
||||
fi
|
||||
rm -f conftest*])
|
||||
AC_SUBST(libc_cv_hashstyle)
|
||||
fi
|
||||
|
||||
AC_CACHE_CHECK(for -fno-toplevel-reorder, libc_cv_fno_toplevel_reorder, [dnl
|
||||
AC_CACHE_CHECK(for -fno-unit-at-a-time, libc_cv_fno_unit_at_a_time, [dnl
|
||||
cat > conftest.c <<EOF
|
||||
int foo;
|
||||
EOF
|
||||
if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -S -fno-toplevel-reorder
|
||||
if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -S -fno-unit-at-a-time
|
||||
conftest.c 1>&AS_MESSAGE_LOG_FD])
|
||||
then
|
||||
libc_cv_fno_toplevel_reorder=yes
|
||||
libc_cv_fno_unit_at_a_time=yes
|
||||
else
|
||||
libc_cv_fno_toplevel_reorder=no
|
||||
libc_cv_fno_unit_at_a_time=no
|
||||
fi
|
||||
rm -f conftest*])
|
||||
if test $libc_cv_fno_toplevel_reorder = yes; then
|
||||
fno_unit_at_a_time=-fno-toplevel-reorder
|
||||
else
|
||||
if test $libc_cv_fno_unit_at_a_time = yes; then
|
||||
fno_unit_at_a_time=-fno-unit-at-a-time
|
||||
fi
|
||||
AC_SUBST(fno_unit_at_a_time)
|
||||
|
||||
AC_CACHE_CHECK(for -fstack-protector, libc_cv_ssp, [dnl
|
||||
cat > conftest.c <<EOF
|
||||
int foo;
|
||||
main () { return 0;}
|
||||
EOF
|
||||
if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -fstack-protector
|
||||
-o conftest conftest.c 1>&AS_MESSAGE_LOG_FD])
|
||||
then
|
||||
libc_cv_ssp=yes
|
||||
else
|
||||
libc_cv_ssp=no
|
||||
fi
|
||||
rm -f conftest*])
|
||||
AC_SUBST(libc_cv_ssp)
|
||||
|
||||
if test $elf != yes; then
|
||||
AC_CACHE_CHECK(for .init and .fini sections, libc_cv_have_initfini,
|
||||
[AC_TRY_COMPILE(, [asm (".section .init");
|
||||
@ -1654,7 +1506,7 @@ if test $elf != yes; then
|
||||
fi
|
||||
fi
|
||||
|
||||
if test $elf = yes; then
|
||||
if test $elf = yes -a $gnu_ld = yes; then
|
||||
AC_CACHE_CHECK(whether cc puts quotes around section names,
|
||||
libc_cv_have_section_quotes,
|
||||
[cat > conftest.c <<EOF
|
||||
@ -1770,17 +1622,13 @@ elif test $libc_cv_asm_weakext_directive = yes; then
|
||||
fi
|
||||
|
||||
AC_CACHE_CHECK(whether CFI directives are supported, libc_cv_asm_cfi_directives, [dnl
|
||||
case $machine in
|
||||
sparc/sparc64*) cfi_offset=2047;;
|
||||
*) cfi_offset=0;;
|
||||
esac
|
||||
cat > conftest.s <<EOF
|
||||
.text
|
||||
.type func,%function
|
||||
.type func,@function
|
||||
func:
|
||||
.cfi_startproc
|
||||
.cfi_remember_state
|
||||
.cfi_rel_offset 1, $cfi_offset
|
||||
.cfi_rel_offset 1, 0
|
||||
.cfi_endproc
|
||||
EOF
|
||||
if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
|
||||
@ -1793,6 +1641,39 @@ if test $libc_cv_asm_cfi_directives = yes; then
|
||||
AC_DEFINE(HAVE_ASM_CFI_DIRECTIVES)
|
||||
fi
|
||||
|
||||
AC_CACHE_CHECK(if -g produces usable source locations for assembler-with-cpp,
|
||||
libc_cv_cpp_asm_debuginfo, [dnl
|
||||
cat > conftest.S <<EOF
|
||||
#include "confdefs.h"
|
||||
|
||||
/* comment on
|
||||
two lines */
|
||||
${libc_cv_dot_text}
|
||||
${libc_cv_asm_global_directive} foo
|
||||
foo:
|
||||
/* Unfortunately this test only works for a real instruction,
|
||||
not for any of the machine-independent pseudo-ops.
|
||||
So we just have to assume everybody has a "nop". */
|
||||
nop
|
||||
/* comment */
|
||||
nop
|
||||
/* comment */
|
||||
nop
|
||||
EOF
|
||||
if AC_TRY_COMMAND([${CC-cc} $CPPFLAGS $ASFLAGS -g -c conftest.S 1>&AS_MESSAGE_LOG_FD]) && {
|
||||
ac_pattern='conftest\.S'
|
||||
AC_TRY_COMMAND([readelf --debug-dump=line conftest.o |
|
||||
grep $ac_pattern 1>&AS_MESSAGE_LOG_FD])
|
||||
}; then
|
||||
libc_cv_cpp_asm_debuginfo=yes
|
||||
else
|
||||
libc_cv_cpp_asm_debuginfo=no
|
||||
fi
|
||||
rm -f conftest*])AC_SUBST(libc_cv_cpp_asm_debuginfo)
|
||||
if test $libc_cv_cpp_asm_debuginfo = yes; then
|
||||
AC_DEFINE(HAVE_CPP_ASM_DEBUGINFO)
|
||||
fi
|
||||
|
||||
AC_CACHE_CHECK(for ld --no-whole-archive, libc_cv_ld_no_whole_archive, [dnl
|
||||
cat > conftest.c <<\EOF
|
||||
_start () {}
|
||||
@ -1845,6 +1726,71 @@ if test "$libc_cv_c_asmcr0_bug" != 'no'; then
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_CACHE_CHECK(for DWARF2 unwind info support, libc_cv_gcc_dwarf2_unwind_info,
|
||||
[cat > conftest.c <<EOF
|
||||
#line $LINENO "configure"
|
||||
static char *__EH_FRAME_BEGIN__;
|
||||
_start ()
|
||||
{
|
||||
#ifdef CHECK__register_frame
|
||||
__register_frame (__EH_FRAME_BEGIN__);
|
||||
__deregister_frame (__EH_FRAME_BEGIN__);
|
||||
#endif
|
||||
#ifdef CHECK__register_frame_info
|
||||
__register_frame_info (__EH_FRAME_BEGIN__);
|
||||
__deregister_frame_info (__EH_FRAME_BEGIN__);
|
||||
#endif
|
||||
}
|
||||
int __eh_pc;
|
||||
__throw () {}
|
||||
/* FIXME: this is fragile. */
|
||||
malloc () {}
|
||||
strcmp () {}
|
||||
strlen () {}
|
||||
memcpy () {}
|
||||
memset () {}
|
||||
free () {}
|
||||
abort () {}
|
||||
__bzero () {}
|
||||
dl_iterate_phdr () {}
|
||||
EOF
|
||||
libc_unwind_check="${CC-cc} $CFLAGS $CPPFLAGS -DCHECK__register_frame_info \
|
||||
$LDFLAGS \
|
||||
-nostdlib -nostartfiles -o conftest conftest.c \
|
||||
-lgcc"
|
||||
# Some platforms' specs put -lgcc first. The second one doesn't hurt.
|
||||
if AC_TRY_COMMAND([$libc_unwind_check >&AS_MESSAGE_LOG_FD]) ||
|
||||
AC_TRY_COMMAND([$libc_unwind_check -lgcc_eh -lgcc >&AS_MESSAGE_LOG_FD])
|
||||
then
|
||||
if $libc_unwind_check -v 2>&1 >/dev/null \
|
||||
| grep -- --eh-frame-hdr 2>&1 >/dev/null; then
|
||||
libc_cv_gcc_dwarf2_unwind_info=no_registry_needed
|
||||
else
|
||||
libc_cv_gcc_dwarf2_unwind_info=static
|
||||
fi
|
||||
else
|
||||
libc_cv_gcc_dwarf2_unwind_info=no
|
||||
fi
|
||||
if test $libc_cv_gcc_dwarf2_unwind_info = no; then
|
||||
if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -DCHECK__register_frame
|
||||
$LDFLAGS -nostdlib -nostartfiles
|
||||
-o conftest conftest.c -lgcc >&AS_MESSAGE_LOG_FD]); then
|
||||
libc_cv_gcc_dwarf2_unwind_info=yes
|
||||
else
|
||||
libc_cv_gcc_dwarf2_unwind_info=no
|
||||
fi
|
||||
fi
|
||||
rm -f conftest*])
|
||||
case $libc_cv_gcc_dwarf2_unwind_info in
|
||||
yes)
|
||||
AC_DEFINE(HAVE_DWARF2_UNWIND_INFO)
|
||||
;;
|
||||
static)
|
||||
AC_DEFINE(HAVE_DWARF2_UNWIND_INFO)
|
||||
AC_DEFINE(HAVE_DWARF2_UNWIND_INFO_STATIC)
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl Check whether compiler understands __builtin_expect.
|
||||
AC_CACHE_CHECK(for __builtin_expect, libc_cv_gcc_builtin_expect,
|
||||
[cat > conftest.c <<EOF
|
||||
@ -1906,6 +1852,35 @@ if test "$libc_cv_gcc_builtin_redirection" = yes ; then
|
||||
AC_DEFINE(HAVE_BUILTIN_REDIRECTION)
|
||||
fi
|
||||
|
||||
dnl Check whether the compiler supports subtraction of local labels.
|
||||
AC_CACHE_CHECK(for local label subtraction, libc_cv_gcc_subtract_local_labels,
|
||||
[cat > conftest.c <<EOF
|
||||
changequote(,)dnl
|
||||
#line $LINENO "configure"
|
||||
int foo (int a)
|
||||
{
|
||||
static const int ar[] = { &&l1 - &&l1, &&l2 - &&l1 };
|
||||
void *p = &&l1 + ar[a];
|
||||
goto *p;
|
||||
l1:
|
||||
return 1;
|
||||
l2:
|
||||
return 2;
|
||||
}
|
||||
changequote([,])dnl
|
||||
EOF
|
||||
dnl No \ in command here because it ends up inside ''.
|
||||
if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -nostdlib -nostartfiles
|
||||
-o conftest conftest.c -lgcc >&AS_MESSAGE_LOG_FD]); then
|
||||
libc_cv_gcc_subtract_local_labels=yes
|
||||
else
|
||||
libc_cv_gcc_subtract_local_labels=no
|
||||
fi
|
||||
rm -f conftest*])
|
||||
if test "$libc_cv_gcc_subtract_local_labels" = yes; then
|
||||
AC_DEFINE(HAVE_SUBTRACT_LOCAL_LABELS)
|
||||
fi
|
||||
|
||||
dnl Check whether the compiler supports the __thread keyword.
|
||||
if test "x$use__thread" != xno; then
|
||||
AC_CACHE_CHECK([for __thread], libc_cv_gcc___thread,
|
||||
@ -1989,22 +1964,7 @@ else
|
||||
fi
|
||||
# Check if we're building with SELinux support.
|
||||
if test "x$have_selinux" = xyes; then
|
||||
AC_DEFINE(HAVE_SELINUX, 1, [SELinux support])
|
||||
|
||||
# See if we have the libaudit library
|
||||
AC_CHECK_LIB(audit, audit_log_user_avc_message,
|
||||
have_libaudit=yes, have_libaudit=no)
|
||||
if test "x$have_libaudit" = xyes; then
|
||||
AC_DEFINE(HAVE_LIBAUDIT, 1, [SELinux libaudit support])
|
||||
fi
|
||||
AC_SUBST(have_libaudit)
|
||||
|
||||
# See if we have the libcap library
|
||||
AC_CHECK_LIB(cap, cap_init, have_libcap=yes, have_libcap=no)
|
||||
if test "x$have_libcap" = xyes; then
|
||||
AC_DEFINE(HAVE_LIBCAP, 1, [SELinux libcap support])
|
||||
fi
|
||||
AC_SUBST(have_libcap)
|
||||
AC_DEFINE(HAVE_SELINUX,1,[SELinux support])
|
||||
fi
|
||||
AC_SUBST(have_selinux)
|
||||
|
||||
@ -2138,7 +2098,13 @@ AC_SUBST(libc_cv_forced_unwind)
|
||||
AC_SUBST(use_ldconfig)
|
||||
AC_SUBST(ldd_rewrite_script)
|
||||
|
||||
AC_SUBST(elf) AC_SUBST(xcoff)
|
||||
AC_SUBST(gnu_ld) AC_SUBST(gnu_as) AC_SUBST(elf) AC_SUBST(xcoff)
|
||||
if test $gnu_ld = yes; then
|
||||
AC_DEFINE(HAVE_GNU_LD)
|
||||
fi
|
||||
if test $gnu_as = yes; then
|
||||
AC_DEFINE(HAVE_GNU_AS)
|
||||
fi
|
||||
if test $elf = yes; then
|
||||
AC_DEFINE(HAVE_ELF)
|
||||
fi
|
||||
@ -2149,7 +2115,17 @@ fi
|
||||
AC_SUBST(static)
|
||||
AC_SUBST(shared)
|
||||
if test $shared = default; then
|
||||
shared=$elf
|
||||
if test $gnu_ld = yes; then
|
||||
shared=$elf
|
||||
else
|
||||
# For now we do not assume shared libs are available. In future more
|
||||
# tests might become available.
|
||||
shared=no
|
||||
fi
|
||||
fi
|
||||
|
||||
if test x"$libc_cv_idn" = xyes; then
|
||||
AC_DEFINE(HAVE_LIBIDN)
|
||||
fi
|
||||
|
||||
AC_CACHE_CHECK([whether -fPIC is default], pic_default,
|
||||
@ -2173,6 +2149,12 @@ AC_SUBST(nopic_initfini)
|
||||
|
||||
AC_SUBST(DEFINES)
|
||||
|
||||
case "$add_ons" in
|
||||
*door*) linux_doors=yes ;;
|
||||
*) linux_doors=no ;;
|
||||
esac
|
||||
AC_SUBST(linux_doors)
|
||||
|
||||
dnl See sysdeps/mach/configure.in for this variable.
|
||||
AC_SUBST(mach_interface_list)
|
||||
|
||||
|
@ -23,15 +23,17 @@ subdir := crypt
|
||||
|
||||
headers := crypt.h
|
||||
|
||||
distribute := md5.h
|
||||
|
||||
extra-libs := libcrypt
|
||||
extra-libs-others := $(extra-libs)
|
||||
|
||||
libcrypt-routines := crypt-entry md5-crypt md5 crypt crypt_util
|
||||
|
||||
tests := cert md5test md5c-test
|
||||
tests = cert md5test md5c-test
|
||||
|
||||
distribute := ufc-crypt.h crypt-private.h ufc.c speeds.c README.ufc-crypt \
|
||||
Banner md5.h
|
||||
distribute = ufc-crypt.h crypt-private.h ufc.c speeds.c README.ufc-crypt \
|
||||
Banner md5.h
|
||||
|
||||
include ../Makeconfig
|
||||
|
||||
|
@ -902,7 +902,7 @@ __setkey_r(__key, __data)
|
||||
c = c << 1 | *__key++;
|
||||
ktab[i] = c >> 1;
|
||||
}
|
||||
_ufc_mk_keytab_r((char *) ktab, __data);
|
||||
_ufc_mk_keytab_r(ktab, __data);
|
||||
}
|
||||
weak_alias (__setkey_r, setkey_r)
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
/* Functions to compute MD5 message digest of files or memory blocks.
|
||||
according to the definition of MD5 in RFC 1321 from April 1992.
|
||||
Copyright (C) 1995,1996,1997,1999,2000,2001,2005
|
||||
Free Software Foundation, Inc.
|
||||
Copyright (C) 1995,1996,1997,1999,2000,2001 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
|
||||
@ -32,7 +31,7 @@
|
||||
# include <string.h>
|
||||
#else
|
||||
# ifndef HAVE_MEMCPY
|
||||
# define memcpy(d, s, n) (bcopy ((s), (d), (n)), (d))
|
||||
# define memcpy(d, s, n) bcopy ((s), (d), (n))
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
/* Declaration of functions and data types used for MD5 sum computing
|
||||
library functions.
|
||||
Copyright (C) 1995-1997,1999,2000,2001,2004,2005
|
||||
Free Software Foundation, Inc.
|
||||
Copyright (C) 1995-1997,1999,2000,2001,2004 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
|
||||
@ -28,9 +27,6 @@
|
||||
# include <limits.h>
|
||||
#endif
|
||||
|
||||
#define MD5_DIGEST_SIZE 16
|
||||
#define MD5_BLOCK_SIZE 64
|
||||
|
||||
/* The following contortions are an attempt to use the C preprocessor
|
||||
to determine an unsigned integral type that is 32 bits wide. An
|
||||
alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but
|
||||
|
30
csu/Makefile
30
csu/Makefile
@ -1,5 +1,5 @@
|
||||
# Makefile for csu code for GNU C library.
|
||||
# Copyright (C) 1995-2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1995-2003, 2004 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
|
||||
@ -39,8 +39,8 @@ omit-deps = $(patsubst %.o,%,$(start-installed-name) g$(start-installed-name) \
|
||||
b$(start-installed-name) $(csu-dummies) \
|
||||
S$(start-installed-name))
|
||||
install-lib = $(start-installed-name) g$(start-installed-name) $(csu-dummies)
|
||||
distribute = initfini.c gmon-start.c start.c defs.awk \
|
||||
abi-note.S init.c c not-cancel.h
|
||||
distribute = initfini.c gmon-start.c start.c defs.awk munch.awk \
|
||||
abi-note.S init.c munch-tmpl.c not-cancel.h
|
||||
generated = version-info.h
|
||||
before-compile = $(objpfx)version-info.h
|
||||
|
||||
@ -54,13 +54,11 @@ include ../Makeconfig
|
||||
ifeq (yes,$(build-shared))
|
||||
extra-objs += S$(start-installed-name)
|
||||
install-lib += S$(start-installed-name)
|
||||
generated += start.os
|
||||
endif
|
||||
|
||||
ifeq (yes,$(build-bounded))
|
||||
extra-objs += b$(start-installed-name)
|
||||
install-lib += b$(start-installed-name)
|
||||
generated += start.ob
|
||||
endif
|
||||
|
||||
ifneq ($(start-installed-name),$(static-start-installed-name))
|
||||
@ -75,6 +73,19 @@ before-compile += $(objpfx)abi-tag.h
|
||||
generated += abi-tag.h
|
||||
endif
|
||||
|
||||
ifneq (yes,$(gnu-ld))
|
||||
libc-init = munch-init
|
||||
$(objpfx)munch-init.c: munch.awk munch-tmpl.c $(+subdir_inits)
|
||||
$(AWK) -f $< subdirs='$(+init_subdirs)' $(word 2,$^) > $@-t
|
||||
mv -f $@-t $@
|
||||
generated += munch-init.c
|
||||
|
||||
# All initialization source files.
|
||||
+subdir_inits := $(wildcard $(foreach dir,$(subdirs),$(dir)/init-$(dir).c))
|
||||
# All subdirectories containing initialization source files.
|
||||
+init_subdirs := $(patsubst %/,%,$(dir $(+subdir_inits)))
|
||||
endif
|
||||
|
||||
ifeq ($(have-initfini),yes)
|
||||
|
||||
CPPFLAGS += -DHAVE_INITFINI
|
||||
@ -95,7 +106,7 @@ $(crtstuff:%=$(objpfx)%.o): %.o: %.S $(objpfx)defs.h
|
||||
|
||||
CFLAGS-initfini.s = -g0 -fPIC -fno-inline-functions $(fno-unit-at-a-time)
|
||||
|
||||
vpath initfini.c $(sysdirs)
|
||||
vpath initfini.c $(full_config_sysdirs)
|
||||
|
||||
$(objpfx)initfini.s: initfini.c $(before-compile)
|
||||
$(compile.c) -S $(CFLAGS-initfini.s) -finhibit-size-directive \
|
||||
@ -200,9 +211,8 @@ $(objpfx)abi-tag.h: $(..)abi-tags
|
||||
if test -r $@.new; then mv -f $@.new $@; \
|
||||
else echo >&2 'This configuration not matched in $<'; exit 1; fi
|
||||
|
||||
all-Banner-files = $(wildcard $(addsuffix /Banner,\
|
||||
$(sort $(subdir-srcdirs) \
|
||||
$(sysdeps-srcdirs))))
|
||||
all-Banner-files = $(wildcard $(addsuffix /Banner, \
|
||||
$(addprefix $(..), $(subdirs))))
|
||||
$(objpfx)version-info.h: $(common-objpfx)config.make $(all-Banner-files)
|
||||
$(make-target-directory)
|
||||
(case $(config-os) in \
|
||||
@ -229,7 +239,7 @@ $(objpfx)version-info.h: $(common-objpfx)config.make $(all-Banner-files)
|
||||
esac; \
|
||||
files="$(all-Banner-files)"; \
|
||||
if test -n "$$files"; then \
|
||||
printf '"Available extensions:\\n"\n'; \
|
||||
echo "\"Available extensions:\\n\""; \
|
||||
sed -e '/^#/d' -e 's/^[[:space:]]*/ /' \
|
||||
-e 's/^\(.*\)$$/\"\1\\n\"/' $$files; \
|
||||
fi) > $@T
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2002, 2005 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 2002 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
|
||||
@ -18,5 +18,4 @@
|
||||
|
||||
/* We have to define __dso_handle ourselves since we do not use gcc's
|
||||
crtbegin files. */
|
||||
const void *const __dso_handle __attribute__ ((__visibility__ ("hidden")))
|
||||
= &__dso_handle;
|
||||
void *__dso_handle __attribute__ ((__visibility__ ("hidden"))) = &__dso_handle;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Startup support for ELF initializers/finalizers in the main executable.
|
||||
Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2003 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
|
||||
@ -36,37 +36,16 @@
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
#ifdef HAVE_INITFINI_ARRAY
|
||||
/* These magic symbols are provided by the linker. */
|
||||
extern void (*__preinit_array_start []) (int, char **, char **)
|
||||
attribute_hidden;
|
||||
extern void (*__preinit_array_end []) (int, char **, char **)
|
||||
attribute_hidden;
|
||||
extern void (*__init_array_start []) (int, char **, char **)
|
||||
attribute_hidden;
|
||||
extern void (*__init_array_end []) (int, char **, char **)
|
||||
attribute_hidden;
|
||||
extern void (*__preinit_array_start []) (void) attribute_hidden;
|
||||
extern void (*__preinit_array_end []) (void) attribute_hidden;
|
||||
extern void (*__init_array_start []) (void) attribute_hidden;
|
||||
extern void (*__init_array_end []) (void) attribute_hidden;
|
||||
extern void (*__fini_array_start []) (void) attribute_hidden;
|
||||
extern void (*__fini_array_end []) (void) attribute_hidden;
|
||||
|
||||
#if defined HAVE_VISIBILITY_ATTRIBUTE \
|
||||
&& (defined SHARED || defined LIBC_NONSHARED)
|
||||
# define hidden_undef_2(x) #x
|
||||
# define hidden_undef_1(x) hidden_undef_2 (x)
|
||||
# define hidden_undef(x) \
|
||||
__asm (hidden_undef_1 (ASM_GLOBAL_DIRECTIVE) " " #x); \
|
||||
__asm (".hidden " #x);
|
||||
#else
|
||||
# define hidden_undef(x)
|
||||
#endif
|
||||
|
||||
hidden_undef (__preinit_array_start)
|
||||
hidden_undef (__preinit_array_end)
|
||||
hidden_undef (__init_array_start)
|
||||
hidden_undef (__init_array_end)
|
||||
hidden_undef (__fini_array_start)
|
||||
hidden_undef (__fini_array_end)
|
||||
|
||||
/* These function symbols are provided for the .init/.fini section entry
|
||||
points automagically by the linker. */
|
||||
extern void _init (void);
|
||||
@ -78,39 +57,43 @@ extern void _fini (void);
|
||||
the libc.a module in that it doesn't call the preinit array. */
|
||||
|
||||
void
|
||||
__libc_csu_init (int argc, char **argv, char **envp)
|
||||
__libc_csu_init (void)
|
||||
{
|
||||
#ifdef HAVE_INITFINI_ARRAY
|
||||
/* For dynamically linked executables the preinit array is executed by
|
||||
the dynamic linker (before initializing any shared object. */
|
||||
|
||||
#ifndef LIBC_NONSHARED
|
||||
# ifndef LIBC_NONSHARED
|
||||
/* For static executables, preinit happens rights before init. */
|
||||
{
|
||||
const size_t size = __preinit_array_end - __preinit_array_start;
|
||||
size_t i;
|
||||
for (i = 0; i < size; i++)
|
||||
(*__preinit_array_start [i]) (argc, argv, envp);
|
||||
(*__preinit_array_start [i]) ();
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
_init ();
|
||||
|
||||
const size_t size = __init_array_end - __init_array_start;
|
||||
for (size_t i = 0; i < size; i++)
|
||||
(*__init_array_start [i]) (argc, argv, envp);
|
||||
#ifdef HAVE_INITFINI_ARRAY
|
||||
{
|
||||
const size_t size = __init_array_end - __init_array_start;
|
||||
size_t i;
|
||||
for (i = 0; i < size; i++)
|
||||
(*__init_array_start [i]) ();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* This function should not be used anymore. We run the executable's
|
||||
destructor now just like any other. We cannot remove the function,
|
||||
though. */
|
||||
void
|
||||
__libc_csu_fini (void)
|
||||
{
|
||||
#ifndef LIBC_NONSHARED
|
||||
#ifdef HAVE_INITFINI_ARRAY
|
||||
size_t i = __fini_array_end - __fini_array_start;
|
||||
while (i-- > 0)
|
||||
(*__fini_array_start [i]) ();
|
||||
#endif
|
||||
|
||||
_fini ();
|
||||
#endif
|
||||
}
|
||||
|
263
csu/libc-start.c
263
csu/libc-start.c
@ -1,263 +0,0 @@
|
||||
/* Copyright (C) 1998-2003, 2004, 2005 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
|
||||
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. */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <ldsodefs.h>
|
||||
#include <bp-start.h>
|
||||
#include <bp-sym.h>
|
||||
|
||||
extern void __libc_init_first (int argc, char **argv, char **envp);
|
||||
|
||||
extern int __libc_multiple_libcs;
|
||||
|
||||
#include <tls.h>
|
||||
#ifndef SHARED
|
||||
# include <dl-osinfo.h>
|
||||
extern void __pthread_initialize_minimal (void)
|
||||
# if !(USE_TLS - 0) && !defined NONTLS_INIT_TP
|
||||
__attribute__ ((weak))
|
||||
# endif
|
||||
;
|
||||
# ifndef THREAD_SET_STACK_GUARD
|
||||
/* Only exported for architectures that don't store the stack guard canary
|
||||
in thread local area. */
|
||||
uintptr_t __stack_chk_guard attribute_relro;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PTR_NTHREADS
|
||||
/* We need atomic operations. */
|
||||
# include <atomic.h>
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef LIBC_START_MAIN
|
||||
# ifdef LIBC_START_DISABLE_INLINE
|
||||
# define STATIC static
|
||||
# else
|
||||
# define STATIC static inline __attribute__ ((always_inline))
|
||||
# endif
|
||||
#else
|
||||
# define STATIC
|
||||
# define LIBC_START_MAIN BP_SYM (__libc_start_main)
|
||||
#endif
|
||||
|
||||
#ifdef MAIN_AUXVEC_ARG
|
||||
/* main gets passed a pointer to the auxiliary. */
|
||||
# define MAIN_AUXVEC_DECL , void *
|
||||
# define MAIN_AUXVEC_PARAM , auxvec
|
||||
#else
|
||||
# define MAIN_AUXVEC_DECL
|
||||
# define MAIN_AUXVEC_PARAM
|
||||
#endif
|
||||
|
||||
STATIC int LIBC_START_MAIN (int (*main) (int, char **, char **
|
||||
MAIN_AUXVEC_DECL),
|
||||
int argc,
|
||||
char *__unbounded *__unbounded ubp_av,
|
||||
#ifdef LIBC_START_MAIN_AUXVEC_ARG
|
||||
ElfW(auxv_t) *__unbounded auxvec,
|
||||
#endif
|
||||
__typeof (main) init,
|
||||
void (*fini) (void),
|
||||
void (*rtld_fini) (void),
|
||||
void *__unbounded stack_end)
|
||||
__attribute__ ((noreturn));
|
||||
|
||||
|
||||
/* Note: the fini parameter is ignored here for shared library. It
|
||||
is registered with __cxa_atexit. This had the disadvantage that
|
||||
finalizers were called in more than one place. */
|
||||
STATIC int
|
||||
LIBC_START_MAIN (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL),
|
||||
int argc, char *__unbounded *__unbounded ubp_av,
|
||||
#ifdef LIBC_START_MAIN_AUXVEC_ARG
|
||||
ElfW(auxv_t) *__unbounded auxvec,
|
||||
#endif
|
||||
__typeof (main) init,
|
||||
void (*fini) (void),
|
||||
void (*rtld_fini) (void), void *__unbounded stack_end)
|
||||
{
|
||||
#if __BOUNDED_POINTERS__
|
||||
char **argv;
|
||||
#else
|
||||
# define argv ubp_av
|
||||
#endif
|
||||
|
||||
/* Result of the 'main' function. */
|
||||
int result;
|
||||
|
||||
__libc_multiple_libcs = &_dl_starting_up && !_dl_starting_up;
|
||||
|
||||
#ifndef SHARED
|
||||
char *__unbounded *__unbounded ubp_ev = &ubp_av[argc + 1];
|
||||
|
||||
INIT_ARGV_and_ENVIRON;
|
||||
|
||||
/* Store the lowest stack address. This is done in ld.so if this is
|
||||
the code for the DSO. */
|
||||
__libc_stack_end = stack_end;
|
||||
|
||||
# ifdef HAVE_AUX_VECTOR
|
||||
/* First process the auxiliary vector since we need to find the
|
||||
program header to locate an eventually present PT_TLS entry. */
|
||||
# ifndef LIBC_START_MAIN_AUXVEC_ARG
|
||||
ElfW(auxv_t) *__unbounded auxvec;
|
||||
{
|
||||
char *__unbounded *__unbounded evp = ubp_ev;
|
||||
while (*evp++ != NULL)
|
||||
;
|
||||
auxvec = (ElfW(auxv_t) *__unbounded) evp;
|
||||
}
|
||||
# endif
|
||||
_dl_aux_init (auxvec);
|
||||
# endif
|
||||
# ifdef DL_SYSDEP_OSCHECK
|
||||
if (!__libc_multiple_libcs)
|
||||
{
|
||||
/* This needs to run to initiliaze _dl_osversion before TLS
|
||||
setup might check it. */
|
||||
DL_SYSDEP_OSCHECK (__libc_fatal);
|
||||
}
|
||||
# endif
|
||||
|
||||
/* Initialize the thread library at least a bit since the libgcc
|
||||
functions are using thread functions if these are available and
|
||||
we need to setup errno. If there is no thread library and we
|
||||
handle TLS the function is defined in the libc to initialized the
|
||||
TLS handling. */
|
||||
# if !(USE_TLS - 0) && !defined NONTLS_INIT_TP
|
||||
if (__pthread_initialize_minimal)
|
||||
# endif
|
||||
__pthread_initialize_minimal ();
|
||||
#endif
|
||||
|
||||
# ifndef SHARED
|
||||
/* Set up the stack checker's canary. */
|
||||
uintptr_t stack_chk_guard = _dl_setup_stack_chk_guard ();
|
||||
# ifdef THREAD_SET_STACK_GUARD
|
||||
THREAD_SET_STACK_GUARD (stack_chk_guard);
|
||||
# else
|
||||
__stack_chk_guard = stack_chk_guard;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Register the destructor of the dynamic linker if there is any. */
|
||||
if (__builtin_expect (rtld_fini != NULL, 1))
|
||||
__cxa_atexit ((void (*) (void *)) rtld_fini, NULL, NULL);
|
||||
|
||||
#ifndef SHARED
|
||||
/* Call the initializer of the libc. This is only needed here if we
|
||||
are compiling for the static library in which case we haven't
|
||||
run the constructors in `_dl_start_user'. */
|
||||
__libc_init_first (argc, argv, __environ);
|
||||
|
||||
/* Register the destructor of the program, if any. */
|
||||
if (fini)
|
||||
__cxa_atexit ((void (*) (void *)) fini, NULL, NULL);
|
||||
|
||||
/* Some security at this point. Prevent starting a SUID binary where
|
||||
the standard file descriptors are not opened. We have to do this
|
||||
only for statically linked applications since otherwise the dynamic
|
||||
loader did the work already. */
|
||||
if (__builtin_expect (__libc_enable_secure, 0))
|
||||
__libc_check_standard_fds ();
|
||||
#endif
|
||||
|
||||
/* Call the initializer of the program, if any. */
|
||||
#ifdef SHARED
|
||||
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_IMPCALLS, 0))
|
||||
GLRO(dl_debug_printf) ("\ninitialize program: %s\n\n", argv[0]);
|
||||
#endif
|
||||
if (init)
|
||||
(*init) (argc, argv, __environ MAIN_AUXVEC_PARAM);
|
||||
|
||||
#ifdef SHARED
|
||||
/* Auditing checkpoint: we have a new object. */
|
||||
if (__builtin_expect (GLRO(dl_naudit) > 0, 0))
|
||||
{
|
||||
struct audit_ifaces *afct = GLRO(dl_audit);
|
||||
struct link_map *head = GL(dl_ns)[LM_ID_BASE]._ns_loaded;
|
||||
for (unsigned int cnt = 0; cnt < GLRO(dl_naudit); ++cnt)
|
||||
{
|
||||
if (afct->preinit != NULL)
|
||||
afct->preinit (&head->l_audit[cnt].cookie);
|
||||
|
||||
afct = afct->next;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef SHARED
|
||||
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_IMPCALLS, 0))
|
||||
GLRO(dl_debug_printf) ("\ntransferring control: %s\n\n", argv[0]);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CLEANUP_JMP_BUF
|
||||
/* Memory for the cancellation buffer. */
|
||||
struct pthread_unwind_buf unwind_buf;
|
||||
|
||||
int not_first_call;
|
||||
not_first_call = setjmp ((struct __jmp_buf_tag *) unwind_buf.cancel_jmp_buf);
|
||||
if (__builtin_expect (! not_first_call, 1))
|
||||
{
|
||||
struct pthread *self = THREAD_SELF;
|
||||
|
||||
/* Store old info. */
|
||||
unwind_buf.priv.data.prev = THREAD_GETMEM (self, cleanup_jmp_buf);
|
||||
unwind_buf.priv.data.cleanup = THREAD_GETMEM (self, cleanup);
|
||||
|
||||
/* Store the new cleanup handler info. */
|
||||
THREAD_SETMEM (self, cleanup_jmp_buf, &unwind_buf);
|
||||
|
||||
/* Run the program. */
|
||||
result = main (argc, argv, __environ MAIN_AUXVEC_PARAM);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Remove the thread-local data. */
|
||||
# ifdef SHARED
|
||||
__libc_pthread_functions.ptr__nptl_deallocate_tsd ();
|
||||
# else
|
||||
extern void __nptl_deallocate_tsd (void) __attribute ((weak));
|
||||
__nptl_deallocate_tsd ();
|
||||
# endif
|
||||
|
||||
/* One less thread. Decrement the counter. If it is zero we
|
||||
terminate the entire process. */
|
||||
result = 0;
|
||||
# ifdef SHARED
|
||||
unsigned int *const ptr = __libc_pthread_functions.ptr_nthreads;
|
||||
# else
|
||||
extern unsigned int __nptl_nthreads __attribute ((weak));
|
||||
unsigned int *const ptr = &__nptl_nthreads;
|
||||
# endif
|
||||
|
||||
if (! atomic_decrement_and_test (ptr))
|
||||
/* Not much left to do but to exit the thread, not the process. */
|
||||
__exit_thread (0);
|
||||
}
|
||||
#else
|
||||
/* Nothing fancy, just call the function. */
|
||||
result = main (argc, argv, __environ MAIN_AUXVEC_PARAM);
|
||||
#endif
|
||||
|
||||
exit (result);
|
||||
}
|
38
csu/munch-tmpl.c
Normal file
38
csu/munch-tmpl.c
Normal file
@ -0,0 +1,38 @@
|
||||
/* Copyright (C) 1991, 1995, 1997, 2000 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
|
||||
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. */
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
EXTERNS
|
||||
|
||||
void
|
||||
__libc_init (int argc, char **argv, char **envp)
|
||||
{
|
||||
CALLS
|
||||
|
||||
#ifdef HAVE_INITFINI
|
||||
{
|
||||
/* These functions are defined in crti.o to run the .init and .fini
|
||||
sections, which are used for initializers and finalizers. */
|
||||
extern void _init (void), _fini (void);
|
||||
atexit (&_fini); /* Arrange for _fini to run at exit. */
|
||||
_init ();
|
||||
}
|
||||
#endif
|
||||
}
|
11
csu/munch.awk
Normal file
11
csu/munch.awk
Normal file
@ -0,0 +1,11 @@
|
||||
BEGIN { special = 0 }
|
||||
|
||||
/EXTERNS/ { ndirs = split(subdirs, dirs)
|
||||
for (i = 1; i <= ndirs; ++i)
|
||||
printf "extern void __init_%s (int argc, char **argv, char **envp);\n", dirs[i]
|
||||
special = 1 }
|
||||
/CALLS/ { ndirs = split(subdirs, dirs)
|
||||
for (i = 1; i <= ndirs; ++i) printf " __init_%s (argc, argv, envp);\n", dirs[i]
|
||||
special = 1 }
|
||||
|
||||
{ if (special == 0) print $0; special = 0 }
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1992-2002, 2003, 2004, 2006 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1992-2002, 2003, 2004 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
|
||||
@ -25,7 +25,7 @@ static const char __libc_version[] = VERSION;
|
||||
|
||||
static const char banner[] =
|
||||
"GNU C Library "RELEASE" release version "VERSION", by Roland McGrath et al.\n\
|
||||
Copyright (C) 2006 Free Software Foundation, Inc.\n\
|
||||
Copyright (C) 2004 Free Software Foundation, Inc.\n\
|
||||
This is free software; see the source for copying conditions.\n\
|
||||
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n\
|
||||
PARTICULAR PURPOSE.\n\
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1991,1997,1999,2000,2002,2005 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1991, 1997, 1999, 2000, 2002 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
|
||||
@ -20,9 +20,9 @@
|
||||
#include <ctype.h>
|
||||
|
||||
#define __ctype_tolower \
|
||||
((int32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TOLOWER) + 128)
|
||||
((uint32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TOLOWER) + 128)
|
||||
#define __ctype_toupper \
|
||||
((int32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TOUPPER) + 128)
|
||||
((uint32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TOUPPER) + 128)
|
||||
|
||||
/* Real function versions of the non-ANSI ctype functions. isblank is
|
||||
now in ISO C99 but we leave it here. */
|
||||
|
@ -1 +0,0 @@
|
||||
localedata
|
@ -1,4 +1,4 @@
|
||||
# Copyright (C) 1998-2001,2004,2005,2006 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1998, 1999, 2000, 2001, 2004 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
|
||||
@ -24,27 +24,12 @@ subdir := debug
|
||||
headers := execinfo.h
|
||||
distribute = sigcontextinfo.h register-dump.h frame.h
|
||||
|
||||
routines = backtrace backtracesyms backtracesymsfd noophooks \
|
||||
routines := backtrace backtracesyms backtracesymsfd noophooks \
|
||||
memcpy_chk memmove_chk mempcpy_chk memset_chk stpcpy_chk \
|
||||
strcat_chk strcpy_chk strncat_chk strncpy_chk stpncpy_chk \
|
||||
strcat_chk strcpy_chk strncat_chk strncpy_chk \
|
||||
sprintf_chk vsprintf_chk snprintf_chk vsnprintf_chk \
|
||||
printf_chk fprintf_chk vprintf_chk vfprintf_chk \
|
||||
gets_chk chk_fail readonly-area fgets_chk fgets_u_chk \
|
||||
read_chk pread_chk pread64_chk recv_chk recvfrom_chk \
|
||||
readlink_chk readlinkat_chk getwd_chk getcwd_chk \
|
||||
realpath_chk ptsname_r_chk \
|
||||
wctomb_chk wcscpy_chk wmemcpy_chk wmemmove_chk wmempcpy_chk \
|
||||
wcpcpy_chk wcsncpy_chk wcscat_chk wcsncat_chk wmemset_chk \
|
||||
wcpncpy_chk \
|
||||
swprintf_chk vswprintf_chk wprintf_chk fwprintf_chk \
|
||||
vwprintf_chk vfwprintf_chk fgetws_chk fgetws_u_chk \
|
||||
confstr_chk getgroups_chk ttyname_r_chk getlogin_r_chk \
|
||||
gethostname_chk getdomainname_chk wcrtomb_chk mbsnrtowcs_chk \
|
||||
wcsnrtombs_chk mbsrtowcs_chk wcsrtombs_chk mbstowcs_chk \
|
||||
wcstombs_chk \
|
||||
stack_chk_fail \
|
||||
$(static-only-routines)
|
||||
static-only-routines := warning-nop stack_chk_fail_local
|
||||
gets_chk chk_fail readonly-area
|
||||
|
||||
CFLAGS-backtrace.c = -fno-omit-frame-pointer
|
||||
CFLAGS-sprintf_chk.c = -D_IO_MTSAFE_IO
|
||||
@ -56,31 +41,9 @@ CFLAGS-fprintf_chk.c = -D_IO_MTSAFE_IO $(exceptions)
|
||||
CFLAGS-vprintf_chk.c = -D_IO_MTSAFE_IO $(exceptions)
|
||||
CFLAGS-vfprintf_chk.c = -D_IO_MTSAFE_IO $(exceptions)
|
||||
CFLAGS-gets_chk.c = -D_IO_MTSAFE_IO $(exceptions)
|
||||
CFLAGS-fgets_chk.c = -D_IO_MTSAFE_IO $(exceptions)
|
||||
CFLAGS-fgets_u_chk.c = -D_IO_MTSAFE_IO $(exceptions)
|
||||
CFLAGS-swprintf_chk.c = -D_IO_MTSAFE_IO
|
||||
CFLAGS-vswprintf_chk.c = -D_IO_MTSAFE_IO
|
||||
CFLAGS-wprintf_chk.c = -D_IO_MTSAFE_IO $(exceptions)
|
||||
CFLAGS-fwprintf_chk.c = -D_IO_MTSAFE_IO $(exceptions)
|
||||
CFLAGS-vwprintf_chk.c = -D_IO_MTSAFE_IO $(exceptions)
|
||||
CFLAGS-vfwprintf_chk.c = -D_IO_MTSAFE_IO $(exceptions)
|
||||
CFLAGS-fgetws_chk.c = -D_IO_MTSAFE_IO $(exceptions)
|
||||
CFLAGS-fgetws_u_chk.c = -D_IO_MTSAFE_IO $(exceptions)
|
||||
CFLAGS-read_chk.c = -fexceptions -fasynchronous-unwind-tables
|
||||
CFLAGS-pread_chk.c = -fexceptions -fasynchronous-unwind-tables
|
||||
CFLAGS-pread64_chk.c = -fexceptions -fasynchronous-unwind-tables
|
||||
CFLAGS-recv_chk.c = -fexceptions -fasynchronous-unwind-tables
|
||||
CFLAGS-recvfrom_chk.c = -fexceptions -fasynchronous-unwind-tables
|
||||
|
||||
tst-chk1-ENV = LOCPATH=$(common-objpfx)localedata
|
||||
tst-chk2-ENV = LOCPATH=$(common-objpfx)localedata
|
||||
tst-chk3-ENV = LOCPATH=$(common-objpfx)localedata
|
||||
tst-lfschk1-ENV = LOCPATH=$(common-objpfx)localedata
|
||||
tst-lfschk2-ENV = LOCPATH=$(common-objpfx)localedata
|
||||
tst-lfschk3-ENV = LOCPATH=$(common-objpfx)localedata
|
||||
|
||||
tests = backtrace-tst tst-chk1 tst-chk2 tst-chk3 \
|
||||
tst-lfschk1 tst-lfschk2 tst-lfschk3 test-strcpy_chk test-stpcpy_chk
|
||||
test-strcpy_chk test-stpcpy_chk
|
||||
|
||||
extra-libs = libSegFault libpcprofile
|
||||
extra-libs-others = $(extra-libs)
|
||||
@ -107,8 +70,6 @@ generated = catchsegv xtrace
|
||||
|
||||
include ../Rules
|
||||
|
||||
sLIBdir := $(shell echo $(slibdir) | sed 's,lib\(\|64\)$$,\\\\$$LIB,')
|
||||
|
||||
$(objpfx)catchsegv: catchsegv.sh $(common-objpfx)soversions.mk \
|
||||
$(common-objpfx)config.make
|
||||
slibpfx=`echo $(slibdir)|sed 's/lib\(64\|\)$$/\\\\\\\\$$LIB/'`; \
|
||||
@ -121,7 +82,7 @@ $(objpfx)pcprofiledump: $(objpfx)pcprofiledump.o
|
||||
$(objpfx)xtrace: xtrace.sh
|
||||
rm -f $@.new
|
||||
sed -e 's|@BASH@|$(BASH)|' -e 's|@VERSION@|$(version)|' \
|
||||
-e 's|@SLIBDIR@|$(sLIBdir)|' -e 's|@BINDIR@|$(bindir)|' $^ > $@.new \
|
||||
-e 's|@SLIBDIR@|$(slibdir)|' -e 's|@BINDIR@|$(bindir)|' $^ > $@.new \
|
||||
&& rm -f $@ && mv $@.new $@ && chmod +x $@
|
||||
|
||||
# Depend on libc.so so a DT_NEEDED is generated in the shared objects.
|
||||
|
@ -18,25 +18,4 @@ libc {
|
||||
__printf_chk; __fprintf_chk; __vprintf_chk; __vfprintf_chk;
|
||||
__gets_chk;
|
||||
}
|
||||
GLIBC_2.4 {
|
||||
__fgets_chk; __fgets_unlocked_chk;
|
||||
__read_chk; __pread_chk; __pread64_chk;
|
||||
__readlink_chk; __getcwd_chk; __getwd_chk;
|
||||
__recv_chk; __recvfrom_chk;
|
||||
__realpath_chk; __ptsname_r_chk; __wctomb_chk;
|
||||
__stpncpy_chk;
|
||||
__wcscpy_chk; __wmemcpy_chk; __wmemmove_chk; __wmempcpy_chk; __wcpcpy_chk;
|
||||
__wcsncpy_chk; __wcscat_chk; __wcsncat_chk; __wmemset_chk; __wcpncpy_chk;
|
||||
__swprintf_chk; __vswprintf_chk; __wprintf_chk; __fwprintf_chk;
|
||||
__vwprintf_chk; __vfwprintf_chk; __fgetws_chk; __fgetws_unlocked_chk;
|
||||
__confstr_chk; __getgroups_chk; __ttyname_r_chk; __getlogin_r_chk;
|
||||
__gethostname_chk; __getdomainname_chk; __wcrtomb_chk; __mbsnrtowcs_chk;
|
||||
__wcsnrtombs_chk; __mbsrtowcs_chk; __wcsrtombs_chk; __mbstowcs_chk;
|
||||
__wcstombs_chk;
|
||||
|
||||
__stack_chk_fail;
|
||||
}
|
||||
GLIBC_2.5 {
|
||||
__readlinkat_chk;
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
#! /bin/sh
|
||||
# Copyright (C) 1998,1999,2001,2003,2004,2006 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1998, 1999, 2001, 2003, 2004 Free Software Foundation, Inc.
|
||||
# This file is part of the GNU C Library.
|
||||
# Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
|
||||
|
||||
@ -39,7 +39,7 @@ if test $# -eq 0; then
|
||||
;;
|
||||
--v | --ve | --ver | --vers | --versi | --versio | --version)
|
||||
echo 'catchsegv (GNU libc) @VERSION@'
|
||||
echo 'Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
echo 'Copyright (C) 2004 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
Written by Ulrich Drepper.'
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* Copyright (C) 2004, 2005 Free Software Foundation, Inc.
|
||||
|
||||
/* Copyright (C) 2004 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
|
||||
@ -20,15 +21,10 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
extern char **__libc_argv attribute_hidden;
|
||||
|
||||
void
|
||||
__attribute__ ((noreturn))
|
||||
__chk_fail (void)
|
||||
{
|
||||
/* The loop is added only to keep gcc happy. */
|
||||
while (1)
|
||||
__libc_message (2, "*** buffer overflow detected ***: %s terminated\n",
|
||||
__libc_argv[0] ?: "<unknown>");
|
||||
__libc_fatal ("*** buffer overflow detected ***\n");
|
||||
}
|
||||
libc_hidden_def (__chk_fail)
|
||||
|
@ -1,30 +0,0 @@
|
||||
/* Copyright (C) 2005 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@readhat.com>, 20055.
|
||||
|
||||
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. */
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
|
||||
size_t
|
||||
__confstr_chk (int name, char *buf, size_t len, size_t buflen)
|
||||
{
|
||||
if (__builtin_expect (buflen < len, 0))
|
||||
__chk_fail ();
|
||||
|
||||
return confstr (name, buf, len);
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1998, 1999, 2004, 2005 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1998, 1999, 2004 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
|
||||
@ -35,7 +35,8 @@ extern char **backtrace_symbols (void *__const *__array, int __size)
|
||||
|
||||
|
||||
/* This function is similar to backtrace_symbols() but it writes the result
|
||||
immediately to a file. */
|
||||
immediately to a file and can therefore also be used in situations where
|
||||
malloc() is not usable anymore. */
|
||||
extern void backtrace_symbols_fd (void *__const *__array, int __size, int __fd)
|
||||
__THROW __nonnull ((1));
|
||||
|
||||
|
@ -1,67 +0,0 @@
|
||||
/* Copyright (C) 1993, 1995, 1996, 1997, 1998, 1999, 2002, 2003, 2005
|
||||
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
|
||||
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.
|
||||
|
||||
As a special exception, if you link the code in this file with
|
||||
files compiled with a GNU compiler to produce an executable,
|
||||
that does not cause the resulting executable to be covered by
|
||||
the GNU Lesser General Public License. This exception does not
|
||||
however invalidate any other reasons why the executable file
|
||||
might be covered by the GNU Lesser General Public License.
|
||||
This exception applies to code released by its copyright holders
|
||||
in files containing the exception. */
|
||||
|
||||
#include "libioP.h"
|
||||
#include <stdio.h>
|
||||
#include <sys/param.h>
|
||||
|
||||
char *
|
||||
__fgets_chk (buf, size, n, fp)
|
||||
char *buf;
|
||||
size_t size;
|
||||
int n;
|
||||
_IO_FILE *fp;
|
||||
{
|
||||
_IO_size_t count;
|
||||
char *result;
|
||||
CHECK_FILE (fp, NULL);
|
||||
if (n <= 0)
|
||||
return NULL;
|
||||
_IO_acquire_lock (fp);
|
||||
/* This is very tricky since a file descriptor may be in the
|
||||
non-blocking mode. The error flag doesn't mean much in this
|
||||
case. We return an error only when there is a new error. */
|
||||
int old_error = fp->_IO_file_flags & _IO_ERR_SEEN;
|
||||
fp->_IO_file_flags &= ~_IO_ERR_SEEN;
|
||||
count = INTUSE(_IO_getline) (fp, buf, MIN ((size_t) n - 1, size), '\n', 1);
|
||||
/* If we read in some bytes and errno is EAGAIN, that error will
|
||||
be reported for next read. */
|
||||
if (count == 0 || ((fp->_IO_file_flags & _IO_ERR_SEEN)
|
||||
&& errno != EAGAIN))
|
||||
result = NULL;
|
||||
else if (count >= size)
|
||||
__chk_fail ();
|
||||
else
|
||||
{
|
||||
buf[count] = '\0';
|
||||
result = buf;
|
||||
}
|
||||
fp->_IO_file_flags |= old_error;
|
||||
_IO_release_lock (fp);
|
||||
return result;
|
||||
}
|
@ -1,65 +0,0 @@
|
||||
/* Copyright (C) 1993, 1995, 1996, 1997, 1998, 1999, 2002, 2003, 2005
|
||||
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
|
||||
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.
|
||||
|
||||
As a special exception, if you link the code in this file with
|
||||
files compiled with a GNU compiler to produce an executable,
|
||||
that does not cause the resulting executable to be covered by
|
||||
the GNU Lesser General Public License. This exception does not
|
||||
however invalidate any other reasons why the executable file
|
||||
might be covered by the GNU Lesser General Public License.
|
||||
This exception applies to code released by its copyright holders
|
||||
in files containing the exception. */
|
||||
|
||||
#include "libioP.h"
|
||||
#include <stdio.h>
|
||||
#include <sys/param.h>
|
||||
|
||||
char *
|
||||
__fgets_unlocked_chk (buf, size, n, fp)
|
||||
char *buf;
|
||||
size_t size;
|
||||
int n;
|
||||
_IO_FILE *fp;
|
||||
{
|
||||
_IO_size_t count;
|
||||
char *result;
|
||||
CHECK_FILE (fp, NULL);
|
||||
if (n <= 0)
|
||||
return NULL;
|
||||
/* This is very tricky since a file descriptor may be in the
|
||||
non-blocking mode. The error flag doesn't mean much in this
|
||||
case. We return an error only when there is a new error. */
|
||||
int old_error = fp->_IO_file_flags & _IO_ERR_SEEN;
|
||||
fp->_IO_file_flags &= ~_IO_ERR_SEEN;
|
||||
count = INTUSE(_IO_getline) (fp, buf, MIN ((size_t) n - 1, size), '\n', 1);
|
||||
/* If we read in some bytes and errno is EAGAIN, that error will
|
||||
be reported for next read. */
|
||||
if (count == 0 || ((fp->_IO_file_flags & _IO_ERR_SEEN)
|
||||
&& errno != EAGAIN))
|
||||
result = NULL;
|
||||
else if (count >= size)
|
||||
__chk_fail ();
|
||||
else
|
||||
{
|
||||
buf[count] = '\0';
|
||||
result = buf;
|
||||
}
|
||||
fp->_IO_file_flags |= old_error;
|
||||
return result;
|
||||
}
|
@ -1,54 +0,0 @@
|
||||
/* Copyright (C) 1993, 1995, 1996, 1997, 1998, 1999, 2001, 2005
|
||||
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
|
||||
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. */
|
||||
|
||||
#include "libioP.h"
|
||||
#include <wchar.h>
|
||||
#include <sys/param.h>
|
||||
|
||||
wchar_t *
|
||||
__fgetws_chk (wchar_t *buf, size_t size, int n, _IO_FILE *fp)
|
||||
{
|
||||
_IO_size_t count;
|
||||
wchar_t *result;
|
||||
int old_error;
|
||||
CHECK_FILE (fp, NULL);
|
||||
if (n <= 0)
|
||||
return NULL;
|
||||
_IO_acquire_lock (fp);
|
||||
/* This is very tricky since a file descriptor may be in the
|
||||
non-blocking mode. The error flag doesn't mean much in this
|
||||
case. We return an error only when there is a new error. */
|
||||
old_error = fp->_IO_file_flags & _IO_ERR_SEEN;
|
||||
fp->_IO_file_flags &= ~_IO_ERR_SEEN;
|
||||
count = _IO_getwline (fp, buf, MIN ((size_t) n - 1, size), L'\n', 1);
|
||||
/* If we read in some bytes and errno is EAGAIN, that error will
|
||||
be reported for next read. */
|
||||
if (count == 0 || (_IO_ferror_unlocked (fp) && errno != EAGAIN))
|
||||
result = NULL;
|
||||
else if (count >= size)
|
||||
__chk_fail ();
|
||||
else
|
||||
{
|
||||
buf[count] = '\0';
|
||||
result = buf;
|
||||
}
|
||||
fp->_IO_file_flags |= old_error;
|
||||
_IO_release_lock (fp);
|
||||
return result;
|
||||
}
|
@ -1,61 +0,0 @@
|
||||
/* Copyright (C) 1993, 95, 96, 97, 98, 99, 2005 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
|
||||
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.
|
||||
|
||||
As a special exception, if you link the code in this file with
|
||||
files compiled with a GNU compiler to produce an executable,
|
||||
that does not cause the resulting executable to be covered by
|
||||
the GNU Lesser General Public License. This exception does not
|
||||
however invalidate any other reasons why the executable file
|
||||
might be covered by the GNU Lesser General Public License.
|
||||
This exception applies to code released by its copyright holders
|
||||
in files containing the exception. */
|
||||
|
||||
#include "libioP.h"
|
||||
#include <wchar.h>
|
||||
#include <sys/param.h>
|
||||
|
||||
wchar_t *
|
||||
__fgetws_unlocked_chk (wchar_t *buf, size_t size, int n, _IO_FILE *fp)
|
||||
{
|
||||
_IO_size_t count;
|
||||
wchar_t *result;
|
||||
int old_error;
|
||||
CHECK_FILE (fp, NULL);
|
||||
if (n <= 0)
|
||||
return NULL;
|
||||
/* This is very tricky since a file descriptor may be in the
|
||||
non-blocking mode. The error flag doesn't mean much in this
|
||||
case. We return an error only when there is a new error. */
|
||||
old_error = fp->_IO_file_flags & _IO_ERR_SEEN;
|
||||
fp->_IO_file_flags &= ~_IO_ERR_SEEN;
|
||||
count = _IO_getwline (fp, buf, MIN ((size_t) n - 1, size), L'\n', 1);
|
||||
/* If we read in some bytes and errno is EAGAIN, that error will
|
||||
be reported for next read. */
|
||||
if (count == 0 || ((fp->_IO_file_flags & _IO_ERR_SEEN)
|
||||
&& errno != EAGAIN))
|
||||
result = NULL;
|
||||
else if (count >= size)
|
||||
__chk_fail ();
|
||||
else
|
||||
{
|
||||
buf[count] = '\0';
|
||||
result = buf;
|
||||
}
|
||||
fp->_IO_file_flags |= old_error;
|
||||
return result;
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1991, 1995, 1996, 1997, 2001, 2004, 2006
|
||||
/* Copyright (C) 1991, 1995, 1996, 1997, 2001, 2004
|
||||
Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
|
||||
/* Write formatted output to FP from the format string FORMAT. */
|
||||
int
|
||||
___fprintf_chk (FILE *fp, int flag, const char *format, ...)
|
||||
__fprintf_chk (FILE *fp, int flag, const char *format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
int done;
|
||||
@ -43,4 +43,3 @@ ___fprintf_chk (FILE *fp, int flag, const char *format, ...)
|
||||
|
||||
return done;
|
||||
}
|
||||
ldbl_strong_alias (___fprintf_chk, __fprintf_chk)
|
||||
|
@ -1,45 +0,0 @@
|
||||
/* Copyright (C) 1991, 1995, 1996, 1997, 2001, 2004, 2005
|
||||
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
|
||||
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. */
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <wchar.h>
|
||||
#include "../libio/libioP.h"
|
||||
|
||||
|
||||
/* Write formatted output to FP from the format string FORMAT. */
|
||||
int
|
||||
__fwprintf_chk (FILE *fp, int flag, const wchar_t *format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
int done;
|
||||
|
||||
_IO_acquire_lock (fp);
|
||||
if (flag > 0)
|
||||
fp->_flags2 |= _IO_FLAGS2_FORTIFY;
|
||||
|
||||
va_start (ap, format);
|
||||
done = _IO_vfwprintf (fp, format, ap);
|
||||
va_end (ap);
|
||||
|
||||
if (flag > 0)
|
||||
fp->_flags2 &= ~_IO_FLAGS2_FORTIFY;
|
||||
_IO_release_lock (fp);
|
||||
|
||||
return done;
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
/* Copyright (C) 2005 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
|
||||
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. */
|
||||
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/param.h>
|
||||
|
||||
|
||||
char *
|
||||
__getcwd_chk (char *buf, size_t size, size_t buflen)
|
||||
{
|
||||
if (size > buflen)
|
||||
__chk_fail ();
|
||||
|
||||
return __getcwd (buf, size);
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
/* Copyright (C) 2005 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
|
||||
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. */
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
|
||||
int
|
||||
__getdomainname_chk (char *buf, size_t buflen, size_t nreal)
|
||||
{
|
||||
if (buflen > nreal)
|
||||
__chk_fail ();
|
||||
|
||||
return getdomainname (buf, buflen);
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
/* Copyright (C) 2005 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
|
||||
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. */
|
||||
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
||||
int
|
||||
__getgroups_chk (int size, __gid_t list[], size_t listlen)
|
||||
{
|
||||
if (__builtin_expect (size * sizeof (__gid_t) > listlen, 0))
|
||||
__chk_fail ();
|
||||
|
||||
return __getgroups (size, list);
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
/* Copyright (C) 2005 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
|
||||
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. */
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
|
||||
int
|
||||
__gethostname_chk (char *buf, size_t buflen, size_t nreal)
|
||||
{
|
||||
if (buflen > nreal)
|
||||
__chk_fail ();
|
||||
|
||||
return __gethostname (buf, buflen);
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
/* Copyright (C) 2005 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
|
||||
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. */
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
|
||||
int
|
||||
__getlogin_r_chk (char *buf, size_t buflen, size_t nreal)
|
||||
{
|
||||
if (buflen > nreal)
|
||||
__chk_fail ();
|
||||
|
||||
return getlogin_r (buf, buflen);
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
/* Copyright (C) 2005 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
|
||||
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. */
|
||||
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/param.h>
|
||||
|
||||
|
||||
char *
|
||||
__getwd_chk (char *buf, size_t buflen)
|
||||
{
|
||||
char *res = __getcwd (buf, buflen);
|
||||
if (res == NULL && errno == ERANGE)
|
||||
__chk_fail ();
|
||||
return res;
|
||||
}
|
||||
|
||||
link_warning (getwd,
|
||||
"the `getwd' function is dangerous and should not be used.")
|
@ -1,31 +0,0 @@
|
||||
/* Copyright (C) 2005 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
|
||||
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. */
|
||||
|
||||
#include <locale.h>
|
||||
#include <wchar.h>
|
||||
|
||||
|
||||
size_t
|
||||
__mbsnrtowcs_chk (wchar_t *dst, __const char **src, size_t nmc, size_t len,
|
||||
mbstate_t *ps, size_t dstlen)
|
||||
{
|
||||
if (__builtin_expect (dstlen < len, 0))
|
||||
__chk_fail ();
|
||||
|
||||
return __mbsnrtowcs (dst, src, nmc, len, ps);
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
/* Copyright (C) 2005 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
|
||||
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. */
|
||||
|
||||
#include <locale.h>
|
||||
#include <wchar.h>
|
||||
|
||||
|
||||
size_t
|
||||
__mbsrtowcs_chk (wchar_t *dst, __const char **src, size_t len,
|
||||
mbstate_t *ps, size_t dstlen)
|
||||
{
|
||||
if (__builtin_expect (dstlen < len, 0))
|
||||
__chk_fail ();
|
||||
|
||||
return __mbsrtowcs (dst, src, len, ps);
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
/* Copyright (C) 2005 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
|
||||
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. */
|
||||
|
||||
#include <locale.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
|
||||
|
||||
size_t
|
||||
__mbstowcs_chk (wchar_t *dst, const char *src, size_t len, size_t dstlen)
|
||||
{
|
||||
if (__builtin_expect (dstlen < len, 0))
|
||||
__chk_fail ();
|
||||
|
||||
mbstate_t state;
|
||||
|
||||
memset (&state, '\0', sizeof state);
|
||||
/* Return how many we wrote (or maybe an error). */
|
||||
return __mbsrtowcs (dst, &src, len, &state);
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
/* Copyright (C) 2005 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
|
||||
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. */
|
||||
|
||||
#include <unistd.h>
|
||||
#include <sys/param.h>
|
||||
|
||||
|
||||
ssize_t
|
||||
__pread64_chk (int fd, void *buf, size_t nbytes, off64_t offset, size_t buflen)
|
||||
{
|
||||
if (nbytes > buflen)
|
||||
__chk_fail ();
|
||||
|
||||
return __libc_pread64 (fd, buf, nbytes, offset);
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
/* Copyright (C) 2005 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
|
||||
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. */
|
||||
|
||||
#include <unistd.h>
|
||||
#include <sys/param.h>
|
||||
|
||||
|
||||
ssize_t
|
||||
__pread_chk (int fd, void *buf, size_t nbytes, off_t offset, size_t buflen)
|
||||
{
|
||||
if (nbytes > buflen)
|
||||
__chk_fail ();
|
||||
|
||||
return __pread (fd, buf, nbytes, offset);
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1991, 1995, 1996, 1997, 2001, 2004, 2006
|
||||
/* Copyright (C) 1991, 1995, 1996, 1997, 2001, 2004
|
||||
Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
|
||||
/* Write formatted output to stdout from the format string FORMAT. */
|
||||
int
|
||||
___printf_chk (int flag, const char *format, ...)
|
||||
__printf_chk (int flag, const char *format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
int done;
|
||||
@ -43,4 +43,3 @@ ___printf_chk (int flag, const char *format, ...)
|
||||
|
||||
return done;
|
||||
}
|
||||
ldbl_strong_alias (___printf_chk, __printf_chk)
|
||||
|
@ -1,29 +0,0 @@
|
||||
/* Copyright (C) 2005 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
|
||||
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. */
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
int
|
||||
__ptsname_r_chk (int fd, char *buf, size_t buflen, size_t nreal)
|
||||
{
|
||||
if (buflen > nreal)
|
||||
__chk_fail ();
|
||||
|
||||
return __ptsname_r (fd, buf, buflen);
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
/* Copyright (C) 2005 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
|
||||
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. */
|
||||
|
||||
#include <unistd.h>
|
||||
#include <sys/param.h>
|
||||
#ifdef HAVE_INLINED_SYSCALLS
|
||||
# include <errno.h>
|
||||
# include <sysdep.h>
|
||||
#endif
|
||||
|
||||
|
||||
ssize_t
|
||||
__read_chk (int fd, void *buf, size_t nbytes, size_t buflen)
|
||||
{
|
||||
if (nbytes > buflen)
|
||||
__chk_fail ();
|
||||
|
||||
#ifdef HAVE_INLINED_SYSCALLS
|
||||
return INLINE_SYSCALL (read, 3, fd, buf, nbytes);
|
||||
#else
|
||||
return __read (fd, buf, nbytes);
|
||||
#endif
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user