mirror of
git://sourceware.org/git/glibc.git
synced 2026-09-08 23:58:31 +08:00
Compare commits
109
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6952e59e25 | ||
|
|
1228ed5cd5 | ||
|
|
c0e4567461 | ||
|
|
19361cb768 | ||
|
|
56552e4257 | ||
|
|
831372e7c1 | ||
|
|
bdf289b222 | ||
|
|
33a934a3ab | ||
|
|
5b82669229 | ||
|
|
9d187dd4ad | ||
|
|
8d57beeab1 | ||
|
|
1ef32c3dc4 | ||
|
|
fd26970f33 | ||
|
|
f9c53d1159 | ||
|
|
9381196a94 | ||
|
|
0c5ecdc449 | ||
|
|
5290baf06c | ||
|
|
b51c27c032 | ||
|
|
038ebe2459 | ||
|
|
f94d25d4ee | ||
|
|
61c162b5bc | ||
|
|
2ca1375a22 | ||
|
|
df4ef2ab9c | ||
|
|
6f9e7002f3 | ||
|
|
3aaa074393 | ||
|
|
3e99cd6f00 | ||
|
|
4398fea0c2 | ||
|
|
6a6836233e | ||
|
|
6bc31da01b | ||
|
|
ea971c878f | ||
|
|
3c143620a5 | ||
|
|
d38cd08ca3 | ||
|
|
01c901a56b | ||
|
|
7e3be507ee | ||
|
|
6d52618b15 | ||
|
|
10dc2a90b7 | ||
|
|
cc2af7ea03 | ||
|
|
860d372986 | ||
|
|
68dbb3a69e | ||
|
|
f8b87ef0d4 | ||
|
|
6259ec0d78 | ||
|
|
aee321f468 | ||
|
|
8a4b65b469 | ||
|
|
f5c1ec414e | ||
|
|
feb3c93435 | ||
|
|
f65fd747b4 | ||
|
|
42054ddb49 | ||
|
|
8844bedd4c | ||
|
|
a18f587da5 | ||
|
|
6b612c6709 | ||
|
|
4770745624 | ||
|
|
d88554f033 | ||
|
|
e4cf507069 | ||
|
|
a401eea9eb | ||
|
|
c66452515d | ||
|
|
8a52392237 | ||
|
|
8f8619cbd2 | ||
|
|
3747899aa6 | ||
|
|
2c6d7e67cb | ||
|
|
84384f5b6a | ||
|
|
c44db1b198 | ||
|
|
afd4eb3759 | ||
|
|
3a3df4c78a | ||
|
|
df9ceed92b | ||
|
|
ebe3b3ebb7 | ||
|
|
63afd6ae40 | ||
|
|
54d79e995d | ||
|
|
b296c23344 | ||
|
|
26761c287f | ||
|
|
b8591d1bdf | ||
|
|
412b5b499a | ||
|
|
f155a595f0 | ||
|
|
d4a089cf19 | ||
|
|
2303f5fdd9 | ||
|
|
fe92af1832 | ||
|
|
4dbca03b64 | ||
|
|
d780e42f3c | ||
|
|
b57910379e | ||
|
|
2c6fe0bd3b | ||
|
|
f5311448f8 | ||
|
|
23a01afea2 | ||
|
|
4e32d5893f | ||
|
|
0f110f4100 | ||
|
|
050a966adc | ||
|
|
f0e4495937 | ||
|
|
78abf56371 | ||
|
|
1c404962af | ||
|
|
7148baf601 | ||
|
|
ba1ffaa1c6 | ||
|
|
f0f4432f46 | ||
|
|
6ed0492f8e | ||
|
|
769e8a82da | ||
|
|
e02c53618f | ||
|
|
46ec036de6 | ||
|
|
8145a97443 | ||
|
|
0d204b0a52 | ||
|
|
b207ff4bd8 | ||
|
|
ea97fc8e0b | ||
|
|
d41c6f6161 | ||
|
|
31c95122ee | ||
|
|
201d97bbe9 | ||
|
|
1f64ac13c0 | ||
|
|
b33f91e91d | ||
|
|
11336c165c | ||
|
|
6428aed93c | ||
|
|
ce7f605ba7 | ||
|
|
b853ee82a2 | ||
|
|
88c24ea1c6 | ||
|
|
cccda09fd7 |
+10547
File diff suppressed because it is too large
Load Diff
@@ -63,6 +63,20 @@ please let me know.
|
||||
functions `stat', `lstat', `fstat', and `mknod' and while
|
||||
linking on my Linux system I get error messages. How is
|
||||
this supposed to work?''
|
||||
|
||||
[Q18] ``The prototypes for `connect', `accept', `getsockopt',
|
||||
`setsockopt', `getsockname', `getpeername', `send',
|
||||
`sendto', and `recvfrom' are different in GNU libc than
|
||||
on any other system I saw. This is a bug, isn't it?''
|
||||
|
||||
[Q19] ``My XXX kernel emulates a floating-point coprocessor for me.
|
||||
Should I enable --with-fp?''
|
||||
|
||||
[Q20] ``How can I compile gcc 2.7.2.1 from the gcc source code using
|
||||
glibc 2.x?
|
||||
|
||||
[Q21] ``On Linux I've got problems with the declarations in Linux
|
||||
kernel headers.''
|
||||
|
||||
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
|
||||
[Q1] ``What systems does the GNU C Library run on?''
|
||||
@@ -75,9 +89,9 @@ The systems glibc is known to work on in the moment and most probably
|
||||
in the future are:
|
||||
|
||||
*-*-gnu GNU Hurd
|
||||
i[3456]86-*-linux Linux-2.0 on Intel
|
||||
m68k-*-linux Linux-2.0 on Motorola 680x0
|
||||
alpha-*-linux Linux-2.0 on DEC Alpha
|
||||
i[3456]86-*-linux-gnu Linux-2.0 on Intel
|
||||
m68k-*-linux-gnu Linux-2.0 on Motorola 680x0
|
||||
alpha-*-linux-gnu Linux-2.0 on DEC Alpha
|
||||
|
||||
Other Linux platforms are also on the way to be supported but I need
|
||||
some success reports first.
|
||||
@@ -159,14 +173,10 @@ Library.
|
||||
slow.
|
||||
|
||||
* plenty of time (approx 1h for i?86-linux on i586@133 or 2.5h on
|
||||
i486@66 or 4.5h on i486@33).
|
||||
i486@66 or 4.5h on i486@33). For Hurd systems times are much higher.
|
||||
|
||||
If you have some more measurements let me know.
|
||||
|
||||
* Some files depend on special tools. E.g., files ending in .gperf
|
||||
need a `gperf' program. The GNU version (part of libg++) is known
|
||||
to work while some vendor versions do not.
|
||||
|
||||
* When compiling for Linux:
|
||||
|
||||
+ the header files of the Linux kernel must be available in the
|
||||
@@ -176,6 +186,8 @@ Library.
|
||||
need a `gperf' program. The GNU version (part of libg++) is known
|
||||
to work while some vendor versions do not.
|
||||
|
||||
You should not need these tools unless you change the source files.
|
||||
|
||||
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
|
||||
[Q7] ``When I run `nm -u libc.so' on the produced library I still
|
||||
find unresolved symbols? Can this be ok?''
|
||||
@@ -251,7 +263,7 @@ incompatibilities:
|
||||
|
||||
* swapon(): the interface of this function didn't changed, but the
|
||||
prototype is in a separate header file <sys/swap.h>. For the additional
|
||||
argument of of swapon() you should use the SWAP_* constants from
|
||||
argument of swapon() you should use the SWAP_* constants from
|
||||
<linux/swap.h>, which get defined when <sys/swap.h> is included.
|
||||
|
||||
* errno: If a program uses variable "errno", then it _must_ include header
|
||||
@@ -289,6 +301,13 @@ incompatibilities:
|
||||
a separate library libresolv. If you find some symbols starting with
|
||||
`res_*' undefined simply add -lresolv to your call of the linker.
|
||||
|
||||
* the `signal' function's behaviour corresponds to the BSD semantic and
|
||||
not the SysV semantic as it was in libc-5. The interface on all GNU
|
||||
systems shall be the same and BSD is the semantic of choice. To use
|
||||
the SysV behaviour simply use `sysv_signal'. The major difference is
|
||||
that the SysV implementation sets the SA_ONESHOT flag and so the handler
|
||||
gets removed after the first call.
|
||||
|
||||
|
||||
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
|
||||
[Q10] ``Why does getlogin() always return NULL on my Linux box?''
|
||||
@@ -356,10 +375,10 @@ catalog files to the XPG4 form:
|
||||
[Q13] ``How do I configure GNU libc so that the essential libraries
|
||||
like libc.so go into /lib and the other into /usr/lib?''
|
||||
|
||||
[A13] {UD} Like all other GNU packages GNU libc is configured to use a
|
||||
base directory and install all files relative to this. If you intend
|
||||
to really use GNU libc on your system this base directory is /usr. I.e.,
|
||||
you run
|
||||
[A13] {UD,AJ} Like all other GNU packages GNU libc is configured to
|
||||
use a base directory and install all files relative to this. If you
|
||||
intend to really use GNU libc on your system this base directory is
|
||||
/usr. I.e., you run
|
||||
configure --prefix=/usr <other_options>
|
||||
|
||||
Some systems like Linux have a filesystem standard which makes a
|
||||
@@ -369,10 +388,10 @@ located on the same disk partition as /. The /usr subtree might be
|
||||
found on another partition/disk.
|
||||
|
||||
To install the essential libraries which come with GNU libc in /lib
|
||||
one must explicitly tell this. Autoconf has no option for this so you
|
||||
have to use the file where all user supplied additional information
|
||||
should go in: `configparms' (see the `INSTALL' file). For Linux the
|
||||
`configparms' file should contain:
|
||||
one must explicitly tell this (except on Linux, see below). Autoconf
|
||||
has no option for this so you have to use the file where all user
|
||||
supplied additional information should go in: `configparms' (see the
|
||||
`INSTALL' file). Therefore the `configparms' file should contain:
|
||||
|
||||
slibdir=/lib
|
||||
sysconfdir=/etc
|
||||
@@ -381,6 +400,10 @@ The first line specifies the directory for the essential libraries,
|
||||
the second line the directory for file which are by tradition placed
|
||||
in a directory named /etc.
|
||||
|
||||
No rule without an exception: If you configure for Linux with
|
||||
--prefix=/usr, then slibdir and sysconfdir will automatically be
|
||||
defined as stated above.
|
||||
|
||||
|
||||
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
|
||||
[Q14] ``When linking with the new libc I get unresolved symbols
|
||||
@@ -407,7 +430,7 @@ libc binaries from the US.
|
||||
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
|
||||
[Q15] ``What are these `add-ons'?''
|
||||
|
||||
[A15] {UD} To avoid complications with external or external source
|
||||
[A15] {UD} To avoid complications with export rules or external source
|
||||
code some optional parts of the libc are distributed as separate
|
||||
packages (e.g., the crypt package, see Q14).
|
||||
|
||||
@@ -456,7 +479,7 @@ change the `specs' file of your gcc. This file is normally found at
|
||||
|
||||
In this file you have to change a few things:
|
||||
|
||||
- change `ld-linux.so.1' to `ld.so.1'
|
||||
- change `ld-linux.so.1' to `ld.so.1' (or to ld-linux.so.2, see below)
|
||||
|
||||
- remove all expression `%{...:-lgmon}'; there is no libgmon in glibc
|
||||
|
||||
@@ -467,7 +490,7 @@ use it instead of the old libc. In this case the needed startup files
|
||||
and libraries are not found in the regular places. So the specs file
|
||||
must tell the compiler and linker exactly what to use. Here is for
|
||||
example the gcc-2.7.2 specs file when GNU libc is installed at
|
||||
/home/gnu:
|
||||
/usr:
|
||||
|
||||
-----------------------------------------------------------------------
|
||||
*asm:
|
||||
@@ -477,28 +500,28 @@ example the gcc-2.7.2 specs file when GNU libc is installed at
|
||||
%{pipe:-}
|
||||
|
||||
*cpp:
|
||||
%{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{!m386:-D__i486__} %{posix:-D_POSIX_SOURCE} -I/home/gnu/include
|
||||
%{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{!m386:-D__i486__} %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}
|
||||
|
||||
*cc1:
|
||||
|
||||
%{profile:-p}
|
||||
|
||||
*cc1plus:
|
||||
|
||||
|
||||
*endfile:
|
||||
%{!shared:crtend.o%s} %{shared:crtendS.o%s} /home/gnu/lib/crtn.o%s
|
||||
%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s
|
||||
|
||||
*link:
|
||||
-m elf_i386 -rpath=/home/gnu/lib -L/home/gnu/lib %{shared:-shared} %{!shared: %{!ibcs: %{!static: %{rdynamic:-export-dynamic} %{!dynamic-linker:-dynamic-linker=/home/gnu/lib/ld.so.1}} %{static:-static}}}
|
||||
-m elf_i386 %{shared:-shared} %{!shared: %{!ibcs: %{!static: %{rdynamic:-export-dynamic} %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} %{static:-static}}}
|
||||
|
||||
*lib:
|
||||
%{!shared: %{mieee-fp:-lieee} %{p:-lc_p} %{!p:%{pg:-lc_p} %{!pg:-lc}}}
|
||||
%{!shared: %{pthread:-lpthread} %{profile:-lc_p} %{!profile: -lc}}
|
||||
|
||||
*libgcc:
|
||||
%{!shared:-lgcc}
|
||||
-lgcc
|
||||
|
||||
*startfile:
|
||||
%{!shared: %{pg:/home/gnu/lib/gcrt1.o%s} %{!pg:%{p:/home/gnu/lib/gcrt1.o} %{!p:/home/gnu/lib/crt1.o%s}}} /home/gnu/lib/crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}
|
||||
%{!shared: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:%{profile:gcrt1.o%s} %{!profile:crt1.o%s}}}} crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}
|
||||
|
||||
*switches_need_spaces:
|
||||
|
||||
@@ -517,6 +540,16 @@ example the gcc-2.7.2 specs file when GNU libc is installed at
|
||||
|
||||
-----------------------------------------------------------------------
|
||||
|
||||
The above is currently correct for ix86/Linux. Because of
|
||||
compatibility issues on this platform the dynamic linker must have
|
||||
a different name: ld-linux.so.2. So you have to replace
|
||||
|
||||
%{!dynamic-linker:-dynamic-linker=/home/gnu/lib/ld-linux.so.2}
|
||||
by
|
||||
%{!dynamic-linker:-dynamic-linker=/home/gnu/lib/ld.so.1}
|
||||
|
||||
in the above example specs file to make it work for other systems.
|
||||
|
||||
Future versions of GCC will automatically provide the correct specs.
|
||||
|
||||
|
||||
@@ -541,12 +574,69 @@ link. The linker script with the above contents is placed in
|
||||
/usr/lib which is enough for the linker.
|
||||
|
||||
|
||||
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
|
||||
[Q18] ``The prototypes for `connect', `accept', `getsockopt',
|
||||
`setsockopt', `getsockname', `getpeername', `send',
|
||||
`sendto', and `recvfrom' are different in GNU libc from
|
||||
any other system I saw. This is a bug, isn't it?''
|
||||
|
||||
[A18] {UD} No, this is no bug. This version of the GNU libc already
|
||||
follows the to-be-released POSIX.1g standard. In this standard
|
||||
the type `size_t' is used for all parameters which describe a size.
|
||||
So better change now.
|
||||
|
||||
This change is critical for system which have
|
||||
sizeof (int) != sizeof (size_t)
|
||||
like the Alpha.
|
||||
|
||||
|
||||
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
|
||||
[Q19] ``My XXX kernel emulates a floating-point coprocessor for me.
|
||||
Should I enable --with-fp?''
|
||||
|
||||
[A19] {UD} As `configure --help' shows the default value is `yes' and
|
||||
this should not be changed unless the FPU instructions would be
|
||||
invalid. I.e., an emulated FPU is for the libc as good as a real one.
|
||||
|
||||
|
||||
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
|
||||
[Q20] ``How can I compile gcc 2.7.2.1 from the gcc source code using
|
||||
glibc 2.x?
|
||||
|
||||
[A20] {HJL} There is no support in gcc for glibc 2.0 before gcc 2.8. It
|
||||
is very tricky to compile gcc 2.7.2.1 using glibc 2.x. You have to
|
||||
build it manually or with one pass only. You also have to use the
|
||||
specs file in this FAQ while compiling gcc.
|
||||
|
||||
|
||||
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
|
||||
[Q21] ``On Linux I've got problems with the declarations in Linux
|
||||
kernel headers.''
|
||||
|
||||
[A21] {UD,AJ} On Linux, the use of kernel headers is reduced to a very
|
||||
minimum. Besides giving Linus the possibility to change the headers
|
||||
more freely it has another reason: user level programs now do not
|
||||
always use the same types like the kernel does.
|
||||
|
||||
I.e., the libc abstracts the use of types. E.g., the sigset_t type is
|
||||
in the kernel 32 or 64 bits wide. In glibc it is 1024 bits wide, in
|
||||
preparation for future development. The reasons are obvious: we don't
|
||||
want to have a new major release when the Linux kernel gets these
|
||||
functionality. Consult the headers for more information about the changes.
|
||||
|
||||
Therefore you shouldn't include Linux kernel header files directly if
|
||||
glibc has defined a replacement. Otherwise you might get undefined
|
||||
results because of type conflicts.
|
||||
|
||||
|
||||
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
|
||||
|
||||
Answers were given by:
|
||||
{UD} Ulrich Drepper, <drepper@cygnus.com>
|
||||
{DMT} David Mosberger-Tang, <davidm@AZStarNet.com>
|
||||
{RM} Roland McGrath, <roland@gnu.ai.mit.edu>
|
||||
{HJL} H.J. Lu, <hjl@gnu.ai.mit.edu>
|
||||
{AJ} Andreas Jaeger, <aj@arthur.pfalz.de>
|
||||
|
||||
Local Variables:
|
||||
mode:text
|
||||
|
||||
@@ -773,9 +773,10 @@ parts of the library were contributed or worked on by other people.
|
||||
platforms was written by Per Bothner and modified by Ulrich
|
||||
Drepper.
|
||||
|
||||
* The Internet-related code (most of the `inet' subdirectory) and
|
||||
several other miscellaneous functions and header files have been
|
||||
included from 4.4 BSD with little or no modification.
|
||||
* Some of the Internet-related code (most of the `inet'
|
||||
subdirectory) and several other miscellaneous functions and
|
||||
header files have been included from 4.4 BSD with little or no
|
||||
modification.
|
||||
|
||||
All code incorporated from 4.4 BSD is under the following
|
||||
copyright:
|
||||
@@ -916,3 +917,56 @@ parts of the library were contributed or worked on by other people.
|
||||
or `Software.Distribution@CS.CMU.EDU' any improvements or
|
||||
extensions that they make and grant Carnegie Mellon the
|
||||
rights to redistribute these changes.
|
||||
|
||||
* The `getaddrinfo' function is written by Craig Metz and it has the
|
||||
following copyright:
|
||||
|
||||
The Inner Net License, Version 2.00
|
||||
===================================
|
||||
|
||||
The author(s) grant permission for redistribution and use in source and
|
||||
binary forms, with or without modification, of the software
|
||||
and documentation provided that the following conditions are met:
|
||||
|
||||
0. If you receive a version of the software that is
|
||||
specifically labelled as not being for redistribution
|
||||
(check the version message and/or README), you are not
|
||||
permitted to redistribute that version of the software in
|
||||
any way or form.
|
||||
1. All terms of the all other applicable copyrights and
|
||||
licenses must be followed.
|
||||
2. Redistributions of source code must retain the authors'
|
||||
copyright notice(s), this list of conditions, and the
|
||||
following disclaimer.
|
||||
3. Redistributions in binary form must reproduce the authors'
|
||||
copyright notice(s), this list of conditions, and the
|
||||
following disclaimer in the documentation and/or other
|
||||
materials provided with the distribution.
|
||||
4. All advertising materials mentioning features or use of
|
||||
this software must display the following acknowledgement
|
||||
with the name(s) of the authors as specified in the
|
||||
copyright notice(s) substituted where indicated:
|
||||
|
||||
This product includes software developed by <name(s)>, The Inner
|
||||
Net, and other contributors.
|
||||
|
||||
5. Neither the name(s) of the author(s) nor the names of its
|
||||
contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written
|
||||
permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY ITS AUTHORS AND CONTRIBUTORS ``AS
|
||||
IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||
THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
OF SUCH DAMAGE.
|
||||
|
||||
If these license terms cause you a real problem, contact the author.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1991, 92, 93, 94, 95, 96, 97 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
|
||||
@@ -12,9 +12,9 @@
|
||||
# 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., 675 Mass Ave,
|
||||
# Cambridge, MA 02139, USA.
|
||||
# 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.
|
||||
|
||||
dist:
|
||||
|
||||
@@ -29,6 +29,7 @@ endif
|
||||
include $(..)Makeconfig
|
||||
|
||||
foo:=$(shell echo 'distribute=$(distribute)'>&2)
|
||||
foo:=$(shell echo 'dont_distribute=$(dont_distribute)'>&2)
|
||||
foo:=$(shell echo 'foobar=$(filter %.c %.S %.s %.h,$(distribute))'>&2)
|
||||
|
||||
ifndef sysdep_dirs
|
||||
@@ -111,8 +112,8 @@ sources := $(filter-out $(addsuffix .c,$(basename $(.S.s))),$(sources)) $(.S.s)
|
||||
|
||||
+out := $(patsubst %.S,%.c,$(+sysdep-names:.s=.c)) \
|
||||
$(addsuffix .c,$(sysdep_routines)) \
|
||||
$(+subdir-nodist)
|
||||
#foo:=$(shell echo '+out=$(+out)' >&2; echo foofoo >&2)
|
||||
$(+subdir-nodist) $(dont_distribute)
|
||||
foo:=$(shell echo '+out=$(+out)' >&2; echo foofoo >&2)
|
||||
+tsrcs := $(filter-out $(+out), $(sources) $(all-headers) $(distribute)) \
|
||||
$(+sysdeps)
|
||||
foo:=$(shell echo 'made +tsrcs=$(+tsrcs)'>&2)
|
||||
@@ -186,11 +187,10 @@ endef
|
||||
configure: configure.in aclocal.m4; $(autoconf-it)
|
||||
%/configure: %/configure.in aclocal.m4; $(autoconf-it)
|
||||
|
||||
.PHONY: dist
|
||||
dist: $(tardir).tar.gz
|
||||
|
||||
subdir_dist: dist.tar
|
||||
dist.tar: $(tardir) $(+tsrcs)
|
||||
dist.tar: README $(tardir) $(+tsrcs)
|
||||
tar chvf $@ $(addprefix $(tardir)/,$(filter-out $(tardir),$^))
|
||||
|
||||
$(tardir).tar: dist.tar subdir_dist
|
||||
@@ -213,7 +213,7 @@ $(dist-subdirs):
|
||||
$(MAKE) -C $(patsubst dist-%,%,$@) dist
|
||||
|
||||
# This is here instead of in Makefile so it can use $(release) and $(version).
|
||||
README: README.template version.c
|
||||
README: README.template version.h
|
||||
-rm -f $@
|
||||
sed -e 's/RELEASE/$(release)/' -e 's/VERSION/$(version)/' < $< > $@
|
||||
# Make it unwritable so I won't change it by mistake.
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
# 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., 675 Mass Ave,
|
||||
# Cambridge, MA 02139, USA.
|
||||
# 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.
|
||||
|
||||
# Make this the default goal.
|
||||
TAGS:
|
||||
@@ -39,12 +39,14 @@ tags_sources = $(all-sources) $(all-headers) $(all-dist)
|
||||
endif # ctype
|
||||
endif # No tags_sources
|
||||
|
||||
sysdep-dirs := $(full-config-subdirs)
|
||||
sysdep-dirs := $(full-config-sysdirs)
|
||||
|
||||
ifndef sysdep_dirs
|
||||
# Find all sysdep directories.
|
||||
sysdep_dirs := $(shell find $(..)sysdeps -type d \
|
||||
! -name RCS ! -name CVS -print)
|
||||
sysdep_dirs := $(shell find $(..)sysdeps \
|
||||
$(wildcard \
|
||||
$(patsubst %,$(..)%/sysdeps,$(add-ons))) \
|
||||
-type d ! -name RCS ! -name CVS -print)
|
||||
endif
|
||||
|
||||
# Find all sysdep dirs there are, but putting the ones
|
||||
@@ -82,17 +84,22 @@ 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))) \
|
||||
$(foreach dir,$(all-dirs),\
|
||||
$(wildcard \
|
||||
$(addprefix $(dir)/,\
|
||||
$(sort $(sources) $(sources:.c=.S) \
|
||||
$(sources:.c=.s)))))
|
||||
$(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)/,$(headers))))
|
||||
$(wildcard $(addprefix $(dir)/,$(sysdep-headers))))
|
||||
|
||||
tags_sources := $(strip $(tags_sources))
|
||||
|
||||
@@ -145,13 +152,7 @@ else
|
||||
$(extract)
|
||||
endif
|
||||
|
||||
$P/siglist.pot: $(common-objpfx)stdio-common/siglist.c; $(extract)
|
||||
|
||||
# Extract all strings from this file; its strings are not marked.
|
||||
# Their surroundings are also not interesting.
|
||||
XGETTEXTFLAGS-siglist.pot = -a --no-location
|
||||
|
||||
all-pot = $P/libc-top.pot $P/subdirs.pot $P/siglist.pot
|
||||
all-pot = $P/libc-top.pot $P/subdirs.pot
|
||||
|
||||
ifndef subdir
|
||||
# Collect all the subdir messages, massaging the file names in comments
|
||||
@@ -169,9 +170,9 @@ include $(common-objpfx)version.mk
|
||||
# The following code requires GNU date.
|
||||
$P/libc.pot: $(all-pot)
|
||||
@rm -f $@.new
|
||||
disp='set `date -R`; echo $$6'; \
|
||||
set `date -R`; disp="$$6"; \
|
||||
sed -e 's/VERSION/$(version)/' \
|
||||
-e "s/DATE/`date +'%Y-%m-%d %I:%M'$$disp/" \
|
||||
-e "s/DATE/`date +'%Y-%m-%d %H:%M'$$disp`/" \
|
||||
po/header.pot > $@.new
|
||||
$(XGETTEXT) -d - --omit-header -n -s $^ >> $@.new
|
||||
mv -f $@.new $@
|
||||
|
||||
+92
-29
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1991, 92, 93, 94, 95, 96, 97 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
|
||||
@@ -12,9 +12,9 @@
|
||||
# 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., 675 Mass Ave,
|
||||
# Cambridge, MA 02139, USA.
|
||||
# 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.
|
||||
|
||||
#
|
||||
# Makefile configuration options for the GNU C library.
|
||||
@@ -91,12 +91,13 @@ export full-config-sysdirs := $(full-config-sysdirs)
|
||||
# changes and so config.status would be run every time; the dependence of
|
||||
# config.make should suffice to force regeneration and re-exec, and the new
|
||||
# image will notice if config.h changed.
|
||||
$(common-objpfx)config.make: $(common-objpfx)config.status $(..)config.h.in
|
||||
$(common-objpfx)config.make: $(common-objpfx)config.status \
|
||||
$(..)config.make.in $(..)config.h.in
|
||||
cd $(<D); $(SHELL) $(<F)
|
||||
|
||||
# Find all the sysdeps configure fragments, to make sure we re-run
|
||||
# configure when any of them changes.
|
||||
$(common-objpfx)config.status: $(..)configure \
|
||||
$(common-objpfx)config.status: $(..)version.h $(..)configure \
|
||||
$(foreach dir,$(full-config-sysdirs),\
|
||||
$(wildcard \
|
||||
$(dir)/Implies) \
|
||||
@@ -146,11 +147,13 @@ endif
|
||||
ifndef libdir
|
||||
libdir = $(exec_prefix)/lib
|
||||
endif
|
||||
inst_libdir = $(install_root)$(libdir)
|
||||
|
||||
# Where to install the shared library and dynamic linker.
|
||||
ifndef slibdir
|
||||
slibdir = $(exec_prefix)/lib
|
||||
endif
|
||||
inst_slibdir = $(install_root)$(slibdir)
|
||||
|
||||
# Prefix to put on files installed in $(libdir). For libraries `libNAME.a',
|
||||
# the prefix is spliced between `lib' and the name, so the linker switch
|
||||
@@ -164,50 +167,64 @@ endif
|
||||
ifndef includedir
|
||||
includedir = $(exec_prefix)/include
|
||||
endif
|
||||
inst_includedir = $(install_root)$(includedir)
|
||||
|
||||
# Where to install machine-independent data files.
|
||||
# These are the timezone database, and the locale database.
|
||||
ifndef datadir
|
||||
datadir = $(prefix)/share
|
||||
endif
|
||||
inst_datadir = $(install_root)$(datadir)
|
||||
|
||||
# Where to install the timezone data files (which are machine-independent).
|
||||
ifndef zonedir
|
||||
zonedir = $(datadir)/zoneinfo
|
||||
endif
|
||||
inst_zonedir = $(install_root)$(zonedir)
|
||||
|
||||
# Where to install the locale and message catalog data files (which are
|
||||
# machine-independent).
|
||||
ifndef localedir
|
||||
localedir = $(datadir)/locale
|
||||
endif
|
||||
inst_localedir = $(install_root)$(localedir)
|
||||
|
||||
# Where to install the locale charmap source files.
|
||||
ifndef i18ndir
|
||||
i18ndir = $(datadir)/i18n
|
||||
endif
|
||||
inst_i18ndir = $(install_root)$(i18ndir)
|
||||
|
||||
|
||||
# Where to install programs.
|
||||
ifndef bindir
|
||||
bindir = $(exec_prefix)/bin
|
||||
endif
|
||||
inst_bindir = $(install_root)$(bindir)
|
||||
|
||||
# Where to install administrative programs.
|
||||
ifndef rootsbindir
|
||||
rootsbindir = $(exec_prefix)/sbin
|
||||
endif
|
||||
inst_rootsbindir = $(install_root)$(rootsbindir)
|
||||
|
||||
ifndef sbindir
|
||||
sbindir = $(exec_prefix)/sbin
|
||||
endif
|
||||
inst_sbindir = $(install_root)$(sbindir)
|
||||
|
||||
# Where to install the Info files.
|
||||
ifndef infodir
|
||||
infodir = $(prefix)/info
|
||||
endif
|
||||
inst_infodir = $(install_root)$(infodir)
|
||||
|
||||
# Where to install default configuration files. These include the local
|
||||
# timezone specification and network data base files.
|
||||
ifndef sysconfdir
|
||||
sysconfdir = $(prefix)/etc
|
||||
endif
|
||||
inst_sysconfdir = $(install_root)$(sysconfdir)
|
||||
|
||||
# What timezone should be the installed default (e.g., US/Eastern).
|
||||
# Run `make -C time echo-zonenames' to see a list of available zone names.
|
||||
@@ -222,7 +239,7 @@ endif
|
||||
# other than there, so the zoneinfo directory contains only universal data,
|
||||
# localizing the configuration data elsewhere.
|
||||
ifndef localtime-file
|
||||
localtime-file = $(sysconfdir)/localtime
|
||||
localtime-file = $(inst_sysconfdir)/localtime
|
||||
endif
|
||||
|
||||
# What to use for leap second specifications in compiling the default
|
||||
@@ -330,6 +347,7 @@ default-rpath = $(libdir)
|
||||
endif
|
||||
# This is how to find at build-time things that will be installed there.
|
||||
rpath-link = $(common-objdir):$(elfobjdir):$(nssobjdir)
|
||||
elfobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)elf)
|
||||
nssobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nss)
|
||||
else
|
||||
link-libc = $(common-objpfx)libc.a $(gnulib) $(common-objpfx)libc.a
|
||||
@@ -353,15 +371,6 @@ csu-objpfx = $(common-objpfx)csu/
|
||||
elf-objpfx = $(common-objpfx)elf/
|
||||
db-objpfx = $(common-objpfx)db/
|
||||
|
||||
ifeq (yes,$(build-shared))
|
||||
# The name under which the run-time dynamic linker is installed.
|
||||
# We are currently going for the convention that `/lib/ld.so.1'
|
||||
# names the SVR4/ELF ABI-compliant dynamic linker.
|
||||
ifndef rtld-installed-name
|
||||
rtld-installed-name = ld.so.1
|
||||
endif
|
||||
endif
|
||||
|
||||
# How to run a program we just linked with our library.
|
||||
# The program binary is assumed to be $(word 2,$^).
|
||||
built-program-file = $(dir $(word 2,$^))$(notdir $(word 2,$^))
|
||||
@@ -369,10 +378,12 @@ ifneq (yes,$(build-shared))
|
||||
built-program-cmd = $(built-program-file)
|
||||
else
|
||||
comma = ,
|
||||
sysdep-library-path = \
|
||||
$(subst $(empty) ,:,$(strip $(patsubst -Wl$(comma)-rpath-link=%, %,\
|
||||
$(filter -Wl$(comma)-rpath-link=%,\
|
||||
$(sysdep-LDFLAGS)))))
|
||||
define built-program-cmd
|
||||
LD_LIBRARY_PATH=$(rpath-link)$(patsubst -Wl$(comma)-rpath-link=%,:%,\
|
||||
$(filter -Wl$(comma)-rpath-link=%,\
|
||||
$(sysdep-LDFLAGS))) \
|
||||
LD_LIBRARY_PATH=$(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \
|
||||
$(elf-objpfx)$(rtld-installed-name) $(built-program-file)
|
||||
endef
|
||||
endif
|
||||
@@ -409,7 +420,7 @@ M4 = m4
|
||||
.NOEXPORT:
|
||||
|
||||
# We want to echo the commands we're running without
|
||||
# umpteem zillion filenames along with it (we use `...' instead)
|
||||
# umpteen zillion filenames along with it (we use `...' instead)
|
||||
# but we don't want this echoing done when the user has said
|
||||
# he doesn't want to see commands echoed by using -s.
|
||||
ifneq "$(findstring s,$(MAKEFLAGS))" "" # if -s
|
||||
@@ -427,7 +438,7 @@ ifdef CFLAGS
|
||||
endif # CFLAGS
|
||||
endif # +cflags
|
||||
|
||||
# If none of the above worked, default to "-g".
|
||||
# If none of the above worked, default to "-g -O".
|
||||
ifeq "$(strip $(+cflags))" ""
|
||||
+cflags := $(default_cflags)
|
||||
endif # $(+cflags) == ""
|
||||
@@ -452,9 +463,10 @@ libio-include = -I$(..)libio
|
||||
|
||||
# These are the variables that the implicit compilation rules use.
|
||||
CPPFLAGS = $(+includes) $(defines) -include $(..)libc-symbols.h \
|
||||
$(sysdep-CPPFLAGS) $(CPPFLAGS-$(suffix $@))
|
||||
$(sysdep-CPPFLAGS) $(CPPFLAGS-$(suffix $@)) $(CPPFLAGS-$(<F)) \
|
||||
$(CPPFLAGS-$(@F))
|
||||
override CFLAGS = $(+cflags) $(sysdep-CFLAGS) $(CFLAGS-$(suffix $@)) \
|
||||
$(CFLAGS-$(<F))
|
||||
$(CFLAGS-$(<F)) $(CFLAGS-$(@F))
|
||||
|
||||
|
||||
# This is the macro that the implicit linking rules use.
|
||||
@@ -475,7 +487,7 @@ ifeq (yes,$(build-shared))
|
||||
# The PIC object files are named foo.so.
|
||||
object-suffixes += .so
|
||||
CPPFLAGS-.so = -DPIC
|
||||
CFLAGS-.so = -fPIC
|
||||
CFLAGS-.so = -fPIC -fno-common
|
||||
libtype.so := lib%_pic.a
|
||||
endif
|
||||
ifeq (yes,$(build-profile))
|
||||
@@ -530,22 +542,73 @@ $(common-objpfx)soversions.mk: $(..)shlib-versions $(..)Makeconfig \
|
||||
(file="$(wildcard $(patsubst %,$(..)%/shlib-versions,$(add-ons))) \
|
||||
$(..)shlib-versions"; \
|
||||
for f in $$file; do \
|
||||
sed 's/#.*$$//' $$f | while read conf versions; do \
|
||||
test -n "$$versions" || continue; \
|
||||
case '$(config-machine)-$(config-vendor)-$(config-os)' in $$conf)\
|
||||
sed 's/#.*$$//' $$f | while read conf versions; do \
|
||||
test -n "$$versions" && \
|
||||
test `expr '$(config-machine)-$(config-vendor)-$(config-os)' \
|
||||
: "$$conf"` != 0 || continue; \
|
||||
for v in $$versions; do \
|
||||
lib=`echo $$v | sed 's/=.*$$//'`; \
|
||||
if eval "test -z \"\$$vers_lib$$lib\""; then \
|
||||
eval vers_lib$${lib}=yes; \
|
||||
echo $$v | sed "s/^.*=/$$lib.so-version=./"; \
|
||||
number=`echo $$v | sed "s/^.*=//"`; \
|
||||
case $$number in \
|
||||
[0-9]*) echo "$$lib.so-version=.$$number"; \
|
||||
echo "all-sonames+=$$lib.so\$$($$lib.so-version)";;\
|
||||
*) echo "$$lib.so-version=$$number"; \
|
||||
echo "all-sonames+=\$$($$lib.so-version)";; \
|
||||
esac; \
|
||||
fi; \
|
||||
done ;; esac; done; \
|
||||
done; \
|
||||
done; \
|
||||
done;) > $@T; exit 0
|
||||
mv -f $@T $@
|
||||
|
||||
# Get $(version) defined with the release version number.
|
||||
-include $(common-objpfx)version.mk
|
||||
|
||||
# Generate the header containing the names of all shared libraries.
|
||||
# We use a stamp file to avoid uncessary recompilations.
|
||||
before-compile += $(common-objpfx)gnu/lib-names.h
|
||||
$(common-objpfx)gnu/lib-names.h: $(common-objpfx)gnu/lib-names.stmp
|
||||
$(common-objpfx)gnu/lib-names.stmp: $(common-objpfx)soversions.mk
|
||||
$(make-target-directory)
|
||||
@rm -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 \
|
||||
upname=`echo $$l | sed 's/[.]so.*//' | \
|
||||
tr '[:lower:]-' '[:upper:]_'`; \
|
||||
echo "#define $${upname}_SO \"$$l\""; \
|
||||
done;) | sort; \
|
||||
echo; \
|
||||
echo '#endif /* gnu/lib-names.h */';) > ${@:stmp=T}
|
||||
if test -r ${@:stmp=h} && cmp -s ${@:stmp=h} ${@:stmp=T}; \
|
||||
then rm -f ${@:stmp=T}; \
|
||||
else mv -f ${@:stmp=T} ${@:stmp=h}; fi
|
||||
touch $@
|
||||
|
||||
common-generated += gnu/lib-names.h gnu/lib-names.stmp
|
||||
|
||||
# The name under which the run-time dynamic linker is installed.
|
||||
# We are currently going for the convention that `/lib/ld.so.1'
|
||||
# names the SVR4/ELF ABI-compliant dynamic linker.
|
||||
ifndef rtld-installed-name
|
||||
ifdef ld.so-version
|
||||
rtld-installed-name = $(ld.so-version)
|
||||
else
|
||||
rtld-installed-name = ld.so.1
|
||||
endif
|
||||
endif
|
||||
|
||||
ifndef rtld-version-installed-name
|
||||
rtld-version-installed-name = ld-$(version).so
|
||||
endif
|
||||
|
||||
endif # build-shared
|
||||
|
||||
endif # Makeconfig not yet included
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1991, 92, 93, 94, 95, 96, 97 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
|
||||
@@ -12,9 +12,9 @@
|
||||
# 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., 675 Mass Ave,
|
||||
# Cambridge, MA 02139, USA.
|
||||
# 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.
|
||||
|
||||
#
|
||||
# Master Makefile for the GNU C library
|
||||
@@ -52,9 +52,10 @@ endif
|
||||
|
||||
# These are the subdirectories containing the library source.
|
||||
subdirs = csu assert ctype db locale intl catgets math setjmp signal stdlib \
|
||||
stdio-common $(stdio) malloc string wcsmbs time dirent grp pwd\
|
||||
stdio-common $(stdio) malloc string wcsmbs time dirent grp pwd \
|
||||
posix io termios resource misc login socket sysvipc gmon gnulib \
|
||||
wctype manual shadow $(sysdep-subdirs) nss elf po $(add-ons)
|
||||
wctype manual shadow md5-crypt nss $(sysdep-subdirs) po \
|
||||
$(add-ons) elf
|
||||
export subdirs := $(subdirs) # Benign, useless in GNU make before 3.63.
|
||||
|
||||
# The mach and hurd subdirectories have many generated header files which
|
||||
@@ -82,14 +83,20 @@ subdirs := $(filter mach,$(subdirs)) $(filter hurd,$(subdirs)) \
|
||||
$(addprefix install-, no-libc.a bin lib data headers others)
|
||||
|
||||
headers := errno.h sys/errno.h errnos.h limits.h values.h \
|
||||
features.h gnu-versions.h libc-lock.h
|
||||
features.h gnu-versions.h libc-lock.h xopen_lim.h
|
||||
aux = sysdep $(libc-init) version
|
||||
before-compile = $(objpfx)version-info.h
|
||||
|
||||
echo-headers: subdir_echo-headers
|
||||
|
||||
# What to install.
|
||||
install-others = $(includedir)/stubs.h
|
||||
install-others = $(inst_includedir)/gnu/stubs.h
|
||||
install-bin = glibcbug
|
||||
|
||||
ifeq (yes,$(build-shared))
|
||||
before-compile += $(objpfx)gnu/lib-names.h
|
||||
install-others += $(inst_includedir)/gnu/lib-names.h
|
||||
endif
|
||||
|
||||
ifeq (yes,$(gnu-ld))
|
||||
libc-init = set-init
|
||||
@@ -107,6 +114,15 @@ include Makerules
|
||||
# Install from subdirectories too.
|
||||
install: subdir_install
|
||||
|
||||
# Create linkfs for shared libraries using the `ldconfig' program is possible.
|
||||
ifeq (no,$(cross-compiling))
|
||||
ifeq (yes,$(build-shared))
|
||||
install:
|
||||
test ! -x $(common-objpfx)elf/ldconfig || \
|
||||
$(common-objpfx)elf/ldconfig -d $(inst_slibdir) $(inst_libdir)
|
||||
endif
|
||||
endif
|
||||
|
||||
# Build subdirectory lib objects.
|
||||
lib-noranlib: subdir_lib
|
||||
|
||||
@@ -124,20 +140,37 @@ $(objpfx)sysd-dirs: $(+sysdir_pfx)config.make $(all-Subdirs-files)
|
||||
|
||||
all-Banner-files = $(wildcard $(addsuffix /Banner, $(subdirs)))
|
||||
$(objpfx)version-info.h: $(+sysdir_pfx)config.make $(all-Banner-files)
|
||||
(files="$(all-Banner-files)"; \
|
||||
(case $(config-os) in \
|
||||
linux*) version=`(echo -e "#include <linux/version.h>\nUTS_RELEASE"\
|
||||
| $(CC) -E -P - | \
|
||||
sed -e 's/"\([^"]*\)".*/\1/p' -e d) 2>/dev/null`;\
|
||||
if [ -z "$$version" ]; then \
|
||||
if [ -r /proc/version ]; then \
|
||||
version=`sed 's/.*version \([^ ]*\) .*/>>\1<</' \
|
||||
< /proc/version`; \
|
||||
else \
|
||||
version=`uname -r`; \
|
||||
fi; \
|
||||
fi; \
|
||||
echo -n "\"Compiled on a Linux $$version system "; \
|
||||
echo "on `date +%Y/%m/%d`.\\n\"" ;; \
|
||||
*) ;; \
|
||||
esac; \
|
||||
files="$(all-Banner-files)"; \
|
||||
if test -n "$$files"; then \
|
||||
echo "\"Available extensions:"; \
|
||||
sed -e '/^#/d' -e 's/^[[:space:]]*/ /' $$files; \
|
||||
echo "\""; \
|
||||
fi) > $@-tmp
|
||||
mv -f $@-tmp $@
|
||||
fi) > $@T
|
||||
mv -f $@T $@
|
||||
generated += version-info.h
|
||||
|
||||
version.c-objects := $(addprefix $(objpfx)version,$(object-suffixes))
|
||||
$(version.c-objects): $(objpfx)version-info.h
|
||||
|
||||
# Makerules creates a file `stub-$(subdir)' for each subdirectory, which
|
||||
# contains `#define __stub_FUNCTION' for each function which is a stub.
|
||||
# Here we paste all of these together into <stubs.h>.
|
||||
# Here we paste all of these together into <gnu/stubs.h>.
|
||||
|
||||
subdir-stubs := $(foreach dir,$(subdirs),$(common-objpfx)stub-$(dir))
|
||||
|
||||
@@ -147,7 +180,7 @@ subdir-stubs := $(foreach dir,$(subdirs),$(common-objpfx)stub-$(dir))
|
||||
# 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.
|
||||
$(includedir)/stubs.h: subdir_install
|
||||
$(inst_includedir)/gnu/stubs.h: subdir_install
|
||||
@rm -f $(objpfx)stubs.h
|
||||
(echo '/* This file is automatically generated.';\
|
||||
echo ' It defines a symbol `__stub_FUNCTION'\'' for each function';\
|
||||
@@ -155,14 +188,27 @@ $(includedir)/stubs.h: subdir_install
|
||||
echo ' every time called, usually setting errno to ENOSYS. */';\
|
||||
sort $(subdir-stubs)) > $(objpfx)stubs.h
|
||||
if test -r $@ && cmp -s $(objpfx)stubs.h $@; \
|
||||
then echo stubs.h unchanged ; \
|
||||
then echo 'stubs.h unchanged'; \
|
||||
else $(INSTALL_DATA) $(objpfx)stubs.h $@; fi
|
||||
rm -f $(objpfx)stubs.h
|
||||
|
||||
ifeq (yes,$(build-shared))
|
||||
|
||||
$(inst_includedir)/gnu/lib-names.h: $(common-objpfx)gnu/lib-names.h
|
||||
if test -r $@ && cmp -s $< $@; \
|
||||
then echo 'gnu/lib-names.h unchanged'; \
|
||||
else $(INSTALL_DATA) $< $@; fi
|
||||
endif
|
||||
|
||||
# The `glibcbug' script contains the version number and it shall be rebuild
|
||||
# whenever this changes or the `glibcbug.in' file.
|
||||
$(objpfx)glibcbug: $(common-objpfx)config.status glibcbug.in
|
||||
cd $(<D); CONFIG_FILES=$(@F) CONFIG_HEADERS= $(SHELL) $(<F)
|
||||
|
||||
# This makes the Info or DVI file of the documentation from the Texinfo source.
|
||||
.PHONY: info dvi
|
||||
info dvi:
|
||||
$(MAKE) -C manual $@
|
||||
$(MAKE) $(PARALLELMFLAGS) -C manual $@
|
||||
|
||||
# This makes all the subdirectory targets.
|
||||
|
||||
@@ -176,7 +222,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) -C $(@D) $(@F)
|
||||
$(MAKE) $(PARALLELMFLAGS) -C $(@D) $(@F)
|
||||
|
||||
.PHONY: $(+subdir_targets) $(all-subdirs-targets)
|
||||
|
||||
@@ -240,14 +286,15 @@ distribute := README INSTALL FAQ NOTES NEWS PROJECTS \
|
||||
ansidecl.h mkinstalldirs move-if-change install-sh \
|
||||
configure configure.in aclocal.m4 config.sub config.guess\
|
||||
config.h.in config.make.in config-name.in Makefile.in \
|
||||
autolock.sh munch-tmpl.c munch.awk interp.c \
|
||||
autolock.sh rellns-sh munch-tmpl.c munch.awk interp.c \
|
||||
sysdep.h set-hooks.h libc-symbols.h version.h shlib-versions \
|
||||
rpm/Makefile rpm/template rpm/rpmrc
|
||||
rpm/Makefile rpm/template rpm/rpmrc nsswitch.h netgroup.h \
|
||||
mcheck.h glibcbug.in
|
||||
|
||||
distribute := $(strip $(distribute))
|
||||
generated := $(generated) stubs.h version-info.h
|
||||
|
||||
README: README.template version.c ; # Make-dist should update README.
|
||||
README: README.template version.h ; # Make-dist should update README.
|
||||
|
||||
define format-me
|
||||
@rm -f $@
|
||||
@@ -258,4 +305,10 @@ INSTALL: manual/maint.texi; $(format-me)
|
||||
NOTES: manual/creature.texi; $(format-me)
|
||||
|
||||
rpm/%: subdir_distinfo
|
||||
$(MAKE) -C $(@D) subdirs='$(subdirs)' $(@F)
|
||||
$(MAKE) $(PARALLELMFLAGS) -C $(@D) subdirs='$(subdirs)' $(@F)
|
||||
|
||||
# This is a special goal for people making binary distributions. Normally
|
||||
# everybody uses the DES based crypt library but for the distribution we
|
||||
# need the only-MD5 based one as well.
|
||||
md5-crypt/libmd5crypt:
|
||||
$(MAKE) $(PARALLELMFLAGS) -C $(@D) $(@F)
|
||||
|
||||
+4
-1
@@ -2,5 +2,8 @@
|
||||
|
||||
srcdir = @srcdir@
|
||||
|
||||
# Uncomment the line below if you want to do parallel build.
|
||||
# PARALLELMFLAGS = -j 4
|
||||
|
||||
all .DEFAULT:
|
||||
$(MAKE) -C $(srcdir) objdir=`pwd` $@
|
||||
$(MAKE) PARALLELMFLAGS="$(PARALLELMFLAGS)" -C $(srcdir) objdir=`pwd` $@
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1991, 92, 93, 94, 95, 96, 97 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
|
||||
@@ -12,9 +12,9 @@
|
||||
# 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., 675 Mass Ave,
|
||||
# Cambridge, MA 02139, USA.
|
||||
# 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.
|
||||
|
||||
#
|
||||
# Common rules for making the GNU C library. This file is included
|
||||
@@ -26,9 +26,10 @@ This makefile requires GNU Make.
|
||||
endif
|
||||
|
||||
REQUIRED_MAKE_VERSION = 3.74
|
||||
REAL_MAKE_VERSION = $(firstword $(MAKE_VERSION))
|
||||
|
||||
ifneq ($(REQUIRED_MAKE_VERSION), \
|
||||
$(firstword $(sort $(MAKE_VERSION) $(REQUIRED_MAKE_VERSION))))
|
||||
$(firstword $(sort $(REAL_MAKE_VERSION) $(REQUIRED_MAKE_VERSION))))
|
||||
Wrong GNU Make version. See above for the version needed.
|
||||
endif
|
||||
|
||||
@@ -104,13 +105,17 @@ $(+sysdir_pfx)sysd-Makefile: $(+sysdir_pfx)config.make $(..)Makerules \
|
||||
(echo 'sysd-Makefile-sysdirs := $(config-sysdirs)'; \
|
||||
for dir in $(config-sysdirs); do \
|
||||
file=$$dir/Makefile; \
|
||||
if [ -f $$file ]; then \
|
||||
case $$dir in \
|
||||
/*) rel= ;; \
|
||||
*) rel=$(..) ;; \
|
||||
esac; \
|
||||
if [ -f $$rel$$file ]; then \
|
||||
case $$dir in \
|
||||
/*) echo include "$$file" ;; \
|
||||
*) echo include "\$$(..)$$file" ;; \
|
||||
esac; \
|
||||
else true; fi; \
|
||||
done; \
|
||||
done; \
|
||||
echo 'sysd-Makefile-done=t') > $@T
|
||||
mv -f $@T $@
|
||||
endif
|
||||
@@ -339,10 +344,11 @@ endef
|
||||
# Also omits crti.o and crtn.o, which we do not want
|
||||
# since we define our own `.init' section specially.
|
||||
LDFLAGS-c.so = -nostdlib -nostartfiles
|
||||
# But we still want to link libc.so against -lgcc.
|
||||
LDLIBS-c.so = -lgcc
|
||||
# Give libc.so an entry point and make it directly runnable itself.
|
||||
LDFLAGS-c.so += -e __libc_main
|
||||
# Use our own special initializer and finalizer files for libc.so.
|
||||
elfobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)elf)
|
||||
$(common-objpfx)libc.so: $(elfobjdir)/soinit.so \
|
||||
$(common-objpfx)libc_pic.a \
|
||||
$(elfobjdir)/sofini.so $(elfobjdir)/ld.so
|
||||
@@ -488,8 +494,8 @@ include $(o-iterator)
|
||||
define do-ar
|
||||
topdir=`cd $(..).; pwd`; \
|
||||
$(patsubst %/,cd %;,$(objpfx)) \
|
||||
$$topdir/autolock.sh ${O%-lib}.lck $(AR) cru$(verbose) ${O%-lib} \
|
||||
$(patsubst $(objpfx)%,%,$^)
|
||||
$(SHELL) $$topdir/autolock.sh ${O%-lib}.lck $(AR) cru$(verbose) ${O%-lib} \
|
||||
$(patsubst $(objpfx)%,%,$^)
|
||||
rm -f $@
|
||||
touch $@
|
||||
endef
|
||||
@@ -503,7 +509,7 @@ define o-iterator-doit
|
||||
$(common-objpfx)$(patsubst %,$(libtype$o),c)($(ar-symtab-name)): \
|
||||
$(common-objpfx)$(patsubst %,$(libtype$o),c)(\
|
||||
$(patsubst $(objpfx)%,%,$(o-objects))) $(subdirs-stamp-o); \
|
||||
$$(..)./autolock.sh \
|
||||
$(SHELL) $$(..)./autolock.sh \
|
||||
$$(common-objpfx)$$(patsubst %,$$(libtype$o),c).lck \
|
||||
$$(RANLIB) $$(common-objpfx)$$(patsubst %,$$(libtype$o),c)
|
||||
endef
|
||||
@@ -563,11 +569,11 @@ endef
|
||||
# to install everything it changes.
|
||||
ifdef objects
|
||||
installed-libcs := $(foreach o,$(object-suffixes),\
|
||||
$(libdir)/$(patsubst %,$(libtype$o),\
|
||||
$(libprefix)$(libc-name)))
|
||||
$(inst_libdir)/$(patsubst %,$(libtype$o),\
|
||||
$(libprefix)$(libc-name)))
|
||||
installed-libcs := $(filter-out %_pic.a,$(installed-libcs))
|
||||
install: $(installed-libcs)
|
||||
$(installed-libcs): $(libdir)/lib$(libprefix)%: lib
|
||||
$(installed-libcs): $(inst_libdir)/lib$(libprefix)%: lib
|
||||
$(make-target-directory)
|
||||
$(INSTALL_DATA) $(common-objpfx)lib$(*:$(libc-name)%=c%) $@
|
||||
# Running ranlib after installing makes the __.SYMDEF time stamp up to
|
||||
@@ -585,40 +591,67 @@ install-lib.so := $(filter %.so,$(install-lib:%_pic.a=%.so))
|
||||
install-lib := $(filter-out %.so %_pic.a,$(install-lib))
|
||||
ifeq (yes,$(build-shared))
|
||||
|
||||
install-lib-nosubdir: $(install-lib.so:%=$(libdir)/%)
|
||||
install-lib-nosubdir: $(install-lib.so:%=$(inst_libdir)/%)
|
||||
|
||||
# Find which .so's have versions.
|
||||
versioned := $(strip $(foreach so,$(install-lib.so),\
|
||||
$(patsubst %,$(so),$($(so)-version))))
|
||||
|
||||
# Install all the unversioned shared libraries.
|
||||
$(addprefix $(libdir)/,$(filter-out $(versioned),$(install-lib.so))): \
|
||||
$(libdir)/%.so: $(objpfx)%.so; $(do-install-program)
|
||||
$(addprefix $(inst_slibdir)/, $(filter-out $(versioned),$(install-lib.so))): \
|
||||
$(inst_slibdir)/%.so: $(objpfx)%.so; $(do-install-program)
|
||||
|
||||
ifneq ($(findstring -s,$(LN_S)),)
|
||||
define make-link
|
||||
cd $(@D); rm -f $(@F).new; $(LN_S) $(<F) $(@F).new; mv -f $(@F).new $(@F)
|
||||
rm -f $@.new
|
||||
$(SHELL) $(..)rellns-sh $< $@.new
|
||||
mv -f $@.new $@
|
||||
endef
|
||||
else
|
||||
# If we have no symbolic links don't bother with rellns-sh.
|
||||
define make-link
|
||||
rm -f $@.new
|
||||
$(LN_S) $< $@.new
|
||||
mv -f $@.new $@
|
||||
endef
|
||||
endif
|
||||
|
||||
# XXX The following will have to be changed when `ldconfig' is available.
|
||||
ifneq (yes,$(cross-compiling))
|
||||
ifeq (yes,$(has-ldconfig))
|
||||
define make-shlib-link
|
||||
@:
|
||||
endef
|
||||
endif
|
||||
endif
|
||||
ifndef make-shlib-link
|
||||
define make-shlib-link
|
||||
$(make-link)
|
||||
endef
|
||||
endif
|
||||
|
||||
ifdef libc.so-version
|
||||
# For a library specified to be version N, install three files:
|
||||
# libc.so -> libc.so.N (e.g. libc.so.6)
|
||||
# libc.so.6 -> libc-VERSION.so (e.g. libc-1.10.so)
|
||||
|
||||
$(slibdir)/libc.so$(libc.so-version): $(slibdir)/libc-$(version).so
|
||||
$(make-link)
|
||||
$(slibdir)/libc-$(version).so: $(common-objpfx)libc.so; $(do-install-program)
|
||||
install: $(slibdir)/libc.so$(libc.so-version)
|
||||
$(inst_slibdir)/libc.so$(libc.so-version): $(inst_slibdir)/libc-$(version).so
|
||||
$(make-shlib-link)
|
||||
$(inst_slibdir)/libc-$(version).so: $(common-objpfx)libc.so
|
||||
$(do-install-program)
|
||||
install: $(inst_slibdir)/libc.so$(libc.so-version)
|
||||
|
||||
ifndef subdir
|
||||
# What we install as libc.so for programs to link against is in fact a
|
||||
# link script. It contains references for the various libraries we need.
|
||||
# The libc.so object is not complete since some functions are only defined
|
||||
# in libc.a and the dynamic linker is an etra object.
|
||||
install: $(libdir)/libc.so
|
||||
$(libdir)/libc.so: $(common-objpfx)libc.so$(libc.so-version) \
|
||||
$(elfobjdir)/$(rtld-installed-name) \
|
||||
$(common-objpfx)libc.a
|
||||
(echo '/* Use the shared library, but some functions are only in';\
|
||||
install: $(inst_libdir)/libc.so
|
||||
$(inst_libdir)/libc.so: $(common-objpfx)libc.so$(libc.so-version) \
|
||||
$(elfobjdir)/$(rtld-installed-name) \
|
||||
$(inst_libdir)/lib$(libc-name).a
|
||||
(echo '/* GNU ld script';\
|
||||
echo ' Use the shared library, but some functions are only in';\
|
||||
echo ' the static library, so try that secondarily.'; \
|
||||
echo ' The dynamic linker defines some functions used by $(<F),';\
|
||||
echo ' but ld uses definitions from libc.a before examining the';\
|
||||
@@ -629,8 +662,9 @@ $(libdir)/libc.so: $(common-objpfx)libc.so$(libc.so-version) \
|
||||
endif
|
||||
|
||||
else
|
||||
install: $(slibdir)/libc.so
|
||||
$(slibdir)/libc.so: $(common-objpfx)libc.so; $(do-install-program)
|
||||
install: $(inst_slibdir)/libc.so
|
||||
$(inst_slibdir)/libc.so: $(common-objpfx)libc.so
|
||||
$(do-install-program)
|
||||
endif
|
||||
|
||||
|
||||
@@ -638,7 +672,7 @@ ifneq (,$(versioned))
|
||||
# Produce three sets of rules as above for all the smaller versioned libraries.
|
||||
|
||||
define o-iterator-doit
|
||||
$(libdir)/$o: $(libdir)/$o$($o-version); $$(make-link)
|
||||
$(inst_libdir)/$o: $(inst_slibdir)/$o$($o-version); $$(make-link)
|
||||
endef
|
||||
object-suffixes-left := $(versioned)
|
||||
include $(o-iterator)
|
||||
@@ -654,26 +688,28 @@ include $(o-iterator)
|
||||
|
||||
ifeq (,$($(subdir)-version))
|
||||
define o-iterator-doit
|
||||
$(libdir)/$o$($o-version): $(libdir)/$(o:.so=)-$(version).so; $$(make-link)
|
||||
$(inst_slibdir)/$o$($o-version): $(inst_slibdir)/$(o:.so=)-$(version).so;
|
||||
$$(make-shlib-link)
|
||||
endef
|
||||
object-suffixes-left := $(versioned)
|
||||
include $(o-iterator)
|
||||
|
||||
define o-iterator-doit
|
||||
$(libdir)/$(o:.so=)-$(version).so: $(objpfx)$o; $$(do-install-program)
|
||||
$(inst_slibdir)/$(o:.so=)-$(version).so: $(objpfx)$o; $$(do-install-program)
|
||||
endef
|
||||
object-suffixes-left := $(versioned)
|
||||
include $(o-iterator)
|
||||
else
|
||||
define o-iterator-doit
|
||||
$(libdir)/$o$($o-version): $(libdir)/$(o:.so=)-$($(subdir)-version).so;
|
||||
$$(make-link)
|
||||
$(inst_slibdir)/$o$($o-version): \
|
||||
$(inst_slibdir)/$(o:.so=)-$($(subdir)-version).so;
|
||||
$$(make-shlib-link)
|
||||
endef
|
||||
object-suffixes-left := $(versioned)
|
||||
include $(o-iterator)
|
||||
|
||||
define o-iterator-doit
|
||||
$(libdir)/$(o:.so=)-$($(subdir)-version).so: $(objpfx)$o;
|
||||
$(inst_slibdir)/$(o:.so=)-$($(subdir)-version).so: $(objpfx)$o;
|
||||
$$(do-install-program)
|
||||
endef
|
||||
object-suffixes-left := $(versioned)
|
||||
@@ -689,54 +725,62 @@ endef
|
||||
|
||||
so-versions := $(sort $(foreach so,$(install-lib.so),.so$($(so)-version)))
|
||||
$(foreach v,$(so-versions),\
|
||||
$(libdir)/lib$(libprefix)%$v): $(common-objpfx)lib%.so
|
||||
$(inst_slibdir)/lib$(libprefix)%$v): $(common-objpfx)lib%.so
|
||||
$(do-install-so)
|
||||
$(foreach v,$(so-versions),\
|
||||
$(libdir)/$(libprefix)%$v): $(common-objpfx)%.so
|
||||
$(inst_slibdir)/$(libprefix)%$v): $(common-objpfx)%.so
|
||||
$(do-install-so)
|
||||
endif
|
||||
|
||||
ifdef install-bin
|
||||
$(addprefix $(bindir)/,$(install-bin)): $(bindir)/%: $(objpfx)%
|
||||
$(addprefix $(inst_bindir)/,$(install-bin)): $(inst_bindir)/%: $(objpfx)%
|
||||
$(do-install-program)
|
||||
endif
|
||||
ifdef install-rootsbin
|
||||
$(addprefix $(inst_rootsbindir)/,$(install-rootsbin)):
|
||||
$(inst_rootsbindir)/%: $(objpfx)%
|
||||
$(do-install-program)
|
||||
endif
|
||||
ifdef install-sbin
|
||||
$(addprefix $(sbindir)/,$(install-sbin)): $(sbindir)/%: $(objpfx)%
|
||||
$(addprefix $(inst_sbindir)/,$(install-sbin)): $(inst_sbindir)/%: $(objpfx)%
|
||||
$(do-install-program)
|
||||
endif
|
||||
ifdef install-lib
|
||||
install-lib.a := $(filter lib%.a,$(install-lib))
|
||||
install-lib-non.a := $(filter-out lib%.a,$(install-lib))
|
||||
ifdef install-lib-non.a
|
||||
$(addprefix $(libdir)/$(libprefix),$(install-lib-non.a)): \
|
||||
$(libdir)/$(libprefix)%: $(objpfx)%
|
||||
$(addprefix $(inst_libdir)/$(libprefix),$(install-lib-non.a)): \
|
||||
$(inst_libdir)/$(libprefix)%: $(objpfx)%
|
||||
$(do-install)
|
||||
endif
|
||||
ifdef install-lib.a
|
||||
$(install-lib.a:lib%.a=$(libdir)/lib$(libprefix)%.a): \
|
||||
$(libdir)/lib$(libprefix)%.a: $(objpfx)lib%.a
|
||||
$(install-lib.a:lib%.a=$(inst_libdir)/lib$(libprefix)%.a): \
|
||||
$(inst_libdir)/lib$(libprefix)%.a: $(objpfx)lib%.a
|
||||
$(do-install)
|
||||
$(patsubst %,$(RANLIB) $@,$(filter-out $(non-lib.a),$(<F)))
|
||||
endif
|
||||
endif
|
||||
ifdef install-data
|
||||
$(addprefix $(datadir)/,$(install-data)): $(datadir)/%: %;$(do-install)
|
||||
$(addprefix $(inst_datadir)/,$(install-data)): $(inst_datadir)/%: %;
|
||||
$(do-install)
|
||||
endif
|
||||
headers := $(strip $(headers))
|
||||
ifdef headers
|
||||
$(addprefix $(includedir)/,$(headers)): \
|
||||
$(includedir)/%: %;$(do-install)
|
||||
$(addprefix $(inst_includedir)/,$(headers)): $(inst_includedir)/%: %;
|
||||
$(do-install)
|
||||
endif # headers
|
||||
|
||||
.PHONY: install-bin-nosubdir install-sbin-nosubdir install-lib-nosubdir \
|
||||
install-data-nosubdir install-headers-nosubdir
|
||||
install-bin-nosubdir: $(addprefix $(bindir)/,$(install-bin))
|
||||
install-sbin-nosubdir: $(addprefix $(sbindir)/,$(install-sbin))
|
||||
install-lib-nosubdir: $(addprefix $(libdir)/,\
|
||||
.PHONY: install-bin-nosubdir install-rootsbin-nosubdir install-sbin-nosubdir \
|
||||
install-lib-nosubdir install-data-nosubdir install-headers-nosubdir
|
||||
install-bin-nosubdir: $(addprefix $(inst_bindir)/,$(install-bin))
|
||||
install-rootsbin-nosubdir: \
|
||||
$(addprefix $(inst_rootsbindir)/,$(install-rootsbin))
|
||||
install-sbin-nosubdir: $(addprefix $(inst_sbindir)/,$(install-sbin))
|
||||
install-lib-nosubdir: $(addprefix $(inst_libdir)/,\
|
||||
$(patsubst lib%.a,lib$(libprefix)%.a,$(install-lib.a)) \
|
||||
$(addprefix $(libprefix),$(install-lib-non.a)))
|
||||
install-data-nosubdir: $(addprefix $(datadir)/,$(install-data))
|
||||
install-headers-nosubdir: $(addprefix $(includedir)/,$(headers))
|
||||
install-data-nosubdir: $(addprefix $(inst_datadir)/,$(install-data))
|
||||
install-headers-nosubdir: $(addprefix $(inst_includedir)/,$(headers))
|
||||
install-others-nosubdir: $(install-others)
|
||||
|
||||
# We need all the `-nosubdir' targets so that `install' in the parent
|
||||
@@ -748,7 +792,8 @@ install-%:: install-%-nosubdir ;
|
||||
.PHONY: install install-no-libc.a-nosubdir
|
||||
install-no-libc.a-nosubdir: install-headers-nosubdir install-data-nosubdir\
|
||||
install-bin-nosubdir install-lib-nosubdir \
|
||||
install-others-nosubdir install-sbin-nosubdir
|
||||
install-others-nosubdir install-rootsbin-nosubdir \
|
||||
install-sbin-nosubdir
|
||||
install: install-no-libc.a-nosubdir
|
||||
|
||||
# Command to compile $< in $(objdir) using the native libraries.
|
||||
@@ -758,12 +803,14 @@ cwd=`pwd`; cd $(@D); $(BUILD_CC) $(BUILD_CFLAGS) \
|
||||
endef
|
||||
|
||||
# Command to compile $< in $(common-objdir) using the native libraries.
|
||||
# We must cd to $(objdir) anyway so that $(..)config.h is valid.
|
||||
define common-objdir-compile
|
||||
cd $(@D); $(BUILD_CC) $(BUILD_CFLAGS) $(<:$(common-objpfx)%=%) -o $(@F)
|
||||
cd $(objpfx).; \
|
||||
$(BUILD_CC) $(BUILD_CFLAGS) $(<:$(common-objpfx)%=$(..)%) -o $(..)$(@F)
|
||||
endef
|
||||
|
||||
# We always want to use configuration definitions.
|
||||
BUILD_CFLAGS = -include $(common-objpfx)config.h
|
||||
BUILD_CFLAGS = -include $(..)config.h
|
||||
|
||||
# Support the GNU standard name for this target.
|
||||
.PHONY: check
|
||||
@@ -805,6 +852,7 @@ endef
|
||||
# Also remove the dependencies and generated source files.
|
||||
common-clean: common-mostlyclean
|
||||
-rm -f $(addprefix $(objpfx),$(generated)) $(+depfiles)
|
||||
-rm -fr $(addprefix $(objpfx),$(generated-dirs))
|
||||
-rm -f $(addprefix $(common-objpfx),$(common-generated))
|
||||
-rm -f $(common-objpfx)distinfo-$(subdir)
|
||||
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
GNU C Library NEWS -- history of user-visible changes. 25 August 1996
|
||||
GNU C Library NEWS -- history of user-visible changes. 26 January 1997
|
||||
|
||||
Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
|
||||
Copyright (C) 1992, 93, 94, 95, 96, 97 Free Software Foundation, Inc.
|
||||
See the end for copying conditions.
|
||||
|
||||
Please send GNU C library bug reports to bug-glibc@prep.ai.mit.edu.
|
||||
Please send GNU C library bug reports using the `glibcbug' script to
|
||||
<bugs@gnu.ai.mit.edu>. Questions and suggestions should be send to
|
||||
<bug-glibc@prep.ai.mit.edu>.
|
||||
|
||||
Version 2.0
|
||||
|
||||
@@ -34,7 +36,9 @@ Version 2.0
|
||||
are enabled, the new library `-ldl' is available for arbitrary run-time
|
||||
loading of shared objects; its interface is defined in <dlfcn.h>. The
|
||||
new header file <link.h> gives access to the internals of the run-time
|
||||
dynamic linker, `ld.so'.
|
||||
dynamic linker, `ld.so'. The shell script `ldd' is similar to the
|
||||
application of same name on other systems and it provides information
|
||||
about dynamically linked binaries.
|
||||
|
||||
* The C library now provides the run-time support code for profiling
|
||||
executables compiled with `-pg'. Programs can control the profiling code
|
||||
@@ -43,18 +47,22 @@ Version 2.0
|
||||
the support for this file format was contributed by David Mosberger-Tang.
|
||||
|
||||
* The math code has been replaced with a math library based on fdlibm from
|
||||
Sun, and modified by JT Conklin with i387 support and by Ian Taylor with
|
||||
`float' functions. The math functions now reside in a separate library,
|
||||
so programs using them will need to use `-lm' their linking commands.
|
||||
Sun, and modified by JT Conklin and Ulrich Drepper with i387 support, by
|
||||
Ian Taylor with `float' functions and by Ulrich Drepper with `long double'
|
||||
functions. The math functions now reside in a separate library, so
|
||||
programs using them will need to use `-lm' their linking commands.
|
||||
|
||||
* John C. Bowman contributed optimized ix87 assembler inline functions.
|
||||
|
||||
* Ulrich Drepper has contributed support for an `/etc/nsswitch.conf'
|
||||
mechanism similar to that found in Solaris 2. This is now used for the
|
||||
group, passwd, hosts, networks, services, protocols, and rpc databases.
|
||||
The `nsswitch.conf' file controls what services are used for each
|
||||
individual database. This works by loading shared libraries with names
|
||||
specified in `nsswitch.conf', so service modules can be changed or added at
|
||||
any time without even relinking any program. A future release of the
|
||||
separate NYS package will provide NIS/YP and NIS+ modules for this interface.
|
||||
group, passwd, hosts, networks, services, protocols, rpc, ethers,
|
||||
shadow, netgroup, publickey, and alias databases. The `nsswitch.conf'
|
||||
file controls what services are used for each individual database. This
|
||||
works by loading shared libraries with names specified in `nsswitch.conf',
|
||||
so service modules can be changed or added at any time without even
|
||||
relinking any program. Currently there are the file, db, and NIS based
|
||||
NSS services available.
|
||||
|
||||
* The new functions `strtoq' and `strtouq' parse integer values from
|
||||
strings, like `strtol' and `strtoul', but they return `long long int' and
|
||||
@@ -69,13 +77,25 @@ Version 2.0
|
||||
`strtod', `strtof', and `strtold'. These new functions are perfectly
|
||||
accurate, and much faster than the old ones.
|
||||
|
||||
* The implementation of the POSIX locale model was completely rewritten by
|
||||
Ulrich Drepper. This includes the new programs `localedef' and `locale'
|
||||
to compile the POSIX locale definition.
|
||||
|
||||
* The former dummy implementations of the strcoll and strxfrm function are
|
||||
now replaced by fully functional code contributed by Ulrich Drepper. The
|
||||
collation information comes from the POSIX locale definitions.
|
||||
|
||||
* The new header <langinfo.h> defines an interface for accessing
|
||||
various locale-dependent data (using the locale chosen with `setlocale').
|
||||
|
||||
* Ulrich Drepper has contributed a new suite of functions for operation on
|
||||
wide-character and multibyte-character strings, in <wcstr.h> and <mbstr.h>;
|
||||
wide-character and multibyte-character strings, in <wchar.h>;
|
||||
and classification and case conversion of wide characters, in <wctype.h>.
|
||||
These new functions are intended to conform to the ISO C specification.
|
||||
These new functions are conforming to the ISO C, Amendement 1 specification.
|
||||
|
||||
* There is now a second implementation of the standard I/O library available.
|
||||
It comes from GNU libg++ as was written by Per Bothner, heavily modified
|
||||
by Hongjiu Lu and made thread safe by Ulrich Drepper.
|
||||
|
||||
* You can now use positional parameter specifications in format strings
|
||||
for the `printf' and `scanf' families of functions. For example,
|
||||
@@ -104,7 +124,9 @@ Version 2.0
|
||||
* The new header file <fts.h> and suite of functions simplify programs that
|
||||
operate on directory trees. This code comes from 4.4 BSD.
|
||||
|
||||
* The resolver code has been updated from the BIND 4.9.5-T4B release.
|
||||
* The resolver code has been updated from the BIND 4.9.5-P1 release.
|
||||
Parts of the code were heavily modified by Ulrich Drepper to fit in the
|
||||
NSS scheme used in glibc.
|
||||
|
||||
* The new function `malloc_find_object_address' finds the starting address
|
||||
of a malloc'd block, given any address within the block;
|
||||
@@ -132,7 +154,9 @@ Version 2.0
|
||||
|
||||
* The new functions `ecvt', `fcvt', and `gcvt' provide an obsolete interface
|
||||
for formatting floating-point numbers. They are provided only for
|
||||
compatibility; new programs should use `sprintf' instead.
|
||||
compatibility; new programs should use `sprintf' instead. There are
|
||||
also equivalent function for the `long double' floating-point type and
|
||||
all functions also exist in a reentrant form.
|
||||
|
||||
* The new auxiliary library `-lutil' from 4.4 BSD contains various
|
||||
functions for maintaining the login-record files (primarily of use to
|
||||
@@ -156,13 +180,17 @@ Version 2.0
|
||||
|
||||
* Ulrich Drepper has updated the Linux-specific code, based largely
|
||||
on work done in Hongjiu Lu's version of GNU libc for Linux.
|
||||
The GNU library now supports Linux versions 1.3.29 and later,
|
||||
using the ELF object file format (i[345]86-*-linux).
|
||||
The GNU library now supports Linux versions 2.0.10 and later,
|
||||
using the ELF object file format (i[3456]86-*-linux).
|
||||
|
||||
* Andreas Schwab has ported the C library to Linux/m68k (m68k-*-linux).
|
||||
|
||||
* David Mosberger-Tang has ported the C library to Linux/Alpha (alpha-*-linux).
|
||||
Richard Henderson contributed the dynamic linking support for ELF/Alpha.
|
||||
* David Mosberger-Tang and Richard Henderson have ported the C library
|
||||
to Linux/Alpha (alpha-*-linux). Richard Henderson contributed the
|
||||
dynamic linking support for ELF/Alpha.
|
||||
|
||||
* Richard Henderson contributed several Alpha optimized assembler function
|
||||
for arithmetic and string handling.
|
||||
|
||||
* Ulrich Drepper has contributed a new set of message catalog functions to
|
||||
support multiple languages using the <libintl.h> interface, for use with
|
||||
@@ -190,7 +218,7 @@ Version 2.0
|
||||
`struct sockaddr *' type, does not generate a type-clash warning.
|
||||
|
||||
* New function `error' declared in header file <error.h> is a convenient
|
||||
function for printing error messages and optionally exitting; this is the
|
||||
function for printing error messages and optionally exiting; this is the
|
||||
canonical function used in GNU programs. The new functions `err', `warn',
|
||||
and friends in header file <err.h> are the canonical 4.4 BSD interface for
|
||||
doing the same thing.
|
||||
@@ -199,20 +227,23 @@ Version 2.0
|
||||
POSIX.2 `glob' function to do ~ and {...} expansion.
|
||||
|
||||
* New function `unsetenv' complements `setenv' for compatibility with 4.4 BSD.
|
||||
`clearenv' which is used in POSIX.9 is also available.
|
||||
|
||||
* New function `getsid' returns session ID number on systems that support it.
|
||||
|
||||
* We have incorporated the 4.4 BSD `db' library (version 1.85). New header
|
||||
files <db.h> and <mpool.h> provide a rich set of functions for several
|
||||
types of simple databases stored in memory and in files, and <ndbm.h> is
|
||||
an old `ndbm'-compatbile interface using the `db' functions. Link with
|
||||
an old `ndbm'-compatible interface using the `db' functions. Link with
|
||||
`-ldb' to get these functions.
|
||||
|
||||
* New macro `strdupa' copies a string like `strdup', but uses local stack
|
||||
space from `alloca' instead of dynamic heap space from `malloc'.
|
||||
|
||||
* New function `strnlen' is like `strlen' but searches only a given maximum
|
||||
number of characters for the null terminator.
|
||||
number of characters for the null terminator. `stpncpy', `strndup' and
|
||||
`strndupa' are similar variants for the `stpcpy', `strdup' and `strdupa'
|
||||
function.
|
||||
|
||||
* New function `statfs' in header <sys/statfs.h>.
|
||||
|
||||
@@ -222,6 +253,46 @@ Version 2.0
|
||||
|
||||
* A new suite of functions in <utmp.h> handle all the details of reading
|
||||
and writing the utmp file.
|
||||
|
||||
* An implementation of the NIS/YP(tm) based NSS service was contributed by
|
||||
Thorsten Kukuk.
|
||||
|
||||
* Paul Eggert and Ulrich Drepper modified the `strftime' function to be
|
||||
completely POSIX compliant and also implemented the extended functionality
|
||||
to handle alternate digit representation and alternate era date formats.
|
||||
|
||||
* Ulrich Drepper provided an implementation of the `strptime' function
|
||||
defined in XPG4.2 which transforms a string into a `struct tm' value.
|
||||
|
||||
* Paul Eggert provided the tzselect shell script as part of the timezone
|
||||
code. The shell script makes it easy to select the correct timezone
|
||||
specification.
|
||||
|
||||
* The implementation of the malloc family of functions is completely replaced
|
||||
by a new implementation by Doug Lea with many improvements by Wolfram Gloger.
|
||||
The implementation uses the mmap function (if available) and it is
|
||||
optimized for the use in multi threaded programs.
|
||||
|
||||
* Ulrich Drepper contributed a MD5 "encryption" for the crypt family of
|
||||
functions. This new functionality is usable by specifying a special
|
||||
salt string and it is compatible with implementation on *BSD systems.
|
||||
|
||||
* Lots of functions from the XPG4.2 standard were added by Ulrich Drepper:
|
||||
`getsubopt' to handle second level command line options, `bsd_signal'
|
||||
to access BSD style `signal' functionality, the obsolete `regexp' style
|
||||
expression matcher.
|
||||
|
||||
* the `lchown' function is available on system which support this
|
||||
functionality.
|
||||
|
||||
* The implementation of the shadow password handling function was contributed
|
||||
by Ulrich Drepper.
|
||||
|
||||
* David Mosberger-Tang changed the SunRPC implementation to be 64bit safe.
|
||||
|
||||
* POSIX.1g support was added. The <sys/select.h> header is available,
|
||||
`isfdtype' and `pselect' are implemented. Craig Metz contributed an
|
||||
implementation of `getaddrinfo'.
|
||||
|
||||
Version 1.09
|
||||
|
||||
|
||||
@@ -53,12 +53,26 @@ self-contained way.
|
||||
|
||||
- Macro: _SVID_SOURCE
|
||||
If you define this macro, functionality derived from SVID is
|
||||
included as well as the ANSI C, POSIX.1, and POSIX.2 material.
|
||||
included as well as the ANSI C, POSIX.1, POSIX.2, and X/Open
|
||||
material.
|
||||
|
||||
- Macro: _XOPEN_SOURCE
|
||||
If you define these macro, functionality described in the X/Open
|
||||
Portability Guide is included. This is an superset of the POSIX.1
|
||||
and POSIX.2 functionality and in fact `_POSIX_SOURCE' and
|
||||
`_POSIX_C_SOURCE' get automatically be defined.
|
||||
|
||||
But as the great unifaction of all Unices there is also
|
||||
functionality only available in BSD and SVID is included.
|
||||
|
||||
If the macro `_XOPEN_SOURCE_EXTENDED' is also defined, even more
|
||||
functionality is available. The extra functions will make all
|
||||
functions available which are necessary for the X/Open Unix brand.
|
||||
|
||||
- Macro: _GNU_SOURCE
|
||||
If you define this macro, everything is included: ANSI C, POSIX.1,
|
||||
POSIX.2, BSD, SVID, and GNU extensions. In the cases where POSIX.1
|
||||
conflicts with BSD, the POSIX definitions take precedence.
|
||||
POSIX.2, BSD, SVID, X/Open, and GNU extensions. In the cases where
|
||||
POSIX.1 conflicts with BSD, the POSIX definitions take precedence.
|
||||
|
||||
If you want to get the full effect of `_GNU_SOURCE' but make the
|
||||
BSD definitions take precedence over the POSIX definitions, use
|
||||
@@ -73,9 +87,23 @@ self-contained way.
|
||||
compiler or linker. *Note:* If you forget to do this, you may get
|
||||
very strange errors at run time.
|
||||
|
||||
- Macro: _REENTRANT,_THREAD_SAFE
|
||||
If you define one this macro, 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
|
||||
or are unique to GNU libc. The problem is that the
|
||||
standardization of the thread safe C library interface still is
|
||||
behind.
|
||||
|
||||
Unlike on some other systems no special version of the C library
|
||||
must be used for linking. There is only one version but while
|
||||
compiling this it must have been specified to compile as thread
|
||||
safe.
|
||||
|
||||
We recommend you use `_GNU_SOURCE' in new programs. If you don't
|
||||
specify the `-ansi' option to GCC and don't define any of these macros
|
||||
explicitly, the effect is the same as defining `_GNU_SOURCE'.
|
||||
explicitly, the effect is the same as defining `_POSIX_C_SOURCE' to 2
|
||||
and `_POSIX_SOURCE', `_SVID_SOURCE', and `_BSD_SOURCE' to 1.
|
||||
|
||||
When you define a feature test macro to request a larger class of
|
||||
features, it is harmless to define in addition a feature test macro for
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Open jobs for finishing GNU libc:
|
||||
---------------------------------
|
||||
Status: August 1996
|
||||
Status: January 1997
|
||||
|
||||
If you have time and talent to take over any of the jobs below please
|
||||
contact <bug-glibc@prep.ai.mit.edu>
|
||||
@@ -10,6 +10,8 @@ contact <bug-glibc@prep.ai.mit.edu>
|
||||
[ 1] Port to new platforms or test current version on formerly supported
|
||||
platforms.
|
||||
|
||||
**** See http://www.gnu.org/software/libc/porting.html for more details.
|
||||
|
||||
|
||||
[ 2] Test compliance with standards. If you have access to recent
|
||||
standards (IEEE, ISO, ANSI, X/Open, ...) and/or test suites you
|
||||
@@ -26,11 +28,13 @@ contact <bug-glibc@prep.ai.mit.edu>
|
||||
for the current status (of course better use a mirror of prep).
|
||||
|
||||
|
||||
[ 4] Write wordexp() function; this is described in POSIX.2, The
|
||||
[ 4] Write wordexp() function; this is described in POSIX.2, the
|
||||
header <wordexp.h> already exists.
|
||||
|
||||
Implementation idea: use some functions from bash.
|
||||
|
||||
**** Somebody is working on this. Help may or may not be appreciated.
|
||||
|
||||
|
||||
[ 5] Write `long double' versions of the math functions. This should be
|
||||
done in collaboration with the NetBSD and FreeBSD people.
|
||||
@@ -51,9 +55,9 @@ contact <bug-glibc@prep.ai.mit.edu>
|
||||
Henry Spencer, University of Toronto
|
||||
Usenix Winter '92, pp. 419--428
|
||||
|
||||
or just ask. Currently mostly i?86 optimized versions exist.
|
||||
Alpha versions are on their way, so please ask before working
|
||||
on this.
|
||||
or just ask. Currently mostly i?86 and Alpha optimized versions
|
||||
exist. Please ask before working on this to avoid duplicate
|
||||
work.
|
||||
|
||||
|
||||
[ 7] Write nftw() function. Perhaps it might be good to reimplement the
|
||||
@@ -67,22 +71,31 @@ contact <bug-glibc@prep.ai.mit.edu>
|
||||
There is a public domain version but using this would cause problems
|
||||
with the assignment.
|
||||
|
||||
[ 9] Extend regex and/or rx to work with wide characters.
|
||||
|
||||
[ 9] Extend regex and/or rx to work with wide characters and complete
|
||||
implementation of character class and collation class handling.
|
||||
|
||||
It is planed to do a complete rewrite.
|
||||
|
||||
|
||||
[10] Add mmap() support to malloc().
|
||||
Doug Lea's malloc implementation might give some ideas. Perhaps
|
||||
switching completly to his implementation is an option if it
|
||||
a) can work without mmap() support (not all system GNU libc
|
||||
is running on have mmap)
|
||||
b) is without mmap support at least as fast as the current
|
||||
implementation
|
||||
c) will be extended with the current hooks and additional functions
|
||||
|
||||
Please contact bug-glibc@prep.ai.mit.edu before starting to avoid
|
||||
duplicated work.
|
||||
|
||||
[11] Write access function for netmasks, bootparams, publickey, automount,
|
||||
and aliases databases for nss_files and nss_db module.
|
||||
[10] Write access function for netmasks, bootparams, and automount
|
||||
databases for nss_files and nss_db module.
|
||||
The functions should be embedded in the nss scheme. This is not
|
||||
hard and not all services must be supported at once.
|
||||
|
||||
|
||||
[11] Rewrite utmp/wtmp functions to use database functions. This is much
|
||||
better than the normal flat file format.
|
||||
|
||||
**** There are plans for a new approach to this problem. Please contact
|
||||
bug-glibc@prep.ai.mit.edu before starting to work.)
|
||||
|
||||
|
||||
[12] Several more or less small functions have to be written:
|
||||
|
||||
+ tcgetid() and waitid() from XPG4.2
|
||||
+ grantpt(), ptsname(), unlockpt() from XPG4.2
|
||||
+ getdate() from XPG4.2
|
||||
+ fmtmsg() from SVID
|
||||
|
||||
More information are available on request.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
This directory contains the version 1.94 test release of the GNU C Library.
|
||||
This directory contains the version 2.0.1 test release of the GNU C Library.
|
||||
Many bugs have been fixed since the last release.
|
||||
Some bugs surely remain.
|
||||
|
||||
@@ -6,9 +6,9 @@ As of this release, the GNU C library is known to run on the following
|
||||
configurations:
|
||||
|
||||
*-*-gnu GNU Hurd
|
||||
i[3456]86-*-linux Linux-2.0 on Intel
|
||||
m68k-*-linux Linux-2.0 on Motorola 680x0
|
||||
alpha-*-linux Linux-2.0 on DEC Alpha
|
||||
i[3456]86-*-linux-gnu Linux-2.0 on Intel
|
||||
m68k-*-linux-gnu Linux-2.0 on Motorola 680x0
|
||||
alpha-*-linux-gnu Linux-2.0 on DEC Alpha
|
||||
|
||||
|
||||
Former releases of this library (version 1.09.1 and perhaps earlier
|
||||
@@ -39,38 +39,50 @@ versions) used to run on the following configurations:
|
||||
Whether this is still true for this release is unknown. Porting the
|
||||
library is not hard. If you are interested in doing a port, please
|
||||
get on the mailing list by sending electronic mail to
|
||||
bug-glibc-request@prep.ai.mit.edu.
|
||||
<bug-glibc-request@prep.ai.mit.edu>.
|
||||
|
||||
The GNU C library now includes Michael Glad's Ultra Fast Crypt, which
|
||||
provides the Unix `crypt' function, plus some other entry points.
|
||||
Because of the United States export restriction on DES implementations,
|
||||
we are distributing this code separately from the rest of the C
|
||||
library. There is an extra distribution tar file just for crypt; it is
|
||||
called `glibc-1.94-crypt.tar.gz'. You can just unpack the crypt
|
||||
called `glibc-crypt-2.0.1.tar.gz'. You can just unpack the crypt
|
||||
distribution along with the rest of the C library and build; you can
|
||||
also build the library without getting crypt. Users outside the USA
|
||||
can get the crypt distribution via anonymous FTP from ftp.uni-c.dk
|
||||
[129.142.6.74], or another archive site outside the USA. Archive
|
||||
can get the crypt distribution via anonymous FTP from ftp.ifi.uio.no
|
||||
[129.240.64.21], or another archive site outside the USA. Archive
|
||||
maintainers are encouraged to copy this distribution to their archives
|
||||
outside the USA. Please get it from ftp.uni-c.dk; transferring this
|
||||
outside the USA. Please get it from ftp.ifi.uio.no; transferring this
|
||||
distribution from prep.ai.mit.edu (or any other site in the USA) to a
|
||||
site outside the USA is in violation of US export laws.
|
||||
|
||||
Beside the separate crypt tar file there are some more 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.
|
||||
|
||||
See the file INSTALL to find out how to configure, build, install, and port
|
||||
the GNU C library.
|
||||
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 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@prep.ai.mit.edu, and
|
||||
send comments on the manual to <bug-glibc-manual@prep.ai.mit.edu>, 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
|
||||
facilities you want it to make available.
|
||||
|
||||
Send bug reports to bug-glibc@prep.ai.mit.edu.
|
||||
We prefer to get bug reports sent using the `glibcbug' shell script which
|
||||
is install together with the rest of the GNU libc to <bugs@gnu.ai.mit.edu>.
|
||||
Simply run this shell script and fill in the information. Nevertheless
|
||||
you can still send bug reports to <bug-glibc@prep.ai.mit.edu> as normal
|
||||
electronic mails.
|
||||
|
||||
The GNU C Library is free software. See the file COPYING.LIB for copying
|
||||
conditions.
|
||||
|
||||
+827
-1
@@ -4,7 +4,6 @@ function have to be written:
|
||||
e_acosl.c
|
||||
e_asinl.c
|
||||
e_atan2l.c
|
||||
e_acoshl.c
|
||||
e_expl.c
|
||||
e_fmodl.c
|
||||
e_hypotl.c
|
||||
@@ -28,3 +27,830 @@ s_atanl.c
|
||||
s_erfl.c
|
||||
s_expm1l.c
|
||||
s_log1pl.c
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Methods
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
arcsin
|
||||
~~~~~~
|
||||
* Since asin(x) = x + x^3/6 + x^5*3/40 + x^7*15/336 + ...
|
||||
* we approximate asin(x) on [0,0.5] by
|
||||
* asin(x) = x + x*x^2*R(x^2)
|
||||
* where
|
||||
* R(x^2) is a rational approximation of (asin(x)-x)/x^3
|
||||
* and its remez error is bounded by
|
||||
* |(asin(x)-x)/x^3 - R(x^2)| < 2^(-58.75)
|
||||
*
|
||||
* For x in [0.5,1]
|
||||
* asin(x) = pi/2-2*asin(sqrt((1-x)/2))
|
||||
* Let y = (1-x), z = y/2, s := sqrt(z), and pio2_hi+pio2_lo=pi/2;
|
||||
* then for x>0.98
|
||||
* asin(x) = pi/2 - 2*(s+s*z*R(z))
|
||||
* = pio2_hi - (2*(s+s*z*R(z)) - pio2_lo)
|
||||
* For x<=0.98, let pio4_hi = pio2_hi/2, then
|
||||
* f = hi part of s;
|
||||
* c = sqrt(z) - f = (z-f*f)/(s+f) ...f+c=sqrt(z)
|
||||
* and
|
||||
* asin(x) = pi/2 - 2*(s+s*z*R(z))
|
||||
* = pio4_hi+(pio4-2s)-(2s*z*R(z)-pio2_lo)
|
||||
* = pio4_hi+(pio4-2f)-(2s*z*R(z)-(pio2_lo+2c))
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
arccos
|
||||
~~~~~~
|
||||
* Method :
|
||||
* acos(x) = pi/2 - asin(x)
|
||||
* acos(-x) = pi/2 + asin(x)
|
||||
* For |x|<=0.5
|
||||
* acos(x) = pi/2 - (x + x*x^2*R(x^2)) (see asin.c)
|
||||
* For x>0.5
|
||||
* acos(x) = pi/2 - (pi/2 - 2asin(sqrt((1-x)/2)))
|
||||
* = 2asin(sqrt((1-x)/2))
|
||||
* = 2s + 2s*z*R(z) ...z=(1-x)/2, s=sqrt(z)
|
||||
* = 2f + (2c + 2s*z*R(z))
|
||||
* where f=hi part of s, and c = (z-f*f)/(s+f) is the correction term
|
||||
* for f so that f+c ~ sqrt(z).
|
||||
* For x<-0.5
|
||||
* acos(x) = pi - 2asin(sqrt((1-|x|)/2))
|
||||
* = pi - 0.5*(s+s*z*R(z)), where z=(1-|x|)/2,s=sqrt(z)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
atan2
|
||||
~~~~~
|
||||
* Method :
|
||||
* 1. Reduce y to positive by atan2(y,x)=-atan2(-y,x).
|
||||
* 2. Reduce x to positive by (if x and y are unexceptional):
|
||||
* ARG (x+iy) = arctan(y/x) ... if x > 0,
|
||||
* ARG (x+iy) = pi - arctan[y/(-x)] ... if x < 0,
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
atan
|
||||
~~~~
|
||||
* Method
|
||||
* 1. Reduce x to positive by atan(x) = -atan(-x).
|
||||
* 2. According to the integer k=4t+0.25 chopped, t=x, the argument
|
||||
* is further reduced to one of the following intervals and the
|
||||
* arctangent of t is evaluated by the corresponding formula:
|
||||
*
|
||||
* [0,7/16] atan(x) = t-t^3*(a1+t^2*(a2+...(a10+t^2*a11)...)
|
||||
* [7/16,11/16] atan(x) = atan(1/2) + atan( (t-0.5)/(1+t/2) )
|
||||
* [11/16.19/16] atan(x) = atan( 1 ) + atan( (t-1)/(1+t) )
|
||||
* [19/16,39/16] atan(x) = atan(3/2) + atan( (t-1.5)/(1+1.5t) )
|
||||
* [39/16,INF] atan(x) = atan(INF) + atan( -1/t )
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
exp
|
||||
~~~
|
||||
* Method
|
||||
* 1. Argument reduction:
|
||||
* Reduce x to an r so that |r| <= 0.5*ln2 ~ 0.34658.
|
||||
* Given x, find r and integer k such that
|
||||
*
|
||||
* x = k*ln2 + r, |r| <= 0.5*ln2.
|
||||
*
|
||||
* Here r will be represented as r = hi-lo for better
|
||||
* accuracy.
|
||||
*
|
||||
* 2. Approximation of exp(r) by a special rational function on
|
||||
* the interval [0,0.34658]:
|
||||
* Write
|
||||
* R(r**2) = r*(exp(r)+1)/(exp(r)-1) = 2 + r*r/6 - r**4/360 + ...
|
||||
* We use a special Reme algorithm on [0,0.34658] to generate
|
||||
* a polynomial of degree 5 to approximate R. The maximum error
|
||||
* of this polynomial approximation is bounded by 2**-59. In
|
||||
* other words,
|
||||
* R(z) ~ 2.0 + P1*z + P2*z**2 + P3*z**3 + P4*z**4 + P5*z**5
|
||||
* (where z=r*r, and the values of P1 to P5 are listed below)
|
||||
* and
|
||||
* | 5 | -59
|
||||
* | 2.0+P1*z+...+P5*z - R(z) | <= 2
|
||||
* | |
|
||||
* The computation of exp(r) thus becomes
|
||||
* 2*r
|
||||
* exp(r) = 1 + -------
|
||||
* R - r
|
||||
* r*R1(r)
|
||||
* = 1 + r + ----------- (for better accuracy)
|
||||
* 2 - R1(r)
|
||||
* where
|
||||
* 2 4 10
|
||||
* R1(r) = r - (P1*r + P2*r + ... + P5*r ).
|
||||
*
|
||||
* 3. Scale back to obtain exp(x):
|
||||
* From step 1, we have
|
||||
* exp(x) = 2^k * exp(r)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
hypot
|
||||
~~~~~
|
||||
* If (assume round-to-nearest) z=x*x+y*y
|
||||
* has error less than sqrt(2)/2 ulp, than
|
||||
* sqrt(z) has error less than 1 ulp (exercise).
|
||||
*
|
||||
* So, compute sqrt(x*x+y*y) with some care as
|
||||
* follows to get the error below 1 ulp:
|
||||
*
|
||||
* Assume x>y>0;
|
||||
* (if possible, set rounding to round-to-nearest)
|
||||
* 1. if x > 2y use
|
||||
* x1*x1+(y*y+(x2*(x+x1))) for x*x+y*y
|
||||
* where x1 = x with lower 32 bits cleared, x2 = x-x1; else
|
||||
* 2. if x <= 2y use
|
||||
* t1*y1+((x-y)*(x-y)+(t1*y2+t2*y))
|
||||
* where t1 = 2x with lower 32 bits cleared, t2 = 2x-t1,
|
||||
* y1= y with lower 32 bits chopped, y2 = y-y1.
|
||||
*
|
||||
* NOTE: scaling may be necessary if some argument is too
|
||||
* large or too tiny
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
j0/y0
|
||||
~~~~~
|
||||
* Method -- j0(x):
|
||||
* 1. For tiny x, we use j0(x) = 1 - x^2/4 + x^4/64 - ...
|
||||
* 2. Reduce x to |x| since j0(x)=j0(-x), and
|
||||
* for x in (0,2)
|
||||
* j0(x) = 1-z/4+ z^2*R0/S0, where z = x*x;
|
||||
* (precision: |j0-1+z/4-z^2R0/S0 |<2**-63.67 )
|
||||
* for x in (2,inf)
|
||||
* j0(x) = sqrt(2/(pi*x))*(p0(x)*cos(x0)-q0(x)*sin(x0))
|
||||
* where x0 = x-pi/4. It is better to compute sin(x0),cos(x0)
|
||||
* as follow:
|
||||
* cos(x0) = cos(x)cos(pi/4)+sin(x)sin(pi/4)
|
||||
* = 1/sqrt(2) * (cos(x) + sin(x))
|
||||
* sin(x0) = sin(x)cos(pi/4)-cos(x)sin(pi/4)
|
||||
* = 1/sqrt(2) * (sin(x) - cos(x))
|
||||
* (To avoid cancellation, use
|
||||
* sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x))
|
||||
* to compute the worse one.)
|
||||
*
|
||||
* Method -- y0(x):
|
||||
* 1. For x<2.
|
||||
* Since
|
||||
* y0(x) = 2/pi*(j0(x)*(ln(x/2)+Euler) + x^2/4 - ...)
|
||||
* therefore y0(x)-2/pi*j0(x)*ln(x) is an even function.
|
||||
* We use the following function to approximate y0,
|
||||
* y0(x) = U(z)/V(z) + (2/pi)*(j0(x)*ln(x)), z= x^2
|
||||
* where
|
||||
* U(z) = u00 + u01*z + ... + u06*z^6
|
||||
* V(z) = 1 + v01*z + ... + v04*z^4
|
||||
* with absolute approximation error bounded by 2**-72.
|
||||
* Note: For tiny x, U/V = u0 and j0(x)~1, hence
|
||||
* y0(tiny) = u0 + (2/pi)*ln(tiny), (choose tiny<2**-27)
|
||||
* 2. For x>=2.
|
||||
* y0(x) = sqrt(2/(pi*x))*(p0(x)*cos(x0)+q0(x)*sin(x0))
|
||||
* where x0 = x-pi/4. It is better to compute sin(x0),cos(x0)
|
||||
* by the method mentioned above.
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
j1/y1
|
||||
~~~~~
|
||||
* Method -- j1(x):
|
||||
* 1. For tiny x, we use j1(x) = x/2 - x^3/16 + x^5/384 - ...
|
||||
* 2. Reduce x to |x| since j1(x)=-j1(-x), and
|
||||
* for x in (0,2)
|
||||
* j1(x) = x/2 + x*z*R0/S0, where z = x*x;
|
||||
* (precision: |j1/x - 1/2 - R0/S0 |<2**-61.51 )
|
||||
* for x in (2,inf)
|
||||
* j1(x) = sqrt(2/(pi*x))*(p1(x)*cos(x1)-q1(x)*sin(x1))
|
||||
* y1(x) = sqrt(2/(pi*x))*(p1(x)*sin(x1)+q1(x)*cos(x1))
|
||||
* where x1 = x-3*pi/4. It is better to compute sin(x1),cos(x1)
|
||||
* as follow:
|
||||
* cos(x1) = cos(x)cos(3pi/4)+sin(x)sin(3pi/4)
|
||||
* = 1/sqrt(2) * (sin(x) - cos(x))
|
||||
* sin(x1) = sin(x)cos(3pi/4)-cos(x)sin(3pi/4)
|
||||
* = -1/sqrt(2) * (sin(x) + cos(x))
|
||||
* (To avoid cancellation, use
|
||||
* sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x))
|
||||
* to compute the worse one.)
|
||||
*
|
||||
* Method -- y1(x):
|
||||
* 1. screen out x<=0 cases: y1(0)=-inf, y1(x<0)=NaN
|
||||
* 2. For x<2.
|
||||
* Since
|
||||
* y1(x) = 2/pi*(j1(x)*(ln(x/2)+Euler)-1/x-x/2+5/64*x^3-...)
|
||||
* therefore y1(x)-2/pi*j1(x)*ln(x)-1/x is an odd function.
|
||||
* We use the following function to approximate y1,
|
||||
* y1(x) = x*U(z)/V(z) + (2/pi)*(j1(x)*ln(x)-1/x), z= x^2
|
||||
* where for x in [0,2] (abs err less than 2**-65.89)
|
||||
* U(z) = U0[0] + U0[1]*z + ... + U0[4]*z^4
|
||||
* V(z) = 1 + v0[0]*z + ... + v0[4]*z^5
|
||||
* Note: For tiny x, 1/x dominate y1 and hence
|
||||
* y1(tiny) = -2/pi/tiny, (choose tiny<2**-54)
|
||||
* 3. For x>=2.
|
||||
* y1(x) = sqrt(2/(pi*x))*(p1(x)*sin(x1)+q1(x)*cos(x1))
|
||||
* where x1 = x-3*pi/4. It is better to compute sin(x1),cos(x1)
|
||||
* by method mentioned above.
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
jn/yn
|
||||
~~~~~
|
||||
* Note 2. About jn(n,x), yn(n,x)
|
||||
* For n=0, j0(x) is called,
|
||||
* for n=1, j1(x) is called,
|
||||
* for n<x, forward recursion us used starting
|
||||
* from values of j0(x) and j1(x).
|
||||
* for n>x, a continued fraction approximation to
|
||||
* j(n,x)/j(n-1,x) is evaluated and then backward
|
||||
* recursion is used starting from a supposed value
|
||||
* for j(n,x). The resulting value of j(0,x) is
|
||||
* compared with the actual value to correct the
|
||||
* supposed value of j(n,x).
|
||||
*
|
||||
* yn(n,x) is similar in all respects, except
|
||||
* that forward recursion is used for all
|
||||
* values of n>1.
|
||||
|
||||
jn:
|
||||
/* (x >> n**2)
|
||||
* Jn(x) = cos(x-(2n+1)*pi/4)*sqrt(2/x*pi)
|
||||
* Yn(x) = sin(x-(2n+1)*pi/4)*sqrt(2/x*pi)
|
||||
* Let s=sin(x), c=cos(x),
|
||||
* xn=x-(2n+1)*pi/4, sqt2 = sqrt(2),then
|
||||
*
|
||||
* n sin(xn)*sqt2 cos(xn)*sqt2
|
||||
* ----------------------------------
|
||||
* 0 s-c c+s
|
||||
* 1 -s-c -c+s
|
||||
* 2 -s+c -c-s
|
||||
* 3 s+c c-s
|
||||
...
|
||||
/* x is tiny, return the first Taylor expansion of J(n,x)
|
||||
* J(n,x) = 1/n!*(x/2)^n - ...
|
||||
...
|
||||
/* use backward recurrence */
|
||||
/* x x^2 x^2
|
||||
* J(n,x)/J(n-1,x) = ---- ------ ------ .....
|
||||
* 2n - 2(n+1) - 2(n+2)
|
||||
*
|
||||
* 1 1 1
|
||||
* (for large x) = ---- ------ ------ .....
|
||||
* 2n 2(n+1) 2(n+2)
|
||||
* -- - ------ - ------ -
|
||||
* x x x
|
||||
*
|
||||
* Let w = 2n/x and h=2/x, then the above quotient
|
||||
* is equal to the continued fraction:
|
||||
* 1
|
||||
* = -----------------------
|
||||
* 1
|
||||
* w - -----------------
|
||||
* 1
|
||||
* w+h - ---------
|
||||
* w+2h - ...
|
||||
*
|
||||
* To determine how many terms needed, let
|
||||
* Q(0) = w, Q(1) = w(w+h) - 1,
|
||||
* Q(k) = (w+k*h)*Q(k-1) - Q(k-2),
|
||||
* When Q(k) > 1e4 good for single
|
||||
* When Q(k) > 1e9 good for double
|
||||
* When Q(k) > 1e17 good for quadruple
|
||||
|
||||
...
|
||||
/* estimate log((2/x)^n*n!) = n*log(2/x)+n*ln(n)
|
||||
* Hence, if n*(log(2n/x)) > ...
|
||||
* single 8.8722839355e+01
|
||||
* double 7.09782712893383973096e+02
|
||||
* long double 1.1356523406294143949491931077970765006170e+04
|
||||
* then recurrent value may overflow and the result is
|
||||
* likely underflow to zero
|
||||
|
||||
yn:
|
||||
/* (x >> n**2)
|
||||
* Jn(x) = cos(x-(2n+1)*pi/4)*sqrt(2/x*pi)
|
||||
* Yn(x) = sin(x-(2n+1)*pi/4)*sqrt(2/x*pi)
|
||||
* Let s=sin(x), c=cos(x),
|
||||
* xn=x-(2n+1)*pi/4, sqt2 = sqrt(2),then
|
||||
*
|
||||
* n sin(xn)*sqt2 cos(xn)*sqt2
|
||||
* ----------------------------------
|
||||
* 0 s-c c+s
|
||||
* 1 -s-c -c+s
|
||||
* 2 -s+c -c-s
|
||||
* 3 s+c c-s
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
lgamma
|
||||
~~~~~~
|
||||
* Method:
|
||||
* 1. Argument Reduction for 0 < x <= 8
|
||||
* Since gamma(1+s)=s*gamma(s), for x in [0,8], we may
|
||||
* reduce x to a number in [1.5,2.5] by
|
||||
* lgamma(1+s) = log(s) + lgamma(s)
|
||||
* for example,
|
||||
* lgamma(7.3) = log(6.3) + lgamma(6.3)
|
||||
* = log(6.3*5.3) + lgamma(5.3)
|
||||
* = log(6.3*5.3*4.3*3.3*2.3) + lgamma(2.3)
|
||||
* 2. Polynomial approximation of lgamma around its
|
||||
* minimun ymin=1.461632144968362245 to maintain monotonicity.
|
||||
* On [ymin-0.23, ymin+0.27] (i.e., [1.23164,1.73163]), use
|
||||
* Let z = x-ymin;
|
||||
* lgamma(x) = -1.214862905358496078218 + z^2*poly(z)
|
||||
* where
|
||||
* poly(z) is a 14 degree polynomial.
|
||||
* 2. Rational approximation in the primary interval [2,3]
|
||||
* We use the following approximation:
|
||||
* s = x-2.0;
|
||||
* lgamma(x) = 0.5*s + s*P(s)/Q(s)
|
||||
* with accuracy
|
||||
* |P/Q - (lgamma(x)-0.5s)| < 2**-61.71
|
||||
* Our algorithms are based on the following observation
|
||||
*
|
||||
* zeta(2)-1 2 zeta(3)-1 3
|
||||
* lgamma(2+s) = s*(1-Euler) + --------- * s - --------- * s + ...
|
||||
* 2 3
|
||||
*
|
||||
* where Euler = 0.5771... is the Euler constant, which is very
|
||||
* close to 0.5.
|
||||
*
|
||||
* 3. For x>=8, we have
|
||||
* lgamma(x)~(x-0.5)log(x)-x+0.5*log(2pi)+1/(12x)-1/(360x**3)+....
|
||||
* (better formula:
|
||||
* lgamma(x)~(x-0.5)*(log(x)-1)-.5*(log(2pi)-1) + ...)
|
||||
* Let z = 1/x, then we approximation
|
||||
* f(z) = lgamma(x) - (x-0.5)(log(x)-1)
|
||||
* by
|
||||
* 3 5 11
|
||||
* w = w0 + w1*z + w2*z + w3*z + ... + w6*z
|
||||
* where
|
||||
* |w - f(z)| < 2**-58.74
|
||||
*
|
||||
* 4. For negative x, since (G is gamma function)
|
||||
* -x*G(-x)*G(x) = pi/sin(pi*x),
|
||||
* we have
|
||||
* G(x) = pi/(sin(pi*x)*(-x)*G(-x))
|
||||
* since G(-x) is positive, sign(G(x)) = sign(sin(pi*x)) for x<0
|
||||
* Hence, for x<0, signgam = sign(sin(pi*x)) and
|
||||
* lgamma(x) = log(|Gamma(x)|)
|
||||
* = log(pi/(|x*sin(pi*x)|)) - lgamma(-x);
|
||||
* Note: one should avoid compute pi*(-x) directly in the
|
||||
* computation of sin(pi*(-x)).
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
log
|
||||
~~~
|
||||
* Method :
|
||||
* 1. Argument Reduction: find k and f such that
|
||||
* x = 2^k * (1+f),
|
||||
* where sqrt(2)/2 < 1+f < sqrt(2) .
|
||||
*
|
||||
* 2. Approximation of log(1+f).
|
||||
* Let s = f/(2+f) ; based on log(1+f) = log(1+s) - log(1-s)
|
||||
* = 2s + 2/3 s**3 + 2/5 s**5 + .....,
|
||||
* = 2s + s*R
|
||||
* We use a special Reme algorithm on [0,0.1716] to generate
|
||||
* a polynomial of degree 14 to approximate R The maximum error
|
||||
* of this polynomial approximation is bounded by 2**-58.45. In
|
||||
* other words,
|
||||
* 2 4 6 8 10 12 14
|
||||
* R(z) ~ Lg1*s +Lg2*s +Lg3*s +Lg4*s +Lg5*s +Lg6*s +Lg7*s
|
||||
* (the values of Lg1 to Lg7 are listed in the program)
|
||||
* and
|
||||
* | 2 14 | -58.45
|
||||
* | Lg1*s +...+Lg7*s - R(z) | <= 2
|
||||
* | |
|
||||
* Note that 2s = f - s*f = f - hfsq + s*hfsq, where hfsq = f*f/2.
|
||||
* In order to guarantee error in log below 1ulp, we compute log
|
||||
* by
|
||||
* log(1+f) = f - s*(f - R) (if f is not too large)
|
||||
* log(1+f) = f - (hfsq - s*(hfsq+R)). (better accuracy)
|
||||
*
|
||||
* 3. Finally, log(x) = k*ln2 + log(1+f).
|
||||
* = k*ln2_hi+(f-(hfsq-(s*(hfsq+R)+k*ln2_lo)))
|
||||
* Here ln2 is split into two floating point number:
|
||||
* ln2_hi + ln2_lo,
|
||||
* where n*ln2_hi is always exact for |n| < 2000.
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
log10
|
||||
~~~~~
|
||||
* Method :
|
||||
* Let log10_2hi = leading 40 bits of log10(2) and
|
||||
* log10_2lo = log10(2) - log10_2hi,
|
||||
* ivln10 = 1/log(10) rounded.
|
||||
* Then
|
||||
* n = ilogb(x),
|
||||
* if(n<0) n = n+1;
|
||||
* x = scalbn(x,-n);
|
||||
* log10(x) := n*log10_2hi + (n*log10_2lo + ivln10*log(x))
|
||||
*
|
||||
* Note 1:
|
||||
* To guarantee log10(10**n)=n, where 10**n is normal, the rounding
|
||||
* mode must set to Round-to-Nearest.
|
||||
* Note 2:
|
||||
* [1/log(10)] rounded to 53 bits has error .198 ulps;
|
||||
* log10 is monotonic at all binary break points.
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
pow
|
||||
~~~
|
||||
* Method: Let x = 2 * (1+f)
|
||||
* 1. Compute and return log2(x) in two pieces:
|
||||
* log2(x) = w1 + w2,
|
||||
* where w1 has 53-24 = 29 bit trailing zeros.
|
||||
* 2. Perform y*log2(x) = n+y' by simulating muti-precision
|
||||
* arithmetic, where |y'|<=0.5.
|
||||
* 3. Return x**y = 2**n*exp(y'*log2)
|
||||
*
|
||||
* Special cases:
|
||||
* 1. (anything) ** 0 is 1
|
||||
* 2. (anything) ** 1 is itself
|
||||
* 3. (anything) ** NAN is NAN
|
||||
* 4. NAN ** (anything except 0) is NAN
|
||||
* 5. +-(|x| > 1) ** +INF is +INF
|
||||
* 6. +-(|x| > 1) ** -INF is +0
|
||||
* 7. +-(|x| < 1) ** +INF is +0
|
||||
* 8. +-(|x| < 1) ** -INF is +INF
|
||||
* 9. +-1 ** +-INF is NAN
|
||||
* 10. +0 ** (+anything except 0, NAN) is +0
|
||||
* 11. -0 ** (+anything except 0, NAN, odd integer) is +0
|
||||
* 12. +0 ** (-anything except 0, NAN) is +INF
|
||||
* 13. -0 ** (-anything except 0, NAN, odd integer) is +INF
|
||||
* 14. -0 ** (odd integer) = -( +0 ** (odd integer) )
|
||||
* 15. +INF ** (+anything except 0,NAN) is +INF
|
||||
* 16. +INF ** (-anything except 0,NAN) is +0
|
||||
* 17. -INF ** (anything) = -0 ** (-anything)
|
||||
* 18. (-anything) ** (integer) is (-1)**(integer)*(+anything**integer)
|
||||
* 19. (-anything except 0 and inf) ** (non-integer) is NAN
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
rem_pio2 return the remainder of x rem pi/2 in y[0]+y[1]
|
||||
~~~~~~~~
|
||||
This is one of the basic functions which is written with highest accuracy
|
||||
in mind.
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
sinh
|
||||
~~~~
|
||||
* Method :
|
||||
* mathematically sinh(x) if defined to be (exp(x)-exp(-x))/2
|
||||
* 1. Replace x by |x| (sinh(-x) = -sinh(x)).
|
||||
* 2.
|
||||
* E + E/(E+1)
|
||||
* 0 <= x <= 22 : sinh(x) := --------------, E=expm1(x)
|
||||
* 2
|
||||
*
|
||||
* 22 <= x <= lnovft : sinh(x) := exp(x)/2
|
||||
* lnovft <= x <= ln2ovft: sinh(x) := exp(x/2)/2 * exp(x/2)
|
||||
* ln2ovft < x : sinh(x) := x*shuge (overflow)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
sqrt
|
||||
~~~~
|
||||
* Method:
|
||||
* 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
|
||||
* sqrt(x) = 2^k * sqrt(y)
|
||||
* 2. Bit by bit computation
|
||||
* Let q = sqrt(y) truncated to i bit after binary point (q = 1),
|
||||
* i 0
|
||||
* i+1 2
|
||||
* s = 2*q , and y = 2 * ( y - q ). (1)
|
||||
* i i i i
|
||||
*
|
||||
* To compute q from q , one checks whether
|
||||
* i+1 i
|
||||
*
|
||||
* -(i+1) 2
|
||||
* (q + 2 ) <= y. (2)
|
||||
* i
|
||||
* -(i+1)
|
||||
* If (2) is false, then q = q ; otherwise q = q + 2 .
|
||||
* i+1 i i+1 i
|
||||
*
|
||||
* With some algebric manipulation, it is not difficult to see
|
||||
* that (2) is equivalent to
|
||||
* -(i+1)
|
||||
* s + 2 <= y (3)
|
||||
* i i
|
||||
*
|
||||
* The advantage of (3) is that s and y can be computed by
|
||||
* i i
|
||||
* the following recurrence formula:
|
||||
* if (3) is false
|
||||
*
|
||||
* s = s , y = y ; (4)
|
||||
* i+1 i i+1 i
|
||||
*
|
||||
* otherwise,
|
||||
* -i -(i+1)
|
||||
* s = s + 2 , y = y - s - 2 (5)
|
||||
* i+1 i i+1 i i
|
||||
*
|
||||
* One may easily use induction to prove (4) and (5).
|
||||
* Note. Since the left hand side of (3) contain only i+2 bits,
|
||||
* it does not necessary to do a full (53-bit) comparison
|
||||
* in (3).
|
||||
* 3. Final rounding
|
||||
* After generating the 53 bits result, we compute one more bit.
|
||||
* Together with the remainder, we can decide whether the
|
||||
* result is exact, bigger than 1/2ulp, or less than 1/2ulp
|
||||
* (it will never equal to 1/2ulp).
|
||||
* The rounding mode can be detected by checking whether
|
||||
* huge + tiny is equal to huge, and whether huge - tiny is
|
||||
* equal to huge for some floating point number "huge" and "tiny".
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
cos
|
||||
~~~
|
||||
* kernel cos function on [-pi/4, pi/4], pi/4 ~ 0.785398164
|
||||
* Input x is assumed to be bounded by ~pi/4 in magnitude.
|
||||
* Input y is the tail of x.
|
||||
*
|
||||
* Algorithm
|
||||
* 1. Since cos(-x) = cos(x), we need only to consider positive x.
|
||||
* 2. if x < 2^-27 (hx<0x3e400000 0), return 1 with inexact if x!=0.
|
||||
* 3. cos(x) is approximated by a polynomial of degree 14 on
|
||||
* [0,pi/4]
|
||||
* 4 14
|
||||
* cos(x) ~ 1 - x*x/2 + C1*x + ... + C6*x
|
||||
* where the remez error is
|
||||
*
|
||||
* | 2 4 6 8 10 12 14 | -58
|
||||
* |cos(x)-(1-.5*x +C1*x +C2*x +C3*x +C4*x +C5*x +C6*x )| <= 2
|
||||
* | |
|
||||
*
|
||||
* 4 6 8 10 12 14
|
||||
* 4. let r = C1*x +C2*x +C3*x +C4*x +C5*x +C6*x , then
|
||||
* cos(x) = 1 - x*x/2 + r
|
||||
* since cos(x+y) ~ cos(x) - sin(x)*y
|
||||
* ~ cos(x) - x*y,
|
||||
* a correction term is necessary in cos(x) and hence
|
||||
* cos(x+y) = 1 - (x*x/2 - (r - x*y))
|
||||
* For better accuracy when x > 0.3, let qx = |x|/4 with
|
||||
* the last 32 bits mask off, and if x > 0.78125, let qx = 0.28125.
|
||||
* Then
|
||||
* cos(x+y) = (1-qx) - ((x*x/2-qx) - (r-x*y)).
|
||||
* Note that 1-qx and (x*x/2-qx) is EXACT here, and the
|
||||
* magnitude of the latter is at least a quarter of x*x/2,
|
||||
* thus, reducing the rounding error in the subtraction.
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
sin
|
||||
~~~
|
||||
* kernel sin function on [-pi/4, pi/4], pi/4 ~ 0.7854
|
||||
* Input x is assumed to be bounded by ~pi/4 in magnitude.
|
||||
* Input y is the tail of x.
|
||||
* Input iy indicates whether y is 0. (if iy=0, y assume to be 0).
|
||||
*
|
||||
* Algorithm
|
||||
* 1. Since sin(-x) = -sin(x), we need only to consider positive x.
|
||||
* 2. if x < 2^-27 (hx<0x3e400000 0), return x with inexact if x!=0.
|
||||
* 3. sin(x) is approximated by a polynomial of degree 13 on
|
||||
* [0,pi/4]
|
||||
* 3 13
|
||||
* sin(x) ~ x + S1*x + ... + S6*x
|
||||
* where
|
||||
*
|
||||
* |sin(x) 2 4 6 8 10 12 | -58
|
||||
* |----- - (1+S1*x +S2*x +S3*x +S4*x +S5*x +S6*x )| <= 2
|
||||
* | x |
|
||||
*
|
||||
* 4. sin(x+y) = sin(x) + sin'(x')*y
|
||||
* ~ sin(x) + (1-x*x/2)*y
|
||||
* For better accuracy, let
|
||||
* 3 2 2 2 2
|
||||
* r = x *(S2+x *(S3+x *(S4+x *(S5+x *S6))))
|
||||
* then 3 2
|
||||
* sin(x) = x + (S1*x + (x *(r-y/2)+y))
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
tan
|
||||
~~~
|
||||
* kernel tan function on [-pi/4, pi/4], pi/4 ~ 0.7854
|
||||
* Input x is assumed to be bounded by ~pi/4 in magnitude.
|
||||
* Input y is the tail of x.
|
||||
* Input k indicates whether tan (if k=1) or
|
||||
* -1/tan (if k= -1) is returned.
|
||||
*
|
||||
* Algorithm
|
||||
* 1. Since tan(-x) = -tan(x), we need only to consider positive x.
|
||||
* 2. if x < 2^-28 (hx<0x3e300000 0), return x with inexact if x!=0.
|
||||
* 3. tan(x) is approximated by a odd polynomial of degree 27 on
|
||||
* [0,0.67434]
|
||||
* 3 27
|
||||
* tan(x) ~ x + T1*x + ... + T13*x
|
||||
* where
|
||||
*
|
||||
* |tan(x) 2 4 26 | -59.2
|
||||
* |----- - (1+T1*x +T2*x +.... +T13*x )| <= 2
|
||||
* | x |
|
||||
*
|
||||
* Note: tan(x+y) = tan(x) + tan'(x)*y
|
||||
* ~ tan(x) + (1+x*x)*y
|
||||
* Therefore, for better accuracy in computing tan(x+y), let
|
||||
* 3 2 2 2 2
|
||||
* r = x *(T2+x *(T3+x *(...+x *(T12+x *T13))))
|
||||
* then
|
||||
* 3 2
|
||||
* tan(x+y) = x + (T1*x + (x *(r+y)+y))
|
||||
*
|
||||
* 4. For x in [0.67434,pi/4], let y = pi/4 - x, then
|
||||
* tan(x) = tan(pi/4-y) = (1-tan(y))/(1+tan(y))
|
||||
* = 1 - 2*(tan(y) - (tan(y)^2)/(1+tan(y)))
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
atan
|
||||
~~~~
|
||||
* Method
|
||||
* 1. Reduce x to positive by atan(x) = -atan(-x).
|
||||
* 2. According to the integer k=4t+0.25 chopped, t=x, the argument
|
||||
* is further reduced to one of the following intervals and the
|
||||
* arctangent of t is evaluated by the corresponding formula:
|
||||
*
|
||||
* [0,7/16] atan(x) = t-t^3*(a1+t^2*(a2+...(a10+t^2*a11)...)
|
||||
* [7/16,11/16] atan(x) = atan(1/2) + atan( (t-0.5)/(1+t/2) )
|
||||
* [11/16.19/16] atan(x) = atan( 1 ) + atan( (t-1)/(1+t) )
|
||||
* [19/16,39/16] atan(x) = atan(3/2) + atan( (t-1.5)/(1+1.5t) )
|
||||
* [39/16,INF] atan(x) = atan(INF) + atan( -1/t )
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
erf
|
||||
~~~
|
||||
* x
|
||||
* 2 |\
|
||||
* erf(x) = --------- | exp(-t*t)dt
|
||||
* sqrt(pi) \|
|
||||
* 0
|
||||
*
|
||||
* erfc(x) = 1-erf(x)
|
||||
* Note that
|
||||
* erf(-x) = -erf(x)
|
||||
* erfc(-x) = 2 - erfc(x)
|
||||
*
|
||||
* Method:
|
||||
* 1. For |x| in [0, 0.84375]
|
||||
* erf(x) = x + x*R(x^2)
|
||||
* erfc(x) = 1 - erf(x) if x in [-.84375,0.25]
|
||||
* = 0.5 + ((0.5-x)-x*R) if x in [0.25,0.84375]
|
||||
* where R = P/Q where P is an odd poly of degree 8 and
|
||||
* Q is an odd poly of degree 10.
|
||||
* -57.90
|
||||
* | R - (erf(x)-x)/x | <= 2
|
||||
*
|
||||
*
|
||||
* Remark. The formula is derived by noting
|
||||
* erf(x) = (2/sqrt(pi))*(x - x^3/3 + x^5/10 - x^7/42 + ....)
|
||||
* and that
|
||||
* 2/sqrt(pi) = 1.128379167095512573896158903121545171688
|
||||
* is close to one. The interval is chosen because the fix
|
||||
* point of erf(x) is near 0.6174 (i.e., erf(x)=x when x is
|
||||
* near 0.6174), and by some experiment, 0.84375 is chosen to
|
||||
* guarantee the error is less than one ulp for erf.
|
||||
*
|
||||
* 2. For |x| in [0.84375,1.25], let s = |x| - 1, and
|
||||
* c = 0.84506291151 rounded to single (24 bits)
|
||||
* erf(x) = sign(x) * (c + P1(s)/Q1(s))
|
||||
* erfc(x) = (1-c) - P1(s)/Q1(s) if x > 0
|
||||
* 1+(c+P1(s)/Q1(s)) if x < 0
|
||||
* |P1/Q1 - (erf(|x|)-c)| <= 2**-59.06
|
||||
* Remark: here we use the taylor series expansion at x=1.
|
||||
* erf(1+s) = erf(1) + s*Poly(s)
|
||||
* = 0.845.. + P1(s)/Q1(s)
|
||||
* That is, we use rational approximation to approximate
|
||||
* erf(1+s) - (c = (single)0.84506291151)
|
||||
* Note that |P1/Q1|< 0.078 for x in [0.84375,1.25]
|
||||
* where
|
||||
* P1(s) = degree 6 poly in s
|
||||
* Q1(s) = degree 6 poly in s
|
||||
*
|
||||
* 3. For x in [1.25,1/0.35(~2.857143)],
|
||||
* erfc(x) = (1/x)*exp(-x*x-0.5625+R1/S1)
|
||||
* erf(x) = 1 - erfc(x)
|
||||
* where
|
||||
* R1(z) = degree 7 poly in z, (z=1/x^2)
|
||||
* S1(z) = degree 8 poly in z
|
||||
*
|
||||
* 4. For x in [1/0.35,28]
|
||||
* erfc(x) = (1/x)*exp(-x*x-0.5625+R2/S2) if x > 0
|
||||
* = 2.0 - (1/x)*exp(-x*x-0.5625+R2/S2) if -6<x<0
|
||||
* = 2.0 - tiny (if x <= -6)
|
||||
* erf(x) = sign(x)*(1.0 - erfc(x)) if x < 6, else
|
||||
* erf(x) = sign(x)*(1.0 - tiny)
|
||||
* where
|
||||
* R2(z) = degree 6 poly in z, (z=1/x^2)
|
||||
* S2(z) = degree 7 poly in z
|
||||
*
|
||||
* Note1:
|
||||
* To compute exp(-x*x-0.5625+R/S), let s be a single
|
||||
* precision number and s := x; then
|
||||
* -x*x = -s*s + (s-x)*(s+x)
|
||||
* exp(-x*x-0.5626+R/S) =
|
||||
* exp(-s*s-0.5625)*exp((s-x)*(s+x)+R/S);
|
||||
* Note2:
|
||||
* Here 4 and 5 make use of the asymptotic series
|
||||
* exp(-x*x)
|
||||
* erfc(x) ~ ---------- * ( 1 + Poly(1/x^2) )
|
||||
* x*sqrt(pi)
|
||||
* We use rational approximation to approximate
|
||||
* g(s)=f(1/x^2) = log(erfc(x)*x) - x*x + 0.5625
|
||||
* Here is the error bound for R1/S1 and R2/S2
|
||||
* |R1/S1 - f(x)| < 2**(-62.57)
|
||||
* |R2/S2 - f(x)| < 2**(-61.52)
|
||||
*
|
||||
* 5. For inf > x >= 28
|
||||
* erf(x) = sign(x) *(1 - tiny) (raise inexact)
|
||||
* erfc(x) = tiny*tiny (raise underflow) if x > 0
|
||||
* = 2 - tiny if x<0
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
expm1 Returns exp(x)-1, the exponential of x minus 1
|
||||
~~~~~
|
||||
* Method
|
||||
* 1. Argument reduction:
|
||||
* Given x, find r and integer k such that
|
||||
*
|
||||
* x = k*ln2 + r, |r| <= 0.5*ln2 ~ 0.34658
|
||||
*
|
||||
* Here a correction term c will be computed to compensate
|
||||
* the error in r when rounded to a floating-point number.
|
||||
*
|
||||
* 2. Approximating expm1(r) by a special rational function on
|
||||
* the interval [0,0.34658]:
|
||||
* Since
|
||||
* r*(exp(r)+1)/(exp(r)-1) = 2+ r^2/6 - r^4/360 + ...
|
||||
* we define R1(r*r) by
|
||||
* r*(exp(r)+1)/(exp(r)-1) = 2+ r^2/6 * R1(r*r)
|
||||
* That is,
|
||||
* R1(r**2) = 6/r *((exp(r)+1)/(exp(r)-1) - 2/r)
|
||||
* = 6/r * ( 1 + 2.0*(1/(exp(r)-1) - 1/r))
|
||||
* = 1 - r^2/60 + r^4/2520 - r^6/100800 + ...
|
||||
* We use a special Reme algorithm on [0,0.347] to generate
|
||||
* a polynomial of degree 5 in r*r to approximate R1. The
|
||||
* maximum error of this polynomial approximation is bounded
|
||||
* by 2**-61. In other words,
|
||||
* R1(z) ~ 1.0 + Q1*z + Q2*z**2 + Q3*z**3 + Q4*z**4 + Q5*z**5
|
||||
* where Q1 = -1.6666666666666567384E-2,
|
||||
* Q2 = 3.9682539681370365873E-4,
|
||||
* Q3 = -9.9206344733435987357E-6,
|
||||
* Q4 = 2.5051361420808517002E-7,
|
||||
* Q5 = -6.2843505682382617102E-9;
|
||||
* (where z=r*r, and the values of Q1 to Q5 are listed below)
|
||||
* with error bounded by
|
||||
* | 5 | -61
|
||||
* | 1.0+Q1*z+...+Q5*z - R1(z) | <= 2
|
||||
* | |
|
||||
*
|
||||
* expm1(r) = exp(r)-1 is then computed by the following
|
||||
* specific way which minimize the accumulation rounding error:
|
||||
* 2 3
|
||||
* r r [ 3 - (R1 + R1*r/2) ]
|
||||
* expm1(r) = r + --- + --- * [--------------------]
|
||||
* 2 2 [ 6 - r*(3 - R1*r/2) ]
|
||||
*
|
||||
* To compensate the error in the argument reduction, we use
|
||||
* expm1(r+c) = expm1(r) + c + expm1(r)*c
|
||||
* ~ expm1(r) + c + r*c
|
||||
* Thus c+r*c will be added in as the correction terms for
|
||||
* expm1(r+c). Now rearrange the term to avoid optimization
|
||||
* screw up:
|
||||
* ( 2 2 )
|
||||
* ({ ( r [ R1 - (3 - R1*r/2) ] ) } r )
|
||||
* expm1(r+c)~r - ({r*(--- * [--------------------]-c)-c} - --- )
|
||||
* ({ ( 2 [ 6 - r*(3 - R1*r/2) ] ) } 2 )
|
||||
* ( )
|
||||
*
|
||||
* = r - E
|
||||
* 3. Scale back to obtain expm1(x):
|
||||
* From step 1, we have
|
||||
* expm1(x) = either 2^k*[expm1(r)+1] - 1
|
||||
* = or 2^k*[expm1(r) + (1-2^-k)]
|
||||
* 4. Implementation notes:
|
||||
* (A). To save one multiplication, we scale the coefficient Qi
|
||||
* to Qi*2^i, and replace z by (x^2)/2.
|
||||
* (B). To achieve maximum accuracy, we compute expm1(x) by
|
||||
* (i) if x < -56*ln2, return -1.0, (raise inexact if x!=inf)
|
||||
* (ii) if k=0, return r-E
|
||||
* (iii) if k=-1, return 0.5*(r-E)-0.5
|
||||
* (iv) if k=1 if r < -0.25, return 2*((r+0.5)- E)
|
||||
* else return 1.0+2.0*(r-E);
|
||||
* (v) if (k<-2||k>56) return 2^k(1-(E-r)) - 1 (or exp(x)-1)
|
||||
* (vi) if k <= 20, return 2^k((1-2^-k)-(E-r)), else
|
||||
* (vii) return 2^k(1-((E+2^-k)-r))
|
||||
*
|
||||
* Special cases:
|
||||
* expm1(INF) is INF, expm1(NaN) is NaN;
|
||||
* expm1(-INF) is -1, and
|
||||
* for finite argument, only expm1(0)=0 is exact.
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
log1p
|
||||
~~~~~
|
||||
* Method :
|
||||
* 1. Argument Reduction: find k and f such that
|
||||
* 1+x = 2^k * (1+f),
|
||||
* where sqrt(2)/2 < 1+f < sqrt(2) .
|
||||
*
|
||||
* Note. If k=0, then f=x is exact. However, if k!=0, then f
|
||||
* may not be representable exactly. In that case, a correction
|
||||
* term is need. Let u=1+x rounded. Let c = (1+x)-u, then
|
||||
* log(1+x) - log(u) ~ c/u. Thus, we proceed to compute log(u),
|
||||
* and add back the correction term c/u.
|
||||
* (Note: when x > 2**53, one can simply return log(x))
|
||||
*
|
||||
* 2. Approximation of log1p(f).
|
||||
* Let s = f/(2+f) ; based on log(1+f) = log(1+s) - log(1-s)
|
||||
* = 2s + 2/3 s**3 + 2/5 s**5 + .....,
|
||||
* = 2s + s*R
|
||||
* We use a special Reme algorithm on [0,0.1716] to generate
|
||||
* a polynomial of degree 14 to approximate R The maximum error
|
||||
* of this polynomial approximation is bounded by 2**-58.45. In
|
||||
* other words,
|
||||
* 2 4 6 8 10 12 14
|
||||
* R(z) ~ Lp1*s +Lp2*s +Lp3*s +Lp4*s +Lp5*s +Lp6*s +Lp7*s
|
||||
* (the values of Lp1 to Lp7 are listed in the program)
|
||||
* and
|
||||
* | 2 14 | -58.45
|
||||
* | Lp1*s +...+Lp7*s - R(z) | <= 2
|
||||
* | |
|
||||
* Note that 2s = f - s*f = f - hfsq + s*hfsq, where hfsq = f*f/2.
|
||||
* In order to guarantee error in log below 1ulp, we compute log
|
||||
* by
|
||||
* log1p(f) = f - (hfsq - s*(hfsq+R)).
|
||||
*
|
||||
* 3. Finally, log1p(x) = k*ln2 + log1p(f).
|
||||
* = k*ln2_hi+(f-(hfsq-(s*(hfsq+R)+k*ln2_lo)))
|
||||
* Here ln2 is split into two floating point number:
|
||||
* ln2_hi + ln2_lo,
|
||||
* where n*ln2_hi is always exact for |n| < 2000.
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
+23
-11
@@ -6,9 +6,9 @@ As of this release, the GNU C library is known to run on the following
|
||||
configurations:
|
||||
|
||||
*-*-gnu GNU Hurd
|
||||
i[3456]86-*-linux Linux-2.0 on Intel
|
||||
m68k-*-linux Linux-2.0 on Motorola 680x0
|
||||
alpha-*-linux Linux-2.0 on DEC Alpha
|
||||
i[3456]86-*-linux-gnu Linux-2.0 on Intel
|
||||
m68k-*-linux-gnu Linux-2.0 on Motorola 680x0
|
||||
alpha-*-linux-gnu Linux-2.0 on DEC Alpha
|
||||
|
||||
|
||||
Former releases of this library (version 1.09.1 and perhaps earlier
|
||||
@@ -39,38 +39,50 @@ versions) used to run on the following configurations:
|
||||
Whether this is still true for this release is unknown. Porting the
|
||||
library is not hard. If you are interested in doing a port, please
|
||||
get on the mailing list by sending electronic mail to
|
||||
bug-glibc-request@prep.ai.mit.edu.
|
||||
<bug-glibc-request@prep.ai.mit.edu>.
|
||||
|
||||
The GNU C library now includes Michael Glad's Ultra Fast Crypt, which
|
||||
provides the Unix `crypt' function, plus some other entry points.
|
||||
Because of the United States export restriction on DES implementations,
|
||||
we are distributing this code separately from the rest of the C
|
||||
library. There is an extra distribution tar file just for crypt; it is
|
||||
called `glibc-VERSION-crypt.tar.gz'. You can just unpack the crypt
|
||||
called `glibc-crypt-VERSION.tar.gz'. You can just unpack the crypt
|
||||
distribution along with the rest of the C library and build; you can
|
||||
also build the library without getting crypt. Users outside the USA
|
||||
can get the crypt distribution via anonymous FTP from ftp.uni-c.dk
|
||||
[129.142.6.74], or another archive site outside the USA. Archive
|
||||
can get the crypt distribution via anonymous FTP from ftp.ifi.uio.no
|
||||
[129.240.64.21], or another archive site outside the USA. Archive
|
||||
maintainers are encouraged to copy this distribution to their archives
|
||||
outside the USA. Please get it from ftp.uni-c.dk; transferring this
|
||||
outside the USA. Please get it from ftp.ifi.uio.no; transferring this
|
||||
distribution from prep.ai.mit.edu (or any other site in the USA) to a
|
||||
site outside the USA is in violation of US export laws.
|
||||
|
||||
Beside the separate crypt tar file there are some more 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.
|
||||
|
||||
See the file INSTALL to find out how to configure, build, install, and port
|
||||
the GNU C library.
|
||||
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 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@prep.ai.mit.edu, and
|
||||
send comments on the manual to <bug-glibc-manual@prep.ai.mit.edu>, 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
|
||||
facilities you want it to make available.
|
||||
|
||||
Send bug reports to bug-glibc@prep.ai.mit.edu.
|
||||
We prefer to get bug reports sent using the `glibcbug' shell script which
|
||||
is install together with the rest of the GNU libc to <bugs@gnu.ai.mit.edu>.
|
||||
Simply run this shell script and fill in the information. Nevertheless
|
||||
you can still send bug reports to <bug-glibc@prep.ai.mit.edu> as normal
|
||||
electronic mails.
|
||||
|
||||
The GNU C Library is free software. See the file COPYING.LIB for copying
|
||||
conditions.
|
||||
|
||||
@@ -39,7 +39,8 @@ export subdir := $(subdir)
|
||||
all: objs lib others
|
||||
|
||||
others: $(addprefix $(objpfx),$(extra-objs) \
|
||||
$(install-lib) $(install-bin) $(install-sbin))
|
||||
$(install-lib) $(install-bin) \
|
||||
$(install-rootsbin) $(install-sbin))
|
||||
|
||||
ifneq "$(findstring env,$(origin headers))" ""
|
||||
headers :=
|
||||
@@ -72,12 +73,12 @@ $(AR) cr$(verbose) $@ $<
|
||||
endef
|
||||
$(common-objpfx)dummy.c:
|
||||
rm -f $@
|
||||
echo 'void __dummy__ () { }' > $@
|
||||
echo 'void __dummy__ (void) { }' > $@
|
||||
$(common-objpfx)empty.c:
|
||||
cp -f /dev/null $@
|
||||
common-generated := $(common-generated) dummy.o dummy.c empty.c empty.o
|
||||
|
||||
# This makes all the auxilliary and test programs.
|
||||
# This makes all the auxiliary and test programs.
|
||||
|
||||
.PHONY: others tests
|
||||
others: $(addprefix $(objpfx),$(others) $(extra-objs))
|
||||
|
||||
+4
-4
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 1991, 1994 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1991, 1994, 1997 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
|
||||
@@ -12,9 +12,9 @@
|
||||
# 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., 675 Mass Ave,
|
||||
# Cambridge, MA 02139, USA.
|
||||
# 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 assert portion of the library.
|
||||
|
||||
+16
-15
@@ -1,20 +1,20 @@
|
||||
/* Copyright (C) 1994, 1995 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
/* Copyright (C) 1994, 1995, 1996 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 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.
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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 <assert.h>
|
||||
#include <stdio.h>
|
||||
@@ -38,6 +38,7 @@ __assert_perror_fail (int errnum,
|
||||
const char *file, unsigned int line,
|
||||
const char *function)
|
||||
{
|
||||
char errbuf[1024];
|
||||
#ifdef FATAL_PREPARE
|
||||
FATAL_PREPARE;
|
||||
#endif
|
||||
@@ -48,7 +49,7 @@ __assert_perror_fail (int errnum,
|
||||
__assert_program_name ? ": " : "",
|
||||
file, line,
|
||||
function ? function : "", function ? ": " : "",
|
||||
strerror (errnum));
|
||||
__strerror_r (errnum, errbuf, sizeof errbuf));
|
||||
(void) fflush (stderr);
|
||||
|
||||
abort ();
|
||||
|
||||
+18
-21
@@ -1,29 +1,28 @@
|
||||
/* Copyright (C) 1991, 1994, 1995 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
/* Copyright (C) 1991, 1994, 1995, 1996 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 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.
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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 <ansidecl.h>
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sysdep.h>
|
||||
|
||||
|
||||
CONST char *__assert_program_name;
|
||||
const char *__assert_program_name;
|
||||
|
||||
/* This function, when passed a string containing an asserted
|
||||
expression, a filename, and a line number, prints a message
|
||||
@@ -36,9 +35,8 @@ CONST char *__assert_program_name;
|
||||
#endif
|
||||
|
||||
void
|
||||
DEFUN(__assert_fail, (assertion, file, line, function),
|
||||
CONST char *assertion AND
|
||||
CONST char *file AND unsigned int line AND CONST char *function)
|
||||
__assert_fail (const char *assertion, const char *file, unsigned int line,
|
||||
const char *function)
|
||||
{
|
||||
#ifdef FATAL_PREPARE
|
||||
FATAL_PREPARE;
|
||||
@@ -61,8 +59,7 @@ DEFUN(__assert_fail, (assertion, file, line, function),
|
||||
#include <string.h>
|
||||
|
||||
static void
|
||||
DEFUN(set_progname, (argc, argv, envp),
|
||||
int argc AND char **argv AND char **envp)
|
||||
set_progname (int argc, char **argv, char **envp)
|
||||
{
|
||||
char *p;
|
||||
|
||||
|
||||
+14
-14
@@ -1,23 +1,23 @@
|
||||
/* Copyright (C) 1991, 92, 94, 95, 96 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
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 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.
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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. */
|
||||
|
||||
/*
|
||||
* ANSI Standard: 4.2 DIAGNOSTICS <assert.h>
|
||||
* ISO C Standard: 4.2 DIAGNOSTICS <assert.h>
|
||||
*/
|
||||
|
||||
#ifdef _ASSERT_H
|
||||
|
||||
+12
-13
@@ -1,23 +1,22 @@
|
||||
# Copyright (C) 1994 Free Software Foundation, Inc.
|
||||
# Contributed by Joel Sherrill (jsherril@redstone-emh2.army.mil),
|
||||
# On-Line Applications Research Corporation.
|
||||
#
|
||||
# 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 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., 675 Mass Ave,
|
||||
# Cambridge, MA 02139, USA.
|
||||
# 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.
|
||||
|
||||
subdir := bare
|
||||
|
||||
@@ -33,11 +32,11 @@ 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
|
||||
# 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
|
||||
# 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.
|
||||
#
|
||||
|
||||
|
||||
+28
-17
@@ -1,23 +1,24 @@
|
||||
/* Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU 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 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.
|
||||
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. */
|
||||
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 <alloca.h>
|
||||
#include <errno.h>
|
||||
#include <nl_types.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -45,6 +46,7 @@ catopen (const char *cat_name, int flag)
|
||||
if (result->cat_name == NULL)
|
||||
{
|
||||
free (result);
|
||||
__set_errno (ENOMEM);
|
||||
return (nl_catd) -1;
|
||||
}
|
||||
|
||||
@@ -76,6 +78,7 @@ catopen (const char *cat_name, int flag)
|
||||
{
|
||||
free ((void *) result->cat_name);
|
||||
free ((void *) result);
|
||||
__set_errno (ENOMEM);
|
||||
return (nl_catd) -1;
|
||||
}
|
||||
|
||||
@@ -89,6 +92,7 @@ catopen (const char *cat_name, int flag)
|
||||
free ((void *) result->cat_name);
|
||||
free ((void *) result->env_var);
|
||||
free ((void *) result);
|
||||
__set_errno (ENOMEM);
|
||||
return (nl_catd) -1;
|
||||
}
|
||||
}
|
||||
@@ -120,7 +124,10 @@ catgets (nl_catd catalog_desc, int set, int message, const char *string)
|
||||
__open_catalog (catalog, 1);
|
||||
|
||||
if (catalog->status == nonexisting)
|
||||
return (char *) string;
|
||||
{
|
||||
__set_errno (EBADF);
|
||||
return (char *) string;
|
||||
}
|
||||
|
||||
idx = ((set * message) % catalog->plane_size) * 3;
|
||||
cnt = 0;
|
||||
@@ -134,6 +141,7 @@ catgets (nl_catd catalog_desc, int set, int message, const char *string)
|
||||
}
|
||||
while (++cnt < catalog->plane_depth);
|
||||
|
||||
__set_errno (ENOMSG);
|
||||
return (char *) string;
|
||||
}
|
||||
|
||||
@@ -146,12 +154,15 @@ catclose (nl_catd catalog_desc)
|
||||
|
||||
catalog = (__nl_catd) catalog_desc;
|
||||
|
||||
if (catalog->status == mmaped)
|
||||
if (catalog->status == mmapped)
|
||||
munmap ((void *) catalog->file_ptr, catalog->file_size);
|
||||
else if (catalog->status == malloced)
|
||||
free ((void *) catalog->file_ptr);
|
||||
else if (catalog->status != closed && catalog->status != nonexisting)
|
||||
return -1;
|
||||
{
|
||||
__set_errno (EBADF);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (catalog->nlspath)
|
||||
free ((void *) catalog->nlspath);
|
||||
|
||||
+15
-15
@@ -1,21 +1,21 @@
|
||||
/* Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU 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 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.
|
||||
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. */
|
||||
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 <sys/types.h>
|
||||
|
||||
@@ -34,7 +34,7 @@ struct catalog_obj
|
||||
/* This structure will be filled after loading the catalog. */
|
||||
typedef struct catalog_info
|
||||
{
|
||||
enum { closed, nonexisting, mmaped, malloced } status;
|
||||
enum { closed, nonexisting, mmapped, malloced } status;
|
||||
|
||||
const char *cat_name;
|
||||
const char *env_var;
|
||||
|
||||
+22
-21
@@ -1,21 +1,21 @@
|
||||
/* Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
|
||||
/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1996.
|
||||
|
||||
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 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.
|
||||
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. */
|
||||
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. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
@@ -141,7 +141,7 @@ main (int argc, char *argv[])
|
||||
header_name = NULL;
|
||||
result = NULL;
|
||||
|
||||
while ((opt = getopt_long (argc, argv, "hH:o:V", long_options, NULL)) != EOF)
|
||||
while ((opt = getopt_long (argc, argv, "hH:o:V", long_options, NULL)) != -1)
|
||||
switch (opt)
|
||||
{
|
||||
case '\0': /* Long option. */
|
||||
@@ -170,7 +170,7 @@ main (int argc, char *argv[])
|
||||
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\
|
||||
"), "1996");
|
||||
"), "1996, 1997");
|
||||
printf (_("Written by %s.\n"), "Ulrich Drepper");
|
||||
|
||||
exit (EXIT_SUCCESS);
|
||||
@@ -221,7 +221,8 @@ Mandatory arguments to long options are mandatory for short options too.\n\
|
||||
If INPUT-FILE is -, input is read from standard input. If OUTPUT-FILE\n\
|
||||
is -, output is written to standard output.\n"),
|
||||
program_invocation_name, program_invocation_name);
|
||||
fputs (gettext ("Report bugs to <bug-glibc@prep.ai.mit.edu>.\n"),
|
||||
fputs (gettext ("\
|
||||
Report bugs using the `glibcbug' script to <bugs@gnu.ai.mit.edu>.\n"),
|
||||
stdout);
|
||||
}
|
||||
|
||||
@@ -270,7 +271,7 @@ read_input_file (struct catalog *current, const char *fname)
|
||||
current->last_set = 0;
|
||||
current->current_set = find_set (current, NL_SETD);
|
||||
|
||||
#define obstack_chunk_alloc xmalloc
|
||||
#define obstack_chunk_alloc malloc
|
||||
#define obstack_chunk_free free
|
||||
obstack_init (¤t->mem_pool);
|
||||
}
|
||||
@@ -353,7 +354,7 @@ read_input_file (struct catalog *current, const char *fname)
|
||||
}
|
||||
else
|
||||
{
|
||||
/* We have found seomthing which looks like a
|
||||
/* We have found seomthing that looks like a
|
||||
correct identifier. */
|
||||
struct set_list *runp;
|
||||
|
||||
@@ -980,7 +981,7 @@ read_old (struct catalog *catalog, const char *file_name)
|
||||
/* Try to open catalog, but don't look through the NLSPATH. */
|
||||
__open_catalog (&old_cat_obj, 0);
|
||||
|
||||
if (old_cat_obj.status != mmaped && old_cat_obj.status != malloced)
|
||||
if (old_cat_obj.status != mmapped && old_cat_obj.status != malloced)
|
||||
if (errno == ENOENT)
|
||||
/* No problem, the catalog simply does not exist. */
|
||||
return;
|
||||
|
||||
+16
-16
@@ -1,20 +1,20 @@
|
||||
/* Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
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 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.
|
||||
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. */
|
||||
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. */
|
||||
|
||||
#ifndef _NL_TYPES_H
|
||||
#define _NL_TYPES_H 1
|
||||
@@ -26,12 +26,12 @@ Boston, MA 02111-1307, USA. */
|
||||
/* Value for FLAG parameter of `catgets' to say we want XPG4 compliance. */
|
||||
#define NL_CAT_LOCALE 1
|
||||
|
||||
/* Message catalog descriptor type. */
|
||||
typedef void *nl_catd;
|
||||
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Message catalog descriptor type. */
|
||||
typedef void *nl_catd;
|
||||
|
||||
/* Open message catalog for later use, returning descriptor. */
|
||||
extern nl_catd catopen __P ((__const char *__cat_name, int __flag));
|
||||
|
||||
|
||||
+16
-16
@@ -1,21 +1,21 @@
|
||||
/* Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU 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 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.
|
||||
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. */
|
||||
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 <endian.h>
|
||||
#include <fcntl.h>
|
||||
@@ -185,7 +185,7 @@ __open_catalog (__nl_catd catalog, int with_path)
|
||||
MAP_FILE|MAP_COPY|MAP_INHERIT, fd, 0);
|
||||
if (catalog->file_ptr != (struct catalog_obj *) -1)
|
||||
/* Tell the world we managed to mmap the file. */
|
||||
catalog->status = mmaped;
|
||||
catalog->status = mmapped;
|
||||
else
|
||||
{
|
||||
/* mmap failed perhaps because the system call is not
|
||||
@@ -229,7 +229,7 @@ __open_catalog (__nl_catd catalog, int with_path)
|
||||
{
|
||||
/* Illegal file. Free he resources and mark catalog as not
|
||||
usable. */
|
||||
if (catalog->status == mmaped)
|
||||
if (catalog->status == mmapped)
|
||||
__munmap ((void *) catalog->file_ptr, catalog->file_size);
|
||||
else
|
||||
free (catalog->file_ptr);
|
||||
|
||||
Vendored
+119
-34
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
# Attempt to guess a canonical system name.
|
||||
# Copyright (C) 1992, 93, 94, 95, 1996 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1992, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
@@ -67,17 +67,27 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
amiga:NetBSD:*:*)
|
||||
echo m68k-cbm-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
amiga:OpenBSD:*:*)
|
||||
echo m68k-cbm-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
|
||||
echo arm-acorn-riscix${UNAME_RELEASE}
|
||||
exit 0;;
|
||||
Pyramid*:OSx*:*:*)
|
||||
SR2?01:HI-UX/MPP:*:*)
|
||||
echo hppa1.1-hitachi-hiuxmpp
|
||||
exit 0;;
|
||||
Pyramid*:OSx*:*:*|MIS*:OSx*:*:*)
|
||||
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
|
||||
if test "`(/bin/universe) 2>/dev/null`" = att ; then
|
||||
echo pyramid-pyramid-sysv3
|
||||
else
|
||||
echo pyramid-pyramid-bsd
|
||||
fi
|
||||
exit 0 ;;
|
||||
sun4*:SunOS:5.*:*)
|
||||
NILE:*:*:dcosx)
|
||||
echo pyramid-pyramid-svr4
|
||||
exit 0 ;;
|
||||
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
|
||||
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit 0 ;;
|
||||
i86pc:SunOS:5.*:*)
|
||||
@@ -101,15 +111,33 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
sun3*:SunOS:*:*)
|
||||
echo m68k-sun-sunos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
aushp:SunOS:*:*)
|
||||
echo sparc-auspex-sunos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
atari*:NetBSD:*:*)
|
||||
echo m68k-atari-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
atari*:OpenBSD:*:*)
|
||||
echo m68k-atari-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
sun3*:NetBSD:*:*)
|
||||
echo m68k-sun-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
sun3*:OpenBSD:*:*)
|
||||
echo m68k-sun-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mac68k:NetBSD:*:*)
|
||||
echo m68k-apple-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mac68k:OpenBSD:*:*)
|
||||
echo m68k-apple-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
powerpc:machten:*:*)
|
||||
echo powerpc-apple-machten${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
RISC*:Mach:*:*)
|
||||
echo mips-dec-mach_bsd4.3
|
||||
exit 0 ;;
|
||||
RISC*:ULTRIX:*:*)
|
||||
echo mips-dec-ultrix${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
@@ -133,7 +161,8 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
exit (-1);
|
||||
}
|
||||
EOF
|
||||
${CC-cc} dummy.c -o dummy && ./dummy "${UNAME_RELEASE}" \
|
||||
${CC-cc} dummy.c -o dummy \
|
||||
&& ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
|
||||
&& rm dummy.c dummy && exit 0
|
||||
rm -f dummy.c dummy
|
||||
echo mips-mips-riscos${UNAME_RELEASE}
|
||||
@@ -179,10 +208,10 @@ EOF
|
||||
*:IRIX*:*:*)
|
||||
echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
|
||||
exit 0 ;;
|
||||
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
|
||||
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
|
||||
echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
|
||||
exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
|
||||
i[34]86:AIX:*:*)
|
||||
i?86:AIX:*:*)
|
||||
echo i386-ibm-aix
|
||||
exit 0 ;;
|
||||
*:AIX:2:3)
|
||||
@@ -293,6 +322,13 @@ EOF
|
||||
hp8??:OSF1:*:*)
|
||||
echo hppa1.0-hp-osf
|
||||
exit 0 ;;
|
||||
i?86:OSF1:*:*)
|
||||
if [ -x /usr/sbin/sysversion ] ; then
|
||||
echo ${UNAME_MACHINE}-unknown-osf1mk
|
||||
else
|
||||
echo ${UNAME_MACHINE}-unknown-osf1
|
||||
fi
|
||||
exit 0 ;;
|
||||
parisc*:Lites*:*:*)
|
||||
echo hppa1.1-hp-lites
|
||||
exit 0 ;;
|
||||
@@ -325,13 +361,27 @@ EOF
|
||||
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
|
||||
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
|
||||
exit 0 ;;
|
||||
CRAY*TS:*:*:*)
|
||||
echo t90-cray-unicos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
CRAY-2:*:*:*)
|
||||
echo cray2-cray-unicos
|
||||
exit 0 ;;
|
||||
F300:UNIX_System_V:*:*)
|
||||
FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'`
|
||||
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
|
||||
echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
|
||||
exit 0 ;;
|
||||
F301:UNIX_System_V:*:*)
|
||||
echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
|
||||
exit 0 ;;
|
||||
hp3[0-9][05]:NetBSD:*:*)
|
||||
echo m68k-hp-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
i[34]86:BSD/386:*:* | *:BSD/OS:*:*)
|
||||
hp3[0-9][05]:OpenBSD:*:*)
|
||||
echo m68k-hp-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
i?86:BSD/386:*:* | *:BSD/OS:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*:FreeBSD:*:*)
|
||||
@@ -340,6 +390,9 @@ EOF
|
||||
*:NetBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
|
||||
exit 0 ;;
|
||||
*:OpenBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
|
||||
exit 0 ;;
|
||||
i*:CYGWIN*:*)
|
||||
echo i386-pc-cygwin32
|
||||
exit 0 ;;
|
||||
@@ -350,17 +403,17 @@ EOF
|
||||
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit 0 ;;
|
||||
*:GNU:*:*)
|
||||
echo `echo ${UNAME_MACHINE}|sed -e 's,/.*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
|
||||
echo `echo ${UNAME_MACHINE}|sed -e 's,-.*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
|
||||
exit 0 ;;
|
||||
*:Linux:*:*)
|
||||
# The BFD linker knows what the default object file format is, so
|
||||
# first see if it will tell us.
|
||||
ld_help_string=`ld --help 2>&1`
|
||||
if echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: elf_i[345]86"; then
|
||||
if echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: elf_i.86"; then
|
||||
echo "${UNAME_MACHINE}-pc-linux-gnu" ; exit 0
|
||||
elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i[345]86linux"; then
|
||||
elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i.86linux"; then
|
||||
echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0
|
||||
elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i[345]86coff"; then
|
||||
elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i.86coff"; then
|
||||
echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0
|
||||
elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68kelf"; then
|
||||
echo "${UNAME_MACHINE}-unknown-linux-gnu" ; exit 0
|
||||
@@ -372,6 +425,23 @@ EOF
|
||||
echo alpha-unknown-linux-gnu ; exit 0
|
||||
elif test "${UNAME_MACHINE}" = "sparc" ; then
|
||||
echo sparc-unknown-linux-gnu ; exit 0
|
||||
elif test "${UNAME_MACHINE}" = "mips" ; then
|
||||
cat >dummy.c <<EOF
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
#ifdef __MIPSEB__
|
||||
printf ("%s-unknown-linux-gnu\n", argv[1]);
|
||||
#endif
|
||||
#ifdef __MIPSEL__
|
||||
printf ("%sel-unknown-linux-gnu\n", argv[1]);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
EOF
|
||||
${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
|
||||
rm -f dummy.c dummy
|
||||
else
|
||||
# Either a pre-BFD a.out linker (linux-gnuoldld) or one that does not give us
|
||||
# useful --help. Gcc wants to distinguish between linux-gnuoldld and linux-gnuaout.
|
||||
@@ -396,17 +466,17 @@ EOF
|
||||
fi ;;
|
||||
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
|
||||
# are messed up and put the nodename in both sysname and nodename.
|
||||
i[34]86:DYNIX/ptx:4*:*)
|
||||
i?86:DYNIX/ptx:4*:*)
|
||||
echo i386-sequent-sysv4
|
||||
exit 0 ;;
|
||||
i[34]86:*:4.*:* | i[34]86:SYSTEM_V:4.*:*)
|
||||
i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
|
||||
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
|
||||
echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
|
||||
else
|
||||
echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
|
||||
fi
|
||||
exit 0 ;;
|
||||
i[34]86:*:3.2:*)
|
||||
i?86:*:3.2:*)
|
||||
if test -f /usr/options/cb.name; then
|
||||
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
|
||||
echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
|
||||
@@ -437,34 +507,36 @@ EOF
|
||||
# "miniframe"
|
||||
echo m68010-convergent-sysv
|
||||
exit 0 ;;
|
||||
M680[234]0:*:R3V[567]*:*)
|
||||
M68*:*:R3V[567]*:*)
|
||||
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
|
||||
3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
|
||||
UNAME_REL=4.3
|
||||
if test -f /etc/.relid; then
|
||||
UNAME_REL=4.3.`awk '{ print $3 }' /etc/.relid`
|
||||
fi
|
||||
uname -p 2>/dev/null | grep 86 >/dev/null \
|
||||
&& echo i486-ncr-sysv$UNAME_REL && exit 0
|
||||
uname -p 2>/dev/null | /bin/grep entium >/dev/null \
|
||||
&& echo i586-ncr-sysv$UNAME_REL && exit 0 ;;
|
||||
OS_REL=''
|
||||
test -r /etc/.relid \
|
||||
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
|
||||
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
|
||||
&& echo i486-ncr-sysv4.3${OS_REL} && exit 0
|
||||
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
|
||||
&& echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
|
||||
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
|
||||
uname -p 2>/dev/null | grep 86 >/dev/null \
|
||||
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
|
||||
&& echo i486-ncr-sysv4 && exit 0 ;;
|
||||
m680[234]0:LynxOS:2.[23]*:*)
|
||||
echo m68k-lynx-lynxos${UNAME_RELEASE}
|
||||
m68*:LynxOS:2.*:*)
|
||||
echo m68k-unknown-lynxos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mc68030:UNIX_System_V:4.*:*)
|
||||
echo m68k-atari-sysv4
|
||||
exit 0 ;;
|
||||
i[34]86:LynxOS:2.[23]*:*)
|
||||
echo i386-lynx-lynxos${UNAME_RELEASE}
|
||||
i?86:LynxOS:2.*:*)
|
||||
echo i386-unknown-lynxos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
TSUNAMI:LynxOS:2.[23]*:*)
|
||||
echo sparc-lynx-lynxos${UNAME_RELEASE}
|
||||
TSUNAMI:LynxOS:2.*:*)
|
||||
echo sparc-unknown-lynxos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
rs6000:LynxOS:2.[23]*:*)
|
||||
echo rs6000-lynx-lynxos${UNAME_RELEASE}
|
||||
rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*)
|
||||
echo rs6000-unknown-lynxos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
SM[BE]S:UNIX_SV:*:*)
|
||||
echo mips-dde-sysv${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
RM*:SINIX-*:*:*)
|
||||
echo mips-sni-sysv4
|
||||
@@ -477,10 +549,23 @@ EOF
|
||||
echo ns32k-sni-sysv
|
||||
fi
|
||||
exit 0 ;;
|
||||
PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
|
||||
# says <Richard.M.Bartel@ccMail.Census.GOV>
|
||||
echo i586-unisys-sysv4
|
||||
exit 0 ;;
|
||||
*:UNIX_System_V:4*:FTX*)
|
||||
# From Gerald Hewes <hewes@openmarket.com>.
|
||||
# How about differentiating between stratus architectures? -djm
|
||||
echo hppa1.1-stratus-sysv4
|
||||
exit 0 ;;
|
||||
*:*:*:FTX*)
|
||||
# From seanf@swdc.stratus.com.
|
||||
echo i860-stratus-sysv4
|
||||
exit 0 ;;
|
||||
mc68*:A/UX:*:*)
|
||||
echo m68k-apple-aux${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
R3000:*System_V*:*:*)
|
||||
R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:*)
|
||||
if [ -d /usr/nec ]; then
|
||||
echo mips-nec-sysv${UNAME_RELEASE}
|
||||
else
|
||||
@@ -530,7 +615,7 @@ main ()
|
||||
#endif
|
||||
int version;
|
||||
version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
|
||||
printf ("%s-next-nextstep%s\n", __ARCHITECTURE__, version==2 ? "2" : "3");
|
||||
printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
|
||||
exit (0);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -35,6 +35,14 @@
|
||||
This is defined by configure under --enable-libio. */
|
||||
#undef USE_IN_LIBIO
|
||||
|
||||
/* Define if using ELF and the assembler supports the `.previous'
|
||||
directive. */
|
||||
#undef HAVE_ASM_PREVIOUS_DIRECTIVE
|
||||
|
||||
/* Define if using ELF and the assembler supports the `.popsection'
|
||||
directive. */
|
||||
#undef HAVE_ASM_POPSECTION_DIRECTIVE
|
||||
|
||||
/*
|
||||
*/
|
||||
|
||||
|
||||
@@ -3,8 +3,16 @@
|
||||
# Don't edit this file. Put configuration parameters in configparms instead.
|
||||
|
||||
# Installation prefixes.
|
||||
install_root =
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
slibdir = @libc_cv_slibdir@
|
||||
sysconfdir = @libc_cv_sysconfdir@
|
||||
rootsbindir = @libc_cv_rootsbindir@
|
||||
|
||||
# If ldconfig exists. This will go away as soon as `ldconfig' is available
|
||||
# in GNU libc.
|
||||
has-ldconfig = @has_ldconfig@
|
||||
|
||||
# System configuration.
|
||||
config-machine = @host_cpu@
|
||||
@@ -20,6 +28,8 @@ have-initfini = @libc_cv_have_initfini@
|
||||
|
||||
have-no-whole-archive = @libc_cv_ld_no_whole_archive@
|
||||
have-no-exceptions = @libc_cv_gcc_no_exceptions@
|
||||
have-bash2 = @libc_cv_have_bash2@
|
||||
have-ksh = @libc_cv_have_ksh@
|
||||
|
||||
# Configuration options.
|
||||
gnu-as = @gnu_as@
|
||||
@@ -44,5 +54,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
LN_S = @LN_S@
|
||||
MSGFMT = @MSGFMT@
|
||||
BASH = @BASH@
|
||||
KSH = @KSH@
|
||||
|
||||
# More variables may be inserted below by configure.
|
||||
|
||||
Vendored
+27
-9
@@ -151,7 +151,7 @@ case $basic_machine in
|
||||
# Some are omitted here because they have special meanings below.
|
||||
tahoe | i860 | m68k | m68000 | m88k | ns32k | arm \
|
||||
| arme[lb] | pyramid \
|
||||
| tron | a29k | 580 | i960 | h8300 | hppa1.0 | hppa1.1 \
|
||||
| tron | a29k | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 \
|
||||
| alpha | we32k | ns16k | clipper | i370 | sh \
|
||||
| powerpc | powerpcle | 1750a | dsp16xx | mips64 | mipsel \
|
||||
| pdp11 | mips64el | mips64orion | mips64orionel \
|
||||
@@ -174,10 +174,10 @@ case $basic_machine in
|
||||
| sparc-* | ns32k-* | fx80-* | arm-* | c[123]* \
|
||||
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* | power-* \
|
||||
| none-* | 580-* | cray2-* | h8300-* | i960-* | xmp-* | ymp-* \
|
||||
| hppa1.0-* | hppa1.1-* | alpha-* | we32k-* | cydra-* | ns16k-* \
|
||||
| hppa-* | hppa1.0-* | hppa1.1-* | alpha-* | we32k-* | cydra-* | ns16k-* \
|
||||
| pn-* | np1-* | xps100-* | clipper-* | orion-* | sparclite-* \
|
||||
| pdp11-* | sh-* | powerpc-* | powerpcle-* | sparc64-* | mips64-* | mipsel-* \
|
||||
| mips64el-* | mips64orion-* | mips64orionel-*)
|
||||
| mips64el-* | mips64orion-* | mips64orionel-* | f301-*)
|
||||
;;
|
||||
# Recognize the various machine names and aliases which stand
|
||||
# for a CPU type and a company and sometimes even an OS.
|
||||
@@ -337,6 +337,9 @@ case $basic_machine in
|
||||
hp9k8[0-9][0-9] | hp8[0-9][0-9])
|
||||
basic_machine=hppa1.0-hp
|
||||
;;
|
||||
hppa-next)
|
||||
os=-nextstep3
|
||||
;;
|
||||
i370-ibm* | ibm*)
|
||||
basic_machine=i370-ibm
|
||||
os=-mvs
|
||||
@@ -386,6 +389,14 @@ case $basic_machine in
|
||||
miniframe)
|
||||
basic_machine=m68000-convergent
|
||||
;;
|
||||
mipsel*-linux*)
|
||||
basic_machine=mipsel-unknown
|
||||
os=-linux
|
||||
;;
|
||||
mips*-linux*)
|
||||
basic_machine=mips-unknown
|
||||
os=-linux
|
||||
;;
|
||||
mips3*-*)
|
||||
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
|
||||
;;
|
||||
@@ -574,6 +585,9 @@ case $basic_machine in
|
||||
basic_machine=vax-dec
|
||||
os=-vms
|
||||
;;
|
||||
vpp*|vx|vx-*)
|
||||
basic_machine=f301-fujitsu
|
||||
;;
|
||||
vxworks960)
|
||||
basic_machine=i960-wrs
|
||||
os=-vxworks
|
||||
@@ -601,7 +615,11 @@ case $basic_machine in
|
||||
# Here we handle the default manufacturer of certain CPU types. It is in
|
||||
# some cases the only manufacturer, in others, it is the most popular.
|
||||
mips)
|
||||
basic_machine=mips-mips
|
||||
if [ x$os = x-linux ]; then
|
||||
basic_machine=mips-unknown
|
||||
else
|
||||
basic_machine=mips-mips
|
||||
fi
|
||||
;;
|
||||
romp)
|
||||
basic_machine=romp-ibm
|
||||
@@ -678,12 +696,12 @@ case $os in
|
||||
| -amigados* | -msdos* | -newsos* | -unicos* | -aof* | -aos* \
|
||||
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
|
||||
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
|
||||
| -hiux* | -386bsd* | -netbsd* | -freebsd* | -riscix* \
|
||||
| -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
|
||||
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
|
||||
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
|
||||
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
|
||||
| -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
|
||||
| -linux-gnu*)
|
||||
| -linux-gnu* | -uxpv*)
|
||||
# Remember, each alternative MUST END IN *, to match a version number.
|
||||
;;
|
||||
-linux*)
|
||||
@@ -859,6 +877,9 @@ case $basic_machine in
|
||||
*-masscomp)
|
||||
os=-rtu
|
||||
;;
|
||||
f301-fujitsu)
|
||||
os=-uxpv
|
||||
;;
|
||||
*)
|
||||
os=-none
|
||||
;;
|
||||
@@ -877,9 +898,6 @@ case $basic_machine in
|
||||
-sunos*)
|
||||
vendor=sun
|
||||
;;
|
||||
-lynxos*)
|
||||
vendor=lynx
|
||||
;;
|
||||
-aix*)
|
||||
vendor=ibm
|
||||
;;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
# From configure.in CVSid
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated automatically using autoconf version 2.10
|
||||
# Generated automatically using autoconf version 2.12
|
||||
# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
|
||||
#
|
||||
# This configure script is free software; the Free Software Foundation
|
||||
@@ -17,7 +17,7 @@ ac_help="$ac_help
|
||||
ac_help="$ac_help
|
||||
--with-gettext=DIR find GNU gettext source code in DIR (not needed)"
|
||||
ac_help="$ac_help
|
||||
--with-fp if using floating-point hardware default=yes"
|
||||
--with-fp if using floating-point hardware [default=yes]"
|
||||
ac_help="$ac_help
|
||||
--with-gnu-binutils if using GNU binutils (as and ld)"
|
||||
ac_help="$ac_help
|
||||
@@ -28,6 +28,9 @@ ac_help="$ac_help
|
||||
--with-elf if using the ELF object format"
|
||||
ac_help="$ac_help
|
||||
--enable-libio build in GNU libio instead of GNU stdio"
|
||||
ac_help="$ac_help
|
||||
--disable-sanity-checks really do not use threads (should not be used
|
||||
except in special situations) [default=yes]"
|
||||
ac_help="$ac_help
|
||||
--enable-shared build shared library [default=yes if GNU ld & ELF]"
|
||||
ac_help="$ac_help
|
||||
@@ -74,6 +77,8 @@ mandir='${prefix}/man'
|
||||
# Initialize some other variables.
|
||||
subdirs=
|
||||
MFLAGS= MAKEFLAGS=
|
||||
# Maximum number of lines to put in a shell here document.
|
||||
ac_max_here_lines=12
|
||||
|
||||
ac_prev=
|
||||
for ac_option
|
||||
@@ -355,7 +360,7 @@ EOF
|
||||
verbose=yes ;;
|
||||
|
||||
-version | --version | --versio | --versi | --vers)
|
||||
echo "configure generated by autoconf version 2.10"
|
||||
echo "configure generated by autoconf version 2.12"
|
||||
exit 0 ;;
|
||||
|
||||
-with-* | --with-*)
|
||||
@@ -457,11 +462,14 @@ do
|
||||
done
|
||||
|
||||
# NLS nuisances.
|
||||
# Only set LANG and LC_ALL to C if already set.
|
||||
# These must not be set unconditionally because not all systems understand
|
||||
# e.g. LANG=C (notably SCO).
|
||||
if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
|
||||
# Only set these to C if already set. These must not be set unconditionally
|
||||
# because not all systems understand e.g. LANG=C (notably SCO).
|
||||
# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
|
||||
# Non-C LC_CTYPE values break the ctype check.
|
||||
if test "${LANG+set}" = set; then LANG=C; export LANG; fi
|
||||
if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
|
||||
if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
|
||||
if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
|
||||
|
||||
# confdefs.h avoids OS command line length limits that DEFS can exceed.
|
||||
rm -rf conftest* confdefs.h
|
||||
@@ -523,6 +531,7 @@ ac_ext=c
|
||||
ac_cpp='$CPP $CPPFLAGS'
|
||||
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
|
||||
ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
|
||||
cross_compiling=$ac_cv_prog_cc_cross
|
||||
|
||||
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
|
||||
# Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
|
||||
@@ -634,6 +643,15 @@ else
|
||||
fi
|
||||
|
||||
|
||||
# Check whether --enable-sanity-checks or --disable-sanity-checks was given.
|
||||
if test "${enable_sanity_checks+set}" = set; then
|
||||
enableval="$enable_sanity_checks"
|
||||
enable_sanity=$enableval
|
||||
else
|
||||
enable_sanity=yes
|
||||
fi
|
||||
|
||||
|
||||
# Check whether --enable-shared or --disable-shared was given.
|
||||
if test "${enable_shared+set}" = set; then
|
||||
enableval="$enable_shared"
|
||||
@@ -682,7 +700,6 @@ done
|
||||
if test -z "$ac_aux_dir"; then
|
||||
{ echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
|
||||
fi
|
||||
ac_config_mkinstalldirs=$ac_aux_dir/mkinstalldirs
|
||||
ac_config_guess=$ac_aux_dir/config.guess
|
||||
ac_config_sub=$ac_aux_dir/config.sub
|
||||
ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
|
||||
@@ -703,6 +720,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
|
||||
fi
|
||||
|
||||
echo $ac_n "checking host system type""... $ac_c" 1>&6
|
||||
echo "configure:724: checking host system type" >&5
|
||||
|
||||
host_alias=$host
|
||||
case "$host_alias" in
|
||||
@@ -722,6 +740,20 @@ host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
|
||||
host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
|
||||
echo "$ac_t""$host" 1>&6
|
||||
|
||||
|
||||
# The way shlib-versions is used to generate soversions.mk uses a
|
||||
# fairly simplistic model for name recognition that can't distinguish
|
||||
# i486-pc-linux-gnu fully from i486-pc-gnu. So we mutate a $host_os
|
||||
# of `gnu*' here to be `gnu-gnu*' just so that shlib-versions can
|
||||
# tell. This doesn't get used much beyond that, so it's fairly safe.
|
||||
case "$host_os" in
|
||||
linux*)
|
||||
;;
|
||||
gnu*)
|
||||
host_os=`echo $host_os | sed -e 's/gnu/gnu-gnu/'`
|
||||
;;
|
||||
esac
|
||||
|
||||
# We keep the original values in `$config_*' and never modify them, so we
|
||||
# can write them unchanged into config.make. Everything else uses
|
||||
# $machine, $vendor, and $os, and changes them whenever convenient.
|
||||
@@ -768,6 +800,7 @@ esac
|
||||
# This can take a while to compute.
|
||||
sysdep_dir=$srcdir/sysdeps
|
||||
echo $ac_n "checking sysdep dirs""... $ac_c" 1>&6
|
||||
echo "configure:804: checking sysdep dirs" >&5
|
||||
# Make sco3.2v4 become sco3.2.4 and sunos4.1.1_U1 become sunos4.1.1.U1.
|
||||
os="`echo $os | sed 's/\([0-9A-Z]\)[v_]\([0-9A-Z]\)/\1.\2/g'`"
|
||||
|
||||
@@ -968,11 +1001,12 @@ echo "$ac_t""sysdeps/generic sysdeps/stub" 1>&6
|
||||
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
|
||||
# ./install, which can be erroneously created by make from ./install.sh.
|
||||
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
|
||||
echo "configure:1005: checking for a BSD compatible install" >&5
|
||||
if test -z "$INSTALL"; then
|
||||
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
|
||||
IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
|
||||
for ac_dir in $PATH; do
|
||||
# Account for people who put trailing slashes in PATH elements.
|
||||
case "$ac_dir/" in
|
||||
@@ -995,7 +1029,7 @@ else
|
||||
;;
|
||||
esac
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
IFS="$ac_save_IFS"
|
||||
|
||||
fi
|
||||
if test "${ac_cv_path_install+set}" = set; then
|
||||
@@ -1010,21 +1044,18 @@ fi
|
||||
fi
|
||||
echo "$ac_t""$INSTALL" 1>&6
|
||||
|
||||
# The purpose of this command is only to make sure the auxiliary path
|
||||
# is set and that the symbol AC_REQUIRE_AC_PROG_MKINSTALLDIRS is set.
|
||||
|
||||
|
||||
# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
|
||||
# It thinks the first close brace ends the variable substitution.
|
||||
test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
|
||||
|
||||
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
|
||||
|
||||
if test "$INSTALL" = "${srcdir}/install-sh"; then
|
||||
if test "$INSTALL" = "${srcdir}/install-sh -c"; then
|
||||
# The makefiles need to use a different form to find it in $srcdir.
|
||||
INSTALL='$(..)./install-sh'
|
||||
INSTALL='$(..)./install-sh -c'
|
||||
fi
|
||||
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
|
||||
echo "configure:1059: checking whether ln -s works" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@@ -1049,6 +1080,7 @@ do
|
||||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1084: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_MSGFMT'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@@ -1079,6 +1111,7 @@ test -n "$MSGFMT" || MSGFMT=":"
|
||||
|
||||
|
||||
echo $ac_n "checking build system type""... $ac_c" 1>&6
|
||||
echo "configure:1115: checking build system type" >&5
|
||||
|
||||
build_alias=$build
|
||||
case "$build_alias" in
|
||||
@@ -1104,6 +1137,7 @@ fi
|
||||
# Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
|
||||
set dummy ${ac_tool_prefix}gcc; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1141: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@@ -1135,6 +1169,7 @@ if test $host != $build; then
|
||||
# Extract the first word of "gcc cc", so it can be a program name with args.
|
||||
set dummy gcc cc; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1173: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_BUILD_CC'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@@ -1161,6 +1196,7 @@ fi
|
||||
|
||||
fi
|
||||
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
|
||||
echo "configure:1200: checking how to run the C preprocessor" >&5
|
||||
# On Suns, sometimes $CPP names a directory.
|
||||
if test -n "$CPP" && test -d "$CPP"; then
|
||||
CPP=
|
||||
@@ -1175,33 +1211,37 @@ else
|
||||
# On the NeXT, cc -E runs the code through the compiler's parser,
|
||||
# not just through cpp.
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1179 "configure"
|
||||
#line 1215 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <assert.h>
|
||||
Syntax Error
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:1185: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:1221: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out`
|
||||
if test -z "$ac_err"; then
|
||||
:
|
||||
else
|
||||
echo "$ac_err" >&5
|
||||
echo "configure: failed program was:" >&5
|
||||
cat conftest.$ac_ext >&5
|
||||
rm -rf conftest*
|
||||
CPP="${CC-cc} -E -traditional-cpp"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1194 "configure"
|
||||
#line 1232 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <assert.h>
|
||||
Syntax Error
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:1200: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:1238: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out`
|
||||
if test -z "$ac_err"; then
|
||||
:
|
||||
else
|
||||
echo "$ac_err" >&5
|
||||
echo "configure: failed program was:" >&5
|
||||
cat conftest.$ac_ext >&5
|
||||
rm -rf conftest*
|
||||
CPP=/lib/cpp
|
||||
fi
|
||||
@@ -1219,6 +1259,7 @@ echo "$ac_t""$CPP" 1>&6
|
||||
# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
|
||||
set dummy ${ac_tool_prefix}ar; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1263: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@@ -1249,6 +1290,7 @@ fi
|
||||
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
|
||||
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1294: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@@ -1279,6 +1321,7 @@ if test -n "$ac_tool_prefix"; then
|
||||
# Extract the first word of "ranlib", so it can be a program name with args.
|
||||
set dummy ranlib; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1325: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@@ -1310,7 +1353,93 @@ fi
|
||||
fi
|
||||
|
||||
|
||||
# Extract the first word of "bash", so it can be a program name with args.
|
||||
set dummy bash; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1360: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_path_BASH'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
case "$BASH" in
|
||||
/*)
|
||||
ac_cv_path_BASH="$BASH" # Let the user override the test with a path.
|
||||
;;
|
||||
*)
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
|
||||
for ac_dir in $PATH; do
|
||||
test -z "$ac_dir" && ac_dir=.
|
||||
if test -f $ac_dir/$ac_word; then
|
||||
ac_cv_path_BASH="$ac_dir/$ac_word"
|
||||
break
|
||||
fi
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
test -z "$ac_cv_path_BASH" && ac_cv_path_BASH="no"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
BASH="$ac_cv_path_BASH"
|
||||
if test -n "$BASH"; then
|
||||
echo "$ac_t""$BASH" 1>&6
|
||||
else
|
||||
echo "$ac_t""no" 1>&6
|
||||
fi
|
||||
|
||||
if test "$BASH" != no &&
|
||||
$BASH -c 'test "$BASH_VERSINFO" -ge 2 >&/dev/null'; then
|
||||
libc_cv_have_bash2=yes
|
||||
else
|
||||
libc_cv_have_bash2=no
|
||||
fi
|
||||
|
||||
|
||||
if test "$BASH" = no; then
|
||||
# Extract the first word of "ksh", so it can be a program name with args.
|
||||
set dummy ksh; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1401: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_path_KSH'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
case "$KSH" in
|
||||
/*)
|
||||
ac_cv_path_KSH="$KSH" # Let the user override the test with a path.
|
||||
;;
|
||||
*)
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
|
||||
for ac_dir in $PATH; do
|
||||
test -z "$ac_dir" && ac_dir=.
|
||||
if test -f $ac_dir/$ac_word; then
|
||||
ac_cv_path_KSH="$ac_dir/$ac_word"
|
||||
break
|
||||
fi
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
test -z "$ac_cv_path_KSH" && ac_cv_path_KSH="no"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
KSH="$ac_cv_path_KSH"
|
||||
if test -n "$KSH"; then
|
||||
echo "$ac_t""$KSH" 1>&6
|
||||
else
|
||||
echo "$ac_t""no" 1>&6
|
||||
fi
|
||||
|
||||
if test "$KSH" = no; then
|
||||
libc_cv_have_ksh=no
|
||||
else
|
||||
libc_cv_have_ksh=yes
|
||||
fi
|
||||
else
|
||||
KSH="$BASH"
|
||||
|
||||
libc_cv_have_ksh=yes
|
||||
fi
|
||||
|
||||
|
||||
echo $ac_n "checking for signed size_t type""... $ac_c" 1>&6
|
||||
echo "configure:1443: checking for signed size_t type" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_signed_size_t'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@@ -1334,19 +1463,19 @@ EOF
|
||||
fi
|
||||
|
||||
echo $ac_n "checking for libc-friendly stddef.h""... $ac_c" 1>&6
|
||||
echo "configure:1467: checking for libc-friendly stddef.h" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_friendly_stddef'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1342 "configure"
|
||||
#line 1472 "configure"
|
||||
#include "confdefs.h"
|
||||
#define __need_size_t
|
||||
#define __need_wchar_t
|
||||
#include <stddef.h>
|
||||
#define __need_NULL
|
||||
#include <stddef.h>
|
||||
int main() { return 0; }
|
||||
int t() {
|
||||
int main() {
|
||||
size_t size; wchar_t wchar;
|
||||
#ifdef offsetof
|
||||
#error stddef.h ignored __need_*
|
||||
@@ -1354,15 +1483,16 @@ size_t size; wchar_t wchar;
|
||||
if (&size == NULL || &wchar == NULL) abort ();
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1358: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:1487: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
libc_cv_friendly_stddef=yes
|
||||
else
|
||||
echo "configure: failed program was:" >&5
|
||||
cat conftest.$ac_ext >&5
|
||||
rm -rf conftest*
|
||||
libc_cv_friendly_stddef=no
|
||||
fi
|
||||
rm -f conftest*
|
||||
|
||||
fi
|
||||
|
||||
echo "$ac_t""$libc_cv_friendly_stddef" 1>&6
|
||||
@@ -1372,6 +1502,7 @@ override stddef.h = # The installed <stddef.h> seems to be libc-friendly."
|
||||
fi
|
||||
|
||||
echo $ac_n "checking whether we need to use -P to assemble .S files""... $ac_c" 1>&6
|
||||
echo "configure:1506: checking whether we need to use -P to assemble .S files" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_need_minus_P'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@@ -1394,6 +1525,7 @@ asm-CPPFLAGS = -P # The assembler can't grok cpp's # line directives."
|
||||
fi
|
||||
|
||||
echo $ac_n "checking for assembler global-symbol directive""... $ac_c" 1>&6
|
||||
echo "configure:1529: checking for assembler global-symbol directive" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_asm_global_directive'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@@ -1423,6 +1555,7 @@ EOF
|
||||
fi
|
||||
|
||||
echo $ac_n "checking for .set assembler directive""... $ac_c" 1>&6
|
||||
echo "configure:1559: checking for .set assembler directive" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_asm_set_directive'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@@ -1455,31 +1588,84 @@ EOF
|
||||
|
||||
fi
|
||||
|
||||
if test $elf = yes; then
|
||||
echo $ac_n "checking for .previous assembler directive""... $ac_c" 1>&6
|
||||
echo "configure:1594: checking for .previous assembler directive" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_asm_previous_directive'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.s <<EOF
|
||||
.section foo_section
|
||||
.previous
|
||||
EOF
|
||||
if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:1602: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
|
||||
libc_cv_asm_previous_directive=yes
|
||||
else
|
||||
libc_cv_asm_previous_directive=no
|
||||
fi
|
||||
rm -f conftest*
|
||||
fi
|
||||
|
||||
echo "$ac_t""$libc_cv_asm_previous_directive" 1>&6
|
||||
if test $libc_cv_asm_previous_directive = yes; then
|
||||
cat >> confdefs.h <<\EOF
|
||||
#define HAVE_ASM_PREVIOUS_DIRECTIVE 1
|
||||
EOF
|
||||
|
||||
else
|
||||
echo $ac_n "checking for .popsection assembler directive""... $ac_c" 1>&6
|
||||
echo "configure:1618: checking for .popsection assembler directive" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_asm_popsection_directive'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.s <<EOF
|
||||
.pushsection foo_section
|
||||
.popsection
|
||||
EOF
|
||||
if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:1626: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
|
||||
libc_cv_asm_popsection_directive=yes
|
||||
else
|
||||
libc_cv_asm_popsection_directive=no
|
||||
fi
|
||||
rm -f conftest*
|
||||
fi
|
||||
|
||||
echo "$ac_t""$libc_cv_asm_popsection_directive" 1>&6
|
||||
if test $libc_cv_asm_popsection_directive = yes; then
|
||||
cat >> confdefs.h <<\EOF
|
||||
#define HAVE_ASM_POPSECTION_DIRECTIVE 1
|
||||
EOF
|
||||
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test $elf != yes; then
|
||||
echo $ac_n "checking for .init and .fini sections""... $ac_c" 1>&6
|
||||
echo "configure:1646: checking for .init and .fini sections" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_have_initfini'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1465 "configure"
|
||||
#line 1651 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
int main() { return 0; }
|
||||
int t() {
|
||||
int main() {
|
||||
asm (".section .init");
|
||||
asm (".section .fini");
|
||||
asm (".text");
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1475: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:1660: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
libc_cv_have_initfini=yes
|
||||
else
|
||||
echo "configure: failed program was:" >&5
|
||||
cat conftest.$ac_ext >&5
|
||||
rm -rf conftest*
|
||||
libc_cv_have_initfini=no
|
||||
fi
|
||||
rm -f conftest*
|
||||
|
||||
fi
|
||||
|
||||
echo "$ac_t""$libc_cv_have_initfini" 1>&6
|
||||
@@ -1495,27 +1681,28 @@ if test $elf = yes; then
|
||||
libc_cv_asm_underscores=no
|
||||
else
|
||||
echo $ac_n "checking for _ prefix on C symbol names""... $ac_c" 1>&6
|
||||
echo "configure:1685: checking for _ prefix on C symbol names" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_asm_underscores'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1503 "configure"
|
||||
#line 1690 "configure"
|
||||
#include "confdefs.h"
|
||||
asm ("_glibc_foobar:");
|
||||
int main() { return 0; }
|
||||
int t() {
|
||||
int main() {
|
||||
glibc_foobar ();
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1511: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
|
||||
if { (eval echo configure:1697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
rm -rf conftest*
|
||||
libc_cv_asm_underscores=yes
|
||||
else
|
||||
echo "configure: failed program was:" >&5
|
||||
cat conftest.$ac_ext >&5
|
||||
rm -rf conftest*
|
||||
libc_cv_asm_underscores=no
|
||||
fi
|
||||
rm -f conftest*
|
||||
|
||||
fi
|
||||
|
||||
echo "$ac_t""$libc_cv_asm_underscores" 1>&6
|
||||
@@ -1533,6 +1720,7 @@ if test $elf = yes; then
|
||||
libc_cv_asm_weakext_directive=no
|
||||
else
|
||||
echo $ac_n "checking for assembler .weak directive""... $ac_c" 1>&6
|
||||
echo "configure:1724: checking for assembler .weak directive" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_asm_weak_directive'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@@ -1555,6 +1743,7 @@ echo "$ac_t""$libc_cv_asm_weak_directive" 1>&6
|
||||
|
||||
if test $libc_cv_asm_weak_directive = no; then
|
||||
echo $ac_n "checking for assembler .weakext directive""... $ac_c" 1>&6
|
||||
echo "configure:1747: checking for assembler .weakext directive" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_asm_weakext_directive'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@@ -1591,6 +1780,7 @@ EOF
|
||||
fi
|
||||
|
||||
echo $ac_n "checking for ld --no-whole-archive""... $ac_c" 1>&6
|
||||
echo "configure:1784: checking for ld --no-whole-archive" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_ld_no_whole_archive'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@@ -1601,7 +1791,7 @@ __throw () {}
|
||||
EOF
|
||||
if { ac_try='${CC-cc} $CFLAGS
|
||||
-nostdlib -nostartfiles -Wl,--no-whole-archive
|
||||
-o conftest conftest.c'; { (eval echo configure:1605: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
|
||||
-o conftest conftest.c'; { (eval echo configure:1795: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
|
||||
libc_cv_ld_no_whole_archive=yes
|
||||
else
|
||||
libc_cv_ld_no_whole_archive=no
|
||||
@@ -1612,6 +1802,7 @@ fi
|
||||
echo "$ac_t""$libc_cv_ld_no_whole_archive" 1>&6
|
||||
|
||||
echo $ac_n "checking for gcc -fno-exceptions""... $ac_c" 1>&6
|
||||
echo "configure:1806: checking for gcc -fno-exceptions" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_gcc_no_exceptions'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@@ -1622,7 +1813,7 @@ __throw () {}
|
||||
EOF
|
||||
if { ac_try='${CC-cc} $CFLAGS
|
||||
-nostdlib -nostartfiles -fno-exceptions
|
||||
-o conftest conftest.c'; { (eval echo configure:1626: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
|
||||
-o conftest conftest.c'; { (eval echo configure:1817: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
|
||||
libc_cv_gcc_no_exceptions=yes
|
||||
else
|
||||
libc_cv_gcc_no_exceptions=no
|
||||
@@ -1674,6 +1865,7 @@ if test "$uname" = generic; then
|
||||
fi
|
||||
|
||||
echo $ac_n "checking OS release for uname""... $ac_c" 1>&6
|
||||
echo "configure:1869: checking OS release for uname" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_uname_release'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@@ -1695,6 +1887,7 @@ echo "$ac_t""$libc_cv_uname_release" 1>&6
|
||||
uname_release="$libc_cv_uname_release"
|
||||
|
||||
echo $ac_n "checking OS version for uname""... $ac_c" 1>&6
|
||||
echo "configure:1891: checking OS version for uname" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_uname_version'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@@ -1716,6 +1909,7 @@ else
|
||||
fi
|
||||
|
||||
echo $ac_n "checking stdio selection""... $ac_c" 1>&6
|
||||
echo "configure:1913: checking stdio selection" >&5
|
||||
|
||||
case $stdio in
|
||||
libio) cat >> confdefs.h <<\EOF
|
||||
@@ -1726,6 +1920,12 @@ default) stdio=stdio ;;
|
||||
esac
|
||||
echo "$ac_t""$stdio" 1>&6
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if test $gnu_ld = yes; then
|
||||
cat >> confdefs.h <<\EOF
|
||||
@@ -1750,6 +1950,10 @@ fi
|
||||
if test $shared = default; then
|
||||
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
|
||||
|
||||
@@ -1763,6 +1967,9 @@ else
|
||||
config_makefile=Makefile
|
||||
fi
|
||||
|
||||
VERSION=`sed -e 's/^#define VERSION "\([^"]*\)"/\1/p' -e d < $srcdir/version.h`
|
||||
|
||||
|
||||
trap '' 1 2 15
|
||||
cat > confcache <<\EOF
|
||||
# This file is a shell script that caches the results of configure
|
||||
@@ -1780,11 +1987,25 @@ cat > confcache <<\EOF
|
||||
# --recheck option to rerun configure.
|
||||
#
|
||||
EOF
|
||||
# The following way of writing the cache mishandles newlines in values,
|
||||
# but we know of no workaround that is simple, portable, and efficient.
|
||||
# So, don't put newlines in cache variables' values.
|
||||
# Ultrix sh set writes to stderr and can't be redirected directly,
|
||||
# and sets the high bit in the cache file unless we assign to the vars.
|
||||
(set) 2>&1 |
|
||||
sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\${\1='\2'}/p" \
|
||||
>> confcache
|
||||
case `(ac_space=' '; set | grep ac_space) 2>&1` in
|
||||
*ac_space=\ *)
|
||||
# `set' does not quote correctly, so add quotes (double-quote substitution
|
||||
# turns \\\\ into \\, and sed turns \\ into \).
|
||||
sed -n \
|
||||
-e "s/'/'\\\\''/g" \
|
||||
-e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
|
||||
;;
|
||||
*)
|
||||
# `set' quotes correctly as required by POSIX, so do not add quotes.
|
||||
sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
|
||||
;;
|
||||
esac >> confcache
|
||||
if cmp -s $cache_file confcache; then
|
||||
:
|
||||
else
|
||||
@@ -1839,7 +2060,7 @@ do
|
||||
echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
|
||||
exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
|
||||
-version | --version | --versio | --versi | --vers | --ver | --ve | --v)
|
||||
echo "$CONFIG_STATUS generated by autoconf version 2.10"
|
||||
echo "$CONFIG_STATUS generated by autoconf version 2.12"
|
||||
exit 0 ;;
|
||||
-help | --help | --hel | --he | --h)
|
||||
echo "\$ac_cs_usage"; exit 0 ;;
|
||||
@@ -1850,7 +2071,7 @@ done
|
||||
ac_given_srcdir=$srcdir
|
||||
ac_given_INSTALL="$INSTALL"
|
||||
|
||||
trap 'rm -fr `echo "config.make ${config_makefile} ${config_uname} config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
|
||||
trap 'rm -fr `echo "config.make glibcbug ${config_makefile} ${config_uname} config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
|
||||
EOF
|
||||
cat >> $CONFIG_STATUS <<EOF
|
||||
|
||||
@@ -1902,6 +2123,10 @@ s%@BUILD_CC@%$BUILD_CC%g
|
||||
s%@CPP@%$CPP%g
|
||||
s%@AR@%$AR%g
|
||||
s%@RANLIB@%$RANLIB%g
|
||||
s%@BASH@%$BASH%g
|
||||
s%@libc_cv_have_bash2@%$libc_cv_have_bash2%g
|
||||
s%@KSH@%$KSH%g
|
||||
s%@libc_cv_have_ksh@%$libc_cv_have_ksh%g
|
||||
s%@libc_cv_have_initfini@%$libc_cv_have_initfini%g
|
||||
s%@libc_cv_ld_no_whole_archive@%$libc_cv_ld_no_whole_archive%g
|
||||
s%@libc_cv_gcc_no_exceptions@%$libc_cv_gcc_no_exceptions%g
|
||||
@@ -1909,6 +2134,10 @@ s%@uname_sysname@%$uname_sysname%g
|
||||
s%@uname_release@%$uname_release%g
|
||||
s%@uname_version@%$uname_version%g
|
||||
s%@stdio@%$stdio%g
|
||||
s%@libc_cv_slibdir@%$libc_cv_slibdir%g
|
||||
s%@libc_cv_sysconfdir@%$libc_cv_sysconfdir%g
|
||||
s%@libc_cv_rootsbindir@%$libc_cv_rootsbindir%g
|
||||
s%@has_ldconfig@%$has_ldconfig%g
|
||||
s%@gnu_ld@%$gnu_ld%g
|
||||
s%@gnu_as@%$gnu_as%g
|
||||
s%@elf@%$elf%g
|
||||
@@ -1916,23 +2145,60 @@ s%@shared@%$shared%g
|
||||
s%@profile@%$profile%g
|
||||
s%@omitfp@%$omitfp%g
|
||||
s%@DEFINES@%$DEFINES%g
|
||||
s%@VERSION@%$VERSION%g
|
||||
|
||||
CEOF
|
||||
EOF
|
||||
|
||||
cat >> $CONFIG_STATUS <<\EOF
|
||||
|
||||
# Split the substitutions into bite-sized pieces for seds with
|
||||
# small command number limits, like on Digital OSF/1 and HP-UX.
|
||||
ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
|
||||
ac_file=1 # Number of current file.
|
||||
ac_beg=1 # First line for current file.
|
||||
ac_end=$ac_max_sed_cmds # Line after last line for current file.
|
||||
ac_more_lines=:
|
||||
ac_sed_cmds=""
|
||||
while $ac_more_lines; do
|
||||
if test $ac_beg -gt 1; then
|
||||
sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
|
||||
else
|
||||
sed "${ac_end}q" conftest.subs > conftest.s$ac_file
|
||||
fi
|
||||
if test ! -s conftest.s$ac_file; then
|
||||
ac_more_lines=false
|
||||
rm -f conftest.s$ac_file
|
||||
else
|
||||
if test -z "$ac_sed_cmds"; then
|
||||
ac_sed_cmds="sed -f conftest.s$ac_file"
|
||||
else
|
||||
ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
|
||||
fi
|
||||
ac_file=`expr $ac_file + 1`
|
||||
ac_beg=$ac_end
|
||||
ac_end=`expr $ac_end + $ac_max_sed_cmds`
|
||||
fi
|
||||
done
|
||||
if test -z "$ac_sed_cmds"; then
|
||||
ac_sed_cmds=cat
|
||||
fi
|
||||
EOF
|
||||
|
||||
cat >> $CONFIG_STATUS <<EOF
|
||||
|
||||
CONFIG_FILES=\${CONFIG_FILES-"config.make ${config_makefile} ${config_uname}"}
|
||||
CONFIG_FILES=\${CONFIG_FILES-"config.make glibcbug ${config_makefile} ${config_uname}"}
|
||||
EOF
|
||||
cat >> $CONFIG_STATUS <<\EOF
|
||||
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
|
||||
# Support "outfile[:infile]", defaulting infile="outfile.in".
|
||||
# Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
|
||||
case "$ac_file" in
|
||||
*:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
|
||||
*:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
|
||||
ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
|
||||
*) ac_file_in="${ac_file}.in" ;;
|
||||
esac
|
||||
|
||||
# Adjust relative srcdir, etc. for subdirectories.
|
||||
# Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
|
||||
|
||||
# Remove last slash and all that follows it. Not all systems have dirname.
|
||||
ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
|
||||
@@ -1960,6 +2226,7 @@ for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
|
||||
[/$]*) INSTALL="$ac_given_INSTALL" ;;
|
||||
*) INSTALL="$ac_dots$ac_given_INSTALL" ;;
|
||||
esac
|
||||
|
||||
echo creating "$ac_file"
|
||||
rm -f "$ac_file"
|
||||
configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
|
||||
@@ -1968,14 +2235,16 @@ for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
|
||||
# $configure_input" ;;
|
||||
*) ac_comsub= ;;
|
||||
esac
|
||||
|
||||
ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
|
||||
sed -e "$ac_comsub
|
||||
s%@configure_input@%$configure_input%g
|
||||
s%@srcdir@%$srcdir%g
|
||||
s%@top_srcdir@%$top_srcdir%g
|
||||
s%@INSTALL@%$INSTALL%g
|
||||
" -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file
|
||||
" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
|
||||
fi; done
|
||||
rm -f conftest.subs
|
||||
rm -f conftest.s*
|
||||
|
||||
# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
|
||||
# NAME is the cpp macro being defined and VALUE is the value it is being given.
|
||||
@@ -1996,11 +2265,17 @@ ac_eB='$%\1#\2define\3'
|
||||
ac_eC=' '
|
||||
ac_eD='%g'
|
||||
|
||||
CONFIG_HEADERS=${CONFIG_HEADERS-"config.h"}
|
||||
if test "${CONFIG_HEADERS+set}" != set; then
|
||||
EOF
|
||||
cat >> $CONFIG_STATUS <<EOF
|
||||
CONFIG_HEADERS="config.h"
|
||||
EOF
|
||||
cat >> $CONFIG_STATUS <<\EOF
|
||||
fi
|
||||
for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
|
||||
# Support "outfile[:infile]", defaulting infile="outfile.in".
|
||||
# Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
|
||||
case "$ac_file" in
|
||||
*:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
|
||||
*:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
|
||||
ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
|
||||
*) ac_file_in="${ac_file}.in" ;;
|
||||
esac
|
||||
@@ -2008,7 +2283,8 @@ for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
|
||||
echo creating $ac_file
|
||||
|
||||
rm -f conftest.frag conftest.in conftest.out
|
||||
cp $ac_given_srcdir/$ac_file_in conftest.in
|
||||
ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
|
||||
cat $ac_file_inputs > conftest.in
|
||||
|
||||
EOF
|
||||
|
||||
@@ -2036,8 +2312,6 @@ EOF
|
||||
|
||||
# Break up conftest.vals because some shells have a limit on
|
||||
# the size of here documents, and old seds have small limits too.
|
||||
# Maximum number of lines to put in a single here document.
|
||||
ac_max_here_lines=12
|
||||
|
||||
rm -f conftest.tail
|
||||
while :
|
||||
@@ -2184,13 +2458,16 @@ if test "$no_recursion" != yes; then
|
||||
ac_popdir=`pwd`
|
||||
cd $ac_config_dir
|
||||
|
||||
# A "../" for each directory in /$ac_config_dir.
|
||||
ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'`
|
||||
|
||||
case "$srcdir" in
|
||||
.) # No --srcdir option. We are building in place.
|
||||
ac_sub_srcdir=$srcdir ;;
|
||||
/*) # Absolute path.
|
||||
ac_sub_srcdir=$srcdir/$ac_config_dir ;;
|
||||
*) # Relative path.
|
||||
ac_sub_srcdir=../$srcdir/$ac_config_dir ;;
|
||||
ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;;
|
||||
esac
|
||||
|
||||
# Check for guested configure; otherwise get Cygnus style configure.
|
||||
@@ -2207,8 +2484,6 @@ if test "$no_recursion" != yes; then
|
||||
if test -n "$ac_sub_configure"; then
|
||||
|
||||
# Make the cache file name correct relative to the subdirectory.
|
||||
# A "../" for each directory in /$ac_config_dir.
|
||||
ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'`
|
||||
case "$cache_file" in
|
||||
/*) ac_sub_cache_file=$cache_file ;;
|
||||
*) # Relative path.
|
||||
|
||||
+95
-5
@@ -1,6 +1,6 @@
|
||||
Dnl Process this file with autoconf to produce a configure script.
|
||||
AC_REVISION([$CVSid$])
|
||||
AC_PREREQ(2.10)dnl dnl Minimum Autoconf version required.
|
||||
AC_PREREQ(2.11)dnl dnl Minimum Autoconf version required.
|
||||
AC_INIT(features.h)
|
||||
AC_CONFIG_HEADER(config.h)
|
||||
|
||||
@@ -34,7 +34,7 @@ esac
|
||||
|
||||
dnl Arguments to specify presence of other packages/features.
|
||||
AC_ARG_WITH(fp, dnl
|
||||
--with-fp if using floating-point hardware [default=yes],
|
||||
[ --with-fp if using floating-point hardware [default=yes]],
|
||||
with_fp=$withval, with_fp=yes)
|
||||
AC_ARG_WITH(gnu-binutils, dnl
|
||||
--with-gnu-binutils if using GNU binutils (as and ld),
|
||||
@@ -59,6 +59,11 @@ AC_ARG_ENABLE(libio, dnl
|
||||
fi],
|
||||
stdio=default)
|
||||
|
||||
AC_ARG_ENABLE(sanity-checks, dnl
|
||||
[ --disable-sanity-checks really do not use threads (should not be used
|
||||
except in special situations) [default=yes]],
|
||||
enable_sanity=$enableval, enable_sanity=yes)
|
||||
|
||||
dnl Arguments to enable or disable building the shared, profiled, and
|
||||
dnl -fomit-frame-pointer libraries.
|
||||
AC_ARG_ENABLE(shared, dnl
|
||||
@@ -85,6 +90,20 @@ if test x"$add_ons" != x; then
|
||||
fi
|
||||
|
||||
AC_CANONICAL_HOST
|
||||
|
||||
# The way shlib-versions is used to generate soversions.mk uses a
|
||||
# fairly simplistic model for name recognition that can't distinguish
|
||||
# i486-pc-linux-gnu fully from i486-pc-gnu. So we mutate a $host_os
|
||||
# of `gnu*' here to be `gnu-gnu*' just so that shlib-versions can
|
||||
# tell. This doesn't get used much beyond that, so it's fairly safe.
|
||||
case "$host_os" in
|
||||
linux*)
|
||||
;;
|
||||
gnu*)
|
||||
host_os=`echo $host_os | sed -e 's/gnu/gnu-gnu/'`
|
||||
;;
|
||||
esac
|
||||
|
||||
# We keep the original values in `$config_*' and never modify them, so we
|
||||
# can write them unchanged into config.make. Everything else uses
|
||||
# $machine, $vendor, and $os, and changes them whenever convenient.
|
||||
@@ -330,9 +349,9 @@ AC_MSG_RESULT(sysdeps/generic sysdeps/stub)
|
||||
### Locate tools.
|
||||
|
||||
AC_PROG_INSTALL
|
||||
if test "$INSTALL" = "${srcdir}/install-sh"; then
|
||||
if test "$INSTALL" = "${srcdir}/install-sh -c"; then
|
||||
# The makefiles need to use a different form to find it in $srcdir.
|
||||
INSTALL='$(..)./install-sh'
|
||||
INSTALL='$(..)./install-sh -c'
|
||||
fi
|
||||
AC_PROG_LN_S
|
||||
AC_CHECK_PROGS(MSGFMT, msgfmt gmsgfmt, :)
|
||||
@@ -345,6 +364,30 @@ AC_PROG_CPP
|
||||
AC_CHECK_TOOL(AR, ar)
|
||||
AC_CHECK_TOOL(RANLIB, ranlib, :)
|
||||
|
||||
AC_PATH_PROG(BASH, bash, no)
|
||||
if test "$BASH" != no &&
|
||||
$BASH -c 'test "$BASH_VERSINFO" -ge 2 >&/dev/null'; then
|
||||
libc_cv_have_bash2=yes
|
||||
else
|
||||
libc_cv_have_bash2=no
|
||||
fi
|
||||
AC_SUBST(libc_cv_have_bash2)
|
||||
|
||||
dnl We need a ksh compatible shell for tzselect.
|
||||
if test "$BASH" = no; then
|
||||
AC_PATH_PROG(KSH, ksh, no)
|
||||
if test "$KSH" = no; then
|
||||
libc_cv_have_ksh=no
|
||||
else
|
||||
libc_cv_have_ksh=yes
|
||||
fi
|
||||
else
|
||||
KSH="$BASH"
|
||||
AC_SUBST(KSH)
|
||||
libc_cv_have_ksh=yes
|
||||
fi
|
||||
AC_SUBST(libc_cv_have_ksh)
|
||||
|
||||
AC_CACHE_CHECK(for signed size_t type, libc_cv_signed_size_t, [dnl
|
||||
echo '#include <stddef.h>
|
||||
FOOBAR __SIZE_TYPE__ FOOBAR' > conftest.c
|
||||
@@ -443,6 +486,40 @@ if test $libc_cv_asm_set_directive = yes; then
|
||||
AC_DEFINE(HAVE_ASM_SET_DIRECTIVE)
|
||||
fi
|
||||
|
||||
if test $elf = yes; then
|
||||
AC_CACHE_CHECK(for .previous assembler directive,
|
||||
libc_cv_asm_previous_directive, [dnl
|
||||
cat > conftest.s <<EOF
|
||||
.section foo_section
|
||||
.previous
|
||||
EOF
|
||||
if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AC_FD_CC); then
|
||||
libc_cv_asm_previous_directive=yes
|
||||
else
|
||||
libc_cv_asm_previous_directive=no
|
||||
fi
|
||||
rm -f conftest*])
|
||||
if test $libc_cv_asm_previous_directive = yes; then
|
||||
AC_DEFINE(HAVE_ASM_PREVIOUS_DIRECTIVE)
|
||||
else
|
||||
AC_CACHE_CHECK(for .popsection assembler directive,
|
||||
libc_cv_asm_popsection_directive, [dnl
|
||||
cat > conftest.s <<EOF
|
||||
.pushsection foo_section
|
||||
.popsection
|
||||
EOF
|
||||
if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AC_FD_CC); then
|
||||
libc_cv_asm_popsection_directive=yes
|
||||
else
|
||||
libc_cv_asm_popsection_directive=no
|
||||
fi
|
||||
rm -f conftest*])
|
||||
if test $libc_cv_asm_popsection_directive = yes; then
|
||||
AC_DEFINE(HAVE_ASM_POPSECTION_DIRECTIVE)
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test $elf != yes; then
|
||||
AC_CACHE_CHECK(for .init and .fini sections, libc_cv_have_initfini,
|
||||
[AC_TRY_COMPILE(, [asm (".section .init");
|
||||
@@ -649,6 +726,12 @@ default) stdio=stdio ;;
|
||||
esac
|
||||
AC_MSG_RESULT($stdio)
|
||||
|
||||
AC_SUBST(libc_cv_slibdir)
|
||||
AC_SUBST(libc_cv_sysconfdir)
|
||||
AC_SUBST(libc_cv_rootsbindir)
|
||||
|
||||
AC_SUBST(has_ldconfig)
|
||||
|
||||
AC_SUBST(gnu_ld) AC_SUBST(gnu_as) AC_SUBST(elf)
|
||||
if test $gnu_ld = yes; then
|
||||
AC_DEFINE(HAVE_GNU_LD)
|
||||
@@ -664,6 +747,10 @@ AC_SUBST(shared)
|
||||
if test $shared = default; then
|
||||
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
|
||||
AC_SUBST(profile)
|
||||
@@ -677,5 +764,8 @@ else
|
||||
config_makefile=Makefile
|
||||
fi
|
||||
|
||||
AC_OUTPUT(config.make ${config_makefile} ${config_uname}, ,
|
||||
VERSION=`sed -e 's/^#define VERSION "\([^"]*\)"/\1/p' -e d < $srcdir/version.h`
|
||||
AC_SUBST(VERSION)
|
||||
|
||||
AC_OUTPUT(config.make glibcbug ${config_makefile} ${config_uname}, ,
|
||||
[echo '$config_vars' >> config.make])
|
||||
|
||||
+4
-5
@@ -14,9 +14,9 @@
|
||||
# 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., 675 Mass Ave,
|
||||
# Cambridge, MA 02139, USA.
|
||||
# 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.
|
||||
|
||||
# This directory contains the C startup code (that which calls main). This
|
||||
# consists of the startfile, built from start.c and installed as crt0.o
|
||||
@@ -71,7 +71,7 @@ generated += $(crtstuff:=.s)
|
||||
omit-deps += $(crtstuff)
|
||||
|
||||
# Compile initfini.c to assembly code, which contains embedded shell
|
||||
# commands that prodice crti.s-new and crtn.s-new when run. We need to
|
||||
# commands that produce crti.s-new and crtn.s-new when run. We need to
|
||||
# disable emission of .size directives and debugging information, since
|
||||
# they will get confused by the splitting of the output we do.
|
||||
$(objpfx)cr%i.s $(objpfx)cr%n.s: initfini.c; $(initfini)
|
||||
@@ -113,4 +113,3 @@ $(addprefix $(objpfx),$(filter-out $(start-installed-name),$(csu-dummies))):
|
||||
cp /dev/null $(@:.o=.c)
|
||||
$(COMPILE.c) $(@:.o=.c) $(OUTPUT_OPTION)
|
||||
rm -f $(@:.o=.c)
|
||||
|
||||
|
||||
+15
-15
@@ -1,21 +1,21 @@
|
||||
/* Code to enable profiling at program startup.
|
||||
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Copyright (C) 1995, 1996 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 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.
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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 <sys/types.h>
|
||||
#include <sys/gmon.h>
|
||||
@@ -52,7 +52,7 @@ __gmon_start__ (void)
|
||||
/* Start keeping profiling records. */
|
||||
monstartup ((u_long) &_start, (u_long) &etext);
|
||||
|
||||
/* Call _mcleanup before exitting; it will write out gmon.out from the
|
||||
/* Call _mcleanup before exiting; it will write out gmon.out from the
|
||||
collected data. */
|
||||
atexit (&_mcleanup);
|
||||
}
|
||||
|
||||
+23
-14
@@ -1,21 +1,30 @@
|
||||
/* Special .init and .fini section support.
|
||||
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Copyright (C) 1995, 1996 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 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.
|
||||
In addition to the permissions in the GNU Library General Public
|
||||
License, the Free Software Foundation gives you unlimited
|
||||
permission to link the compiled version of this file with other
|
||||
programs, and to distribute those programs without any restriction
|
||||
coming from the use of this file. (The Library General Public
|
||||
License restrictions do apply in other respects; for example, they
|
||||
cover modification of the file, and distribution when not linked
|
||||
into another program.)
|
||||
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* This file is compiled into assembly code which is then surrounded by the
|
||||
lines `cat > crtcommon.tmp <<\EOF_common' and `EOF_common' and thus
|
||||
|
||||
+4
-4
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1991, 1992, 1993, 1997 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
|
||||
@@ -12,9 +12,9 @@
|
||||
# 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., 675 Mass Ave,
|
||||
# Cambridge, MA 02139, USA.
|
||||
# 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 ctype portion of the library.
|
||||
|
||||
+20
-20
@@ -1,23 +1,23 @@
|
||||
/* Copyright (C) 1991, 92, 93, 95, 96 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
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 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.
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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. */
|
||||
|
||||
/*
|
||||
* ANSI Standard 4.3: CHARACTER HANDLING <ctype.h>
|
||||
* ISO C Standard 4.3: CHARACTER HANDLING <ctype.h>
|
||||
*/
|
||||
|
||||
#ifndef _CTYPE_H
|
||||
@@ -65,7 +65,7 @@ enum
|
||||
|
||||
These point into arrays of 384, so they can be indexed by any `unsigned
|
||||
char' value [0,255]; by EOF (-1); or by any `signed char' value
|
||||
[-128,-1). ANSI requires that the ctype functions work for `unsigned
|
||||
[-128,-1). ISO C requires that the ctype functions work for `unsigned
|
||||
char' values and for EOF; we also support negative `signed char' values
|
||||
for broken old programs. The case conversion arrays are of `int's
|
||||
rather than `unsigned char's because tolower (EOF) must be EOF, which
|
||||
@@ -78,8 +78,8 @@ extern __const int *__ctype_toupper; /* Case conversions. */
|
||||
#define __isctype(c, type) \
|
||||
(__ctype_b[(int) (c)] & (unsigned short int) type)
|
||||
|
||||
#define __isascii(c) (((c) & (1 << 7)) == 0) /* If high bit is set. */
|
||||
#define __toascii(c) ((c) & 0x7f) /* Mask off high bit. */
|
||||
#define __isascii(c) (((c) & ~0x7f) == 0) /* If C is a 7 bit value. */
|
||||
#define __toascii(c) ((c) & 0x7f) /* Mask off high bits. */
|
||||
|
||||
#define __tolower(c) ((int) __ctype_tolower[(int) (c)])
|
||||
#define __toupper(c) ((int) __ctype_toupper[(int) (c)])
|
||||
@@ -114,7 +114,7 @@ extern int tolower __P ((int __c));
|
||||
extern int toupper __P ((int __c));
|
||||
|
||||
|
||||
#if defined(__USE_SVID) || defined(__USE_MISC)
|
||||
#if defined(__USE_SVID) || defined(__USE_MISC) || defined(__USE_XOPEN)
|
||||
|
||||
/* Return nonzero iff C is in the ASCII set
|
||||
(i.e., is no more than 7 bits wide). */
|
||||
@@ -126,7 +126,7 @@ extern int toascii __P ((int __c));
|
||||
|
||||
#endif /* Use SVID or use misc. */
|
||||
|
||||
#ifdef __USE_SVID
|
||||
#if defined(__USE_SVID) || defined(__USE_MISC) || defined(__USE_XOPEN)
|
||||
/* These are the same as `toupper' and `tolower'. */
|
||||
__exctype (_toupper);
|
||||
__exctype (_tolower);
|
||||
@@ -152,7 +152,7 @@ __exctype (_tolower);
|
||||
#define tolower(c) __tolower(c)
|
||||
#define toupper(c) __toupper(c)
|
||||
|
||||
#if defined(__USE_SVID) || defined(__USE_MISC)
|
||||
#if defined(__USE_SVID) || defined(__USE_MISC) || defined(__USE_XOPEN)
|
||||
#define isascii(c) __isascii(c)
|
||||
#define toascii(c) __toascii(c)
|
||||
#endif
|
||||
|
||||
+2
-2
@@ -201,7 +201,7 @@ delete: if (__bt_dleaf(t, key, h, index) == RET_ERROR) {
|
||||
* into the offset array, shift the pointers up.
|
||||
*/
|
||||
nbytes = NBLEAFDBT(key->size, data->size);
|
||||
if (h->upper - h->lower < nbytes + sizeof(indx_t)) {
|
||||
if ((u_int32_t) (h->upper - h->lower) < nbytes + sizeof(indx_t)) {
|
||||
if ((status = __bt_split(t, h, key,
|
||||
data, dflags, nbytes, index)) != RET_SUCCESS)
|
||||
return (status);
|
||||
@@ -284,7 +284,7 @@ bt_fast(t, key, data, exactp)
|
||||
* have to search to get split stack.
|
||||
*/
|
||||
nbytes = NBLEAFDBT(key->size, data->size);
|
||||
if (h->upper - h->lower < nbytes + sizeof(indx_t))
|
||||
if ((u_int32_t) (h->upper - h->lower) < nbytes + sizeof(indx_t))
|
||||
goto miss;
|
||||
|
||||
if (t->bt_order == FORWARD) {
|
||||
|
||||
+2
-2
@@ -92,7 +92,7 @@ __bt_seq(dbp, key, data, flags)
|
||||
}
|
||||
|
||||
/*
|
||||
* If scan unitialized as yet, or starting at a specific record, set
|
||||
* If scan uninitialized as yet, or starting at a specific record, set
|
||||
* the scan to a specific key. Both __bt_seqset and __bt_seqadv pin
|
||||
* the page the cursor references if they're successful.
|
||||
*/
|
||||
@@ -364,7 +364,7 @@ __bt_first(t, key, erval, exactp)
|
||||
*erval = *ep;
|
||||
return (RET_SUCCESS);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Walk backwards, as long as the entry matches and there are
|
||||
* keys left in the tree. Save a copy of each match in case
|
||||
|
||||
+2
-1
@@ -215,7 +215,8 @@ __bt_split(t, sp, key, data, flags, ilen, argskip)
|
||||
}
|
||||
|
||||
/* Split the parent page if necessary or shift the indices. */
|
||||
if (h->upper - h->lower < nbytes + sizeof(indx_t)) {
|
||||
if ((u_int32_t) (h->upper - h->lower)
|
||||
< nbytes + sizeof(indx_t)) {
|
||||
sp = h;
|
||||
h = h->pgno == P_ROOT ?
|
||||
bt_root(t, h, &l, &r, &skip, nbytes) :
|
||||
|
||||
+1
-1
@@ -76,7 +76,7 @@ __bt_ret(t, e, key, rkey, data, rdata, copy)
|
||||
bl = GETBLEAF(e->page, e->index);
|
||||
|
||||
/*
|
||||
* We must copy big keys/data to make them contigous. Otherwise,
|
||||
* We must copy big keys/data to make them contiguous. Otherwise,
|
||||
* leave the page pinned and don't copy unless the user specified
|
||||
* concurrent access.
|
||||
*/
|
||||
|
||||
+1
-1
@@ -161,7 +161,7 @@ typedef struct _rinternal {
|
||||
#define NRINTERNAL \
|
||||
LALIGN(sizeof(recno_t) + sizeof(pgno_t))
|
||||
|
||||
/* Copy a RINTERAL entry to the page. */
|
||||
/* Copy a RINTERNAL entry to the page. */
|
||||
#define WR_RINTERNAL(p, nrecs, pgno) { \
|
||||
*(recno_t *)p = nrecs; \
|
||||
p += sizeof(recno_t); \
|
||||
|
||||
+5
-4
@@ -157,7 +157,8 @@ __hash_open(file, flags, mode, info, dflags)
|
||||
if (hashp->VERSION != HASHVERSION &&
|
||||
hashp->VERSION != OLDHASHVERSION)
|
||||
RETURN_ERROR(EFTYPE, error1);
|
||||
if (hashp->hash(CHARKEY, sizeof(CHARKEY)) != hashp->H_CHARKEY)
|
||||
if (hashp->hash(CHARKEY, sizeof(CHARKEY))
|
||||
!= (u_int32_t) hashp->H_CHARKEY)
|
||||
RETURN_ERROR(EFTYPE, error1);
|
||||
/*
|
||||
* Figure out how many segments we need. Max_Bucket is the
|
||||
@@ -189,7 +190,7 @@ __hash_open(file, flags, mode, info, dflags)
|
||||
__buf_init(hashp, DEF_BUFSIZE);
|
||||
|
||||
hashp->new_file = new_table;
|
||||
hashp->save_file = file && (hashp->flags & O_RDWR);
|
||||
hashp->save_file = file && (hashp->flags & O_ACCMODE) != O_RDONLY;
|
||||
hashp->cbucket = -1;
|
||||
if (!(dbp = (DB *)malloc(sizeof(DB)))) {
|
||||
save_errno = errno;
|
||||
@@ -744,7 +745,7 @@ hash_seq(dbp, key, data, flag)
|
||||
for (bp = NULL; !bp || !bp[0]; ) {
|
||||
if (!(bufp = hashp->cpage)) {
|
||||
for (bucket = hashp->cbucket;
|
||||
bucket <= hashp->MAX_BUCKET;
|
||||
bucket <= (u_int32_t) hashp->MAX_BUCKET;
|
||||
bucket++, hashp->cndx = 1) {
|
||||
bufp = __get_buf(hashp, bucket, NULL, 0);
|
||||
if (!bufp)
|
||||
@@ -848,7 +849,7 @@ __expand_table(hashp)
|
||||
hashp->OVFL_POINT = spare_ndx;
|
||||
}
|
||||
|
||||
if (new_bucket > hashp->HIGH_MASK) {
|
||||
if (new_bucket > (u_int32_t) hashp->HIGH_MASK) {
|
||||
/* Starting a new doubling */
|
||||
hashp->LOW_MASK = hashp->HIGH_MASK;
|
||||
hashp->HIGH_MASK = new_bucket | hashp->LOW_MASK;
|
||||
|
||||
+1
-1
@@ -104,7 +104,7 @@ typedef struct htab { /* Memory resident data structure */
|
||||
int cbucket; /* Current bucket */
|
||||
int cndx; /* Index of next item on cpage */
|
||||
int errnum; /* Error Number -- for DBM
|
||||
* compatability */
|
||||
* compatibility */
|
||||
int new_file; /* Indicates if fd is backing store
|
||||
* or no */
|
||||
int save_file; /* Indicates whether we need to flush
|
||||
|
||||
@@ -147,7 +147,7 @@ __big_insert(hashp, bufp, key, val)
|
||||
* Here's the hack to make sure that if the data ends on the
|
||||
* same page as the key ends, FREESPACE is at least one.
|
||||
*/
|
||||
if (space == val_size && val_size == val->size)
|
||||
if ((int) space == val_size && (size_t) val_size == val->size)
|
||||
move_bytes--;
|
||||
off = OFFSET(p) - move_bytes;
|
||||
memmove(cp + off, val_data, move_bytes);
|
||||
@@ -431,7 +431,7 @@ __big_return(hashp, bufp, ndx, val, set_current)
|
||||
}
|
||||
|
||||
val->size = collect_data(hashp, bufp, (int)len, set_current);
|
||||
if (val->size == -1)
|
||||
if (val->size == (size_t) -1)
|
||||
return (-1);
|
||||
if (save_p->addr != save_addr) {
|
||||
/* We are pretty short on buffers. */
|
||||
@@ -510,7 +510,7 @@ __big_keydata(hashp, bufp, key, val, set)
|
||||
int set;
|
||||
{
|
||||
key->size = collect_key(hashp, bufp, 0, val, set);
|
||||
if (key->size == -1)
|
||||
if (key->size == (size_t) -1)
|
||||
return (-1);
|
||||
key->data = (u_char *)hashp->tmp_key;
|
||||
return (0);
|
||||
|
||||
+20
-18
@@ -1,22 +1,22 @@
|
||||
/* makedb -- create simple DB database from textual input.
|
||||
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
|
||||
Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
|
||||
|
||||
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 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.
|
||||
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. */
|
||||
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 <db.h>
|
||||
#include <ctype.h>
|
||||
@@ -52,6 +52,7 @@ static void usage __P ((int status)) __attribute__ ((noreturn));
|
||||
static int process_input __P ((FILE *input, const char *inname, DB *output,
|
||||
int to_lowercase, int be_quiet));
|
||||
static int print_database __P ((DB *db));
|
||||
int main __P ((int argc, char *argv[]));
|
||||
|
||||
|
||||
int
|
||||
@@ -85,7 +86,7 @@ main (argc, argv)
|
||||
be_quiet = 0;
|
||||
output_name = NULL;
|
||||
|
||||
while ((opt = getopt_long (argc, argv, "fho:uV", long_options, NULL)) != EOF)
|
||||
while ((opt = getopt_long (argc, argv, "fho:uV", long_options, NULL)) != -1)
|
||||
switch (opt)
|
||||
{
|
||||
case '\0': /* Long option. */
|
||||
@@ -120,7 +121,7 @@ main (argc, argv)
|
||||
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\
|
||||
"), "1996");
|
||||
"), "1996, 1997");
|
||||
printf (_("Written by %s.\n"), "Ulrich Drepper");
|
||||
|
||||
exit (EXIT_SUCCESS);
|
||||
@@ -223,7 +224,8 @@ Mandatory arguments to long options are mandatory for short options too.\n\
|
||||
If INPUT-FILE is -, input is read from standard input.\n"),
|
||||
program_invocation_name, program_invocation_name,
|
||||
program_invocation_name);
|
||||
fputs (gettext ("Report bugs to <bug-glibc@prep.ai.mit.edu>.\n"),
|
||||
fputs (gettext ("\
|
||||
Report bugs using the `glibcbug' script to <bugs@gnu.ai.mit.edu>.\n"),
|
||||
stdout);
|
||||
}
|
||||
|
||||
|
||||
+6
-5
@@ -109,7 +109,7 @@ mpool_filter(mp, pgin, pgout, pgcookie)
|
||||
mp->pgout = pgout;
|
||||
mp->pgcookie = pgcookie;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* mpool_new --
|
||||
* Get a new page of memory.
|
||||
@@ -205,7 +205,8 @@ mpool_get(mp, pgno, flags)
|
||||
off = mp->pagesize * pgno;
|
||||
if (lseek(mp->fd, off, SEEK_SET) != off)
|
||||
return (NULL);
|
||||
if ((nr = read(mp->fd, bp->page, mp->pagesize)) != mp->pagesize) {
|
||||
if ((u_long) (nr = read(mp->fd, bp->page, mp->pagesize))
|
||||
!= mp->pagesize) {
|
||||
if (nr >= 0)
|
||||
errno = EFTYPE;
|
||||
return (NULL);
|
||||
@@ -380,7 +381,7 @@ mpool_write(mp, bp)
|
||||
off = mp->pagesize * bp->pgno;
|
||||
if (lseek(mp->fd, off, SEEK_SET) != off)
|
||||
return (RET_ERROR);
|
||||
if (write(mp->fd, bp->page, mp->pagesize) != mp->pagesize)
|
||||
if ((u_long) write(mp->fd, bp->page, mp->pagesize) != mp->pagesize)
|
||||
return (RET_ERROR);
|
||||
|
||||
bp->flags &= ~MPOOL_DIRTY;
|
||||
@@ -436,7 +437,7 @@ mpool_stat(mp)
|
||||
mp->pagealloc, mp->pageflush);
|
||||
if (mp->cachehit + mp->cachemiss)
|
||||
(void)fprintf(stderr,
|
||||
"%.0f%% cache hit rate (%lu hits, %lu misses)\n",
|
||||
"%.0f%% cache hit rate (%lu hits, %lu misses)\n",
|
||||
((double)mp->cachehit / (mp->cachehit + mp->cachemiss))
|
||||
* 100, mp->cachehit, mp->cachemiss);
|
||||
(void)fprintf(stderr, "%lu page reads, %lu page writes\n",
|
||||
@@ -456,7 +457,7 @@ mpool_stat(mp)
|
||||
cnt = 0;
|
||||
} else
|
||||
sep = ", ";
|
||||
|
||||
|
||||
}
|
||||
(void)fprintf(stderr, "\n");
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ __rec_sync(dbp, flags)
|
||||
*/
|
||||
status = (dbp->seq)(dbp, &key, &data, R_FIRST);
|
||||
while (status == RET_SUCCESS) {
|
||||
if (write(t->bt_rfd, data.data, data.size) != data.size)
|
||||
if ((size_t) write(t->bt_rfd, data.data, data.size) != data.size)
|
||||
return (RET_ERROR);
|
||||
status = (dbp->seq)(dbp, &key, &data, R_NEXT);
|
||||
}
|
||||
@@ -162,7 +162,7 @@ __rec_sync(dbp, flags)
|
||||
while (status == RET_SUCCESS) {
|
||||
iov[0].iov_base = data.data;
|
||||
iov[0].iov_len = data.size;
|
||||
if (writev(t->bt_rfd, iov, 2) != data.size + 1)
|
||||
if ((size_t) writev(t->bt_rfd, iov, 2) != data.size + 1)
|
||||
return (RET_ERROR);
|
||||
status = (dbp->seq)(dbp, &key, &data, R_NEXT);
|
||||
}
|
||||
|
||||
+2
-2
@@ -170,7 +170,7 @@ einval: errno = EINVAL;
|
||||
|
||||
if (flags == R_SETCURSOR)
|
||||
t->bt_cursor.rcursor = nrec;
|
||||
|
||||
|
||||
F_SET(t, R_MODIFIED);
|
||||
return (__rec_ret(t, NULL, nrec, key, NULL));
|
||||
}
|
||||
@@ -256,7 +256,7 @@ __rec_iput(t, nrec, data, flags)
|
||||
* the offset array, shift the pointers up.
|
||||
*/
|
||||
nbytes = NRLEAFDBT(data->size);
|
||||
if (h->upper - h->lower < nbytes + sizeof(indx_t)) {
|
||||
if ((u_int32_t) (h->upper - h->lower) < nbytes + sizeof(indx_t)) {
|
||||
status = __bt_split(t, h, NULL, data, dflags, nbytes, index);
|
||||
if (status == RET_SUCCESS)
|
||||
++t->bt_nrecs;
|
||||
|
||||
@@ -90,7 +90,7 @@ dataonly:
|
||||
return (RET_SUCCESS);
|
||||
|
||||
/*
|
||||
* We must copy big keys/data to make them contigous. Otherwise,
|
||||
* We must copy big keys/data to make them contiguous. Otherwise,
|
||||
* leave the page pinned and don't copy unless the user specified
|
||||
* concurrent access.
|
||||
*/
|
||||
|
||||
+4
-4
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1991, 92, 93, 94, 95, 96, 97 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
|
||||
@@ -12,9 +12,9 @@
|
||||
# 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., 675 Mass Ave,
|
||||
# Cambridge, MA 02139, USA.
|
||||
# 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 dirent portion of the library.
|
||||
|
||||
+61
-56
@@ -1,20 +1,20 @@
|
||||
/* Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
/* Copyright (C) 1991, 92, 93, 94, 95, 96, 97 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 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.
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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. */
|
||||
|
||||
/*
|
||||
* POSIX Standard: 5.1.2 Directory Operations <dirent.h>
|
||||
@@ -39,12 +39,15 @@ __BEGIN_DECLS
|
||||
|
||||
It defines the macro `_DIRENT_HAVE_D_OFF' iff there is a `d_off'
|
||||
member that gives the file offset of the next directory entry.
|
||||
|
||||
It defines the macro `_DIRENT_HAVE_D_TYPE' iff there is a `d_type'
|
||||
member that gives the type of the file.
|
||||
*/
|
||||
|
||||
#include <direntry.h>
|
||||
|
||||
#if (defined(__USE_BSD) || defined(__USE_MISC)) && !defined(d_fileno)
|
||||
#define d_ino d_fileno /* Backward compatibility. */
|
||||
#if (defined __USE_BSD || defined __USE_MISC) && !defined d_fileno
|
||||
# define d_ino d_fileno /* Backward compatibility. */
|
||||
#endif
|
||||
|
||||
/* These macros extract size information from a `struct dirent *'.
|
||||
@@ -62,16 +65,16 @@ __BEGIN_DECLS
|
||||
*/
|
||||
|
||||
#ifdef _DIRENT_HAVE_D_NAMLEN
|
||||
#define _D_EXACT_NAMLEN(d) ((d)->d_namlen)
|
||||
#define _D_ALLOC_NAMLEN(d) (_D_EXACT_NAMLEN (d) + 1)
|
||||
# define _D_EXACT_NAMLEN(d) ((d)->d_namlen)
|
||||
# define _D_ALLOC_NAMLEN(d) (_D_EXACT_NAMLEN (d) + 1)
|
||||
#else
|
||||
#define _D_EXACT_NAMLEN(d) (strlen ((d)->d_name))
|
||||
#ifdef _DIRENT_HAVE_D_RECLEN
|
||||
#define _D_ALLOC_NAMLEN(d) (((char *) (d) + (d)->d_reclen) - &(d)->d_name[0])
|
||||
#else
|
||||
#define _D_ALLOC_NAMLEN(d) (sizeof (d)->d_name > 1 ? sizeof (d)->d_name : \
|
||||
_D_EXACT_NAMLEN (d) + 1)
|
||||
#endif
|
||||
# define _D_EXACT_NAMLEN(d) (strlen ((d)->d_name))
|
||||
# ifdef _DIRENT_HAVE_D_RECLEN
|
||||
# define _D_ALLOC_NAMLEN(d) (((char *) (d) + (d)->d_reclen) - &(d)->d_name[0])
|
||||
# else
|
||||
# define _D_ALLOC_NAMLEN(d) (sizeof (d)->d_name > 1 ? sizeof (d)->d_name : \
|
||||
_D_EXACT_NAMLEN (d) + 1)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
@@ -90,8 +93,8 @@ enum
|
||||
};
|
||||
|
||||
/* Convert between stat structure types and directory types. */
|
||||
#define IFTODT(mode) (((mode) & 0170000) >> 12)
|
||||
#define DTTOIF(dirtype) ((dirtype) << 12)
|
||||
# define IFTODT(mode) (((mode) & 0170000) >> 12)
|
||||
# define DTTOIF(dirtype) ((dirtype) << 12)
|
||||
#endif
|
||||
|
||||
|
||||
@@ -106,64 +109,66 @@ extern DIR *opendir __P ((__const char *__name));
|
||||
|
||||
/* Close the directory stream DIRP.
|
||||
Return 0 if successful, -1 if not. */
|
||||
extern int __closedir __P ((DIR * __dirp));
|
||||
extern int closedir __P ((DIR * __dirp));
|
||||
extern int __closedir __P ((DIR *__dirp));
|
||||
extern int closedir __P ((DIR *__dirp));
|
||||
|
||||
/* Read a directory entry from DIRP.
|
||||
Return a pointer to a `struct dirent' describing the entry,
|
||||
or NULL for EOF or error. The storage returned may be overwritten
|
||||
by a later readdir call on the same DIR stream. */
|
||||
extern struct dirent *__readdir __P ((DIR * __dirp));
|
||||
extern struct dirent *readdir __P ((DIR * __dirp));
|
||||
extern struct dirent *__readdir __P ((DIR *__dirp));
|
||||
extern struct dirent *readdir __P ((DIR *__dirp));
|
||||
|
||||
#ifdef __USE_REENTRANT
|
||||
/* Reentrant versio of `readdir'. Return in RESULT a pointer to the
|
||||
#if defined __USE_POSIX || defined __USE_MISC
|
||||
/* Reentrant version of `readdir'. Return in RESULT a pointer to the
|
||||
next entry. */
|
||||
extern int readdir_r __P ((DIR *__dirp, struct dirent *entry,
|
||||
struct dirent **result));
|
||||
#endif
|
||||
extern int __readdir_r __P ((DIR *__dirp, struct dirent *__entry,
|
||||
struct dirent **__result));
|
||||
extern int readdir_r __P ((DIR *__dirp, struct dirent *__entry,
|
||||
struct dirent **__result));
|
||||
#endif /* POSIX or misc */
|
||||
|
||||
/* Rewind DIRP to the beginning of the directory. */
|
||||
extern void rewinddir __P ((DIR * __dirp));
|
||||
extern void rewinddir __P ((DIR *__dirp));
|
||||
|
||||
#if defined(__USE_BSD) || defined(__USE_MISC)
|
||||
#if defined __USE_BSD || defined __USE_MISC
|
||||
|
||||
/* Return the file descriptor used by DIRP. */
|
||||
extern int dirfd __P ((DIR *__dirp));
|
||||
|
||||
#if defined (__OPTIMIZE__) && defined (_DIR_dirfd)
|
||||
#define dirfd(dirp) _DIR_dirfd (dirp)
|
||||
#endif
|
||||
# if defined __OPTIMIZE__ && defined _DIR_dirfd
|
||||
# define dirfd(dirp) _DIR_dirfd (dirp)
|
||||
# endif
|
||||
|
||||
#ifndef MAXNAMLEN
|
||||
# ifndef MAXNAMLEN
|
||||
/* Get the definitions of the POSIX.1 limits. */
|
||||
#include <posix1_lim.h>
|
||||
# include <posix1_lim.h>
|
||||
|
||||
/* `MAXNAMLEN' is the BSD name for what POSIX calls `NAME_MAX'. */
|
||||
#ifdef NAME_MAX
|
||||
#define MAXNAMLEN NAME_MAX
|
||||
#else
|
||||
#define MAXNAMLEN 255
|
||||
#endif
|
||||
#endif
|
||||
# ifdef NAME_MAX
|
||||
# define MAXNAMLEN NAME_MAX
|
||||
# else
|
||||
# define MAXNAMLEN 255
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#include <gnu/types.h>
|
||||
#define __need_size_t
|
||||
#include <stddef.h>
|
||||
# include <gnu/types.h>
|
||||
# define __need_size_t
|
||||
# include <stddef.h>
|
||||
|
||||
/* Seek to position POS on DIRP. */
|
||||
extern void seekdir __P ((DIR * __dirp, __off_t __pos));
|
||||
extern void seekdir __P ((DIR *__dirp, __off_t __pos));
|
||||
|
||||
/* Return the current position of DIRP. */
|
||||
extern __off_t telldir __P ((DIR * __dirp));
|
||||
extern __off_t telldir __P ((DIR *__dirp));
|
||||
|
||||
/* Scan the directory DIR, calling SELECT on each directory entry.
|
||||
/* Scan the directory DIR, calling SELECTOR on each directory entry.
|
||||
Entries for which SELECT returns nonzero are individually malloc'd,
|
||||
sorted using qsort with CMP, and collected in a malloc'd array in
|
||||
*NAMELIST. Returns the number of entries selected, or -1 on error. */
|
||||
extern int scandir __P ((__const char *__dir,
|
||||
struct dirent ***__namelist,
|
||||
int (*__select) __P ((struct dirent *)),
|
||||
int (*__selector) __P ((struct dirent *)),
|
||||
int (*__cmp) __P ((__const __ptr_t,
|
||||
__const __ptr_t))));
|
||||
|
||||
|
||||
+14
-14
@@ -1,20 +1,20 @@
|
||||
/* Copyright (C) 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
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 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.
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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 <dirent.h>
|
||||
#include <stdlib.h>
|
||||
@@ -41,7 +41,7 @@ scandir (dir, namelist, select, cmp)
|
||||
__set_errno (0);
|
||||
|
||||
i = 0;
|
||||
while ((d = readdir (dp)) != NULL)
|
||||
while ((d = __readdir (dp)) != NULL)
|
||||
if (select == NULL || (*select) (d))
|
||||
{
|
||||
size_t dsize;
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
int
|
||||
main ()
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
|
||||
DIR * dirp;
|
||||
long save3;
|
||||
long int save3 = 0;
|
||||
int i = 0;
|
||||
struct dirent *dp;
|
||||
|
||||
@@ -31,7 +31,7 @@ main ()
|
||||
/* go back to saved entry */
|
||||
seekdir (dirp, save3);
|
||||
|
||||
|
||||
|
||||
/* print remaining files (3-last) */
|
||||
for (dp = readdir(dirp); dp != NULL; dp = readdir(dirp))
|
||||
printf("%s\n", dp->d_name);
|
||||
|
||||
+57
-12
@@ -1,6 +1,6 @@
|
||||
# Makefile for elf subdirectory of GNU C Library.
|
||||
|
||||
# Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1995, 1996, 1997 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
|
||||
@@ -14,9 +14,9 @@
|
||||
# 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., 675 Mass Ave,
|
||||
# Cambridge, MA 02139, USA.
|
||||
# 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.
|
||||
|
||||
subdir := elf
|
||||
|
||||
@@ -35,12 +35,14 @@ elide-routines.so = $(dl-routines) dl-support enbl-secure
|
||||
# interpreter and operating independent of libc.
|
||||
rtld-routines := rtld $(dl-routines) dl-sysdep dl-minimal
|
||||
distribute = $(rtld-routines:=.c) dynamic-link.h do-rel.h dl-machine.h \
|
||||
soinit.c sofini.c ldd.sh.in eval.c
|
||||
soinit.c sofini.c ldd.sh.in ldd.bash.in eval.c
|
||||
|
||||
extra-libs = libdl
|
||||
extra-libs-others = $(extra-libs)
|
||||
libdl-routines := dlopen dlclose dlsym dlerror dladdr
|
||||
|
||||
before-compile = $(objpfx)trusted-dirs.h
|
||||
|
||||
|
||||
all: # Make this the default target; it will be defined in Rules.
|
||||
|
||||
@@ -49,14 +51,26 @@ include ../Makeconfig
|
||||
ifeq (yes,$(build-shared))
|
||||
extra-objs = $(rtld-routines:=.so) soinit.so sofini.so eval.so
|
||||
generated = librtld.so dl-allobjs.so
|
||||
install-others = $(slibdir)/$(rtld-installed-name)
|
||||
install-others = $(inst_slibdir)/$(rtld-installed-name)
|
||||
install-bin = ldd
|
||||
endif
|
||||
|
||||
ifeq (yes,$(has-ldconfig))
|
||||
extra-objs = ldconfig.o
|
||||
install-rootsbin = ldconfig
|
||||
|
||||
$(objpfx)ldconfig: $(objpfx)ldconfig.o
|
||||
$(CC) -nostdlib -nostartfiles -o $@ $(sysdep-LDFLAGS) -static \
|
||||
$(addprefix $(csu-objpfx),start.o) $(+preinit) \
|
||||
$(filter-out $(addprefix $(csu-objpfx),start.o) $(+preinit) \
|
||||
$(link-extra-libs) $(common-objpfx)libc% $(+postinit),$^) \
|
||||
$(link-extra-libs) $(common-objpfx)libc.a $(gnulib) $(+postinit)
|
||||
endif
|
||||
|
||||
include ../Rules
|
||||
|
||||
|
||||
ifeq (yes, $(build-shared))
|
||||
ifeq (yes,$(build-shared))
|
||||
# Make sure these things are built in the `make lib' pass so they can be used
|
||||
# to run programs during the `make others' pass.
|
||||
lib-noranlib: $(objpfx)$(rtld-installed-name) \
|
||||
@@ -84,25 +98,56 @@ endef
|
||||
# The dl code in the static libc needs a default library path.
|
||||
CFLAGS-dl-support.c = -D'DEFAULT_RPATH="$(default-rpath)"'
|
||||
|
||||
ifneq (ld.so, $(rtld-installed-name))
|
||||
# Make sure ld-gnu.so.1 exists in the build directory so we can link
|
||||
ifneq (ld.so,$(rtld-installed-name))
|
||||
# Make sure ld.so.1 exists in the build directory so we can link
|
||||
# against it.
|
||||
$(objpfx)$(rtld-installed-name): $(objpfx)ld.so
|
||||
rm -f $@
|
||||
ln -s $(<F) $@
|
||||
endif
|
||||
|
||||
# Build a file mentioning all trustworthy directories to look for shared
|
||||
# libraries when using LD_LIBRARY_PATH in a setuid program. The user can
|
||||
# add directories to the list by defining $(user-defined-trusted-dirs)
|
||||
# before starting make.
|
||||
$(objpfx)trusted-dirs.h: Makefile
|
||||
$(make-target-directory)
|
||||
(for dir in `echo "$(default-rpath) $(user-defined-trusted-dirs)" | \
|
||||
sed 's/:/ /g'`; do \
|
||||
echo " \"$$dir\","; \
|
||||
done;) > $@T
|
||||
mv -f $@T $@
|
||||
CPPFLAGS-dl-load.c = -I$(objdir)/$(subdir)
|
||||
CFLAGS-dl-load.c += -Wno-uninitialized
|
||||
|
||||
# Specify the dependencies of libdl.so; its commands come from the generic
|
||||
# rule to build a shared library.
|
||||
$(objpfx)libdl.so: $(objpfx)libdl_pic.a $(common-objpfx)libc.so $(objpfx)ld.so
|
||||
|
||||
$(slibdir)/$(rtld-installed-name): $(objpfx)ld.so; $(do-install-program)
|
||||
$(inst_slibdir)/$(rtld-version-installed-name): $(objpfx)ld.so
|
||||
$(do-install-program)
|
||||
|
||||
$(objpfx)ldd: ldd.sh.in Makefile
|
||||
sed 's%@RTLD@%$(slibdir)/$(rtld-installed-name)%g' < $< > $@.new
|
||||
$(inst_slibdir)/$(rtld-installed-name): \
|
||||
$(inst_slibdir)/$(rtld-version-installed-name)
|
||||
$(make-shlib-link)
|
||||
|
||||
ifneq ($(have-bash2),yes)
|
||||
$(objpfx)ldd: ldd.sh.in $(common-objpfx)version.mk \
|
||||
$(common-objpfx)soversions.mk $(common-objpfx)config.make
|
||||
sed -e 's%@RTLD@%$(slibdir)/$(rtld-installed-name)%g' \
|
||||
-e 's%@VERSION@%$(version)%g' < $< > $@.new
|
||||
chmod 555 $@.new
|
||||
mv -f $@.new $@
|
||||
else
|
||||
$(objpfx)ldd: ldd.bash.in $(common-objpfx)version.mk \
|
||||
$(common-objpfx)soversions.mk $(common-objpfx)config.make
|
||||
sed -e 's%@BASH@%$(BASH)%g' \
|
||||
-e 's%@RTLD@%$(slibdir)/$(rtld-installed-name)%g' \
|
||||
-e 's%@VERSION@%$(version)%g' \
|
||||
-e 's%@TEXTDOMAINDIR@%$(localedir)%g' < $< > $@.new
|
||||
chmod 555 $@.new
|
||||
mv -f $@.new $@
|
||||
endif
|
||||
|
||||
# muwahaha
|
||||
|
||||
|
||||
+14
-14
@@ -1,21 +1,21 @@
|
||||
/* _dl_close -- Close a shared object opened by `_dl_open'.
|
||||
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Copyright (C) 1996 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 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.
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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 <link.h>
|
||||
#include <dlfcn.h>
|
||||
|
||||
+14
-14
@@ -1,21 +1,21 @@
|
||||
/* Communicate dynamic linker state to the debugger at runtime.
|
||||
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Copyright (C) 1996 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 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.
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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 <link.h>
|
||||
|
||||
|
||||
+116
-32
@@ -1,21 +1,21 @@
|
||||
/* Load the dependencies of a mapped object.
|
||||
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Copyright (C) 1996, 1997 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 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.
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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 <link.h>
|
||||
#include <errno.h>
|
||||
@@ -24,36 +24,99 @@ Cambridge, MA 02139, USA. */
|
||||
|
||||
void
|
||||
_dl_map_object_deps (struct link_map *map,
|
||||
struct link_map **preloads, unsigned int npreloads)
|
||||
struct link_map **preloads, unsigned int npreloads,
|
||||
int trace_mode)
|
||||
{
|
||||
struct list
|
||||
{
|
||||
struct link_map *map;
|
||||
struct list *next;
|
||||
};
|
||||
struct list head[1 + npreloads], *tailp, *scanp;
|
||||
unsigned int nlist;
|
||||
|
||||
/* Start the search list with one element: MAP itself. */
|
||||
head[0].map = map;
|
||||
|
||||
/* Add the preloaded items after MAP but before any of its dependencies. */
|
||||
for (nlist = 0; nlist < npreloads; ++nlist)
|
||||
struct list *head, *tailp, *scanp;
|
||||
struct list duphead, *duptailp;
|
||||
unsigned int nduplist;
|
||||
unsigned int nlist, naux, i;
|
||||
inline void preload (struct link_map *map)
|
||||
{
|
||||
head[nlist].next = &head[nlist + 1];
|
||||
head[nlist + 1].map = preloads[nlist];
|
||||
head[nlist++].map = map;
|
||||
|
||||
/* We use `l_reserved' as a mark bit to detect objects we have
|
||||
already put in the search list and avoid adding duplicate
|
||||
elements later in the list. */
|
||||
map->l_reserved = 1;
|
||||
}
|
||||
|
||||
/* Terminate the list. */
|
||||
head[nlist].next = NULL;
|
||||
naux = nlist = 0;
|
||||
|
||||
/* XXX The AUXILIARY implementation isn't correct in the moment. XXX
|
||||
XXX The problem is that we currently do not handle auxiliary XXX
|
||||
XXX entries in the loaded objects. XXX */
|
||||
|
||||
#define AUXTAG (DT_NUM + DT_PROCNUM + DT_VERSIONTAGNUM \
|
||||
+ DT_EXTRATAGIDX (DT_AUXILIARY))
|
||||
|
||||
/* First determine the number of auxiliary objects we have to load. */
|
||||
if (map->l_info[AUXTAG])
|
||||
{
|
||||
ElfW(Dyn) *d;
|
||||
for (d = map->l_ld; d->d_tag != DT_NULL; ++d)
|
||||
if (d->d_tag == DT_AUXILIARY)
|
||||
++naux;
|
||||
}
|
||||
|
||||
/* Now we can allocate the array for the linker maps. */
|
||||
head = (struct list *) alloca (sizeof (struct list)
|
||||
* (naux + npreloads + 2));
|
||||
|
||||
/* Load the auxiliary objects, even before the object itself. */
|
||||
if (map->l_info[AUXTAG])
|
||||
{
|
||||
/* There is at least one auxiliary library specified. We try to
|
||||
load it, and if we can, use its symbols in preference to our
|
||||
own. But if we can't load it, we just silently ignore it. */
|
||||
const char *strtab
|
||||
= ((void *) map->l_addr + map->l_info[DT_STRTAB]->d_un.d_ptr);
|
||||
ElfW(Dyn) *d;
|
||||
|
||||
for (d = map->l_ld; d->d_tag != DT_NULL; ++d)
|
||||
if (d->d_tag == DT_AUXILIARY)
|
||||
{
|
||||
struct link_map *aux;
|
||||
void openaux (void)
|
||||
{
|
||||
aux = _dl_map_object (map, strtab + d->d_un.d_val,
|
||||
(map->l_type == lt_executable
|
||||
? lt_library : map->l_type),
|
||||
trace_mode);
|
||||
}
|
||||
char *errstring;
|
||||
const char *objname;
|
||||
if (! _dl_catch_error (&errstring, &objname, openaux))
|
||||
/* The auxiliary object is actually there. Use it as
|
||||
the first search element, even before MAP itself. */
|
||||
preload (aux);
|
||||
}
|
||||
}
|
||||
|
||||
/* Next load MAP itself. */
|
||||
preload (map);
|
||||
|
||||
/* Add the preloaded items after MAP but before any of its dependencies. */
|
||||
for (i = 0; i < npreloads; ++i)
|
||||
preload (preloads[i]);
|
||||
|
||||
/* Terminate the lists. */
|
||||
head[nlist - 1].next = NULL;
|
||||
duphead.next = NULL;
|
||||
|
||||
/* Start here for adding dependencies to the list. */
|
||||
tailp = &head[nlist++];
|
||||
tailp = &head[nlist - 1];
|
||||
|
||||
/* We use `l_reserved' as a mark bit to detect objects we have already
|
||||
put in the search list and avoid adding duplicate elements later in
|
||||
the list. */
|
||||
map->l_reserved = 1;
|
||||
/* Until now we have the same number of libraries in the normal and
|
||||
the list with duplicates. */
|
||||
nduplist = nlist;
|
||||
duptailp = &duphead;
|
||||
|
||||
/* Process each element of the search list, loading each of its immediate
|
||||
dependencies and appending them to the list as we step through it.
|
||||
@@ -75,7 +138,7 @@ _dl_map_object_deps (struct link_map *map,
|
||||
struct link_map *dep
|
||||
= _dl_map_object (l, strtab + d->d_un.d_val,
|
||||
l->l_type == lt_executable ? lt_library :
|
||||
l->l_type);
|
||||
l->l_type, trace_mode);
|
||||
|
||||
if (dep->l_reserved)
|
||||
/* This object is already in the search list we are
|
||||
@@ -93,6 +156,13 @@ _dl_map_object_deps (struct link_map *map,
|
||||
/* Set the mark bit that says it's already in the list. */
|
||||
dep->l_reserved = 1;
|
||||
}
|
||||
|
||||
/* In any case append DEP to the duplicates search list. */
|
||||
duptailp->next = alloca (sizeof *duptailp);
|
||||
duptailp = duptailp->next;
|
||||
duptailp->map = dep;
|
||||
duptailp->next = NULL;
|
||||
++nduplist;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -100,6 +170,9 @@ _dl_map_object_deps (struct link_map *map,
|
||||
/* Store the search list we built in the object. It will be used for
|
||||
searches in the scope of this object. */
|
||||
map->l_searchlist = malloc (nlist * sizeof (struct link_map *));
|
||||
if (map->l_searchlist == NULL)
|
||||
_dl_signal_error (ENOMEM, map->l_name,
|
||||
"cannot allocate symbol search list");
|
||||
map->l_nsearchlist = nlist;
|
||||
|
||||
nlist = 0;
|
||||
@@ -111,4 +184,15 @@ _dl_map_object_deps (struct link_map *map,
|
||||
to avoid duplicates, so the next call starts fresh. */
|
||||
scanp->map->l_reserved = 0;
|
||||
}
|
||||
|
||||
map->l_dupsearchlist = malloc (nduplist * sizeof (struct link_map *));
|
||||
if (map->l_dupsearchlist == NULL)
|
||||
_dl_signal_error (ENOMEM, map->l_name,
|
||||
"cannot allocate symbol search list");
|
||||
map->l_ndupsearchlist = nduplist;
|
||||
|
||||
for (nlist = 0; nlist < naux + 1 + npreloads; ++nlist)
|
||||
map->l_dupsearchlist[nlist] = head[nlist].map;
|
||||
for (scanp = duphead.next; scanp; scanp = scanp->next)
|
||||
map->l_dupsearchlist[nlist++] = scanp->map;
|
||||
}
|
||||
|
||||
+51
-16
@@ -1,21 +1,21 @@
|
||||
/* Error handling for runtime dynamic linker.
|
||||
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Copyright (C) 1995, 1996, 1997 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 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.
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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 <stddef.h>
|
||||
#include <link.h>
|
||||
@@ -37,6 +37,11 @@ struct catch
|
||||
this is null. */
|
||||
static struct catch *catch;
|
||||
|
||||
/* This points to a function which is called when an error is
|
||||
received. Unlike the handling of `catch' this function may return.
|
||||
The arguments will be the `errstring' and `objname'. */
|
||||
static receiver_fct receiver;
|
||||
|
||||
|
||||
void
|
||||
_dl_signal_error (int errcode,
|
||||
@@ -58,6 +63,13 @@ _dl_signal_error (int errcode,
|
||||
catch->objname = objname;
|
||||
longjmp (catch->env, errcode ?: -1);
|
||||
}
|
||||
else if (receiver)
|
||||
{
|
||||
/* We are inside _dl_receive_error. Call the user supplied
|
||||
handler and resume the work. The receiver will still
|
||||
installed. */
|
||||
(*receiver) (errstring, objname);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Lossage while resolving the program's own symbols is always fatal. */
|
||||
@@ -76,21 +88,44 @@ _dl_catch_error (char **errstring,
|
||||
void (*operate) (void))
|
||||
{
|
||||
int errcode;
|
||||
struct catch c = { errstring: NULL, objname: NULL };
|
||||
struct catch *old, c = { errstring: NULL, objname: NULL };
|
||||
/* We need not handle `receiver' since setting a `catch' is handle
|
||||
before it. */
|
||||
|
||||
old = catch;
|
||||
errcode = setjmp (c.env);
|
||||
if (errcode == 0)
|
||||
{
|
||||
catch = &c;
|
||||
(*operate) ();
|
||||
catch = NULL;
|
||||
catch = old;
|
||||
*errstring = NULL;
|
||||
*objname = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* We get here only if we longjmp'd out of OPERATE. */
|
||||
catch = old;
|
||||
*errstring = c.errstring;
|
||||
*objname = c.objname;
|
||||
return errcode == -1 ? 0 : errcode;
|
||||
}
|
||||
|
||||
void
|
||||
_dl_receive_error (receiver_fct fct, void (*operate) (void))
|
||||
{
|
||||
struct catch *old_catch;
|
||||
receiver_fct old_receiver;
|
||||
|
||||
old_catch = catch;
|
||||
old_receiver = receiver;
|
||||
|
||||
/* Set the new values. */
|
||||
catch = NULL;
|
||||
receiver = fct;
|
||||
|
||||
(*operate) ();
|
||||
|
||||
catch = old_catch;
|
||||
receiver = old_receiver;
|
||||
}
|
||||
|
||||
+14
-14
@@ -1,21 +1,21 @@
|
||||
/* Call the termination functions of loaded shared objects.
|
||||
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Copyright (C) 1995, 1996 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 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.
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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 <link.h>
|
||||
|
||||
|
||||
+14
-14
@@ -1,21 +1,21 @@
|
||||
/* Return the next shared object initializer function not yet run.
|
||||
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Copyright (C) 1995, 1996 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 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.
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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 <stddef.h>
|
||||
#include <link.h>
|
||||
|
||||
+92
-28
@@ -1,21 +1,21 @@
|
||||
/* _dl_map_object -- Map in a shared object's segments from the file.
|
||||
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Copyright (C) 1995, 1996, 1997 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 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.
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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 <link.h>
|
||||
#include <sys/types.h>
|
||||
@@ -409,7 +409,8 @@ _dl_map_object_from_fd (char *name, int fd, char *realname,
|
||||
static int
|
||||
open_path (const char *name, size_t namelen,
|
||||
const char *dirpath,
|
||||
char **realname)
|
||||
char **realname,
|
||||
const char *trusted_dirs[])
|
||||
{
|
||||
char *buf;
|
||||
const char *p;
|
||||
@@ -426,13 +427,42 @@ open_path (const char *name, size_t namelen,
|
||||
do
|
||||
{
|
||||
size_t buflen;
|
||||
size_t this_len;
|
||||
|
||||
dirpath = p;
|
||||
p = strpbrk (dirpath, ":;");
|
||||
if (p == NULL)
|
||||
p = strchr (dirpath, '\0');
|
||||
|
||||
if (p == dirpath)
|
||||
this_len = p - dirpath;
|
||||
|
||||
/* When we run a setuid program we do not accept any directory. */
|
||||
if (__libc_enable_secure)
|
||||
{
|
||||
/* All trusted directory must be complete name. */
|
||||
if (dirpath[0] != '/')
|
||||
continue;
|
||||
|
||||
/* If we got a list of trusted directories only accept one
|
||||
of these. */
|
||||
if (trusted_dirs != NULL)
|
||||
{
|
||||
const char **trust = trusted_dirs;
|
||||
|
||||
while (*trust != NULL)
|
||||
if (memcmp (dirpath, *trust, this_len) == 0
|
||||
&& (*trust)[this_len] == '\0')
|
||||
break;
|
||||
else
|
||||
++trust;
|
||||
|
||||
/* If directory is not trusted, ignore this directory. */
|
||||
if (*trust == NULL)
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (this_len == 0)
|
||||
{
|
||||
/* Two adjacent colons, or a colon at the beginning or the end of
|
||||
the path means to search the current directory. */
|
||||
@@ -442,10 +472,10 @@ open_path (const char *name, size_t namelen,
|
||||
else
|
||||
{
|
||||
/* Construct the pathname to try. */
|
||||
(void) memcpy (buf, dirpath, p - dirpath);
|
||||
buf[p - dirpath] = '/';
|
||||
(void) memcpy (&buf[(p - dirpath) + 1], name, namelen);
|
||||
buflen = p - dirpath + 1 + namelen;
|
||||
(void) memcpy (buf, dirpath, this_len);
|
||||
buf[this_len] = '/';
|
||||
(void) memcpy (&buf[this_len + 1], name, namelen);
|
||||
buflen = this_len + 1 + namelen;
|
||||
}
|
||||
|
||||
fd = __open (buf, O_RDONLY);
|
||||
@@ -477,7 +507,8 @@ open_path (const char *name, size_t namelen,
|
||||
/* Map in the shared object file NAME. */
|
||||
|
||||
struct link_map *
|
||||
_dl_map_object (struct link_map *loader, const char *name, int type)
|
||||
_dl_map_object (struct link_map *loader, const char *name, int type,
|
||||
int trace_mode)
|
||||
{
|
||||
int fd;
|
||||
char *realname;
|
||||
@@ -507,9 +538,9 @@ _dl_map_object (struct link_map *loader, const char *name, int type)
|
||||
|
||||
size_t namelen = strlen (name) + 1;
|
||||
|
||||
inline void trypath (const char *dirpath)
|
||||
inline void trypath (const char *dirpath, const char *trusted[])
|
||||
{
|
||||
fd = open_path (name, namelen, dirpath, &realname);
|
||||
fd = open_path (name, namelen, dirpath, &realname, trusted);
|
||||
}
|
||||
|
||||
fd = -1;
|
||||
@@ -520,16 +551,24 @@ _dl_map_object (struct link_map *loader, const char *name, int type)
|
||||
if (l && l->l_info[DT_RPATH])
|
||||
trypath ((const char *) (l->l_addr +
|
||||
l->l_info[DT_STRTAB]->d_un.d_ptr +
|
||||
l->l_info[DT_RPATH]->d_un.d_val));
|
||||
l->l_info[DT_RPATH]->d_un.d_val), NULL);
|
||||
/* If dynamically linked, try the DT_RPATH of the executable itself. */
|
||||
l = _dl_loaded;
|
||||
if (fd == -1 && l && l->l_type != lt_loaded && l->l_info[DT_RPATH])
|
||||
trypath ((const char *) (l->l_addr +
|
||||
l->l_info[DT_STRTAB]->d_un.d_ptr +
|
||||
l->l_info[DT_RPATH]->d_un.d_val));
|
||||
l->l_info[DT_RPATH]->d_un.d_val), NULL);
|
||||
/* Try an environment variable (unless setuid). */
|
||||
if (fd == -1 && ! __libc_enable_secure)
|
||||
trypath (getenv ("LD_LIBRARY_PATH"));
|
||||
{
|
||||
static const char *trusted_dirs[] =
|
||||
{
|
||||
#include "trusted-dirs.h"
|
||||
NULL
|
||||
};
|
||||
|
||||
trypath (getenv ("LD_LIBRARY_PATH"), trusted_dirs);
|
||||
}
|
||||
if (fd == -1)
|
||||
{
|
||||
/* Check the list of libraries in the file /etc/ld.so.cache,
|
||||
@@ -554,7 +593,7 @@ _dl_map_object (struct link_map *loader, const char *name, int type)
|
||||
if (fd == -1)
|
||||
{
|
||||
extern const char *_dl_rpath; /* Set in rtld.c. */
|
||||
trypath (_dl_rpath);
|
||||
trypath (_dl_rpath, NULL);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -582,7 +621,32 @@ _dl_map_object (struct link_map *loader, const char *name, int type)
|
||||
}
|
||||
|
||||
if (fd == -1)
|
||||
_dl_signal_error (errno, name, "cannot open shared object file");
|
||||
{
|
||||
if (trace_mode)
|
||||
{
|
||||
/* We haven't found an appropriate library. But since we
|
||||
are only interested in the list of libraries this isn't
|
||||
so severe. Fake an entry with all the information we
|
||||
have. */
|
||||
static const ElfW(Symndx) dummy_bucket = STN_UNDEF;
|
||||
|
||||
/* Enter the new object in the list of loaded objects. */
|
||||
if ((name_copy = local_strdup (name)) == NULL
|
||||
|| (l = _dl_new_object (name_copy, name, type)) == NULL)
|
||||
_dl_signal_error (ENOMEM, name,
|
||||
"cannot create shared object descriptor");
|
||||
/* We use an opencount of 0 as a sign for the faked entry. */
|
||||
l->l_opencount = 0;
|
||||
l->l_reserved = 0;
|
||||
l->l_buckets = &dummy_bucket;
|
||||
l->l_nbuckets = 1;
|
||||
l->l_relocated = 1;
|
||||
|
||||
return l;
|
||||
}
|
||||
else
|
||||
_dl_signal_error (errno, name, "cannot open shared object file");
|
||||
}
|
||||
|
||||
return _dl_map_object_from_fd (name_copy, fd, realname, loader, type);
|
||||
}
|
||||
|
||||
+150
-88
@@ -1,21 +1,21 @@
|
||||
/* Look up a symbol in the loaded objects.
|
||||
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Copyright (C) 1995, 1996 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 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.
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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 <stddef.h>
|
||||
#include <link.h>
|
||||
@@ -23,6 +23,13 @@ Cambridge, MA 02139, USA. */
|
||||
#include <string.h>
|
||||
|
||||
|
||||
struct sym_val
|
||||
{
|
||||
ElfW(Addr) a;
|
||||
const ElfW(Sym) *s;
|
||||
};
|
||||
|
||||
|
||||
/* This is the hashing function specified by the ELF ABI. */
|
||||
static inline unsigned
|
||||
_dl_elf_hash (const char *name)
|
||||
@@ -44,6 +51,90 @@ _dl_elf_hash (const char *name)
|
||||
return hash;
|
||||
}
|
||||
|
||||
|
||||
/* Inner part of the lookup functions. */
|
||||
static inline ElfW(Addr)
|
||||
do_lookup (const char *undef_name, unsigned long int hash,
|
||||
const ElfW(Sym) **ref, struct sym_val *result,
|
||||
struct link_map *list[], size_t i, size_t n,
|
||||
const char *reference_name, struct link_map *skip, int flags)
|
||||
{
|
||||
struct link_map *map;
|
||||
|
||||
for (; i < n; ++i)
|
||||
{
|
||||
const ElfW(Sym) *symtab;
|
||||
const char *strtab;
|
||||
ElfW(Symndx) symidx;
|
||||
|
||||
map = list[i];
|
||||
|
||||
/* Here come the extra test needed for `_dl_lookup_symbol_skip'. */
|
||||
if (skip != NULL && map == skip)
|
||||
continue;
|
||||
|
||||
/* Don't search the executable when resolving a copy reloc. */
|
||||
if (flags & DL_LOOKUP_NOEXEC && map->l_type == lt_executable)
|
||||
continue;
|
||||
|
||||
symtab = ((void *) map->l_addr + map->l_info[DT_SYMTAB]->d_un.d_ptr);
|
||||
strtab = ((void *) map->l_addr + map->l_info[DT_STRTAB]->d_un.d_ptr);
|
||||
|
||||
/* Search the appropriate hash bucket in this object's symbol table
|
||||
for a definition for the same symbol name. */
|
||||
for (symidx = map->l_buckets[hash % map->l_nbuckets];
|
||||
symidx != STN_UNDEF;
|
||||
symidx = map->l_chain[symidx])
|
||||
{
|
||||
const ElfW(Sym) *sym = &symtab[symidx];
|
||||
|
||||
if (sym->st_value == 0 || /* No value. */
|
||||
((flags & DL_LOOKUP_NOPLT) != 0 /* Reject PLT entry. */
|
||||
&& sym->st_shndx == SHN_UNDEF))
|
||||
continue;
|
||||
|
||||
switch (ELFW(ST_TYPE) (sym->st_info))
|
||||
{
|
||||
case STT_NOTYPE:
|
||||
case STT_FUNC:
|
||||
case STT_OBJECT:
|
||||
break;
|
||||
default:
|
||||
/* Not a code/data definition. */
|
||||
continue;
|
||||
}
|
||||
|
||||
if (sym != *ref && strcmp (strtab + sym->st_name, undef_name))
|
||||
/* Not the symbol we are looking for. */
|
||||
continue;
|
||||
|
||||
switch (ELFW(ST_BIND) (sym->st_info))
|
||||
{
|
||||
case STB_GLOBAL:
|
||||
/* Global definition. Just what we need. */
|
||||
result->s = sym;
|
||||
result->a = map->l_addr;
|
||||
return 1;
|
||||
case STB_WEAK:
|
||||
/* Weak definition. Use this value if we don't find
|
||||
another. */
|
||||
if (! result->s)
|
||||
{
|
||||
result->s = sym;
|
||||
result->a = map->l_addr;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
/* Local symbols are ignored. */
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* We have not found anything until now. */
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Search loaded objects' symbol tables for a definition of the symbol
|
||||
UNDEF_NAME. FLAGS is a set of flags. If DL_LOOKUP_NOEXEC is set,
|
||||
then don't search the executable for a definition; this used for
|
||||
@@ -57,82 +148,17 @@ _dl_lookup_symbol (const char *undef_name, const ElfW(Sym) **ref,
|
||||
int flags)
|
||||
{
|
||||
const unsigned long int hash = _dl_elf_hash (undef_name);
|
||||
struct
|
||||
{
|
||||
ElfW(Addr) a;
|
||||
const ElfW(Sym) *s;
|
||||
} weak_value = { 0, NULL };
|
||||
size_t i;
|
||||
struct link_map **scope, *map;
|
||||
struct sym_val current_value = { 0, NULL };
|
||||
struct link_map **scope;
|
||||
|
||||
/* Search the relevant loaded objects for a definition. */
|
||||
for (scope = symbol_scope; *scope; ++scope)
|
||||
for (i = 0; i < (*scope)->l_nsearchlist; ++i)
|
||||
{
|
||||
const ElfW(Sym) *symtab;
|
||||
const char *strtab;
|
||||
ElfW(Symndx) symidx;
|
||||
if (do_lookup (undef_name, hash, ref, ¤t_value,
|
||||
(*scope)->l_searchlist, 0, (*scope)->l_nsearchlist,
|
||||
reference_name, NULL, flags))
|
||||
break;
|
||||
|
||||
map = (*scope)->l_searchlist[i];
|
||||
|
||||
/* Don't search the executable when resolving a copy reloc. */
|
||||
if (flags & DL_LOOKUP_NOEXEC && map->l_type == lt_executable)
|
||||
continue;
|
||||
|
||||
symtab = ((void *) map->l_addr + map->l_info[DT_SYMTAB]->d_un.d_ptr);
|
||||
strtab = ((void *) map->l_addr + map->l_info[DT_STRTAB]->d_un.d_ptr);
|
||||
|
||||
/* Search the appropriate hash bucket in this object's symbol table
|
||||
for a definition for the same symbol name. */
|
||||
for (symidx = map->l_buckets[hash % map->l_nbuckets];
|
||||
symidx != STN_UNDEF;
|
||||
symidx = map->l_chain[symidx])
|
||||
{
|
||||
const ElfW(Sym) *sym = &symtab[symidx];
|
||||
|
||||
if (sym->st_value == 0 || /* No value. */
|
||||
((flags & DL_LOOKUP_NOPLT) != 0 /* Reject PLT entry. */
|
||||
&& sym->st_shndx == SHN_UNDEF))
|
||||
continue;
|
||||
|
||||
switch (ELFW(ST_TYPE) (sym->st_info))
|
||||
{
|
||||
case STT_NOTYPE:
|
||||
case STT_FUNC:
|
||||
case STT_OBJECT:
|
||||
break;
|
||||
default:
|
||||
/* Not a code/data definition. */
|
||||
continue;
|
||||
}
|
||||
|
||||
if (sym != *ref && strcmp (strtab + sym->st_name, undef_name))
|
||||
/* Not the symbol we are looking for. */
|
||||
continue;
|
||||
|
||||
switch (ELFW(ST_BIND) (sym->st_info))
|
||||
{
|
||||
case STB_GLOBAL:
|
||||
/* Global definition. Just what we need. */
|
||||
*ref = sym;
|
||||
return map->l_addr;
|
||||
case STB_WEAK:
|
||||
/* Weak definition. Use this value if we don't find
|
||||
another. */
|
||||
if (! weak_value.s)
|
||||
{
|
||||
weak_value.s = sym;
|
||||
weak_value.a = map->l_addr;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
/* Local symbols are ignored. */
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (weak_value.s == NULL &&
|
||||
if (current_value.s == NULL &&
|
||||
(*ref == NULL || ELFW(ST_BIND) ((*ref)->st_info) != STB_WEAK))
|
||||
{
|
||||
/* We could find no value for a strong reference. */
|
||||
@@ -144,8 +170,44 @@ _dl_lookup_symbol (const char *undef_name, const ElfW(Sym) **ref,
|
||||
_dl_signal_error (0, reference_name, buf);
|
||||
}
|
||||
|
||||
*ref = weak_value.s;
|
||||
return weak_value.a;
|
||||
*ref = current_value.s;
|
||||
return current_value.a;
|
||||
}
|
||||
|
||||
|
||||
/* This function is nearly the same as `_dl_lookup_symbol' but it
|
||||
skips in the first list all objects until SKIP_MAP is found. I.e.,
|
||||
it only considers objects which were loaded after the described
|
||||
object. If there are more search lists the object described by
|
||||
SKIP_MAP is only skipped. */
|
||||
ElfW(Addr)
|
||||
_dl_lookup_symbol_skip (const char *undef_name, const ElfW(Sym) **ref,
|
||||
struct link_map *symbol_scope[],
|
||||
const char *reference_name,
|
||||
struct link_map *skip_map,
|
||||
int flags)
|
||||
{
|
||||
const unsigned long int hash = _dl_elf_hash (undef_name);
|
||||
struct sym_val current_value = { 0, NULL };
|
||||
struct link_map **scope;
|
||||
size_t i;
|
||||
|
||||
/* Search the relevant loaded objects for a definition. */
|
||||
scope = symbol_scope;
|
||||
for (i = 0; (*scope)->l_dupsearchlist[i] != skip_map; ++i)
|
||||
assert (i < (*scope)->l_ndupsearchlist);
|
||||
|
||||
if (! do_lookup (undef_name, hash, ref, ¤t_value,
|
||||
(*scope)->l_dupsearchlist, i, (*scope)->l_ndupsearchlist,
|
||||
reference_name, skip_map, flags))
|
||||
while (*++scope)
|
||||
if (do_lookup (undef_name, hash, ref, ¤t_value,
|
||||
(*scope)->l_dupsearchlist, 0, (*scope)->l_ndupsearchlist,
|
||||
reference_name, skip_map, flags))
|
||||
break;
|
||||
|
||||
*ref = current_value.s;
|
||||
return current_value.a;
|
||||
}
|
||||
|
||||
|
||||
|
||||
+16
-16
@@ -1,21 +1,21 @@
|
||||
/* Minimal replacements for basic facilities used in the dynamic linker.
|
||||
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Copyright (C) 1995, 1996 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 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.
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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 <sys/types.h>
|
||||
#include <sys/mman.h>
|
||||
@@ -113,12 +113,12 @@ longjmp (jmp_buf env, int val) { __longjmp (env[0].__jmpbuf, val); }
|
||||
English-only in the dynamic linker keeps it smaller. */
|
||||
|
||||
char * weak_function
|
||||
__dgettext (const char *domainname, const char *msgid)
|
||||
__dcgettext (const char *domainname, const char *msgid, int category)
|
||||
{
|
||||
assert (domainname == _libc_intl_domainname);
|
||||
return (char *) msgid;
|
||||
}
|
||||
weak_alias (__dgettext, dgettext)
|
||||
weak_alias (__dcgettext, dcgettext)
|
||||
|
||||
#ifndef NDEBUG
|
||||
|
||||
|
||||
+14
-14
@@ -1,21 +1,21 @@
|
||||
/* Storage management for the chain of loaded shared objects.
|
||||
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Copyright (C) 1995, 1996 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 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.
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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 <link.h>
|
||||
#include <assert.h>
|
||||
|
||||
+24
-24
@@ -1,21 +1,21 @@
|
||||
/* Load a shared object at runtime, relocate it, and run its initializer.
|
||||
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Copyright (C) 1996 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 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.
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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 <link.h>
|
||||
#include <dlfcn.h>
|
||||
@@ -23,7 +23,11 @@ Cambridge, MA 02139, USA. */
|
||||
#include <errno.h>
|
||||
|
||||
|
||||
extern void _dl_start (void); weak_extern (_dl_start)
|
||||
extern ElfW(Addr) _dl_sysdep_start (void **start_argptr,
|
||||
void (*dl_main) (const ElfW(Phdr) *phdr,
|
||||
ElfW(Word) phnum,
|
||||
ElfW(Addr) *user_entry));
|
||||
weak_extern (_dl_sysdep_start)
|
||||
|
||||
extern int __libc_multiple_libcs; /* Defined in init-first.c. */
|
||||
|
||||
@@ -40,18 +44,15 @@ _dl_open (const char *file, int mode)
|
||||
struct link_map *new, *l;
|
||||
ElfW(Addr) init;
|
||||
struct r_debug *r;
|
||||
/* To decide whether we are the static libc or not. We must use
|
||||
this variable since gcc would otherwise optimize the test away. */
|
||||
void (*dl_start_ptr) (void) = &_dl_start;
|
||||
|
||||
/* Load the named object. */
|
||||
new = _dl_map_object (NULL, file, lt_loaded);
|
||||
new = _dl_map_object (NULL, file, lt_loaded, 0);
|
||||
if (new->l_searchlist)
|
||||
/* It was already open. */
|
||||
return new;
|
||||
|
||||
/* Load that object's dependencies. */
|
||||
_dl_map_object_deps (new, NULL, 0);
|
||||
_dl_map_object_deps (new, NULL, 0, 0);
|
||||
|
||||
|
||||
/* Relocate the objects loaded. We do this in reverse order so that copy
|
||||
@@ -144,10 +145,9 @@ _dl_open (const char *file, int mode)
|
||||
(*(void (*) (int, char **, char **)) init) (__libc_argc, __libc_argv,
|
||||
__environ);
|
||||
|
||||
if (dl_start_ptr == NULL)
|
||||
/* We must be the static _dl_open in libc.a because ld.so.1 is not
|
||||
in scope. A static program that has loaded a dynamic object
|
||||
now has competition. */
|
||||
if (_dl_sysdep_start == NULL)
|
||||
/* We must be the static _dl_open in libc.a. A static program that
|
||||
has loaded a dynamic object now has competition. */
|
||||
__libc_multiple_libcs = 1;
|
||||
|
||||
return new;
|
||||
|
||||
+14
-14
@@ -1,21 +1,21 @@
|
||||
/* Relocate a shared object and resolve its references to other loaded objects.
|
||||
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Copyright (C) 1995, 1996 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 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.
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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 <link.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
+15
-15
@@ -1,21 +1,21 @@
|
||||
/* On-demand PLT fixup for shared objects.
|
||||
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Copyright (C) 1995, 1996 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 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.
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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 <link.h>
|
||||
#include <stddef.h>
|
||||
@@ -41,7 +41,7 @@ _dl_object_relocation_scope (struct link_map *l)
|
||||
|
||||
if (! l->l_searchlist)
|
||||
/* We must construct the searchlist for this object. */
|
||||
_dl_map_object_deps (l, NULL, 0);
|
||||
_dl_map_object_deps (l, NULL, 0, 0);
|
||||
|
||||
/* The primary scope is this object itself and its
|
||||
dependencies. */
|
||||
|
||||
+16
-14
@@ -1,21 +1,21 @@
|
||||
/* Support for dynamic linking code in static libc.
|
||||
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Copyright (C) 1996 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 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.
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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 <assert.h>
|
||||
#include <fcntl.h>
|
||||
@@ -33,6 +33,7 @@ char **_dl_argv = &__progname; /* This is checked for some error messages. */
|
||||
For the dynamic linker it is set by -rpath when linking. */
|
||||
const char *_dl_rpath = DEFAULT_RPATH;
|
||||
|
||||
#ifndef MAP_ANON
|
||||
/* This is the only dl-sysdep.c function that is actually needed at run-time
|
||||
by _dl_map_object. */
|
||||
|
||||
@@ -41,6 +42,7 @@ _dl_sysdep_open_zero_fill (void)
|
||||
{
|
||||
return __open ("/dev/zero", O_RDONLY);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* This should never be called. */
|
||||
void
|
||||
|
||||
+14
-14
@@ -1,21 +1,21 @@
|
||||
/* Look up a symbol's run-time value in the scope of a loaded object.
|
||||
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Copyright (C) 1995, 1996 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 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.
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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 <stddef.h>
|
||||
#include <link.h>
|
||||
|
||||
+14
-15
@@ -1,21 +1,21 @@
|
||||
/* dladdr -- Locate the shared object symbol nearest a given address.
|
||||
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Copyright (C) 1996 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 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.
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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 <stddef.h>
|
||||
#include <link.h>
|
||||
@@ -83,4 +83,3 @@ dladdr (void *address, Dl_info *info)
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
+14
-15
@@ -1,21 +1,21 @@
|
||||
/* dlclose -- Close a handle opened by `dlopen'.
|
||||
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Copyright (C) 1995, 1996 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 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.
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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 <link.h>
|
||||
#include <dlfcn.h>
|
||||
@@ -30,4 +30,3 @@ dlclose (void *handle)
|
||||
|
||||
return _dlerror_run (doit) ? -1 : 0;
|
||||
}
|
||||
|
||||
|
||||
+14
-14
@@ -1,21 +1,21 @@
|
||||
/* dlerror -- Return error detail for failing <dlfcn.h> functions.
|
||||
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Copyright (C) 1995, 1996 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 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.
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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 <link.h>
|
||||
#include <dlfcn.h>
|
||||
|
||||
+33
-22
@@ -1,25 +1,26 @@
|
||||
/* dlfcn.h -- User functions for run-time dynamic loading.
|
||||
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Copyright (C) 1995, 1996 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 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.
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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. */
|
||||
|
||||
#ifndef _DLFCN_H
|
||||
#define _DLFCN_H 1
|
||||
|
||||
#define _DLFCN_H 1
|
||||
#include <features.h>
|
||||
|
||||
/* The MODE argument to `dlopen' contains one of the following: */
|
||||
#define RTLD_LAZY 0x001 /* Lazy function call binding. */
|
||||
@@ -31,32 +32,42 @@ Cambridge, MA 02139, USA. */
|
||||
visible as if the object were linked directly into the program. */
|
||||
#define RTLD_GLOBAL 0x100
|
||||
|
||||
/* If the first argument of `dlsym' is set to RTLD_NEXT the run-time
|
||||
address of the symbol called NAME in the next shared object is
|
||||
returned. The "next" relation is defined by the order the shared
|
||||
objects were loaded. */
|
||||
#define RTLD_NEXT ((void *) -1l)
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Open the shared object FILE and map it in; return a handle that can be
|
||||
passed to `dlsym' to get symbol values from it. */
|
||||
extern void *dlopen (const char *__file, int __mode);
|
||||
extern void *dlopen __P ((__const char *__file, int __mode));
|
||||
|
||||
/* Unmap and close a shared object opened by `dlopen'.
|
||||
The handle cannot be used again after calling `dlclose'. */
|
||||
extern int dlclose (void *__handle);
|
||||
extern int dlclose __P ((void *__handle));
|
||||
|
||||
/* Find the run-time address in the shared object HANDLE refers to
|
||||
of the symbol called NAME. */
|
||||
extern void *dlsym (void *__handle, const char *__name);
|
||||
extern void *dlsym __P ((void *__handle, __const char *__name));
|
||||
|
||||
/* When any of the above functions fails, call this function
|
||||
to return a string describing the error. Each call resets
|
||||
the error string so that a following call returns null. */
|
||||
extern char *dlerror (void);
|
||||
extern char *dlerror __P ((void));
|
||||
|
||||
/* Fill in *INFO with the following information about ADDRESS.
|
||||
Returns 0 iff no shared object's segments contain that address. */
|
||||
typedef struct
|
||||
{
|
||||
const char *dli_fname; /* File name of defining object. */
|
||||
__const char *dli_fname; /* File name of defining object. */
|
||||
void *dli_fbase; /* Load address of that object. */
|
||||
const char *dli_sname; /* Name of nearest symbol. */
|
||||
__const char *dli_sname; /* Name of nearest symbol. */
|
||||
void *dli_saddr; /* Exact value of nearest symbol. */
|
||||
} Dl_info;
|
||||
extern int dladdr (void *__address, Dl_info *__info);
|
||||
extern int dladdr __P ((void *__address, Dl_info *__info));
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* dlfcn.h */
|
||||
|
||||
+14
-14
@@ -1,21 +1,21 @@
|
||||
/* dlopen -- Load a shared object at run time.
|
||||
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Copyright (C) 1995, 1996 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 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.
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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 <stddef.h>
|
||||
#include <link.h>
|
||||
|
||||
+42
-24
@@ -1,21 +1,21 @@
|
||||
/* dlsym -- Look up a symbol in a shared object loaded by `dlopen'.
|
||||
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Copyright (C) 1995, 1996 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 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.
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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 <stddef.h>
|
||||
#include <link.h>
|
||||
@@ -26,25 +26,43 @@ Cambridge, MA 02139, USA. */
|
||||
void *
|
||||
dlsym (void *handle, const char *name)
|
||||
{
|
||||
ElfW(Addr) caller = (ElfW(Addr)) __builtin_return_address (0);
|
||||
ElfW(Addr) loadbase;
|
||||
const ElfW(Sym) *ref = NULL;
|
||||
void doit (void)
|
||||
{
|
||||
struct link_map *map = handle, **scope, *mapscope[2] = { map, NULL };
|
||||
const char *owner;
|
||||
|
||||
if (map)
|
||||
if (handle == NULL)
|
||||
/* Search the global scope. */
|
||||
loadbase = _dl_lookup_symbol
|
||||
(name, &ref, &(_dl_global_scope ?: _dl_default_scope)[2], NULL, 0);
|
||||
else if (handle == RTLD_NEXT)
|
||||
{
|
||||
/* Search the scope of the given object. */
|
||||
scope = mapscope;
|
||||
owner = map->l_name;
|
||||
struct link_map *l, *match;
|
||||
|
||||
/* Find the highest-addressed object that CALLER is not below. */
|
||||
match = NULL;
|
||||
for (l = _dl_loaded; l; l = l->l_next)
|
||||
if (caller >= l->l_addr && (!match || match->l_addr < l->l_addr))
|
||||
match = l;
|
||||
|
||||
if (! match)
|
||||
_dl_signal_error (0, NULL, _("\
|
||||
RTLD_NEXT used in code not dynamically loaded"));
|
||||
|
||||
l = match;
|
||||
while (l->l_loader)
|
||||
l = l->l_loader;
|
||||
|
||||
loadbase = _dl_lookup_symbol_skip
|
||||
(name, &ref, &_dl_loaded, NULL, l, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
scope = &(_dl_global_scope ?: _dl_default_scope)[2];
|
||||
owner = NULL;
|
||||
/* Search the scope of the given object. */
|
||||
struct link_map *map = handle;
|
||||
struct link_map *mapscope[2] = { map, NULL };
|
||||
loadbase = _dl_lookup_symbol (name, &ref, mapscope, map->l_name, 0);
|
||||
}
|
||||
loadbase = _dl_lookup_symbol (name, &ref, scope, owner, 0);
|
||||
}
|
||||
|
||||
return _dlerror_run (doit) ? NULL : (void *) (loadbase + ref->st_value);
|
||||
|
||||
+14
-14
@@ -1,21 +1,21 @@
|
||||
/* Do relocations for ELF dynamic linking.
|
||||
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Copyright (C) 1995, 1996 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 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.
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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. */
|
||||
|
||||
/* This file may be included twice, to define both
|
||||
`elf_dynamic_do_rel' and `elf_dynamic_do_rela'. */
|
||||
|
||||
+23
-16
@@ -1,21 +1,21 @@
|
||||
/* Inline functions for dynamic linking.
|
||||
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Copyright (C) 1995, 1996, 1997 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 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.
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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 <elf.h>
|
||||
#include <dl-machine.h>
|
||||
@@ -25,11 +25,13 @@ Cambridge, MA 02139, USA. */
|
||||
/* Read the dynamic section at DYN and fill in INFO with indices DT_*. */
|
||||
|
||||
static inline void __attribute__ ((unused))
|
||||
elf_get_dynamic_info (ElfW(Dyn) *dyn, ElfW(Dyn) *info[DT_NUM + DT_PROCNUM])
|
||||
elf_get_dynamic_info (ElfW(Dyn) *dyn,
|
||||
ElfW(Dyn) *info[DT_NUM + DT_PROCNUM + DT_VERSIONTAGNUM
|
||||
+ DT_EXTRANUM])
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < DT_NUM + DT_PROCNUM; ++i)
|
||||
for (i = 0; i < DT_NUM + DT_PROCNUM + DT_VERSIONTAGNUM + DT_EXTRANUM; ++i)
|
||||
info[i] = NULL;
|
||||
|
||||
if (! dyn)
|
||||
@@ -42,6 +44,11 @@ elf_get_dynamic_info (ElfW(Dyn) *dyn, ElfW(Dyn) *info[DT_NUM + DT_PROCNUM])
|
||||
else if (dyn->d_tag >= DT_LOPROC &&
|
||||
dyn->d_tag < DT_LOPROC + DT_PROCNUM)
|
||||
info[dyn->d_tag - DT_LOPROC + DT_NUM] = dyn;
|
||||
else if ((Elf32_Word) DT_VERSIONTAGIDX (dyn->d_tag) < DT_VERSIONTAGNUM)
|
||||
info[DT_VERSIONTAGIDX (dyn->d_tag) + DT_NUM + DT_PROCNUM] = dyn;
|
||||
else if ((Elf32_Word) DT_EXTRATAGIDX (dyn->d_tag) < DT_EXTRANUM)
|
||||
info[DT_EXTRATAGIDX (dyn->d_tag) + DT_NUM + DT_PROCNUM
|
||||
+ DT_VERSIONTAGNUM] = dyn;
|
||||
else
|
||||
assert (! "bad dynamic tag");
|
||||
dyn++;
|
||||
|
||||
@@ -1,27 +1,29 @@
|
||||
/* This file defines standard ELF types, structures, and macros.
|
||||
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
Contributed by Ian Lance Taylor (ian@cygnus.com).
|
||||
Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ian Lance Taylor <ian@cygnus.com>.
|
||||
|
||||
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 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.
|
||||
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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. */
|
||||
|
||||
#ifndef _ELF_H
|
||||
#define _ELF_H 1
|
||||
|
||||
#define _ELF_H 1
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Standard ELF types. Using __attribute__ mode ensures that GCC
|
||||
will choose the right number of bits for these types. */
|
||||
@@ -230,6 +232,11 @@ typedef struct
|
||||
#define SHT_SHLIB 10 /* Reserved */
|
||||
#define SHT_DYNSYM 11 /* Dynamic linker symbol table */
|
||||
#define SHT_NUM 12 /* Number of defined types. */
|
||||
#define SHT_LOSUNW 0x6ffffffd /* Sun-specific low bound. */
|
||||
#define SHT_GNU_verdef 0x6ffffffd /* Version definition section. */
|
||||
#define SHT_GNU_verneed 0x6ffffffe /* Version needs section. */
|
||||
#define SHT_GNU_versym 0x6fffffff /* Version symbol table. */
|
||||
#define SHT_HISUNW 0x6fffffff /* Sun-specific high bound. */
|
||||
#define SHT_LOPROC 0x70000000 /* Start of processor-specific */
|
||||
#define SHT_HIPROC 0x7fffffff /* End of processor-specific */
|
||||
#define SHT_LOUSER 0x80000000 /* Start of application-specific */
|
||||
@@ -462,6 +469,93 @@ typedef struct
|
||||
#define DT_HIPROC 0x7fffffff /* End of processor-specific */
|
||||
#define DT_PROCNUM DT_MIPS_NUM /* Most used by any processor */
|
||||
|
||||
/* The versioning entry types. The next are defined as part of the
|
||||
GNU extension. */
|
||||
#define DT_VERSYM 0x6ffffff0
|
||||
|
||||
/* These were chosen by Sun. */
|
||||
#define DT_VERDEF 0x6ffffffc /* Address of version definition
|
||||
table */
|
||||
#define DT_VERDEFNUM 0x6ffffffd /* Number of version definitions */
|
||||
#define DT_VERNEED 0x6ffffffe /* Address of table with needed
|
||||
versions */
|
||||
#define DT_VERNEEDNUM 0x6fffffff /* Number of needed versions */
|
||||
#define DT_VERSIONTAGIDX(tag) (DT_VERNEEDNUM - (tag)) /* Reverse order! */
|
||||
#define DT_VERSIONTAGNUM 16
|
||||
|
||||
/* Sun added these machine-independent extensions in the "processor-specific"
|
||||
range. Be compatible. */
|
||||
#define DT_AUXILIARY 0x7ffffffd /* Shared object to load before self */
|
||||
#define DT_FILTER 0x7fffffff /* Shared object to get values from */
|
||||
#define DT_EXTRATAGIDX(tag) ((Elf32_Word)-((Elf32_Sword) (tag) <<1>>1)-1)
|
||||
#define DT_EXTRANUM 3
|
||||
|
||||
/* Version definition sections. */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Elf32_Half vd_version; /* Version revision */
|
||||
Elf32_Half vd_flags; /* Version information */
|
||||
Elf32_Half vd_ndx; /* Version Index */
|
||||
Elf32_Half vd_cnt; /* Number of associated aux entries */
|
||||
Elf32_Word vd_hash; /* Version name hash value */
|
||||
Elf32_Word vd_aux; /* Offset in bytes to verdaux array */
|
||||
Elf32_Word vd_next; /* Offset in bytes to next verdef
|
||||
entry */
|
||||
} Elf32_Verdef;
|
||||
|
||||
/* Legal values for vd_version (version revision). */
|
||||
#define VER_DEF_NONE 0 /* No version */
|
||||
#define VER_DEF_CURRENT 1 /* Current version */
|
||||
#define VER_DEF_NUM 2 /* Given version number */
|
||||
|
||||
/* Legal values for vd_flags (version information flags). */
|
||||
#define VER_FLG_BASE 0x1 /* Version definition of file itself */
|
||||
#define VER_FLG_WEAK 0x2 /* Weak version identifier */
|
||||
|
||||
/* Auxialiary version information. */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Elf32_Addr vda_name; /* Version or dependency names */
|
||||
Elf32_Word vda_next; /* Offset in bytes to next verdaux
|
||||
entry */
|
||||
} Elf32_Verdaux;
|
||||
|
||||
/* Version dependency section. */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Elf32_Half vn_version; /* Version of structure */
|
||||
Elf32_Half vn_cnt; /* Number of associated aux entries */
|
||||
Elf32_Addr vn_file; /* Offset of filename for this
|
||||
dependency */
|
||||
Elf32_Word vn_aux; /* Offset in bytes to vernaux array */
|
||||
Elf32_Word vn_next; /* Offset in bytes to next verneed
|
||||
entry */
|
||||
} Elf32_Verneed;
|
||||
|
||||
/* Legal values for vn_version (version revision). */
|
||||
#define VER_NEED_NONE 0 /* No version */
|
||||
#define VER_NEED_CURRENT 1 /* Current version */
|
||||
#define VER_NEED_NUM 2 /* Given version number */
|
||||
|
||||
/* Auxiliary needed version information. */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Elf32_Word vna_hash; /* Hash value of dependency name */
|
||||
Elf32_Half vna_flags; /* Dependency specific information */
|
||||
Elf32_Half vna_other; /* Unused */
|
||||
Elf32_Addr vna_name; /* Dependency name string offset */
|
||||
Elf32_Word vna_next; /* Offset in bytes to next vernaux
|
||||
entry */
|
||||
} Elf32_Vernaux;
|
||||
|
||||
/* Legal values for vna_flags. */
|
||||
#define VER_FLG_WEAK 0x2 /* Weak verison identifier */
|
||||
|
||||
|
||||
/* Auxiliary vector. */
|
||||
|
||||
/* This vector is normally only used by the program interpreter. The
|
||||
@@ -773,5 +867,6 @@ typedef Elf32_Addr Elf32_Conflict;
|
||||
#define R_ALPHA_JMP_SLOT 26 /* Create PLT entry */
|
||||
#define R_ALPHA_RELATIVE 27 /* Adjust by program base */
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* elf.h */
|
||||
|
||||
+15
-15
@@ -1,21 +1,21 @@
|
||||
/* You don't really want to know what this hack is for.
|
||||
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Copyright (C) 1996 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 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.
|
||||
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. */
|
||||
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 <stdio.h>
|
||||
#include <ctype.h>
|
||||
@@ -128,7 +128,7 @@ _start (void)
|
||||
char *buf = NULL;
|
||||
size_t bufsz = 0;
|
||||
|
||||
while (getline (&buf, &bufsz, stdin) > 0)
|
||||
while (__getline (&buf, &bufsz, stdin) > 0)
|
||||
{
|
||||
char *p = buf;
|
||||
eval (&p);
|
||||
|
||||
+123
@@ -0,0 +1,123 @@
|
||||
#! @BASH@
|
||||
|
||||
# Copyright (C) 1996, 1997 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.
|
||||
|
||||
|
||||
# This is the `ldd' command, which lists what shared libraries are
|
||||
# used by given dynamically-linked executables. It works by invoking the
|
||||
# run-time dynamic linker as a command and setting the environment
|
||||
# variable LD_TRACE_LOADED_OBJECTS to a non-empty value.
|
||||
|
||||
# We should be able to find the translation right at the beginning.
|
||||
TEXTDOMAIN=libc
|
||||
TEXTDOMAINDIR=@TEXTDOMAINDIR@
|
||||
|
||||
RTLD=@RTLD@
|
||||
RELOCS=
|
||||
|
||||
while test $# -gt 0; do
|
||||
case "$1" in
|
||||
--v | --ve | --ver | --vers | --versi | --versio | --version)
|
||||
echo $"ldd (GNU libc) @VERSION@
|
||||
Copyright (C) 1996, 1997 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."
|
||||
exit 0 ;;
|
||||
--h | --he | --hel | --help)
|
||||
echo $"ldd [OPTION]... FILE...
|
||||
--help print this help and exit
|
||||
--version print version information and exit
|
||||
-d, --data-relocs process data relocations
|
||||
-r, --function-relocs process data and function relocations
|
||||
Report bugs using the \`glibcbug' script to <bugs@gnu.ai.mit.edu>."
|
||||
exit 0 ;;
|
||||
-d | --d | --da | --dat | --data | --data- | --data-r | --data-re | \
|
||||
--data-rel | --data-relo | --data-reloc | --data-relocs)
|
||||
RELOCS='--data-relocs'
|
||||
shift ;;
|
||||
-r | --f | --fu | --fun | --func | --funct | --functi | --functio | \
|
||||
--function | --function- | --function-r | --function-re | --function-rel | \
|
||||
--function-relo | --function-reloc | --function-relocs)
|
||||
RELOCS='--function-relocs'
|
||||
shift ;;
|
||||
--) # Stop option processing.
|
||||
shift; break ;;
|
||||
-*)
|
||||
echo >&2 $"ldd: unrecognized option" "\`$1'"
|
||||
echo >&2 $"Try \`ldd --help' for more information."
|
||||
exit 1 ;;
|
||||
*)
|
||||
break ;;
|
||||
esac
|
||||
done
|
||||
|
||||
case $# in
|
||||
0)
|
||||
echo >&2 $"ldd: missing file arguments"
|
||||
echo >&2 $"Try \`ldd --help' for more information."
|
||||
exit 1 ;;
|
||||
1)
|
||||
# We don't list the file name when there is only one.
|
||||
case "$1" in
|
||||
/*) file="$1" ;;
|
||||
*) file="./$1" ;;
|
||||
esac
|
||||
if test ! -f "$file"; then
|
||||
echo "${file}:" $"no such file"
|
||||
exit 1
|
||||
else
|
||||
test -x "$file" ||
|
||||
echo $"warning: you do not have execution permission for" "\`$file'"
|
||||
if ${RTLD} --verify "$file"; then
|
||||
LD_TRACE_LOADED_OBJECTS=1 exec ${RTLD} ${RELOCS} "$file" || exit 1
|
||||
else
|
||||
echo $" not a dynamic executable"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
exit ;;
|
||||
*)
|
||||
set -e # Bail out immediately if ${RTLD} loses on any argument.
|
||||
result=0
|
||||
for file; do
|
||||
echo "${file}:"
|
||||
case "$file" in
|
||||
/*) : ;;
|
||||
*) file="./$file" ;;
|
||||
esac
|
||||
if test ! -f "$file"; then
|
||||
echo "${file}:" $"no such file"
|
||||
result=1
|
||||
else
|
||||
test -x "$file" ||
|
||||
echo $"warning: you do not have execution permission for" "\`$file'"
|
||||
if ${RTLD} --verify "$file"; then
|
||||
LD_TRACE_LOADED_OBJECTS=1 ${RTLD} ${RELOCS} "$file" || result=1
|
||||
else
|
||||
echo $" not a dynamic executable"
|
||||
result=1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
esac
|
||||
|
||||
exit $result
|
||||
# Local Variables:
|
||||
# mode:ksh
|
||||
# End:
|
||||
+87
-11
@@ -1,15 +1,74 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Copyright (C) 1996, 1997 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.
|
||||
|
||||
|
||||
# This is the `ldd' command, which lists what shared libraries are
|
||||
# used by given dynamically-linked executables. It works by invoking the
|
||||
# run-time dynamic linker as a command and giving it the special `--list'
|
||||
# switch.
|
||||
# run-time dynamic linker as a command and setting the environment
|
||||
# variable LD_TRACE_LOADED_OBJECTS to a non-empty value.
|
||||
|
||||
RTLD=@RTLD@
|
||||
RELOCS=
|
||||
|
||||
while test $# -gt 0; do
|
||||
case "$1" in
|
||||
--v | --ve | --ver | --vers | --versi | --versio | --version)
|
||||
echo 'ldd (GNU libc) @VERSION@
|
||||
Copyright (C) 1996, 1997 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.'
|
||||
exit 0 ;;
|
||||
--h | --he | --hel | --help)
|
||||
echo "ldd [OPTION]... FILE...
|
||||
--help print this help and exit
|
||||
--version print version information and exit
|
||||
-d, --data-relocs process data relocations
|
||||
-r, --function-relocs process data and function relocations
|
||||
Report bugs using the \`glibcbug' script to <bugs@gnu.ai.mit.edu>."
|
||||
exit 0 ;;
|
||||
-d | --d | --da | --dat | --data | --data- | --data-r | --data-re | \
|
||||
--data-rel | --data-relo | --data-reloc | --data-relocs)
|
||||
RELOCS='--data-relocs'
|
||||
shift ;;
|
||||
-r | --f | --fu | --fun | --func | --funct | --functi | --functio | \
|
||||
--function | --function- | --function-r | --function-re | --function-rel | \
|
||||
--function-relo | --function-reloc | --function-relocs)
|
||||
RELOCS='--function-relocs'
|
||||
shift ;;
|
||||
--) # Stop option processing.
|
||||
shift; break ;;
|
||||
-*)
|
||||
echo >&2 "\
|
||||
ldd: unrecognized option \`$1'
|
||||
Try \`ldd --help' for more information."
|
||||
exit 1 ;;
|
||||
*)
|
||||
break ;;
|
||||
esac
|
||||
done
|
||||
|
||||
case $# in
|
||||
0)
|
||||
echo >&2 "Usage: $0 FILE..."
|
||||
echo >&2 "\
|
||||
ldd: missing file arguments
|
||||
Try \`ldd --help' for more information."
|
||||
exit 1 ;;
|
||||
1)
|
||||
# We don't list the file name when there is only one.
|
||||
@@ -17,26 +76,43 @@ case $# in
|
||||
/*) file="$1" ;;
|
||||
*) file="./$1" ;;
|
||||
esac
|
||||
if ${RTLD} --verify "$file"; then
|
||||
LD_TRACE_LOADED_OBJECTS=1 exec ${RTLD} "$file" && exit 1
|
||||
if test ! -f "$file"; then
|
||||
echo "${file}: no such file"
|
||||
exit 1
|
||||
else
|
||||
echo ' not a dynamic executable'
|
||||
test -x "$file" ||
|
||||
echo "warning: you do not have execution permission for \`$file'"
|
||||
if ${RTLD} --verify "$file"; then
|
||||
LD_TRACE_LOADED_OBJECTS=1 exec ${RTLD} ${RELOCS} "$file" || exit 1
|
||||
else
|
||||
echo ' not a dynamic executable'
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
exit ;;
|
||||
*)
|
||||
set -e # Bail out immediately if ${RTLD} loses on any argument.
|
||||
result=0
|
||||
for file; do
|
||||
echo "${file}:"
|
||||
case "$file" in
|
||||
/*) file="$file" ;;
|
||||
/*) : ;;
|
||||
*) file="./$file" ;;
|
||||
esac
|
||||
if ${RTLD} --verify "$file"; then
|
||||
LD_TRACE_LOADED_OBJECTS=1 ${RTLD} "$file"
|
||||
if test ! -f "$file"; then
|
||||
echo "${file}: no such file"
|
||||
result=1
|
||||
else
|
||||
echo ' not a dynamic executable'
|
||||
test -x "$file" ||
|
||||
echo "warning: you do not have execution permission for \`$file'"
|
||||
if ${RTLD} --verify "$file"; then
|
||||
LD_TRACE_LOADED_OBJECTS=1 ${RTLD} ${RELOCS} "$file" || result=1
|
||||
else
|
||||
echo ' not a dynamic executable'
|
||||
result=1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
esac
|
||||
|
||||
exit 0
|
||||
exit $result
|
||||
|
||||
+55
-21
@@ -1,21 +1,21 @@
|
||||
/* Run-time dynamic linker data structures for loaded ELF shared objects.
|
||||
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Copyright (C) 1995, 1996, 1997 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 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.
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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. */
|
||||
|
||||
#ifndef _LINK_H
|
||||
#define _LINK_H 1
|
||||
@@ -97,8 +97,14 @@ struct link_map
|
||||
const char *l_libname; /* Name requested (before search). */
|
||||
/* Indexed pointers to dynamic section.
|
||||
[0,DT_NUM) are indexed by the processor-independent tags.
|
||||
[DT_NUM,DT_NUM+DT_PROCNUM] are indexed by the tag minus DT_LOPROC. */
|
||||
ElfW(Dyn) *l_info[DT_NUM + DT_PROCNUM];
|
||||
[DT_NUM,DT_NUM+DT_PROCNUM) are indexed by the tag minus DT_LOPROC.
|
||||
[DT_NUM+DT_PROCNUM,DT_NUM+DT_PROCNUM+DT_EXTRANUM) are indexed
|
||||
by DT_EXTRATAGIDX(tagvalue) and
|
||||
[DT_NUM+DT_PROCNUM+DT_VERSIONTAGNUM,
|
||||
DT_NUM+DT_PROCNUM+DT_VERSIONTAGNUM+DT_EXTRANUM)
|
||||
are indexed by DT_EXTRATAGIDX(tagvalue) (see <elf.h>). */
|
||||
|
||||
ElfW(Dyn) *l_info[DT_NUM + DT_PROCNUM + DT_VERSIONTAGNUM + DT_EXTRANUM];
|
||||
const ElfW(Phdr) *l_phdr; /* Pointer to program header table in core. */
|
||||
ElfW(Addr) l_entry; /* Entry point location. */
|
||||
ElfW(Half) l_phnum; /* Number of program header entries. */
|
||||
@@ -109,6 +115,11 @@ struct link_map
|
||||
struct link_map **l_searchlist;
|
||||
unsigned int l_nsearchlist;
|
||||
|
||||
/* We keep another list in which we keep duplicates. This is
|
||||
needed in _dl_lookup_symbol_skip to implemented RTLD_NEXT. */
|
||||
struct link_map **l_dupsearchlist;
|
||||
unsigned int l_ndupsearchlist;
|
||||
|
||||
/* Dependent object that first caused this object to be loaded. */
|
||||
struct link_map *l_loader;
|
||||
|
||||
@@ -129,6 +140,12 @@ struct link_map
|
||||
unsigned int l_global:1; /* Nonzero if object in _dl_global_scope. */
|
||||
unsigned int l_reserved:2; /* Reserved for internal use. */
|
||||
};
|
||||
|
||||
|
||||
/* Function used as argument for `_dl_receive_error' function. The
|
||||
arguments are the error string and the objname the error occurred
|
||||
in. */
|
||||
typedef void (*receiver_fct) (const char *, const char *);
|
||||
|
||||
/* Internal functions of the run-time dynamic linker.
|
||||
These can be accessed if you link again the dynamic linker
|
||||
@@ -153,6 +170,11 @@ extern int _dl_sysdep_open_zero_fill (void); /* dl-sysdep.c */
|
||||
are concatenated to form the message to print. */
|
||||
extern void _dl_sysdep_message (const char *string, ...);
|
||||
|
||||
/* OS-dependent function to write a message on the standard error.
|
||||
All arguments are `const char *'; args until a null pointer
|
||||
are concatenated to form the message to print. */
|
||||
extern void _dl_sysdep_error (const char *string, ...);
|
||||
|
||||
/* OS-dependent function to give a fatal error message and exit
|
||||
when the dynamic linker fails before the program is fully linked.
|
||||
All arguments are `const char *'; args until a null pointer
|
||||
@@ -169,11 +191,9 @@ extern int _dl_secure;
|
||||
zero; OBJECT is the name of the problematical shared object, or null if
|
||||
it is a general problem; ERRSTRING is a string describing the specific
|
||||
problem. */
|
||||
|
||||
extern void _dl_signal_error (int errcode,
|
||||
const char *object,
|
||||
const char *errstring)
|
||||
__attribute__ ((__noreturn__));
|
||||
const char *errstring);
|
||||
|
||||
/* Call OPERATE, catching errors from `dl_signal_error'. If there is no
|
||||
error, *ERRSTRING is set to null. If there is an error, *ERRSTRING and
|
||||
@@ -184,6 +204,11 @@ extern int _dl_catch_error (char **errstring,
|
||||
const char **object,
|
||||
void (*operate) (void));
|
||||
|
||||
/* Call OPERATE, receiving errors from `dl_signal_error'. Unlike
|
||||
`_dl_catch_error' the operation is resumed after the OPERATE
|
||||
function returns. */
|
||||
extern void _dl_receive_error (receiver_fct fct, void (*operate) (void));
|
||||
|
||||
|
||||
/* Helper function for <dlfcn.h> functions. Runs the OPERATE function via
|
||||
_dl_catch_error. Returns zero for success, nonzero for failure; and
|
||||
@@ -195,7 +220,8 @@ extern int _dlerror_run (void (*operate) (void));
|
||||
LOADER's DT_RPATH is used in searching for NAME.
|
||||
If the object is already opened, returns its existing map. */
|
||||
extern struct link_map *_dl_map_object (struct link_map *loader,
|
||||
const char *name, int type);
|
||||
const char *name, int type,
|
||||
int trace_mode);
|
||||
|
||||
/* Call _dl_map_object on the dependencies of MAP, and set up
|
||||
MAP->l_searchlist. PRELOADS points to a vector of NPRELOADS previously
|
||||
@@ -203,7 +229,7 @@ extern struct link_map *_dl_map_object (struct link_map *loader,
|
||||
but before its dependencies. */
|
||||
extern void _dl_map_object_deps (struct link_map *map,
|
||||
struct link_map **preloads,
|
||||
unsigned int npreloads);
|
||||
unsigned int npreloads, int trace_mode);
|
||||
|
||||
/* Cache the locations of MAP's hash table. */
|
||||
extern void _dl_setup_hash (struct link_map *map);
|
||||
@@ -238,6 +264,14 @@ extern ElfW(Addr) _dl_lookup_symbol (const char *undef,
|
||||
const char *reference_name,
|
||||
int flags);
|
||||
|
||||
/* For handling RTLD_NEXT we must be able to skip shared objects. */
|
||||
extern ElfW(Addr) _dl_lookup_symbol_skip (const char *undef,
|
||||
const ElfW(Sym) **sym,
|
||||
struct link_map *symbol_scope[],
|
||||
const char *reference_name,
|
||||
struct link_map *skip_this,
|
||||
int flags);
|
||||
|
||||
/* Look up symbol NAME in MAP's scope and return its run-time address. */
|
||||
extern ElfW(Addr) _dl_symbol_value (struct link_map *map, const char *name);
|
||||
|
||||
|
||||
+133
-69
@@ -1,21 +1,21 @@
|
||||
/* Run time dynamic linker.
|
||||
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Copyright (C) 1995, 1996, 1997 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 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.
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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 <link.h>
|
||||
#include <stddef.h>
|
||||
@@ -44,6 +44,10 @@ extern void *_dl_sysdep_read_whole_file (const char *filename,
|
||||
size_t *filesize_ptr,
|
||||
int mmap_prot);
|
||||
|
||||
/* Helper function to handle errors while resolving symbols. */
|
||||
static void print_unresolved (const char *errstring, const char *objname);
|
||||
|
||||
|
||||
int _dl_argc;
|
||||
char **_dl_argv;
|
||||
const char *_dl_rpath;
|
||||
@@ -83,10 +87,8 @@ _dl_start (void *arg)
|
||||
/* Figure out the run-time load address of the dynamic linker itself. */
|
||||
bootstrap_map.l_addr = elf_machine_load_address ();
|
||||
|
||||
/* Read our own dynamic section and fill in the info array.
|
||||
Conveniently, the first element of the GOT contains the
|
||||
offset of _DYNAMIC relative to the run-time load address. */
|
||||
bootstrap_map.l_ld = (void *) bootstrap_map.l_addr + *elf_machine_got ();
|
||||
/* Read our own dynamic section and fill in the info array. */
|
||||
bootstrap_map.l_ld = (void *) bootstrap_map.l_addr + elf_machine_dynamic ();
|
||||
elf_get_dynamic_info (bootstrap_map.l_ld, bootstrap_map.l_info);
|
||||
|
||||
#ifdef ELF_MACHINE_BEFORE_RTLD_RELOC
|
||||
@@ -144,11 +146,22 @@ dl_main (const ElfW(Phdr) *phdr,
|
||||
enum { normal, list, verify, trace } mode;
|
||||
struct link_map **preloads;
|
||||
unsigned int npreloads;
|
||||
const char *preloadlist;
|
||||
size_t file_size;
|
||||
char *file;
|
||||
|
||||
mode = getenv ("LD_TRACE_LOADED_OBJECTS") != NULL ? trace : normal;
|
||||
|
||||
/* LAZY is determined by the parameters --datadeps and --function-deps
|
||||
if we trace the binary. */
|
||||
if (mode == trace)
|
||||
lazy = -1;
|
||||
else
|
||||
lazy = !__libc_enable_secure && *(getenv ("LD_BIND_NOW") ?: "") == '\0';
|
||||
|
||||
/* Set up a flag which tells we are just starting. */
|
||||
_dl_starting_up = 1;
|
||||
|
||||
if (*user_entry == (ElfW(Addr)) &_start)
|
||||
{
|
||||
/* Ho ho. We are not the program interpreter! We are the program
|
||||
@@ -185,22 +198,44 @@ of this helper program; chances are you did not intend to run this program.\n",
|
||||
/* Note the place where the dynamic linker actually came from. */
|
||||
_dl_rtld_map.l_name = _dl_argv[0];
|
||||
|
||||
if (! strcmp (_dl_argv[1], "--list"))
|
||||
{
|
||||
mode = list;
|
||||
while (_dl_argc > 1)
|
||||
if (! strcmp (_dl_argv[1], "--list"))
|
||||
{
|
||||
mode = list;
|
||||
lazy = -1; /* This means do no dependency analysis. */
|
||||
|
||||
++_dl_skip_args;
|
||||
--_dl_argc;
|
||||
++_dl_argv;
|
||||
}
|
||||
else if (! strcmp (_dl_argv[1], "--verify"))
|
||||
{
|
||||
mode = verify;
|
||||
++_dl_skip_args;
|
||||
--_dl_argc;
|
||||
++_dl_argv;
|
||||
}
|
||||
else if (! strcmp (_dl_argv[1], "--verify"))
|
||||
{
|
||||
mode = verify;
|
||||
|
||||
++_dl_skip_args;
|
||||
--_dl_argc;
|
||||
++_dl_argv;
|
||||
}
|
||||
++_dl_skip_args;
|
||||
--_dl_argc;
|
||||
++_dl_argv;
|
||||
}
|
||||
else if (! strcmp (_dl_argv[1], "--data-relocs"))
|
||||
{
|
||||
mode = trace;
|
||||
lazy = 1; /* This means do only data relocation analysis. */
|
||||
|
||||
++_dl_skip_args;
|
||||
--_dl_argc;
|
||||
++_dl_argv;
|
||||
}
|
||||
else if (! strcmp (_dl_argv[1], "--function-relocs"))
|
||||
{
|
||||
mode = trace;
|
||||
lazy = 0; /* This means do also function relocation analysis. */
|
||||
|
||||
++_dl_skip_args;
|
||||
--_dl_argc;
|
||||
++_dl_argv;
|
||||
}
|
||||
else
|
||||
break;
|
||||
|
||||
++_dl_skip_args;
|
||||
--_dl_argc;
|
||||
@@ -210,7 +245,7 @@ of this helper program; chances are you did not intend to run this program.\n",
|
||||
{
|
||||
void doit (void)
|
||||
{
|
||||
l = _dl_map_object (NULL, _dl_argv[0], lt_library);
|
||||
l = _dl_map_object (NULL, _dl_argv[0], lt_library, 0);
|
||||
}
|
||||
char *err_str = NULL;
|
||||
const char *obj_name __attribute__ ((unused));
|
||||
@@ -223,7 +258,7 @@ of this helper program; chances are you did not intend to run this program.\n",
|
||||
}
|
||||
}
|
||||
else
|
||||
l = _dl_map_object (NULL, _dl_argv[0], lt_library);
|
||||
l = _dl_map_object (NULL, _dl_argv[0], lt_library, 0);
|
||||
|
||||
phdr = l->l_phdr;
|
||||
phent = l->l_phnum;
|
||||
@@ -235,6 +270,8 @@ of this helper program; chances are you did not intend to run this program.\n",
|
||||
/* Create a link_map for the executable itself.
|
||||
This will be what dlopen on "" returns. */
|
||||
l = _dl_new_object ((char *) "", "", lt_executable);
|
||||
if (l == NULL)
|
||||
_dl_sysdep_fatal ("cannot allocate memory for link map", NULL);
|
||||
l->l_phdr = phdr;
|
||||
l->l_phnum = phent;
|
||||
l->l_entry = *user_entry;
|
||||
@@ -282,9 +319,7 @@ of this helper program; chances are you did not intend to run this program.\n",
|
||||
if (mode == verify)
|
||||
/* We were called just to verify that this is a dynamic executable
|
||||
using us as the program interpreter. */
|
||||
_exit ((strcmp (_dl_rtld_map.l_libname, _dl_rtld_map.l_name) ||
|
||||
l->l_ld == NULL)
|
||||
? EXIT_FAILURE : EXIT_SUCCESS);
|
||||
_exit (l->l_ld == NULL ? EXIT_FAILURE : EXIT_SUCCESS);
|
||||
|
||||
/* Extract the contents of the dynamic section for easy access. */
|
||||
elf_get_dynamic_info (l->l_ld, l->l_info);
|
||||
@@ -310,22 +345,22 @@ of this helper program; chances are you did not intend to run this program.\n",
|
||||
preloads = NULL;
|
||||
npreloads = 0;
|
||||
|
||||
if (! __libc_enable_secure)
|
||||
preloadlist = getenv ("LD_PRELOAD");
|
||||
if (preloadlist)
|
||||
{
|
||||
const char *preloadlist = getenv ("LD_PRELOAD");
|
||||
if (preloadlist)
|
||||
{
|
||||
/* The LD_PRELOAD environment variable gives a colon-separated
|
||||
list of libraries that are loaded before the executable's
|
||||
dependencies and prepended to the global scope list. */
|
||||
char *list = strdupa (preloadlist);
|
||||
char *p;
|
||||
while ((p = strsep (&list, ":")) != NULL)
|
||||
{
|
||||
(void) _dl_map_object (NULL, p, lt_library);
|
||||
++npreloads;
|
||||
}
|
||||
}
|
||||
/* The LD_PRELOAD environment variable gives a white space
|
||||
separated list of libraries that are loaded before the
|
||||
executable's dependencies and prepended to the global scope
|
||||
list. If the binary is running setuid all elements
|
||||
containing a '/' are ignored since it is insecure. */
|
||||
char *list = strdupa (preloadlist);
|
||||
char *p;
|
||||
while ((p = strsep (&list, " ")) != NULL)
|
||||
if (! __libc_enable_secure || strchr (p, '/') == NULL)
|
||||
{
|
||||
(void) _dl_map_object (NULL, p, lt_library, 0);
|
||||
++npreloads;
|
||||
}
|
||||
}
|
||||
|
||||
/* Read the contents of the file. */
|
||||
@@ -378,7 +413,7 @@ of this helper program; chances are you did not intend to run this program.\n",
|
||||
runp = file;
|
||||
while ((p = strsep (&runp, ": \t\n")) != NULL)
|
||||
{
|
||||
(void) _dl_map_object (NULL, p, lt_library);
|
||||
(void) _dl_map_object (NULL, p, lt_library, 0);
|
||||
++npreloads;
|
||||
}
|
||||
}
|
||||
@@ -386,7 +421,7 @@ of this helper program; chances are you did not intend to run this program.\n",
|
||||
if (problem != NULL)
|
||||
{
|
||||
char *p = strndupa (problem, file_size - (problem - file));
|
||||
(void) _dl_map_object (NULL, p, lt_library);
|
||||
(void) _dl_map_object (NULL, p, lt_library, 0);
|
||||
}
|
||||
|
||||
/* We don't need the file anymore. */
|
||||
@@ -412,7 +447,7 @@ of this helper program; chances are you did not intend to run this program.\n",
|
||||
/* Load all the libraries specified by DT_NEEDED entries. If LD_PRELOAD
|
||||
specified some libraries to load, these are inserted before the actual
|
||||
dependencies in the executable's searchlist for symbol resolution. */
|
||||
_dl_map_object_deps (l, preloads, npreloads);
|
||||
_dl_map_object_deps (l, preloads, npreloads, mode == trace);
|
||||
|
||||
#ifndef MAP_ANON
|
||||
/* We are done mapping things, so close the zero-fill descriptor. */
|
||||
@@ -459,15 +494,20 @@ of this helper program; chances are you did not intend to run this program.\n",
|
||||
_dl_sysdep_message ("\t", "statically linked\n", NULL);
|
||||
else
|
||||
for (l = _dl_loaded->l_next; l; l = l->l_next)
|
||||
{
|
||||
char buf[20], *bp;
|
||||
buf[sizeof buf - 1] = '\0';
|
||||
bp = _itoa (l->l_addr, &buf[sizeof buf - 1], 16, 0);
|
||||
while ((size_t) (&buf[sizeof buf - 1] - bp) < sizeof l->l_addr * 2)
|
||||
*--bp = '0';
|
||||
_dl_sysdep_message ("\t", l->l_libname, " => ", l->l_name,
|
||||
" (0x", bp, ")\n", NULL);
|
||||
}
|
||||
if (l->l_opencount == 0)
|
||||
/* The library was not found. */
|
||||
_dl_sysdep_message ("\t", l->l_libname, " => not found\n", NULL);
|
||||
else
|
||||
{
|
||||
char buf[20], *bp;
|
||||
buf[sizeof buf - 1] = '\0';
|
||||
bp = _itoa (l->l_addr, &buf[sizeof buf - 1], 16, 0);
|
||||
while ((size_t) (&buf[sizeof buf - 1] - bp)
|
||||
< sizeof l->l_addr * 2)
|
||||
*--bp = '0';
|
||||
_dl_sysdep_message ("\t", l->l_libname, " => ", l->l_name,
|
||||
" (0x", bp, ")\n", NULL);
|
||||
}
|
||||
|
||||
if (mode != trace)
|
||||
for (i = 1; i < _dl_argc; ++i)
|
||||
@@ -489,12 +529,31 @@ of this helper program; chances are you did not intend to run this program.\n",
|
||||
*--bp = '0';
|
||||
_dl_sysdep_message (" in object at 0x", bp, "\n", NULL);
|
||||
}
|
||||
else if (lazy >= 0)
|
||||
{
|
||||
/* We have to do symbol dependency testing. */
|
||||
void doit (void)
|
||||
{
|
||||
_dl_relocate_object (l, _dl_object_relocation_scope (l), lazy);
|
||||
}
|
||||
|
||||
l = _dl_loaded;
|
||||
while (l->l_next)
|
||||
l = l->l_next;
|
||||
do
|
||||
{
|
||||
if (l != &_dl_rtld_map && l->l_opencount > 0)
|
||||
{
|
||||
_dl_receive_error (print_unresolved, doit);
|
||||
*_dl_global_scope_end = NULL;
|
||||
}
|
||||
l = l->l_prev;
|
||||
} while (l);
|
||||
}
|
||||
|
||||
_exit (0);
|
||||
}
|
||||
|
||||
lazy = !__libc_enable_secure && *(getenv ("LD_BIND_NOW") ?: "") == '\0';
|
||||
|
||||
{
|
||||
/* Now we have all the objects loaded. Relocate them all except for
|
||||
the dynamic linker itself. We do this in reverse order so that copy
|
||||
@@ -563,9 +622,14 @@ of this helper program; chances are you did not intend to run this program.\n",
|
||||
_dl_debug_state ();
|
||||
}
|
||||
|
||||
/* We finished the intialization and will start up. */
|
||||
_dl_starting_up = 1;
|
||||
|
||||
/* Once we return, _dl_sysdep_start will invoke
|
||||
the DT_INIT functions and then *USER_ENTRY. */
|
||||
}
|
||||
|
||||
/* This is a little helper function for resolving symbols while
|
||||
tracing the binary. */
|
||||
static void
|
||||
print_unresolved (const char *errstring, const char *objname)
|
||||
{
|
||||
_dl_sysdep_error (errstring, " (", objname, ")\n", NULL);
|
||||
}
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
/* Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
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 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.
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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. */
|
||||
|
||||
/*
|
||||
* ANSI Standard: 4.1.3 Errors <errno.h>
|
||||
* ISO C Standard: 4.1.3 Errors <errno.h>
|
||||
*/
|
||||
|
||||
#ifndef _ERRNO_H
|
||||
|
||||
+87
-48
@@ -1,20 +1,20 @@
|
||||
/* Copyright (C) 1991, 92, 93, 95, 96 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
/* Copyright (C) 1991, 92, 93, 95, 96, 97 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 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.
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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. */
|
||||
|
||||
#ifndef _FEATURES_H
|
||||
|
||||
@@ -23,11 +23,14 @@ Cambridge, MA 02139, USA. */
|
||||
/* These are defined by the user (or the compiler)
|
||||
to specify the desired environment:
|
||||
|
||||
__STRICT_ANSI__ ANSI Standard C.
|
||||
__STRICT_ANSI__ ISO Standard C.
|
||||
_POSIX_SOURCE IEEE Std 1003.1.
|
||||
_POSIX_C_SOURCE If ==1, like _POSIX_SOURCE; if ==2 add IEEE Std 1003.2.
|
||||
_BSD_SOURCE ANSI, POSIX, and 4.3BSD things.
|
||||
_SVID_SOURCE ANSI, POSIX, and SVID things.
|
||||
_POSIX_C_SOURCE If ==1, like _POSIX_SOURCE; if >=2 add IEEE Std 1003.2;
|
||||
if >=199309L, add IEEE Std 1003.1b-1993
|
||||
_XOPEN_SOURCE Includes POSIX and XPG things.
|
||||
_XOPEN_SOURCE_EXTENDED XPG things and X/Open Unix extensions.
|
||||
_BSD_SOURCE ISO C, POSIX, and 4.3BSD things.
|
||||
_SVID_SOURCE ISO C, POSIX, and SVID things.
|
||||
_GNU_SOURCE All of the above, plus GNU extensions.
|
||||
_REENTRANT Select additionally reentrant object.
|
||||
_THREAD_SAFE Same as _REENTRANT, often used by other systems.
|
||||
@@ -36,13 +39,16 @@ Cambridge, MA 02139, USA. */
|
||||
If none of these are defined, the default is all but _GNU_SOURCE.
|
||||
If more than one of these are defined, they accumulate.
|
||||
For example __STRICT_ANSI__, _POSIX_SOURCE and _POSIX_C_SOURCE
|
||||
together give you ANSI C, 1003.1, and 1003.2, but nothing else.
|
||||
together give you ISO C, 1003.1, and 1003.2, but nothing else.
|
||||
|
||||
These are defined by this file and are used by the
|
||||
header files to decide what to declare or define:
|
||||
|
||||
__USE_POSIX Define IEEE Std 1003.1 things.
|
||||
__USE_POSIX2 Define IEEE Std 1003.2 things.
|
||||
__USE_POSIX199309 Define IEEE Std 1003.1b things.
|
||||
__USE_XOPEN Define XPG things.
|
||||
__USE_XOPEN_EXTENDED Define X/Open Unix things.
|
||||
__USE_BSD Define 4.3BSD things.
|
||||
__USE_SVID Define SVID things.
|
||||
__USE_MISC Define things common to BSD and System V Unix.
|
||||
@@ -50,7 +56,10 @@ Cambridge, MA 02139, USA. */
|
||||
__USE_REENTRANT Define reentrant/thread-safe *_r functions.
|
||||
__FAVOR_BSD Favor 4.3BSD things in cases of conflict.
|
||||
|
||||
The macro `__GNU_LIBRARY__' is defined by this file unconditionally.
|
||||
The macros `__GNU_LIBRARY__', `__GLIBC__', and `__GLIBC_MINOR__' are
|
||||
defined by this file unconditionally. `__GNU_LIBRARY__' is provided
|
||||
only for compatibility. All new code should use the other symbols
|
||||
to test for features.
|
||||
|
||||
All macros listed above as possibly being defined by this file are
|
||||
explicitly undefined if they are not explicitly defined.
|
||||
@@ -62,6 +71,9 @@ Cambridge, MA 02139, USA. */
|
||||
/* Undefine everything, so we get a clean slate. */
|
||||
#undef __USE_POSIX
|
||||
#undef __USE_POSIX2
|
||||
#undef __USE_POSIX199309
|
||||
#undef __USE_XOPEN
|
||||
#undef __USE_XOPEN_EXTENDED
|
||||
#undef __USE_BSD
|
||||
#undef __USE_SVID
|
||||
#undef __USE_MISC
|
||||
@@ -71,20 +83,21 @@ Cambridge, MA 02139, USA. */
|
||||
#undef __KERNEL_STRICT_NAMES
|
||||
|
||||
/* Suppress kernel-name space pollution unless user expressedly asks
|
||||
for it: */
|
||||
for it. */
|
||||
#ifndef _LOOSE_KERNEL_NAMES
|
||||
# define __KERNEL_STRICT_NAMES
|
||||
#endif
|
||||
|
||||
/* Always use ANSI things. */
|
||||
/* Always use ISO C things. */
|
||||
#define __USE_ANSI 1
|
||||
|
||||
|
||||
/* If _BSD_SOURCE was defined by the user, favor BSD over POSIX. */
|
||||
#if defined (_BSD_SOURCE) && \
|
||||
!(defined (_POSIX_SOURCE) || defined (_POSIX_C_SOURCE) || \
|
||||
defined (_GNU_SOURCE) || defined (_SVID_SOURCE))
|
||||
#define __FAVOR_BSD 1
|
||||
#if defined _BSD_SOURCE && \
|
||||
!(defined _POSIX_SOURCE || defined _POSIX_C_SOURCE || \
|
||||
defined _XOPEN_SOURCE || defined _XOPEN_SOURCE_EXTENDED || \
|
||||
defined _GNU_SOURCE || defined _SVID_SOURCE)
|
||||
# define __FAVOR_BSD 1
|
||||
#endif
|
||||
|
||||
/* If _GNU_SOURCE was defined by the user, turn on all the other features. */
|
||||
@@ -92,7 +105,11 @@ Cambridge, MA 02139, USA. */
|
||||
#undef _POSIX_SOURCE
|
||||
#define _POSIX_SOURCE 1
|
||||
#undef _POSIX_C_SOURCE
|
||||
#define _POSIX_C_SOURCE 2
|
||||
#define _POSIX_C_SOURCE 199309L
|
||||
#undef _XOPEN_SOURCE
|
||||
#define _XOPEN_SOURCE 1
|
||||
#undef _XOPEN_SOURCE_EXTENDED
|
||||
#define _XOPEN_SOURCE_EXTENDED 1
|
||||
#undef _BSD_SOURCE
|
||||
#define _BSD_SOURCE 1
|
||||
#undef _SVID_SOURCE
|
||||
@@ -101,29 +118,46 @@ Cambridge, MA 02139, USA. */
|
||||
|
||||
/* If nothing (other than _GNU_SOURCE) is defined,
|
||||
define _BSD_SOURCE and _SVID_SOURCE. */
|
||||
#if (!defined (__STRICT_ANSI__) && !defined (_POSIX_SOURCE) && \
|
||||
!defined (_POSIX_C_SOURCE) && !defined (_BSD_SOURCE) && \
|
||||
!defined (_SVID_SOURCE))
|
||||
#if (!defined __STRICT_ANSI__ && !defined _POSIX_SOURCE && \
|
||||
!defined _POSIX_C_SOURCE && !defined _XOPEN_SOURCE && \
|
||||
!defined _XOPEN_SOURCE_EXTENDED && !defined _BSD_SOURCE && \
|
||||
!defined _SVID_SOURCE)
|
||||
#define _BSD_SOURCE 1
|
||||
#define _SVID_SOURCE 1
|
||||
#endif
|
||||
|
||||
/* If none of the ANSI/POSIX macros are defined, use POSIX.1 and POSIX.2. */
|
||||
#if (!defined (__STRICT_ANSI__) && !defined (_POSIX_SOURCE) && \
|
||||
!defined (_POSIX_C_SOURCE))
|
||||
/* If none of the ANSI/POSIX macros are defined, use POSIX.1 and POSIX.2
|
||||
(and IEEE Std 1003.1b-1993 unless _XOPEN_SOURCE is defined). */
|
||||
#if (!defined __STRICT_ANSI__ && !defined _POSIX_SOURCE && \
|
||||
!defined _POSIX_C_SOURCE)
|
||||
#define _POSIX_SOURCE 1
|
||||
#ifdef _XOPEN_SOURCE
|
||||
#define _POSIX_C_SOURCE 2
|
||||
#else
|
||||
#define _POSIX_C_SOURCE 199309L
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined (_POSIX_SOURCE) || _POSIX_C_SOURCE >= 1
|
||||
#if defined _POSIX_SOURCE || _POSIX_C_SOURCE >= 1 || defined _XOPEN_SOURCE
|
||||
#define __USE_POSIX 1
|
||||
#endif
|
||||
|
||||
#if defined (_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 2
|
||||
#if defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 2 || defined _XOPEN_SOURCE
|
||||
#define __USE_POSIX2 1
|
||||
#endif
|
||||
|
||||
#if defined (_BSD_SOURCE) || defined (_SVID_SOURCE)
|
||||
#if defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 199309L
|
||||
#define __USE_POSIX199309 1
|
||||
#endif
|
||||
|
||||
#ifdef _XOPEN_SOURCE
|
||||
#define __USE_XOPEN 1
|
||||
#ifdef _XOPEN_SOURCE_EXTENDED
|
||||
#define __USE_XOPEN_EXTENDED 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined _BSD_SOURCE || defined _SVID_SOURCE
|
||||
#define __USE_MISC 1
|
||||
#endif
|
||||
|
||||
@@ -139,22 +173,27 @@ Cambridge, MA 02139, USA. */
|
||||
#define __USE_GNU 1
|
||||
#endif
|
||||
|
||||
#if defined (_REENTRANT) || defined (_THREAD_SAFE)
|
||||
#if defined _REENTRANT || defined _THREAD_SAFE
|
||||
#define __USE_REENTRANT 1
|
||||
#endif
|
||||
|
||||
|
||||
/* This macro indicates that the installed library is the GNU C Library.
|
||||
Its value must be incremented whenever any existing library interface
|
||||
changes such that callers must be recompiled with the new header files.
|
||||
This value should always coincide with the major version number used for
|
||||
the shared C library corresponding to this set of header files. */
|
||||
For historic reasons the value now is 6 and this will stay from now
|
||||
on. The use of this variable is deprecated. Use __GLIBC__ and
|
||||
__GLIBC_MINOR__ now (see below) when you want to test for a specific
|
||||
GNU C library version and use the values in <gnu/lib-names.h> to get
|
||||
the sonames of the shared libraries. */
|
||||
#undef __GNU_LIBRARY__
|
||||
#define __GNU_LIBRARY__ 6
|
||||
|
||||
#undef __GNU_LIBRARY__
|
||||
#define __GNU_LIBRARY__ 6
|
||||
/* Major and minor version number of the GNU C library package. Use
|
||||
these macros to test for features in specific releases. */
|
||||
#define __GLIBC__ 2
|
||||
#define __GLIBC_MINOR__ 0
|
||||
|
||||
|
||||
#if !defined (__GNUC__) || __GNUC__ < 2
|
||||
#if !defined __GNUC__ || __GNUC__ < 2
|
||||
/* In GCC version 2, (__extension__ EXPR) will not complain
|
||||
about GCC extensions used in EXPR under -ansi or -pedantic. */
|
||||
#define __extension__
|
||||
@@ -169,15 +208,15 @@ Cambridge, MA 02139, USA. */
|
||||
/* This is here only because every header file already includes this one. */
|
||||
#ifndef _LIBC
|
||||
/* Get the definitions of all the appropriate `__stub_FUNCTION' symbols.
|
||||
<stubs.h> contains `#define __stub_FUNCTION' when FUNCTION is a stub
|
||||
<gnu/stubs.h> contains `#define __stub_FUNCTION' when FUNCTION is a stub
|
||||
which will always return failure (and set errno to ENOSYS).
|
||||
|
||||
We avoid including <stubs.h> when compiling the C library itself to
|
||||
We avoid including <gnu/stubs.h> when compiling the C library itself to
|
||||
avoid a dependency loop. stubs.h depends on every object file. If
|
||||
this #include were done for the library source code, then every object
|
||||
file would depend on stubs.h. */
|
||||
|
||||
#include <stubs.h>
|
||||
#include <gnu/stubs.h>
|
||||
#endif
|
||||
|
||||
#endif /* __features.h */
|
||||
#endif /* features.h */
|
||||
|
||||
+244
@@ -0,0 +1,244 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# glibcbug - create a bug report and mail it to the bug address.
|
||||
#
|
||||
# configuration section:
|
||||
# these variables are filled in by configure
|
||||
#
|
||||
VERSION="@VERSION@"
|
||||
BUGGLIBC="bugs@gnu.ai.mit.edu"
|
||||
ADDONS="@subdirs@"
|
||||
|
||||
PATH=/bin:/usr/bin:/usr/local/bin:$PATH
|
||||
export PATH
|
||||
|
||||
TEMP=/tmp/glibcbug.$$
|
||||
|
||||
BUGADDR=${1-$BUGGLIBC}
|
||||
ENVIRONMENT=`uname -a`
|
||||
|
||||
: ${EDITOR=emacs}
|
||||
|
||||
: ${USER=${LOGNAME-`whoami`}}
|
||||
|
||||
trap 'rm -f $TEMP $TEMP.x; exit 1' 1 2 3 13 15
|
||||
trap 'rm -f $TEMP $TEMP.x' 0
|
||||
|
||||
|
||||
# How to read the passwd database.
|
||||
PASSWD="cat /etc/passwd"
|
||||
|
||||
if [ -f /usr/lib/sendmail ] ; then
|
||||
MAIL_AGENT="/usr/lib/sendmail -oi -t"
|
||||
elif [ -f /usr/sbin/sendmail ] ; then
|
||||
MAIL_AGENT="/usr/sbin/sendmail -oi -t"
|
||||
else
|
||||
MAIL_AGENT=rmail
|
||||
fi
|
||||
|
||||
# Figure out how to echo a string without a trailing newline
|
||||
N=`echo 'hi there\c'`
|
||||
case "$N" in
|
||||
*c) ECHON1='echo -n' ECHON2= ;;
|
||||
*) ECHON1=echo ECHON2='\c' ;;
|
||||
esac
|
||||
|
||||
# Find out the name of the originator of this PR.
|
||||
if [ -n "$NAME" ]; then
|
||||
ORIGINATOR="$NAME"
|
||||
elif [ -f $HOME/.fullname ]; then
|
||||
ORIGINATOR="`sed -e '1q' $HOME/.fullname`"
|
||||
else
|
||||
# Must use temp file due to incompatibilities in quoting behavior
|
||||
# and to protect shell metacharacters in the expansion of $LOGNAME
|
||||
$PASSWD | grep "^$LOGNAME:" | awk -F: '{print $5}' | sed -e 's/,.*//' > $TEMP
|
||||
ORIGINATOR="`cat $TEMP`"
|
||||
rm -f $TEMP
|
||||
fi
|
||||
|
||||
if [ -n "$ORGANIZATION" ]; then
|
||||
if [ -f "$ORGANIZATION" ]; then
|
||||
ORGANIZATION="`cat $ORGANIZATION`"
|
||||
fi
|
||||
else
|
||||
if [ -f $HOME/.organization ]; then
|
||||
ORGANIZATION="`cat $HOME/.organization`"
|
||||
elif [ -f $HOME/.signature ]; then
|
||||
ORGANIZATION=`sed -e "s/^/ /" $HOME/.signature; echo ">"`
|
||||
fi
|
||||
fi
|
||||
|
||||
# If they don't have a preferred editor set, then use
|
||||
if [ -z "$VISUAL" ]; then
|
||||
if [ -z "$EDITOR" ]; then
|
||||
EDIT=vi
|
||||
else
|
||||
EDIT="$EDITOR"
|
||||
fi
|
||||
else
|
||||
EDIT="$VISUAL"
|
||||
fi
|
||||
|
||||
# Find out some information.
|
||||
SYSTEM=`( [ -f /bin/uname ] && /bin/uname -a ) || \
|
||||
( [ -f /usr/bin/uname ] && /usr/bin/uname -a ) || echo ""`
|
||||
ARCH=`[ -f /bin/arch ] && /bin/arch`
|
||||
MACHINE=`[ -f /bin/machine ] && /bin/machine`
|
||||
|
||||
ORGANIZATION_C='<organization of PR author (multiple lines)>'
|
||||
SYNOPSIS_C='<synopsis of the problem (one line)>'
|
||||
SEVERITY_C='<[ non-critical | serious | critical ] (one line)>'
|
||||
PRIORITY_C='<[ low | medium | high ] (one line)>'
|
||||
CLASS_C='<[ sw-bug | doc-bug | change-request | support ] (one line)>'
|
||||
RELEASE_C='<release number or tag (one line)>'
|
||||
ENVIRONMENT_C='<machine, os, target, libraries (multiple lines)>'
|
||||
DESCRIPTION_C='<precise description of the problem (multiple lines)>'
|
||||
HOW_TO_REPEAT_C='<code/input/activities to reproduce the problem (multiple lines)>'
|
||||
FIX_C='<how to correct or work around the problem, if known (multiple lines)>'
|
||||
|
||||
|
||||
cat > $TEMP <<EOF
|
||||
SEND-PR: -*- send-pr -*-
|
||||
SEND-PR: Lines starting with \`SEND-PR' will be removed automatically, as
|
||||
SEND-PR: will all comments (text enclosed in \`<' and \`>').
|
||||
SEND-PR:
|
||||
From: ${USER}
|
||||
To: ${BUGADDR}
|
||||
Subject: [50 character or so descriptive subject here (for reference)]
|
||||
|
||||
>Submitter-Id: net
|
||||
>Originator: ${ORIGINATOR}
|
||||
>Organization:
|
||||
${ORGANIZATION- $ORGANIZATION_C}
|
||||
>Confidential: no
|
||||
>Synopsis: $SYNOPSIS_C
|
||||
>Severity: $SEVERITY_C
|
||||
>Priority: $PRIORITY_C
|
||||
>Category: libc
|
||||
>Class: $CLASS_C
|
||||
>Release: libc-${VERSION}
|
||||
>Environment:
|
||||
$ENVIRONMENT_C
|
||||
`[ -n "$SYSTEM" ] && echo System: $SYSTEM`
|
||||
`[ -n "$ARCH" ] && echo Architecture: $ARCH`
|
||||
`[ -n "$MACHINE" ] && echo Machine: $MACHINE`
|
||||
`[ -n "$ADDONS" ] && echo Addons: $ADDONS`
|
||||
|
||||
>Description:
|
||||
$DESCRIPTION_C
|
||||
>How-To-Repeat:
|
||||
$HOW_TO_REPEAT_C
|
||||
>Fix:
|
||||
$FIX_C
|
||||
EOF
|
||||
|
||||
chmod u+w $TEMP
|
||||
cp $TEMP $TEMP.x
|
||||
|
||||
eval $EDIT $TEMP
|
||||
|
||||
if cmp -s $TEMP $TEMP.x; then
|
||||
echo "File not changed, no bug report submitted."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#
|
||||
# Check the enumeration fields
|
||||
|
||||
# This is a "sed-subroutine" with one keyword parameter
|
||||
# (with workaround for Sun sed bug)
|
||||
#
|
||||
SED_CMD='
|
||||
/$PATTERN/{
|
||||
s|||
|
||||
s|<.*>||
|
||||
s|^[ ]*||
|
||||
s|[ ]*$||
|
||||
p
|
||||
q
|
||||
}'
|
||||
|
||||
|
||||
while :; do
|
||||
CNT=0
|
||||
|
||||
#
|
||||
# 1) Severity
|
||||
#
|
||||
PATTERN=">Severity:"
|
||||
SEVERITY=`eval sed -n -e "\"$SED_CMD\"" $TEMP`
|
||||
case "$SEVERITY" in
|
||||
""|non-critical|serious|critical) CNT=`expr $CNT + 1` ;;
|
||||
*) echo "$COMMAND: \`$SEVERITY' is not a valid value for \`Severity'."
|
||||
esac
|
||||
#
|
||||
# 2) Priority
|
||||
#
|
||||
PATTERN=">Priority:"
|
||||
PRIORITY=`eval sed -n -e "\"$SED_CMD\"" $TEMP`
|
||||
case "$PRIORITY" in
|
||||
""|low|medium|high) CNT=`expr $CNT + 1` ;;
|
||||
*) echo "$COMMAND: \`$PRIORITY' is not a valid value for \`Priority'."
|
||||
esac
|
||||
#
|
||||
# 3) Class
|
||||
#
|
||||
PATTERN=">Class:"
|
||||
CLASS=`eval sed -n -e "\"$SED_CMD\"" $TEMP`
|
||||
case "$CLASS" in
|
||||
""|sw-bug|doc-bug|change-request|support) CNT=`expr $CNT + 1` ;;
|
||||
*) echo "$COMMAND: \`$CLASS' is not a valid value for \`Class'."
|
||||
esac
|
||||
|
||||
[ $CNT -lt 3 ] &&
|
||||
echo "Errors were found with the problem report."
|
||||
|
||||
while :; do
|
||||
$ECHON1 "a)bort, e)dit or s)end? $ECHON2"
|
||||
read input
|
||||
case "$input" in
|
||||
a*)
|
||||
echo "$COMMAND: problem report saved in $HOME/dead.glibcbug."
|
||||
cat $TEMP >> $HOME/dead.glibcbug
|
||||
xs=1; exit
|
||||
;;
|
||||
e*)
|
||||
eval $EDIT $TEMP
|
||||
continue 2
|
||||
;;
|
||||
s*)
|
||||
break 2
|
||||
;;
|
||||
esac
|
||||
done
|
||||
done
|
||||
#
|
||||
# Remove comments and send the problem report
|
||||
# (we have to use patterns, where the comment contains regex chars)
|
||||
#
|
||||
# /^>Originator:/s;$ORIGINATOR;;
|
||||
sed -e "
|
||||
/^SEND-PR:/d
|
||||
/^>Organization:/,/^>[A-Za-z-]*:/s;$ORGANIZATION_C;;
|
||||
/^>Confidential:/s;<.*>;;
|
||||
/^>Synopsis:/s;$SYNOPSIS_C;;
|
||||
/^>Severity:/s;<.*>;;
|
||||
/^>Priority:/s;<.*>;;
|
||||
/^>Class:/s;<.*>;;
|
||||
/^>Release:/,/^>[A-Za-z-]*:/s;$RELEASE_C;;
|
||||
/^>Environment:/,/^>[A-Za-z-]*:/s;$ENVIRONMENT_C;;
|
||||
/^>Description:/,/^>[A-Za-z-]*:/s;$DESCRIPTION_C;;
|
||||
/^>How-To-Repeat:/,/^>[A-Za-z-]*:/s;$HOW_TO_REPEAT_C;;
|
||||
/^>Fix:/,/^>[A-Za-z-]*:/s;$FIX_C;;
|
||||
" $TEMP > $TEMP.x
|
||||
|
||||
if $MAIL_AGENT $BUGGLIBC < $TEMP.x; then
|
||||
echo "$COMMAND: problem report sent"
|
||||
xs=0; exit
|
||||
else
|
||||
echo "$COMMAND: mysterious mail failure, report not sent."
|
||||
echo "$COMMAND: problem report saved in $HOME/dead.glibcbug."
|
||||
cat $TEMP >> $HOME/dead.glibcbug
|
||||
fi
|
||||
|
||||
exit 0
|
||||
+5
-5
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1995, 1996, 1997 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
|
||||
@@ -12,9 +12,9 @@
|
||||
# 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., 675 Mass Ave,
|
||||
# Cambridge, MA 02139, USA.
|
||||
# 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 gmon portion of the library.
|
||||
@@ -31,7 +31,7 @@ include ../Rules
|
||||
CFLAGS-mcount.c := -fno-omit-frame-pointer
|
||||
|
||||
# We cannot compile mcount.c with -pg because that would
|
||||
# create resursive calls. Just copy the normal static object.
|
||||
# create recursive calls. Just copy the normal static object.
|
||||
# On systems where `profil' is not a system call, the same
|
||||
# problem exists for the internal functions in profil.c.
|
||||
|
||||
|
||||
@@ -58,6 +58,11 @@ static int s_scale;
|
||||
|
||||
#define ERR(s) write(2, s, sizeof(s) - 1)
|
||||
|
||||
void moncontrol __P ((int mode));
|
||||
static void write_hist __P ((int fd));
|
||||
static void write_call_graph __P ((int fd));
|
||||
static void write_bb_counts __P ((int fd));
|
||||
|
||||
/*
|
||||
* Control profiling
|
||||
* profiling is what mcount checks to see if
|
||||
|
||||
+28
-23
@@ -1,37 +1,40 @@
|
||||
/* Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
Contributed by David Mosberger (davidm@cs.arizona.edu).
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by David Mosberger <davidm@cs.arizona.edu>.
|
||||
|
||||
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 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.
|
||||
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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. */
|
||||
|
||||
/* This file specifies the format of gmon.out files. It should have
|
||||
as few external dependencies as possible as it is going to be included
|
||||
in many different programs. That is, minimize the number of #include's.
|
||||
as few external dependencies as possible as it is going to be included
|
||||
in many different programs. That is, minimize the number of #include's.
|
||||
|
||||
A gmon.out file consists of a header (defined by gmon_hdr) followed by
|
||||
a sequence of records. Each record starts with a one-byte tag
|
||||
identifying the type of records, followed by records specific data. */
|
||||
A gmon.out file consists of a header (defined by gmon_hdr) followed by
|
||||
a sequence of records. Each record starts with a one-byte tag
|
||||
identifying the type of records, followed by records specific data. */
|
||||
|
||||
#ifndef _SYS_GMON_OUT_H_
|
||||
#define _SYS_GMON_OUT_H_
|
||||
#ifndef _SYS_GMON_OUT_H
|
||||
|
||||
#define _SYS_GMON_OUT_H 1
|
||||
#include <features.h>
|
||||
|
||||
#define GMON_MAGIC "gmon" /* magic cookie */
|
||||
#define GMON_VERSION 1 /* version number */
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/*
|
||||
* Raw header as it appears on file (without padding). This header
|
||||
* always comes first in gmon.out and is then followed by a series
|
||||
@@ -63,4 +66,6 @@ struct gmon_cg_arc_record {
|
||||
int count; /* number of arc traversals */
|
||||
};
|
||||
|
||||
#endif /* !_SYS_GMON_OUT_H_ */
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _SYS_GMON_OUT_H */
|
||||
|
||||
+16
-14
@@ -1,21 +1,21 @@
|
||||
/* Header with interface version macros for library pieces copied elsewhere.
|
||||
Copyright (C) 1995 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Copyright (C) 1995, 1996, 1997 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 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.
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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. */
|
||||
|
||||
#ifndef _GNU_VERSIONS_H
|
||||
#define _GNU_VERSIONS_H 1
|
||||
@@ -47,5 +47,7 @@ Cambridge, MA 02139, USA. */
|
||||
#define _GNU_OBSTACK_INTERFACE_VERSION 1 /* vs malloc/obstack.c */
|
||||
#define _GNU_REGEX_INTERFACE_VERSION 1 /* vs posix/regex.c */
|
||||
#define _GNU_GLOB_INTERFACE_VERSION 1 /* vs posix/glob.c */
|
||||
#define _GNU_GETOPT_INTERFACE_VERSION 2 /* vs posix/getopt.c and
|
||||
posix/getopt1.c */
|
||||
|
||||
#endif /* gnu-versions.h */
|
||||
|
||||
+4
-4
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 1991 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1991, 1997 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
|
||||
@@ -12,9 +12,9 @@
|
||||
# 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., 675 Mass Ave,
|
||||
# Cambridge, MA 02139, USA.
|
||||
# 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.
|
||||
|
||||
subdir := gnulib
|
||||
|
||||
|
||||
+4
-4
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 1991, 1992, 1996 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1991, 1992, 1996, 1997 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
|
||||
@@ -12,9 +12,9 @@
|
||||
# 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., 675 Mass Ave,
|
||||
# Cambridge, MA 02139, USA.
|
||||
# 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 grp portion of the library.
|
||||
|
||||
+6
-2
@@ -25,7 +25,11 @@ struct group *
|
||||
fgetgrent (FILE *stream)
|
||||
{
|
||||
static char buffer[BUFSIZ];
|
||||
static struct group result;
|
||||
static struct group resbuf;
|
||||
struct group *result;
|
||||
|
||||
return __fgetgrent_r (stream, &result, buffer, sizeof buffer);
|
||||
if (__fgetgrent_r (stream, &resbuf, buffer, sizeof buffer, &result) != 0)
|
||||
return NULL;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
+37
-20
@@ -1,20 +1,20 @@
|
||||
/* Copyright (C) 1991, 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
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 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.
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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 <ctype.h>
|
||||
#include <grp.h>
|
||||
@@ -33,14 +33,27 @@ struct grent_data {};
|
||||
LINE_PARSER
|
||||
(,
|
||||
STRING_FIELD (result->gr_name, ISCOLON, 0);
|
||||
STRING_FIELD (result->gr_passwd, ISCOLON, 0);
|
||||
INT_FIELD (result->gr_gid, ISCOLON, 0, 10,);
|
||||
if (line[0] == '\0'
|
||||
&& (result->gr_name[0] == '+' || result->gr_name[0] == '-'))
|
||||
{
|
||||
result->gr_passwd = NULL;
|
||||
result->gr_gid = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
STRING_FIELD (result->gr_passwd, ISCOLON, 0);
|
||||
if (result->gr_name[0] == '+' || result->gr_name[0] == '-')
|
||||
INT_FIELD_MAYBE_NULL (result->gr_gid, ISCOLON, 0, 10, , 0)
|
||||
else
|
||||
INT_FIELD (result->gr_gid, ISCOLON, 0, 10,)
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
/* Read one entry from the given stream. */
|
||||
struct group *
|
||||
__fgetgrent_r (FILE *stream, struct group *result, char *buffer, int buflen)
|
||||
int
|
||||
__fgetgrent_r (FILE *stream, struct group *resbuf, char *buffer, size_t buflen,
|
||||
struct group **result)
|
||||
{
|
||||
char *p;
|
||||
|
||||
@@ -48,7 +61,10 @@ __fgetgrent_r (FILE *stream, struct group *result, char *buffer, int buflen)
|
||||
{
|
||||
p = fgets (buffer, buflen, stream);
|
||||
if (p == NULL)
|
||||
return NULL;
|
||||
{
|
||||
*result = NULL;
|
||||
return errno;
|
||||
}
|
||||
|
||||
/* Skip leading blanks. */
|
||||
while (isspace (*p))
|
||||
@@ -56,8 +72,9 @@ __fgetgrent_r (FILE *stream, struct group *result, char *buffer, int buflen)
|
||||
} while (*p == '\0' || *p == '#' || /* Ignore empty and comment lines. */
|
||||
/* Parse the line. If it is invalid, loop to
|
||||
get the next line of the file to parse. */
|
||||
! parse_line (p, result, (void *) buffer, buflen));
|
||||
! parse_line (p, resbuf, (void *) buffer, buflen));
|
||||
|
||||
return result;
|
||||
*result = resbuf;
|
||||
return 0;
|
||||
}
|
||||
weak_alias (__fgetgrent_r, fgetgrent_r)
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
/* Copyright (C) 1991, 1992, 1995, 1996, 1997 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 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.
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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. */
|
||||
|
||||
/*
|
||||
* POSIX Standard: 9.2.1 Group Database Access <grp.h>
|
||||
@@ -29,6 +29,12 @@ __BEGIN_DECLS
|
||||
|
||||
#include <gnu/types.h>
|
||||
|
||||
#define __need_size_t
|
||||
#include <stddef.h>
|
||||
|
||||
#define __need_size_t
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
/* The group structure. */
|
||||
struct group
|
||||
@@ -51,7 +57,7 @@ extern FILE *__grpopen __P ((void));
|
||||
|
||||
/* Read a group entry from STREAM, filling in G.
|
||||
Return the `struct group' of G if successful, NULL on failure. */
|
||||
extern struct group *__grpread __P ((FILE * __stream, __ptr_t __g));
|
||||
extern struct group *__grpread __P ((FILE *__stream, __ptr_t __g));
|
||||
|
||||
/* Return a chunk of memory containing pre-initialized data for __grpread. */
|
||||
extern __ptr_t __grpalloc __P ((void));
|
||||
@@ -63,7 +69,7 @@ extern struct group *__grpscan __P ((__ptr_t *__p,
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__USE_SVID) || defined(__USE_MISC) || defined (__USE_BSD)
|
||||
#if defined(__USE_SVID) || defined (__USE_BSD) || defined(__USE_XOPEN_EXTENDED)
|
||||
/* Rewind the group-file stream. */
|
||||
extern void setgrent __P ((void));
|
||||
|
||||
@@ -76,7 +82,7 @@ extern struct group *getgrent __P ((void));
|
||||
|
||||
#ifdef __USE_SVID
|
||||
/* Read a group entry from STREAM. */
|
||||
extern struct group *fgetgrent __P ((FILE * __stream));
|
||||
extern struct group *fgetgrent __P ((FILE *__stream));
|
||||
#endif
|
||||
|
||||
/* Search for an entry with a matching group ID. */
|
||||
@@ -85,42 +91,51 @@ extern struct group *getgrgid __P ((__gid_t __gid));
|
||||
/* Search for an entry with a matching group name. */
|
||||
extern struct group *getgrnam __P ((__const char *__name));
|
||||
|
||||
#ifdef __USE_REENTRANT
|
||||
#if defined __USE_POSIX || defined __USE_MISC
|
||||
|
||||
#ifdef __USE_MISC
|
||||
/* Reasonable value for the buffer sized used in the reentrant
|
||||
functions below. But better use `sysconf'. */
|
||||
#define NSS_BUFLEN_GROUP 1024
|
||||
#endif
|
||||
|
||||
/* Reentrant versions of some of the functions above.
|
||||
|
||||
PLEASE NOTE: these functions are not yet standardized. The interface
|
||||
may change in later versions of this library. */
|
||||
PLEASE NOTE: the `getgrent_r' function is not (yet) standardized.
|
||||
The interface may change in later versions of this library. But
|
||||
the interface is designed following the principals used for the
|
||||
other reentrant functions so the chances are good this is what the
|
||||
POSIX people would choose. */
|
||||
|
||||
#if defined(__USE_SVID) || defined(__USE_MISC) || defined (__USE_BSD)
|
||||
extern struct group *getgrent_r __P ((struct group *__resultbuf,
|
||||
char *buffer, int __buflen));
|
||||
#if defined(__USE_SVID) || defined (__USE_BSD) || defined(__USE_XOPEN_EXTENDED)
|
||||
extern int __getgrent_r __P ((struct group *__resultbuf, char *buffer,
|
||||
size_t __buflen, struct group **__result));
|
||||
extern int getgrent_r __P ((struct group *__resultbuf, char *buffer,
|
||||
size_t __buflen, struct group **__result));
|
||||
#endif
|
||||
|
||||
/* Search for an entry with a matching group ID. */
|
||||
extern struct group *getgrgid_r __P ((__gid_t __gid,
|
||||
struct group *__resultbuf,
|
||||
char *buffer, int __buflen));
|
||||
extern int getgrgid_r __P ((__gid_t __gid, struct group *__resultbuf,
|
||||
char *buffer, size_t __buflen,
|
||||
struct group **__result));
|
||||
|
||||
/* Search for an entry with a matching group name. */
|
||||
extern struct group *getgrnam_r __P ((__const char *__name,
|
||||
struct group *__resultbuf,
|
||||
char *buffer, int __buflen));
|
||||
extern int getgrnam_r __P ((__const char *__name, struct group *__resultbuf,
|
||||
char *buffer, size_t __buflen,
|
||||
struct group **__result));
|
||||
|
||||
#ifdef __USE_SVID
|
||||
/* Read a group entry from STREAM. */
|
||||
extern struct group *__fgetgrent_r __P ((FILE * __stream,
|
||||
struct group *__resultbuf,
|
||||
char *buffer, int __buflen));
|
||||
extern struct group *fgetgrent_r __P ((FILE * __stream,
|
||||
struct group *__resultbuf,
|
||||
char *buffer, int __buflen));
|
||||
/* Read a group entry from STREAM. This function is not standardized
|
||||
an probably never will. */
|
||||
extern int __fgetgrent_r __P ((FILE * __stream, struct group *__resultbuf,
|
||||
char *buffer, size_t __buflen,
|
||||
struct group **__result));
|
||||
extern int fgetgrent_r __P ((FILE * __stream, struct group *__resultbuf,
|
||||
char *buffer, size_t __buflen,
|
||||
struct group **__result));
|
||||
#endif
|
||||
|
||||
#endif /* reentrant */
|
||||
#endif /* POSIX or reentrant */
|
||||
|
||||
|
||||
#ifdef __USE_BSD
|
||||
@@ -129,12 +144,12 @@ extern struct group *fgetgrent_r __P ((FILE * __stream,
|
||||
#include <stddef.h>
|
||||
|
||||
/* Set the group set for the current user to GROUPS (N of them). */
|
||||
extern int setgroups __P ((size_t __n, __const __gid_t * groups));
|
||||
extern int setgroups __P ((size_t __n, __const __gid_t *__groups));
|
||||
|
||||
/* Initialize the group set for the current user
|
||||
by reading the group database and using all groups
|
||||
of which USER is a member. Also include GROUP. */
|
||||
extern int initgroups __P ((__const char *user, __gid_t group));
|
||||
extern int initgroups __P ((__const char *__user, __gid_t __group));
|
||||
|
||||
#endif /* Use BSD. */
|
||||
|
||||
|
||||
+18
-15
@@ -1,20 +1,20 @@
|
||||
/* Copyright (C) 1989, 1991, 1993, 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
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 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.
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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 <alloca.h>
|
||||
#include <unistd.h>
|
||||
@@ -39,7 +39,9 @@ initgroups (user, group)
|
||||
|
||||
#else
|
||||
|
||||
struct group *g;
|
||||
struct group grpbuf, *g;
|
||||
size_t buflen = sysconf (_SC_GETPW_R_SIZE_MAX);
|
||||
char *tmpbuf;
|
||||
register size_t n;
|
||||
size_t ngroups;
|
||||
gid_t *groups;
|
||||
@@ -58,13 +60,14 @@ initgroups (user, group)
|
||||
#endif
|
||||
|
||||
groups = __alloca (ngroups * sizeof *groups);
|
||||
tmpbuf = __alloca (buflen);
|
||||
|
||||
setgrent ();
|
||||
|
||||
n = 0;
|
||||
groups[n++] = group;
|
||||
|
||||
while ((g = getgrent ()) != NULL)
|
||||
while (__getgrent_r (&grpbuf, tmpbuf, buflen, &g) >= 0)
|
||||
if (g->gr_gid != group)
|
||||
{
|
||||
register char **m;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user