mirror of
git://sourceware.org/git/glibc.git
synced 2026-09-08 23:58:31 +08:00
Compare commits
89
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cccda09fd7 | ||
|
|
106b47fccf | ||
|
|
a68b0d31a3 | ||
|
|
2d07133b50 | ||
|
|
359a1d0b5f | ||
|
|
d68171edce | ||
|
|
c40298232a | ||
|
|
d022f6ab9f | ||
|
|
0820914952 | ||
|
|
5686557215 | ||
|
|
d8766439cb | ||
|
|
e320cbc913 | ||
|
|
7816fbdf7a | ||
|
|
845dcb57b1 | ||
|
|
daf2bb515b | ||
|
|
8a080f40d8 | ||
|
|
8de8ca1b94 | ||
|
|
c55698973e | ||
|
|
6bbcfbfedb | ||
|
|
ec4b0518a3 | ||
|
|
d66b7b41b8 | ||
|
|
bcc7b35158 | ||
|
|
cd136c56eb | ||
|
|
757dc096f3 | ||
|
|
39a0b05667 | ||
|
|
a8ed817809 | ||
|
|
20e77fa06c | ||
|
|
fafaa44ef0 | ||
|
|
ae2ddc98c1 | ||
|
|
f33b97f913 | ||
|
|
d0045e79eb | ||
|
|
f0f1bf8536 | ||
|
|
158ff48e34 | ||
|
|
da74e90200 | ||
|
|
569c558c88 | ||
|
|
c2bb8cabc5 | ||
|
|
8ca5c11bdf | ||
|
|
499e7464ed | ||
|
|
edf5b2d716 | ||
|
|
474be527c8 | ||
|
|
acf51e0261 | ||
|
|
57ba7bb471 | ||
|
|
db813f25f2 | ||
|
|
3112c3742d | ||
|
|
843be0d3b6 | ||
|
|
b2cd2155a0 | ||
|
|
adfa20781b | ||
|
|
924840c542 | ||
|
|
6e953631df | ||
|
|
747e2b4361 | ||
|
|
bfb826224b | ||
|
|
b77409e605 | ||
|
|
9607dca3f4 | ||
|
|
14bab8de31 | ||
|
|
b236e99d90 | ||
|
|
0b72c47ecf | ||
|
|
59f63dc4f5 | ||
|
|
485604b41c | ||
|
|
548330d38e | ||
|
|
dcf0671d90 | ||
|
|
4884d0f03c | ||
|
|
655a5796e7 | ||
|
|
0f86f6c9a1 | ||
|
|
f77a6b9e45 | ||
|
|
39778c6c9e | ||
|
|
e9d258b798 | ||
|
|
a057e7dcc7 | ||
|
|
2de99474c3 | ||
|
|
ad86485dcf | ||
|
|
5699edb407 | ||
|
|
706074a5bb | ||
|
|
046e3001f9 | ||
|
|
df21c8581a | ||
|
|
13d84ccd53 | ||
|
|
acba7f1984 | ||
|
|
15a83d04bb | ||
|
|
a8874eadae | ||
|
|
a3e59be8d1 | ||
|
|
267ca16a67 | ||
|
|
f2b5d40e87 | ||
|
|
a8922de8c7 | ||
|
|
a5113b141c | ||
|
|
233963756b | ||
|
|
80776ab80d | ||
|
|
6946d44b05 | ||
|
|
08a3c37600 | ||
|
|
ba3f9540ed | ||
|
|
f2fec269bf | ||
|
|
793fde8adb |
@@ -49,6 +49,20 @@ please let me know.
|
||||
|
||||
[Q13] ``How do I configure GNU libc so that the essential libraries
|
||||
like libc.so go into /lib and the other into /usr/lib?''
|
||||
|
||||
[Q14] ``When linking with the new libc I get unresolved symbols
|
||||
`crypt' and `setkey'. Why aren't these functions in the
|
||||
libc anymore?''
|
||||
|
||||
[Q15] ``What are these `add-ons'?''
|
||||
|
||||
[Q16] ``When I use GNU libc on my Linux system by linking against
|
||||
to libc.so which comes with glibc all I get is a core dump.''
|
||||
|
||||
[Q17] ``Looking through the shared libc file I haven't found the
|
||||
functions `stat', `lstat', `fstat', and `mknod' and while
|
||||
linking on my Linux system I get error messages. How is
|
||||
this supposed to work?''
|
||||
|
||||
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
|
||||
[Q1] ``What systems does the GNU C Library run on?''
|
||||
@@ -368,13 +382,170 @@ the second line the directory for file which are by tradition placed
|
||||
in a directory named /etc.
|
||||
|
||||
|
||||
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
|
||||
[Q14] ``When linking with the new libc I get unresolved symbols
|
||||
`crypt' and `setkey'. Why aren't these functions in the
|
||||
libc anymore?''
|
||||
|
||||
[A14] {UD} Remember the US restrictions of exporting cryptographic
|
||||
programs and source code. Until this law gets abolished we cannot
|
||||
ship the cryptographic function together with the libc.
|
||||
|
||||
But of course we provide the code and there is an very easy way to use
|
||||
this code. First get the extra package. People in the US way get it
|
||||
from the same place they got the GNU libc from. People outside the US
|
||||
should get the code from ftp.uni-c.dk [129.142.6.74], or another
|
||||
archive site outside the USA. The README explains how to install the
|
||||
sources.
|
||||
|
||||
If you already have the crypt code on your system the reason for the
|
||||
failure is probably that you failed to link with -lcrypt. The crypto
|
||||
functions are in a separate library to make it possible to export GNU
|
||||
libc binaries from the US.
|
||||
|
||||
|
||||
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
|
||||
[Q15] ``What are these `add-ons'?''
|
||||
|
||||
[A15] {UD} To avoid complications with external or external source
|
||||
code some optional parts of the libc are distributed as separate
|
||||
packages (e.g., the crypt package, see Q14).
|
||||
|
||||
To ease the use as part of GNU libc the installer just has to unpack
|
||||
the package and tell the configuration script about these additional
|
||||
subdirectories using the --enable-add-ons option. When you add the
|
||||
crypt add-on you just have to use
|
||||
|
||||
configure --enable-add-ons=crypt,XXX ...
|
||||
|
||||
where XXX are possible other add-ons and ... means the rest of the
|
||||
normal option list.
|
||||
|
||||
You can use add-ons also to overwrite some files in glibc. The add-on
|
||||
system dependent subdirs are search first. It is also possible to add
|
||||
banner files (use a file named `Banner') or create shared libraries.
|
||||
|
||||
Using add-ons has the big advantage that the makefiles of the GNU libc
|
||||
can be used. Only some few stub rules must be written to get
|
||||
everything running. Even handling of architecture dependent
|
||||
compilation is provided. The GNU libc's sysdeps/ directory shows how
|
||||
to use this feature.
|
||||
|
||||
|
||||
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
|
||||
[Q16] ``When I use GNU libc on my Linux system by linking against
|
||||
to libc.so which comes with glibc all I get is a core dump.''
|
||||
|
||||
[A16] {UD} It is not enough to simply link against the GNU libc
|
||||
library itself. The GNU C library comes with its own dynamic linker
|
||||
which really conforms to the ELF API standard. This dynamic linker
|
||||
must be used.
|
||||
|
||||
Normally this is done by the compiler. The gcc will use
|
||||
|
||||
-dynamic-linker /lib/ld-linux.so.1
|
||||
|
||||
unless the user specifies her/himself a -dynamic-linker argument. But
|
||||
this is not the correct name for the GNU dynamic linker. The correct
|
||||
name is /lib/ld.so.1 which is the name specified in the SVr4 ABi.
|
||||
|
||||
To change your environment to use GNU libc for compiling you need to
|
||||
change the `specs' file of your gcc. This file is normally found at
|
||||
|
||||
/usr/lib/gcc-lib/<arch>/<version>/specs
|
||||
|
||||
In this file you have to change a few things:
|
||||
|
||||
- change `ld-linux.so.1' to `ld.so.1'
|
||||
|
||||
- remove all expression `%{...:-lgmon}'; there is no libgmon in glibc
|
||||
|
||||
|
||||
Things are getting a bit more complicated if you have GNU libc
|
||||
installed in some other place than /usr, i.e., if you do not want to
|
||||
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:
|
||||
|
||||
-----------------------------------------------------------------------
|
||||
*asm:
|
||||
%{V} %{v:%{!V:-V}} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*}
|
||||
|
||||
*asm_final:
|
||||
%{pipe:-}
|
||||
|
||||
*cpp:
|
||||
%{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{!m386:-D__i486__} %{posix:-D_POSIX_SOURCE} -I/home/gnu/include
|
||||
|
||||
*cc1:
|
||||
|
||||
|
||||
*cc1plus:
|
||||
|
||||
|
||||
*endfile:
|
||||
%{!shared:crtend.o%s} %{shared:crtendS.o%s} /home/gnu/lib/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}}}
|
||||
|
||||
*lib:
|
||||
%{!shared: %{mieee-fp:-lieee} %{p:-lc_p} %{!p:%{pg:-lc_p} %{!pg:-lc}}}
|
||||
|
||||
*libgcc:
|
||||
%{!shared:-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}
|
||||
|
||||
*switches_need_spaces:
|
||||
|
||||
|
||||
*signed_char:
|
||||
%{funsigned-char:-D__CHAR_UNSIGNED__}
|
||||
|
||||
*predefines:
|
||||
-D__ELF__ -Dunix -Di386 -Dlinux -Asystem(unix) -Asystem(posix) -Acpu(i386) -Amachine(i386)
|
||||
|
||||
*cross_compile:
|
||||
0
|
||||
|
||||
*multilib:
|
||||
. ;
|
||||
|
||||
-----------------------------------------------------------------------
|
||||
|
||||
Future versions of GCC will automatically provide the correct specs.
|
||||
|
||||
|
||||
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
|
||||
[Q17] ``Looking through the shared libc file I haven't found the
|
||||
functions `stat', `lstat', `fstat', and `mknod' and while
|
||||
linking on my Linux system I get error messages. How is
|
||||
this supposed to work?''
|
||||
|
||||
[A17] {RM} Believe it or not, stat and lstat (and fstat, and mknod)
|
||||
are supposed to be undefined references in libc.so.6! Your problem is
|
||||
probably a missing or incorrect /usr/lib/libc.so file; note that this
|
||||
is a small text file now, not a symlink to libc.so.6. It should look
|
||||
something like this:
|
||||
|
||||
GROUP ( libc.so.6 ld.so.1 libc.a )
|
||||
|
||||
|
||||
{UD} The Linux ldconfig file probably generates a link libc.so ->
|
||||
libc.so.6 in /lib. This is not correct. There must not be such a
|
||||
link. The linker script with the above contents is placed in
|
||||
/usr/lib which is enough for the linker.
|
||||
|
||||
|
||||
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
|
||||
|
||||
Answers were given by:
|
||||
{UD} Ulrich Drepper, <drepper@cygnus.com>
|
||||
{DMT} David Mosberger-Tang, <davidm@AZStarNet.com>
|
||||
|
||||
Amended by:
|
||||
{RM} Roland McGrath, <roland@gnu.ai.mit.edu>
|
||||
|
||||
Local Variables:
|
||||
|
||||
@@ -4,16 +4,13 @@ Library Maintenance
|
||||
How to Install the GNU C Library
|
||||
================================
|
||||
|
||||
Installation of the GNU C library is relatively simple.
|
||||
|
||||
You need the latest version of GNU `make'. Modifying the GNU C
|
||||
Library to work with other `make' programs would be so hard that we
|
||||
recommend you port GNU `make' instead. *Really.*
|
||||
Installation of the GNU C library is relatively simple, but usually
|
||||
requires several GNU tools to be installed already.
|
||||
|
||||
To configure the GNU C library for your system, run the shell script
|
||||
`configure' with `sh'. Use an argument which is the conventional GNU
|
||||
name for your system configuration--for example, `sparc-sun-sunos4.1',
|
||||
for a Sun 4 running Sunos 4.1. *Note Installation:
|
||||
for a Sun 4 running SunOS 4.1. *Note Installation:
|
||||
(gcc.info)Installation, for a full description of standard GNU
|
||||
configuration names. If you omit the configuration name, `configure'
|
||||
will try to guess one for you by inspecting the system it is running
|
||||
@@ -21,46 +18,6 @@ on. It may or may not be able to come up with a guess, and the its
|
||||
guess might be wrong. `configure' will tell you the canonical name of
|
||||
the chosen configuration before proceeding.
|
||||
|
||||
The GNU C Library currently supports configurations that match the
|
||||
following patterns:
|
||||
|
||||
alpha-dec-osf1
|
||||
i386-ANYTHING-bsd4.3
|
||||
i386-ANYTHING-gnu
|
||||
i386-ANYTHING-isc2.2
|
||||
i386-ANYTHING-isc3.N
|
||||
i386-ANYTHING-sco3.2
|
||||
i386-ANYTHING-sco3.2v4
|
||||
i386-ANYTHING-sysv
|
||||
i386-ANYTHING-sysv4
|
||||
i386-force_cpu386-none
|
||||
i386-sequent-bsd
|
||||
i960-nindy960-none
|
||||
m68k-hp-bsd4.3
|
||||
m68k-mvme135-none
|
||||
m68k-mvme136-none
|
||||
m68k-sony-newsos3
|
||||
m68k-sony-newsos4
|
||||
m68k-sun-sunos4.N
|
||||
mips-dec-ultrix4.N
|
||||
mips-sgi-irix4.N
|
||||
sparc-sun-solaris2.N
|
||||
sparc-sun-sunos4.N
|
||||
|
||||
While no other configurations are supported, there are handy aliases
|
||||
for these few. (These aliases work in other GNU software as well.)
|
||||
|
||||
decstation
|
||||
hp320-bsd4.3 hp300bsd
|
||||
i386-sco
|
||||
i386-sco3.2v4
|
||||
i386-sequent-dynix
|
||||
i386-svr4
|
||||
news
|
||||
sun3-sunos4.N sun3
|
||||
sun4-solaris2.N sun4-sunos5.N
|
||||
sun4-sunos4.N sun4
|
||||
|
||||
Here are some options that you should specify (if appropriate) when
|
||||
you run `configure':
|
||||
|
||||
@@ -76,8 +33,15 @@ you run `configure':
|
||||
building the GNU C Library. On some systems, the library may not
|
||||
build properly if you do *not* use `gas'.
|
||||
|
||||
`--with-gnu-binutils'
|
||||
This option implies both `--with-gnu-ld' and `--with-gnu-as'. On
|
||||
systems where GNU tools are the system tools, there is no need to
|
||||
specify this option. These include GNU, GNU/Linux, and free BSD
|
||||
systems.
|
||||
|
||||
`--without-fp'
|
||||
`--nfp'
|
||||
Use this option if your computer lacks hardware floating point
|
||||
Use this option if your computer lacks hardware floating-point
|
||||
support.
|
||||
|
||||
`--prefix=DIRECTORY'
|
||||
@@ -89,6 +53,29 @@ you run `configure':
|
||||
subdirectories of `DIRECTORY'. (You can also set this in
|
||||
`configparms'; see below.)
|
||||
|
||||
`--enable-shared'
|
||||
`--disable-shared'
|
||||
Enable or disable building of an ELF shared library on systems that
|
||||
support it. The default is to build the shared library on systems
|
||||
using ELF when the GNU `binutils' are available.
|
||||
|
||||
`--enable-profile'
|
||||
`--disable-profile'
|
||||
Enable or disable building of the profiled C library, `-lc_p'. The
|
||||
default is to build the profiled library. You may wish to disable
|
||||
it if you don't plan to do profiling, because it doubles the build
|
||||
time of compiling just the unprofiled static library.
|
||||
|
||||
`--enable-omitfp'
|
||||
Enable building a highly-optimized but possibly undebuggable
|
||||
static C library. This causes the normal static and shared (if
|
||||
enabled) C libraries to be compiled with maximal optimization,
|
||||
including the `-fomit-frame-pointer' switch that makes debugging
|
||||
impossible on many machines, and without debugging information
|
||||
(which makes the binaries substantially smaller). An additional
|
||||
static library is compiled with no optimization and full debugging
|
||||
information, and installed as `-lc_g'.
|
||||
|
||||
The simplest way to run `configure' is to do it in the directory
|
||||
that contains the library sources. This prepares to build the library
|
||||
in that very directory.
|
||||
@@ -141,57 +128,107 @@ work with object files for the target you configured for.
|
||||
in the GNU C compiler, so you may need to compile the library with GCC.
|
||||
(In fact, all of the existing complete ports require GCC.)
|
||||
|
||||
The current release of the C library contains some header files that
|
||||
the compiler normally provides: `stddef.h', `stdarg.h', and several
|
||||
files with names of the form `va-MACHINE.h'. The versions of these
|
||||
files that came with older releases of GCC do not work properly with
|
||||
the GNU C library. The `stddef.h' file in release 2.2 and later of GCC
|
||||
is correct. If you have release 2.2 or later of GCC, use its version
|
||||
of `stddef.h' instead of the C library's. To do this, put the line
|
||||
`override stddef.h =' in `configparms'. The other files are corrected
|
||||
in release 2.3 and later of GCC. `configure' will automatically detect
|
||||
whether the installed `stdarg.h' and `va-MACHINE.h' files are
|
||||
compatible with the C library, and use its own if not.
|
||||
|
||||
There is a potential problem with the `size_t' type and versions of
|
||||
GCC prior to release 2.4. ANSI C requires that `size_t' always be an
|
||||
unsigned type. For compatibility with existing systems' header files,
|
||||
GCC defines `size_t' in `stddef.h' to be whatever type the system's
|
||||
`sys/types.h' defines it to be. Most Unix systems that define `size_t'
|
||||
in `sys/types.h', define it to be a signed type. Some code in the
|
||||
library depends on `size_t' being an unsigned type, and will not work
|
||||
correctly if it is signed.
|
||||
|
||||
The GNU C library code which expects `size_t' to be unsigned is
|
||||
correct. The definition of `size_t' as a signed type is incorrect.
|
||||
Versions 2.4 and later of GCC always define `size_t' as an unsigned
|
||||
type, and GCC's `fixincludes' script massages the system's
|
||||
`sys/types.h' so as not to conflict with this.
|
||||
|
||||
In the meantime, we work around this problem by telling GCC
|
||||
explicitly to use an unsigned type for `size_t' when compiling the GNU C
|
||||
library. `configure' will automatically detect what type GCC uses for
|
||||
`size_t' arrange to override it if necessary.
|
||||
|
||||
To build the library, type `make lib'. This will produce a lot of
|
||||
output, some of which looks like errors from `make' (but isn't). Look
|
||||
for error messages from `make' containing `***'. Those indicate that
|
||||
something is really wrong.
|
||||
To build the library and related programs, type `make'. This will
|
||||
produce a lot of output, some of which may look like errors from `make'
|
||||
(but isn't). Look for error messages from `make' containing `***'.
|
||||
Those indicate that something is really wrong.
|
||||
|
||||
To build and run some test programs which exercise some of the
|
||||
library facilities, type `make tests'. This will produce several files
|
||||
library facilities, type `make check'. This will produce several files
|
||||
with names like `PROGRAM.out'.
|
||||
|
||||
To format the `GNU C Library Reference Manual' for printing, type
|
||||
`make dvi'. To format the Info version of the manual for on line
|
||||
reading with `C-h i' in Emacs or with the `info' program, type
|
||||
`make info'.
|
||||
`make dvi'.
|
||||
|
||||
To install the library and its header files, and the Info files of
|
||||
the manual, type `make install', after setting the installation
|
||||
directories in `configparms'. This will build things if necessary,
|
||||
the manual, type `make install'. This will build things if necessary,
|
||||
before installing them.
|
||||
|
||||
Recommended Tools to Install the GNU C Library
|
||||
----------------------------------------------
|
||||
|
||||
We recommend installing the following GNU tools before attempting to
|
||||
build the GNU C library:
|
||||
|
||||
* `make' 3.75
|
||||
|
||||
You need the latest version of GNU `make'. Modifying the GNU C
|
||||
Library to work with other `make' programs would be so hard that we
|
||||
recommend you port GNU `make' instead. *Really.* We recommend
|
||||
version GNU `make' version 3.75 or later.
|
||||
|
||||
* GCC 2.7.2.1
|
||||
|
||||
On most platforms, the GNU C library can only be compiled with the
|
||||
GNU C compiler. We recommend GCC version 2.7.2 or later; earlier
|
||||
versions may have problems.
|
||||
|
||||
* `binutils' 2.7
|
||||
|
||||
Using the GNU `binutils' (assembler, linker, and related tools) is
|
||||
preferable when possible, and they are required to build an ELF
|
||||
shared C library. We recommend `binutils' version 2.7 or later;
|
||||
earlier versions are known to have problems or to not support all
|
||||
architectures.
|
||||
|
||||
Supported Configurations
|
||||
------------------------
|
||||
|
||||
The GNU C Library currently supports configurations that match the
|
||||
following patterns:
|
||||
|
||||
alpha-ANYTHING-linux
|
||||
alpha-ANYTHING-linuxecoff
|
||||
iX86-ANYTHING-gnu
|
||||
iX86-ANYTHING-linux
|
||||
m68k-ANYTHING-linux
|
||||
|
||||
Former versions of this library used to support the following
|
||||
configurations but the current status is unknown:
|
||||
|
||||
alpha-dec-osf1
|
||||
iX86-ANYTHING-bsd4.3
|
||||
iX86-ANYTHING-isc2.2
|
||||
iX86-ANYTHING-isc3.N
|
||||
iX86-ANYTHING-sco3.2
|
||||
iX86-ANYTHING-sco3.2v4
|
||||
iX86-ANYTHING-sysv
|
||||
iX86-ANYTHING-sysv4
|
||||
iX86-force_cpu386-none
|
||||
iX86-sequent-bsd
|
||||
i960-nindy960-none
|
||||
m68k-hp-bsd4.3
|
||||
m68k-mvme135-none
|
||||
m68k-mvme136-none
|
||||
m68k-sony-newsos3
|
||||
m68k-sony-newsos4
|
||||
m68k-sun-sunos4.N
|
||||
mips-dec-ultrix4.N
|
||||
mips-sgi-irix4.N
|
||||
sparc-sun-solaris2.N
|
||||
sparc-sun-sunos4.N
|
||||
|
||||
Each case of `iX86' can be `i386', `i486', `i586', or `i686'.. All
|
||||
of those configurations produce a library that can run on any of these
|
||||
processors. The library will be optimized for the specified processor,
|
||||
but will not use instructions not available on all of them.
|
||||
|
||||
While no other configurations are supported, there are handy aliases
|
||||
for these few. (These aliases work in other GNU software as well.)
|
||||
|
||||
decstation
|
||||
hp320-bsd4.3 hp300bsd
|
||||
i486-gnu
|
||||
i586-linux
|
||||
i386-sco
|
||||
i386-sco3.2v4
|
||||
i386-sequent-dynix
|
||||
i386-svr4
|
||||
news
|
||||
sun3-sunos4.N sun3
|
||||
sun4-solaris2.N sun4-sunos5.N
|
||||
sun4-sunos4.N sun4
|
||||
|
||||
Reporting Bugs
|
||||
==============
|
||||
|
||||
@@ -246,8 +283,10 @@ But what they do is fairly straightforward, and only requires that you
|
||||
define a few variables in the right places.
|
||||
|
||||
The library sources are divided into subdirectories, grouped by
|
||||
topic. The `string' subdirectory has all the string-manipulation
|
||||
functions, `stdio' has all the standard I/O functions, etc.
|
||||
topic.
|
||||
|
||||
The `string' subdirectory has all the string-manipulation functions,
|
||||
`math' has all the mathematical functions, etc.
|
||||
|
||||
Each subdirectory contains a simple makefile, called `Makefile',
|
||||
which defines a few `make' variables and then includes the global
|
||||
@@ -283,7 +322,9 @@ The basic variables that a subdirectory makefile defines are:
|
||||
data in a file called `TEST-PROGRAM.input'; it will be given to
|
||||
the test program on its standard input. If a test program wants
|
||||
to be run with arguments, put the arguments (all on a single line)
|
||||
in a file called `TEST-PROGRAM.args'.
|
||||
in a file called `TEST-PROGRAM.args'. Test programs should exit
|
||||
with zero status when the test passes, and nonzero status when the
|
||||
test indicates a bug in the library or error in building.
|
||||
|
||||
`others'
|
||||
The names of "other" programs associated with this section of the
|
||||
@@ -362,18 +403,24 @@ So the final list is `unix/bsd/vax unix/bsd unix/inet unix posix'.
|
||||
`sysdeps' has two "special" subdirectories, called `generic' and
|
||||
`stub'. These two are always implicitly appended to the list of
|
||||
subdirectories (in that order), so you needn't put them in an `Implies'
|
||||
file, and you should not create any subdirectories under them.
|
||||
`generic' is for things that can be implemented in machine-independent
|
||||
C, using only other machine-independent functions in the C library.
|
||||
`stub' is for "stub" versions of functions which cannot be implemented
|
||||
on a particular machine or operating system. The stub functions always
|
||||
return an error, and set `errno' to `ENOSYS' (Function not
|
||||
implemented). *Note Error Reporting::.
|
||||
file, and you should not create any subdirectories under them intended
|
||||
to be new specific categories. `generic' is for things that can be
|
||||
implemented in machine-independent C, using only other
|
||||
machine-independent functions in the C library. `stub' is for "stub"
|
||||
versions of functions which cannot be implemented on a particular
|
||||
machine or operating system. The stub functions always return an
|
||||
error, and set `errno' to `ENOSYS' (Function not implemented). *Note
|
||||
Error Reporting::.
|
||||
|
||||
A source file is known to be system-dependent by its having a
|
||||
version in `generic' or `stub'; every system-dependent function should
|
||||
have either a generic or stub implementation (there is no point in
|
||||
having both).
|
||||
version in `generic' or `stub'; every generally-available function whose
|
||||
implementation is system-dependent in should have either a generic or
|
||||
stub implementation (there is no point in having both). Some rare
|
||||
functions are only useful on specific systems and aren't defined at all
|
||||
on others; these do not appear anywhere in the system-independent
|
||||
source code or makefiles (including the `generic' and `stub'
|
||||
directories), only in the system-dependent `Makefile' in the specific
|
||||
system's subdirectory.
|
||||
|
||||
If you come across a file that is in one of the main source
|
||||
directories (`string', `stdio', etc.), and you want to write a machine-
|
||||
@@ -629,18 +676,106 @@ generated are `ioctls.h', `errnos.h', `sys/param.h', and `errlist.c'
|
||||
Contributors to the GNU C Library
|
||||
=================================
|
||||
|
||||
The GNU C library was written almost entirely by Roland McGrath, who
|
||||
now maintains it. Some parts of the library were contributed or worked
|
||||
on by other people.
|
||||
The GNU C library was written originally by Roland McGrath. Some
|
||||
parts of the library were contributed or worked on by other people.
|
||||
|
||||
* The `getopt' function and related code were written by Richard
|
||||
Stallman, David J. MacKenzie, and Roland McGrath.
|
||||
|
||||
* Most of the math functions are taken from 4.4 BSD; they have been
|
||||
modified only slightly to work with the GNU C library. The
|
||||
Internet-related code (most of the `inet' subdirectory) and several
|
||||
other miscellaneous functions and header files have been included
|
||||
with little or no modification.
|
||||
* The merge sort function `qsort' was written by Michael J. Haertel.
|
||||
|
||||
* The quick sort function used as a fallback by `qsort' was written
|
||||
by Douglas C. Schmidt.
|
||||
|
||||
* The memory allocation functions `malloc', `realloc' and `free' and
|
||||
related code were written by Michael J. Haertel.
|
||||
|
||||
* Fast implementations of many of the string functions (`memcpy',
|
||||
`strlen', etc.) were written by Torbjorn Granlund.
|
||||
|
||||
* The `tar.h' header file was written by David J. MacKenzie.
|
||||
|
||||
* The port to the MIPS DECStation running Ultrix 4
|
||||
(`mips-dec-ultrix4') was contributed by Brendan Kehoe and Ian
|
||||
Lance Taylor.
|
||||
|
||||
* The DES encryption function `crypt' and related functions were
|
||||
contributed by Michael Glad.
|
||||
|
||||
* The `ftw' function was contributed by Ian Lance Taylor.
|
||||
|
||||
* The startup code to support SunOS shared libraries was contributed
|
||||
by Tom Quinn.
|
||||
|
||||
* The `mktime' function was contributed by Paul Eggert.
|
||||
|
||||
* The port to the Sequent Symmetry running Dynix version 3
|
||||
(`i386-sequent-bsd') was contributed by Jason Merrill.
|
||||
|
||||
* The timezone support code is derived from the public-domain
|
||||
timezone package by Arthur David Olson and his many contributors.
|
||||
|
||||
* The port to the DEC Alpha running OSF/1 (`alpha-dec-osf1') was
|
||||
contributed by Brendan Kehoe, using some code written by Roland
|
||||
McGrath.
|
||||
|
||||
* The port to SGI machines running Irix 4 (`mips-sgi-irix4') was
|
||||
contributed by Tom Quinn.
|
||||
|
||||
* The port of the Mach and Hurd code to the MIPS architecture
|
||||
(`mips-ANYTHING-gnu') was contributed by Kazumoto Kojima.
|
||||
|
||||
* The floating-point printing function used by `printf' and friends
|
||||
and the floating-point reading function used by `scanf', `strtod'
|
||||
and friends were written by Ulrich Drepper. The multi-precision
|
||||
integer functions used in those functions are taken from GNU MP,
|
||||
which was contributed by Torbjorn Granlund.
|
||||
|
||||
* The internationalization support in the library, and the support
|
||||
programs `locale' and `localedef', were written by Ulrich Drepper.
|
||||
Ulrich Drepper adapted the support code for message catalogs
|
||||
(`libintl.h', etc.) from the GNU `gettext' package, which he also
|
||||
wrote. He also contributed the `catgets' support and the entire
|
||||
suite of multi-byte and wide-character support functions
|
||||
(`wctype.h', `wchar.h', etc.).
|
||||
|
||||
* The implementations of the `nsswitch.conf' mechanism and the files
|
||||
and DNS backends for it were designed and written by Ulrich
|
||||
Drepper and Roland McGrath, based on a backend interface defined
|
||||
by Peter Eriksson.
|
||||
|
||||
* The port to Linux i386/ELF (`i386-ANYTHING-linux') was contributed
|
||||
by Ulrich Drepper, based in large part on work done in Hongjiu
|
||||
Lu's Linux version of the GNU C Library.
|
||||
|
||||
* The port to Linux/m68k (`m68k-ANYTHING-linux') was contributed by
|
||||
Andreas Schwab.
|
||||
|
||||
* Richard Henderson contributed the ELF dynamic linking code and
|
||||
other support for the Alpha processor.
|
||||
|
||||
* David Mosberger-Tang contributed the port to Linux/Alpha
|
||||
(`alpha-ANYTHING-linux').
|
||||
|
||||
* Stephen R. van den Berg contributed a highly-optimized `strstr'
|
||||
function.
|
||||
|
||||
* Ulrich Drepper contributed the `hsearch' and `drand48' families of
|
||||
functions; reentrant `...`_r'' versions of the `random' family;
|
||||
System V shared memory and IPC support code; and several
|
||||
highly-optimized string functions for iX86 processors.
|
||||
|
||||
* The math functions are taken from `fdlibm-5.1' by Sun
|
||||
Microsystems, as modified by J.T. Conklin, Ian Lance Taylor,
|
||||
Ulrich Drepper, Andreas Schwab, and Roland McGrath.
|
||||
|
||||
* The `libio' library used to implement `stdio' functions on some
|
||||
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.
|
||||
|
||||
All code incorporated from 4.4 BSD is under the following
|
||||
copyright:
|
||||
@@ -694,70 +829,7 @@ on by other people.
|
||||
changes to fit into the GNU C library and to fit the ANSI C
|
||||
standard, but the functional code is Berkeley's.
|
||||
|
||||
* The merge sort function `qsort' was written by Michael J. Haertel.
|
||||
|
||||
* The quick sort function used as a fallback by `qsort' was written
|
||||
by Douglas C. Schmidt.
|
||||
|
||||
* The memory allocation functions `malloc', `realloc' and `free' and
|
||||
related code were written by Michael J. Haertel.
|
||||
|
||||
* Fast implementations of many of the string functions (`memcpy',
|
||||
`strlen', etc.) were written by Torbjorn Granlund.
|
||||
|
||||
* Some of the support code for Mach is taken from Mach 3.0 by CMU,
|
||||
and is under the following copyright terms:
|
||||
|
||||
Mach Operating System
|
||||
Copyright (C) 1991,1990,1989 Carnegie Mellon University
|
||||
All Rights Reserved.
|
||||
|
||||
Permission to use, copy, modify and distribute this software
|
||||
and its documentation is hereby granted, provided that both
|
||||
the copyright notice and this permission notice appear in all
|
||||
copies of the software, derivative works or modified
|
||||
versions, and any portions thereof, and that both notices
|
||||
appear in supporting documentation.
|
||||
|
||||
CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS
|
||||
IS" CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF
|
||||
ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF
|
||||
THIS SOFTWARE.
|
||||
|
||||
Carnegie Mellon requests users of this software to return to
|
||||
|
||||
Software Distribution Coordinator
|
||||
School of Computer Science
|
||||
Carnegie Mellon University
|
||||
Pittsburgh PA 15213-3890
|
||||
|
||||
or `Software.Distribution@CS.CMU.EDU' any improvements or
|
||||
extensions that they make and grant Carnegie Mellon the
|
||||
rights to redistribute these changes.
|
||||
|
||||
* The `tar.h' header file was written by David J. MacKenzie.
|
||||
|
||||
* The port to the MIPS DECStation running Ultrix 4
|
||||
(`mips-dec-ultrix4') was contributed by Brendan Kehoe and Ian
|
||||
Lance Taylor.
|
||||
|
||||
* The DES encryption function `crypt' and related functions were
|
||||
contributed by Michael Glad.
|
||||
|
||||
* The `ftw' function was contributed by Ian Lance Taylor.
|
||||
|
||||
* The code to support SunOS shared libraries was contributed by Tom
|
||||
Quinn.
|
||||
|
||||
* The `mktime' function was contributed by Noel Cragg.
|
||||
|
||||
* The port to the Sequent Symmetry running Dynix version 3
|
||||
(`i386-sequent-bsd') was contributed by Jason Merrill.
|
||||
|
||||
* The timezone support code is derived from the public-domain
|
||||
timezone package by Arthur David Olson.
|
||||
|
||||
* The Internet resolver code is taken directly from BIND 4.9.1,
|
||||
* The Internet resolver code is taken directly from BIND 4.9.5,
|
||||
which is under both the Berkeley copyright above and also:
|
||||
|
||||
Portions Copyright (C) 1993 by Digital Equipment Corporation.
|
||||
@@ -780,15 +852,6 @@ on by other people.
|
||||
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
|
||||
WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
* The port to the DEC Alpha running OSF/1 (`alpha-dec-osf1') was
|
||||
contributed by Brendan Kehoe, using some code written by Roland
|
||||
McGrath.
|
||||
|
||||
* The floating-point printing function used by `printf' and friends
|
||||
was written by Roland McGrath and Torbjorn Granlund. The
|
||||
multi-precision integer functions used in that function are taken
|
||||
from GNU MP, which was contributed by Torbjorn Granlund.
|
||||
|
||||
* The code to support Sun RPC is taken verbatim from Sun's
|
||||
RPCSRC-4.0 distribution, and is covered by this copyright:
|
||||
|
||||
@@ -824,9 +887,32 @@ on by other people.
|
||||
2550 Garcia Avenue
|
||||
Mountain View, California 94043
|
||||
|
||||
* The port to SGI machines running Irix 4 (`mips-sgi-irix4') was
|
||||
contributed by Tom Quinn.
|
||||
* Some of the support code for Mach is taken from Mach 3.0 by CMU,
|
||||
and is under the following copyright terms:
|
||||
|
||||
* The port of the Mach and Hurd code to the MIPS architecture
|
||||
(`mips-ANYTHING-gnu') was contribued by Kazumoto Kojima.
|
||||
Mach Operating System
|
||||
Copyright (C) 1991,1990,1989 Carnegie Mellon University
|
||||
All Rights Reserved.
|
||||
|
||||
Permission to use, copy, modify and distribute this software
|
||||
and its documentation is hereby granted, provided that both
|
||||
the copyright notice and this permission notice appear in all
|
||||
copies of the software, derivative works or modified
|
||||
versions, and any portions thereof, and that both notices
|
||||
appear in supporting documentation.
|
||||
|
||||
CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS
|
||||
IS" CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF
|
||||
ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF
|
||||
THIS SOFTWARE.
|
||||
|
||||
Carnegie Mellon requests users of this software to return to
|
||||
|
||||
Software Distribution Coordinator
|
||||
School of Computer Science
|
||||
Carnegie Mellon University
|
||||
Pittsburgh PA 15213-3890
|
||||
|
||||
or `Software.Distribution@CS.CMU.EDU' any improvements or
|
||||
extensions that they make and grant Carnegie Mellon the
|
||||
rights to redistribute these changes.
|
||||
|
||||
@@ -40,6 +40,9 @@ else
|
||||
sysdep_dirs := $(addprefix $(..),$(sysdep_dirs))
|
||||
endif
|
||||
|
||||
# Don't distribute add-on subdirs.
|
||||
subdirs := $(filter-out $(add-ons),$(subdirs))
|
||||
|
||||
# Make sure both stdio and libio get in, whichever is in use.
|
||||
subdirs += stdio libio
|
||||
|
||||
@@ -110,8 +113,7 @@ sources := $(filter-out $(addsuffix .c,$(basename $(.S.s))),$(sources)) $(.S.s)
|
||||
$(addsuffix .c,$(sysdep_routines)) \
|
||||
$(+subdir-nodist)
|
||||
#foo:=$(shell echo '+out=$(+out)' >&2; echo foofoo >&2)
|
||||
+tsrcs := $(filter-out $(+out) $(addprefix %/,$(+out)), \
|
||||
$(sources) $(all-headers) $(distribute)) \
|
||||
+tsrcs := $(filter-out $(+out), $(sources) $(all-headers) $(distribute)) \
|
||||
$(+sysdeps)
|
||||
foo:=$(shell echo 'made +tsrcs=$(+tsrcs)'>&2)
|
||||
foo:=$(shell echo generated='$(generated)' >&2)
|
||||
@@ -129,8 +131,8 @@ endif
|
||||
$(..)glibc-$(version):
|
||||
ln -s . $@
|
||||
|
||||
+tsrcs := $(+tsrcs) \
|
||||
TAGS
|
||||
#+tsrcs := $(+tsrcs) \
|
||||
# TAGS
|
||||
.PHONY: TAGS
|
||||
TAGS: $(..)MakeTAGS
|
||||
$(MAKE) -f $< $@ -o subdir_TAGS
|
||||
@@ -195,7 +197,7 @@ $(tardir).tar: dist.tar subdir_dist
|
||||
@echo Files listed here have names exceeding 14 chars.
|
||||
tar xfv $< -C /tmp | sed -n '/[^/]\{15,\}/p'
|
||||
tar covf $@ -C /tmp $(tardir)
|
||||
-rm -fr /tmp/$(tardir) &
|
||||
-rm -fr /tmp/$(tardir) dist.tar &
|
||||
|
||||
%.Z: %
|
||||
compress -c $< > $@
|
||||
|
||||
@@ -39,7 +39,7 @@ tags_sources = $(all-sources) $(all-headers) $(all-dist)
|
||||
endif # ctype
|
||||
endif # No tags_sources
|
||||
|
||||
sysdep-dirs := $(addprefix $(sysdep_dir)/,$(sysdirs))
|
||||
sysdep-dirs := $(full-config-subdirs)
|
||||
|
||||
ifndef sysdep_dirs
|
||||
# Find all sysdep directories.
|
||||
@@ -132,8 +132,8 @@ endif
|
||||
|
||||
define extract
|
||||
@rm -f $@.new
|
||||
$(XGETTEXT) --keyword=_ --keyword=N_ --add-comments=TRANS --sort-output -d - \
|
||||
$(XGETTEXTFLAGS-$(@F)) > $@.new $^
|
||||
$(XGETTEXT) --keyword=_ --keyword=N_ --add-comments=TRANS --sort-output \
|
||||
--omit-header -n -d - $(XGETTEXTFLAGS-$(@F)) > $@.new $^
|
||||
mv -f $@.new $@
|
||||
endef
|
||||
|
||||
@@ -145,16 +145,13 @@ else
|
||||
$(extract)
|
||||
endif
|
||||
|
||||
$P/siglist.pot: $(common-objpfx)siglist.c; $(extract)
|
||||
$P/errlist.pot: $(..)sysdeps/gnu/errlist.c; $(extract)
|
||||
$P/siglist.pot: $(common-objpfx)stdio-common/siglist.c; $(extract)
|
||||
|
||||
# Extract all strings from these files; their strings are not marked.
|
||||
# Extract all strings from this file; its strings are not marked.
|
||||
# Their surroundings are also not interesting.
|
||||
XGETTEXTFLAGS-siglist.pot = -a --no-location
|
||||
XGETTEXTFLAGS-errlist.pot = -a --no-location
|
||||
|
||||
all-pot = $P/libc-top.pot $P/subdirs.pot \
|
||||
$P/siglist.pot $P/errlist.pot
|
||||
all-pot = $P/libc-top.pot $P/subdirs.pot $P/siglist.pot
|
||||
|
||||
ifndef subdir
|
||||
# Collect all the subdir messages, massaging the file names in comments
|
||||
@@ -162,18 +159,21 @@ ifndef subdir
|
||||
$P/subdirs.pot: $(subdirs:%=$P/%.pot)
|
||||
@rm -f $@.new
|
||||
(for d in $(subdirs); \
|
||||
do sed "s%^#: %&$$d/%" $P/$$d.pot; done) > $@.new
|
||||
do sed "/^#:/s% % $$d/%g" $P/$$d.pot; done) > $@.new
|
||||
mv -f $@.new $@
|
||||
|
||||
# Get $(version) defined.
|
||||
include $(common-objpfx)version.mk
|
||||
|
||||
# Combine all the messages into the final sorted template translation file.
|
||||
$P/SYS_libc.pot: $(all-pot)
|
||||
# The following code requires GNU date.
|
||||
$P/libc.pot: $(all-pot)
|
||||
@rm -f $@.new
|
||||
sed -e 's/VERSION/$(version)/' -e "s/DATE/`date +'%Y-%m-%d %k:%M'`/" \
|
||||
disp='set `date -R`; echo $$6'; \
|
||||
sed -e 's/VERSION/$(version)/' \
|
||||
-e "s/DATE/`date +'%Y-%m-%d %I:%M'$$disp/" \
|
||||
po/header.pot > $@.new
|
||||
$(XGETTEXT) -d - -n -s --omit-header $^ >> $@.new
|
||||
$(XGETTEXT) -d - --omit-header -n -s $^ >> $@.new
|
||||
mv -f $@.new $@
|
||||
test ! -d CVS || cvs ci -m'Regenerated from source files' $@
|
||||
|
||||
|
||||
+44
-30
@@ -59,8 +59,8 @@ endif
|
||||
# $(common-objdir) is the place to put objects and
|
||||
# such that are not specific to a single subdir.
|
||||
ifdef objdir
|
||||
objpfx = $(objdir)/
|
||||
common-objpfx = $(objpfx)
|
||||
objpfx := $(patsubst %//,%/,$(objdir)/$(subdir)/)
|
||||
common-objpfx = $(objdir)/
|
||||
common-objdir = $(objdir)
|
||||
else
|
||||
objpfx :=
|
||||
@@ -78,10 +78,14 @@ endif
|
||||
sysdep_dir := $(..)sysdeps
|
||||
export sysdep_dir := $(sysdep_dir)
|
||||
|
||||
|
||||
# Get the values defined by options to `configure'.
|
||||
include $(common-objpfx)config.make
|
||||
|
||||
# Complete path to sysdep dirs.
|
||||
full-config-sysdirs := $(filter /%, $(config-sysdirs)) \
|
||||
$(addprefix $(..), $(filter-out /%, $(config-sysdirs)))
|
||||
export full-config-sysdirs := $(full-config-sysdirs)
|
||||
|
||||
# Run config.status to update config.make and config.h. We don't show the
|
||||
# dependence of config.h to Make, because it is only touched when it
|
||||
# changes and so config.status would be run every time; the dependence of
|
||||
@@ -93,12 +97,12 @@ $(common-objpfx)config.make: $(common-objpfx)config.status $(..)config.h.in
|
||||
# Find all the sysdeps configure fragments, to make sure we re-run
|
||||
# configure when any of them changes.
|
||||
$(common-objpfx)config.status: $(..)configure \
|
||||
$(foreach dir,$(config-sysdirs),\
|
||||
$(foreach dir,$(full-config-sysdirs),\
|
||||
$(wildcard \
|
||||
$(sysdep_dir)/$(dir)/Implies) \
|
||||
$(dir)/Implies) \
|
||||
$(patsubst %.in,%,\
|
||||
$(firstword $(wildcard \
|
||||
$(addprefix $(sysdep_dir)/$(dir)/,configure configure.in)))))
|
||||
$(addprefix $(dir)/,configure configure.in)))))
|
||||
@cd $(@D); if test -f $(@F); then exec $(SHELL) $(@F) --recheck; else \
|
||||
echo The GNU C library has not been configured. >&2; \
|
||||
echo Run \`configure\' to configure it before building. >&2; \
|
||||
@@ -110,8 +114,8 @@ ifneq ($(wildcard $(..)configparms),)
|
||||
include $(..)configparms
|
||||
endif
|
||||
ifneq ($(objpfx),)
|
||||
ifneq ($(wildcard $(objpfx)configparms),)
|
||||
include $(objpfx)configparms
|
||||
ifneq ($(wildcard $(common-objpfx)configparms),)
|
||||
include $(common-objpfx)configparms
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -283,7 +287,7 @@ endif
|
||||
|
||||
# Default flags to pass the C compiler.
|
||||
ifndef default_cflags
|
||||
default_cflags := -g
|
||||
default_cflags := -g -O
|
||||
endif
|
||||
|
||||
# Flags to pass the C compiler when assembling preprocessed assembly code
|
||||
@@ -299,8 +303,9 @@ ifndef +link
|
||||
+link = $(CC) -nostdlib -nostartfiles -o $@ \
|
||||
$(sysdep-LDFLAGS) $(config-LDFLAGS) $(LDFLAGS) \
|
||||
$(addprefix $(csu-objpfx),start.o) $(+preinit) \
|
||||
$(filter-out $(common-objpfx)libc%,$^) $(link-libc) \
|
||||
$(+postinit)
|
||||
$(filter-out $(addprefix $(csu-objpfx),start.o) $(+preinit) \
|
||||
$(link-extra-libs) $(common-objpfx)libc% $(+postinit),$^) \
|
||||
$(link-extra-libs) $(link-libc) $(+postinit)
|
||||
endif
|
||||
ifndef config-LDFLAGS
|
||||
ifeq (yes,$(build-shared))
|
||||
@@ -325,11 +330,18 @@ default-rpath = $(libdir)
|
||||
endif
|
||||
# This is how to find at build-time things that will be installed there.
|
||||
rpath-link = $(common-objdir):$(elfobjdir):$(nssobjdir)
|
||||
nssobjdir := $(firstword $(objdir) $(patsubst ../$(subdir),.,$(..)nss))
|
||||
nssobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nss)
|
||||
else
|
||||
link-libc = $(common-objpfx)libc.a $(gnulib) $(common-objpfx)libc.a
|
||||
endif
|
||||
endif
|
||||
ifndef link-extra-libs
|
||||
ifeq (yes,$(build-shared))
|
||||
link-extra-libs = $(foreach lib,$(LDLIBS-$(@F)),$(common-objpfx)$(lib).so$($(notdir $(lib)).so-version))
|
||||
else
|
||||
link-extra-libs = $(foreach lib,$(LDLIBS-$(@F)),$(common-objpfx)$(lib).a)
|
||||
endif
|
||||
endif
|
||||
ifndef gnulib
|
||||
gnulib := -lgcc
|
||||
endif
|
||||
@@ -337,13 +349,9 @@ ifeq ($(elf),yes)
|
||||
+preinit = $(addprefix $(csu-objpfx),crti.o)
|
||||
+postinit = $(addprefix $(csu-objpfx),crtn.o)
|
||||
endif
|
||||
ifdef objpfx
|
||||
csu-objpfx = $(objpfx)
|
||||
elf-objpfx = $(objpfx)
|
||||
else
|
||||
csu-objpfx = $(..)csu/
|
||||
elf-objpfx = $(..)elf/
|
||||
endif
|
||||
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.
|
||||
@@ -485,7 +493,7 @@ ifeq (yes,$(build-omitfp))
|
||||
object-suffixes += .go
|
||||
CFLAGS-.go = -g
|
||||
CFLAGS-.o = -g0 -O99 -fomit-frame-pointer
|
||||
CFLAGS-.so += $(CFLAGS.o)
|
||||
CFLAGS-.so += $(CFLAGS-.o)
|
||||
libtype.go = lib%_g.a
|
||||
endif
|
||||
|
||||
@@ -516,17 +524,23 @@ ifeq (yes, $(build-shared))
|
||||
# version numbers to use when we install shared objects on this system.
|
||||
-include $(common-objpfx)soversions.mk
|
||||
$(common-objpfx)soversions.mk: $(..)shlib-versions $(..)Makeconfig \
|
||||
$(wildcard $(patsubst %, $(..)%/shlib-versions,\
|
||||
$(add-ons))) \
|
||||
$(common-objpfx)config.make
|
||||
sed 's/#.*$$//' $< | while read conf versions; do \
|
||||
test -n "$$versions" || continue; \
|
||||
case '$(config-machine)-$(config-vendor)-$(config-os)' in $$conf)\
|
||||
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=./"; \
|
||||
fi; \
|
||||
done ;; esac; done > $@T; exit 0
|
||||
(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)\
|
||||
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=./"; \
|
||||
fi; \
|
||||
done ;; esac; done; \
|
||||
done;) > $@T; exit 0
|
||||
mv -f $@T $@
|
||||
|
||||
# Get $(version) defined with the release version number.
|
||||
|
||||
@@ -54,7 +54,7 @@ endif
|
||||
subdirs = csu assert ctype db locale intl catgets math setjmp signal stdlib \
|
||||
stdio-common $(stdio) malloc string wcsmbs time dirent grp pwd\
|
||||
posix io termios resource misc login socket sysvipc gmon gnulib \
|
||||
wctype manual $(sysdep-subdirs) nss elf po $(add-ons)
|
||||
wctype manual shadow crypt $(sysdep-subdirs) nss elf po $(add-ons)
|
||||
export subdirs := $(subdirs) # Benign, useless in GNU make before 3.63.
|
||||
|
||||
# The mach and hurd subdirectories have many generated header files which
|
||||
@@ -78,13 +78,13 @@ subdirs := $(filter mach,$(subdirs)) $(filter hurd,$(subdirs)) \
|
||||
tests subdir_lint.out \
|
||||
subdir_distinfo \
|
||||
subdir_echo-headers subdir_echo-distinfo \
|
||||
subdir_install $(addprefix install-, \
|
||||
no-libc.a bin lib \
|
||||
data headers others)
|
||||
subdir_install \
|
||||
$(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
|
||||
aux = sysdep $(libc-init) version
|
||||
before-compile = $(objpfx)version-info.h
|
||||
|
||||
echo-headers: subdir_echo-headers
|
||||
|
||||
@@ -115,16 +115,25 @@ ifeq (yes,$(build-shared))
|
||||
lib: $(common-objpfx)libc.so
|
||||
endif
|
||||
|
||||
$(objpfx)sysd-dirs: $(+sysdir_pfx)config.make
|
||||
(echo define sysdep-subdirs; \
|
||||
for dir in $(sysdirs); do \
|
||||
if [ -r $(sysdep_dir)/$$dir/Subdirs ]; then \
|
||||
sed 's/#.*$$//' $(sysdep_dir)/$$dir/Subdirs; \
|
||||
else true; \
|
||||
fi; \
|
||||
done; \
|
||||
all-Subdirs-files = $(wildcard $(addsuffix /Subdirs, $(config-sysdirs)))
|
||||
$(objpfx)sysd-dirs: $(+sysdir_pfx)config.make $(all-Subdirs-files)
|
||||
(echo define sysdep-subdirs; \
|
||||
sed 's/#.*$$//' $(all-Subdirs-files) /dev/null; \
|
||||
echo endef) > $@-tmp
|
||||
mv -f $@-tmp $@
|
||||
mv -f $@-tmp $@
|
||||
|
||||
all-Banner-files = $(wildcard $(addsuffix /Banner, $(subdirs)))
|
||||
$(objpfx)version-info.h: $(+sysdir_pfx)config.make $(all-Banner-files)
|
||||
(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 $@
|
||||
|
||||
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.
|
||||
@@ -231,12 +240,12 @@ 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 \
|
||||
munch-tmpl.c munch.awk \
|
||||
autolock.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
|
||||
|
||||
distribute := $(strip $(distribute))
|
||||
generated := $(generated) stubs.h
|
||||
generated := $(generated) stubs.h version-info.h
|
||||
|
||||
README: README.template version.c ; # Make-dist should update README.
|
||||
|
||||
|
||||
@@ -25,6 +25,13 @@ ifneq (,)
|
||||
This makefile requires GNU Make.
|
||||
endif
|
||||
|
||||
REQUIRED_MAKE_VERSION = 3.74
|
||||
|
||||
ifneq ($(REQUIRED_MAKE_VERSION), \
|
||||
$(firstword $(sort $(MAKE_VERSION) $(REQUIRED_MAKE_VERSION))))
|
||||
Wrong GNU Make version. See above for the version needed.
|
||||
endif
|
||||
|
||||
|
||||
ifdef subdir
|
||||
.. := ../
|
||||
@@ -49,13 +56,13 @@ include $(..)Makeconfig
|
||||
endif
|
||||
|
||||
# `configure' writes a definition of `config-sysdirs' in `config.make'.
|
||||
sysdirs = $(config-sysdirs)
|
||||
sysdirs = $(strip $(full-config-sysdirs))
|
||||
|
||||
+sysdir_pfx = $(common-objpfx)
|
||||
|
||||
export sysdirs := $(sysdirs)
|
||||
|
||||
+sysdep_dirs := $(addprefix $(sysdep_dir)/,$(sysdirs))
|
||||
+sysdep_dirs := $(full-config-sysdirs)
|
||||
ifdef objdir
|
||||
+sysdep_dirs := $(objdir) $(+sysdep_dirs)
|
||||
endif
|
||||
@@ -78,9 +85,8 @@ endif
|
||||
# This is here so things in sysdep Makefiles can easily depend on foo.h as
|
||||
# appropriate and not worry about where foo.h comes from, which may be
|
||||
# system dependent and not known by that Makefile.
|
||||
vpath %.h $(subst $(empty) ,:,$(strip $(common-objpfx) \
|
||||
$(addprefix $(sysdep_dir)/,$(sysdirs)) \
|
||||
$(..)))
|
||||
vpath %.h $(subst $(empty) ,:,$(strip $(common-objpfx) $(objpfx) \
|
||||
$(+sysdep_dirs) $(..)))
|
||||
|
||||
# Some sysdep makefiles use this to distinguish being included here from
|
||||
# being included individually by a subdir makefile (hurd/Makefile needs this).
|
||||
@@ -88,18 +94,21 @@ in-Makerules := yes
|
||||
|
||||
ifndef avoid-generated
|
||||
-include $(+sysdir_pfx)sysd-Makefile
|
||||
ifneq ($(sysd-Makefile-sysdirs),$(sysdirs))
|
||||
ifneq ($(sysd-Makefile-sysdirs),$(config-sysdirs))
|
||||
sysd-Makefile-force = FORCE
|
||||
FORCE:
|
||||
endif
|
||||
$(+sysdir_pfx)sysd-Makefile: $(+sysdir_pfx)config.make $(..)Makerules \
|
||||
$(sysd-Makefile-force)
|
||||
-@rm -f $@T
|
||||
(echo 'sysd-Makefile-sysdirs := $(sysdirs)'; \
|
||||
for dir in $(sysdirs); do \
|
||||
file=sysdeps/$$dir/Makefile; \
|
||||
if [ -f $(..)$$file ]; then \
|
||||
echo include "\$$(..)$$file"; \
|
||||
(echo 'sysd-Makefile-sysdirs := $(config-sysdirs)'; \
|
||||
for dir in $(config-sysdirs); do \
|
||||
file=$$dir/Makefile; \
|
||||
if [ -f $$file ]; then \
|
||||
case $$dir in \
|
||||
/*) echo include "$$file" ;; \
|
||||
*) echo include "\$$(..)$$file" ;; \
|
||||
esac; \
|
||||
else true; fi; \
|
||||
done; \
|
||||
echo 'sysd-Makefile-done=t') > $@T
|
||||
@@ -143,9 +152,9 @@ endif
|
||||
# have source in .s files, and thus do not in fact need a .d file.
|
||||
# So we must define rules to make .d files for .s files.
|
||||
define make-dummy-dep
|
||||
$(addprefix ln $(objpfx)dummy.d ,$(filter-out $(wildcard $@),$@))
|
||||
$(addprefix ln $(common-objpfx)dummy.d ,$(filter-out $(wildcard $@),$@))
|
||||
endef
|
||||
$(objpfx)dummy.d:
|
||||
$(common-objpfx)dummy.d:
|
||||
echo '# .s files cannot contain includes, so they need no deps.' > $@
|
||||
|
||||
# It matters that this set of rules, for compiling from sources in
|
||||
@@ -162,7 +171,7 @@ $(objpfx)%.o: %.s $(before-compile); $(compile-command.s)
|
||||
$(objpfx)%.so: %.s $(before-compile); $(compile-command.s)
|
||||
$(objpfx)%.po: %.s $(before-compile); $(compile-command.s)
|
||||
$(objpfx)%.go: %.s $(before-compile); $(compile-command.s)
|
||||
$(objpfx)%.d: %.s $(objpfx)dummy.d; $(make-dummy-dep)
|
||||
$(objpfx)%.d: %.s $(common-objpfx)dummy.d; $(make-dummy-dep)
|
||||
$(objpfx)%.o: %.c $(before-compile); $(compile-command.c)
|
||||
$(objpfx)%.so: %.c $(before-compile); $(compile-command.c)
|
||||
$(objpfx)%.po: %.c $(before-compile); $(compile-command.c)
|
||||
@@ -183,7 +192,7 @@ $(objpfx)%.o: $(objpfx)%.s $(before-compile); $(compile-command.s)
|
||||
$(objpfx)%.so: $(objpfx)%.s $(before-compile); $(compile-command.s)
|
||||
$(objpfx)%.po: $(objpfx)%.s $(before-compile); $(compile-command.s)
|
||||
$(objpfx)%.go: $(objpfx)%.s $(before-compile); $(compile-command.s)
|
||||
$(objpfx)%.d: $(objpfx)%.s $(objpfx)dummy.d; $(make-dummy-dep)
|
||||
$(objpfx)%.d: $(objpfx)%.s $(common-objpfx)dummy.d; $(make-dummy-dep)
|
||||
$(objpfx)%.o: $(objpfx)%.c $(before-compile); $(compile-command.c)
|
||||
$(objpfx)%.so: $(objpfx)%.c $(before-compile); $(compile-command.c)
|
||||
$(objpfx)%.po: $(objpfx)%.c $(before-compile); $(compile-command.c)
|
||||
@@ -206,8 +215,8 @@ endif
|
||||
# contents of sysd-rules.
|
||||
ifdef sysd-Makefile-done
|
||||
-include $(+sysdir_pfx)sysd-rules
|
||||
ifneq ($(sysd-rules-sysdirs),$(sysdirs))
|
||||
# The value of $(sysdirs) the sysd-rules was computed for
|
||||
ifneq ($(sysd-rules-sysdirs),$(config-sysdirs))
|
||||
# The value of $(+sysdep_dirs) the sysd-rules was computed for
|
||||
# differs from the one we are using now. So force a rebuild of sysd-rules.
|
||||
sysd-rules-force = FORCE
|
||||
FORCE:
|
||||
@@ -215,12 +224,15 @@ endif
|
||||
endif
|
||||
$(+sysdir_pfx)sysd-rules: $(+sysdir_pfx)config.make $(..)Makerules \
|
||||
$(wildcard $(foreach dir,$(sysdirs),\
|
||||
$(sysdep_dir)/$(dir)/Makefile))\
|
||||
$(dir)/Makefile))\
|
||||
$(sysd-rules-force)
|
||||
-@rm -f $@T
|
||||
(echo 'sysd-rules-sysdirs := $(sysdirs)'; \
|
||||
for sysdir in $(sysdirs); do \
|
||||
dir="\$$(sysdep_dir)/$$sysdir"; \
|
||||
(echo 'sysd-rules-sysdirs := $(config-sysdirs)'; \
|
||||
for sysdir in $(config-sysdirs); do \
|
||||
case $$sysdir in \
|
||||
/*) dir=$$sysdir ;; \
|
||||
*) dir="\$$(..)$$sysdir" ;; \
|
||||
esac; \
|
||||
for o in $(object-suffixes); do \
|
||||
$(open-check-inhibit-asm) \
|
||||
echo "\$$(objpfx)%$$o: $$dir/%.S \$$(before-compile); \
|
||||
@@ -232,7 +244,7 @@ $(+sysdir_pfx)sysd-rules: $(+sysdir_pfx)config.make $(..)Makerules \
|
||||
\$$(compile-command.c)"; \
|
||||
done; \
|
||||
$(open-check-inhibit-asm) \
|
||||
echo "\$$(objpfx)%.d: $$dir/%.s \$$(objpfx)dummy.d; \
|
||||
echo "\$$(objpfx)%.d: $$dir/%.s \$$(common-objpfx)dummy.d; \
|
||||
\$$(make-dummy-dep)"; \
|
||||
echo "\$$(objpfx)%.d: $$dir/%.S \$$(before-compile); \
|
||||
\$$(+make-deps)"; \
|
||||
@@ -272,6 +284,7 @@ OUTPUT_OPTION = -o $@
|
||||
|
||||
S-CPPFLAGS = $(asm-CPPFLAGS)
|
||||
define +make-deps
|
||||
$(make-target-directory)
|
||||
-@rm -f $@
|
||||
$(+mkdep) $< $(CPPFLAGS) $($(<:$*.%=%)-CPPFLAGS) | \
|
||||
sed -e 's,$(subst .,\.,$*)\.o,$(foreach o,$(object-suffixes),$(@:.d=$o)) $@,' \
|
||||
@@ -281,8 +294,8 @@ endef
|
||||
ifneq (,$(objpfx))
|
||||
# Continuation lines here are dangerous because they introduce spaces!
|
||||
define sed-remove-objpfx
|
||||
-e 's@ $(subst .,\.,$(subst @,\@,$(objpfx)))@ $$(objpfx)@g' \
|
||||
-e 's@^$(subst .,\.,$(subst @,\@,$(objpfx)))@$$(objpfx)@g'
|
||||
-e 's@ $(subst .,\.,$(subst @,\@,$(common-objpfx)))@ $$(common-objpfx)@g' \
|
||||
-e 's@^$(subst .,\.,$(subst @,\@,$(common-objpfx)))@$$(common-objpfx)@g'
|
||||
endef
|
||||
endif
|
||||
|
||||
@@ -303,6 +316,15 @@ else
|
||||
no-whole-archive =
|
||||
endif
|
||||
|
||||
interp-obj = $(common-objpfx)interp.so
|
||||
$(interp-obj): $(common-objpfx)%.so: $(..)%.c
|
||||
$(compile-command.c)
|
||||
common-generated += interp.so
|
||||
CFLAGS-interp.c = -D'RUNTIME_LINKER="$(slibdir)/$(rtld-installed-name)"'
|
||||
|
||||
$(common-objpfx)libc.so: $(interp-obj)
|
||||
$(patsubst %,$(objpfx)%.so,$(extra-libs)): $(interp-obj)
|
||||
|
||||
define build-shlib
|
||||
$(LINK.o) -shared -o $@ $(sysdep-LDFLAGS) $(config-LDFLAGS) \
|
||||
-B$(csu-objpfx) \
|
||||
@@ -320,7 +342,7 @@ LDFLAGS-c.so = -nostdlib -nostartfiles
|
||||
# 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 := $(firstword $(objdir) $(patsubst ../$(subdir),.,$(..)elf))
|
||||
elfobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)elf)
|
||||
$(common-objpfx)libc.so: $(elfobjdir)/soinit.so \
|
||||
$(common-objpfx)libc_pic.a \
|
||||
$(elfobjdir)/sofini.so $(elfobjdir)/ld.so
|
||||
@@ -333,6 +355,15 @@ $(common-objpfx)libc.so$(libc.so-version): $(common-objpfx)libc.so
|
||||
endif
|
||||
endif
|
||||
|
||||
# Some files must not be compiled with the exception handler mechanism
|
||||
# enabled (introduced in gcc-2.8). Use $(no-exceptions) in the
|
||||
# appropriate CFLAGS definition.
|
||||
ifeq ($(have-no-exceptions),yes)
|
||||
no-exceptions = -fno-exceptions
|
||||
else
|
||||
no-exceptions =
|
||||
endif
|
||||
|
||||
# Figure out the source filenames in this directory.
|
||||
|
||||
override sources := $(addsuffix .c,$(filter-out $(elided-routines),\
|
||||
@@ -427,6 +458,7 @@ ifndef objects
|
||||
# Create the stamp$o files to keep the parent makefile happy.
|
||||
subdir_lib: $(foreach o,$(object-suffixes),$(objpfx)stamp$o-$(subdir))
|
||||
$(foreach o,$(object-suffixes),$(objpfx)stamp$o-$(subdir)):
|
||||
$(make-target-directory)
|
||||
rm -f $@; > $@
|
||||
else
|
||||
|
||||
@@ -454,17 +486,14 @@ endef
|
||||
object-suffixes-left := $(object-suffixes)
|
||||
include $(o-iterator)
|
||||
define do-ar
|
||||
$(patsubst %,cd %;,$(objdir)) \
|
||||
$(AR) cru$(verbose) ${O%-lib} \
|
||||
$(patsubst $(objpfx)%,%,$^)
|
||||
topdir=`cd $(..).; pwd`; \
|
||||
$(patsubst %/,cd %;,$(objpfx)) \
|
||||
$$topdir/autolock.sh ${O%-lib}.lck $(AR) cru$(verbose) ${O%-lib} \
|
||||
$(patsubst $(objpfx)%,%,$^)
|
||||
rm -f $@
|
||||
touch $@
|
||||
endef
|
||||
ifdef subdir
|
||||
O%-lib = $(filter ../,$(firstword $(objdir) ../))$(patsubst %,$(libtype$*),c)
|
||||
else
|
||||
O%-lib = $(patsubst %,$(libtype$*),c)
|
||||
endif
|
||||
O%-lib = $(..)$(patsubst %,$(libtype$*),c)
|
||||
|
||||
endif
|
||||
|
||||
@@ -474,11 +503,12 @@ 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); \
|
||||
$$(RANLIB) $$(common-objpfx)$$(patsubst %,$$(libtype$o),c)
|
||||
$$(..)./autolock.sh \
|
||||
$$(common-objpfx)$$(patsubst %,$$(libtype$o),c).lck \
|
||||
$$(RANLIB) $$(common-objpfx)$$(patsubst %,$$(libtype$o),c)
|
||||
endef
|
||||
ifndef subdir
|
||||
subdirs-stamps := $(foreach d,$(subdirs),\
|
||||
$(firstword $(objdir) $(subdir))/stamp%-$d)
|
||||
subdirs-stamps := $(foreach d,$(subdirs),$(common-objpfx)$d/stamp%-$d)
|
||||
subdirs-stamp-o = $(subst %,$o,$(subdirs-stamps))
|
||||
$(subdirs-stamps): subdir_lib;
|
||||
endif
|
||||
@@ -493,7 +523,7 @@ objects objs: $(foreach o,$(object-suffixes),$(o-objects)) \
|
||||
|
||||
# Canned sequence for building an extra library archive.
|
||||
define build-extra-lib
|
||||
$(patsubst %,cd %;,$(objdir)) \
|
||||
$(patsubst %/,cd %;,$(objpfx)) \
|
||||
$(AR) cru$(verbose) $(@:$(objpfx)%=%) \
|
||||
$(patsubst $(objpfx)%,%,$^)
|
||||
$(RANLIB) $@
|
||||
@@ -580,10 +610,10 @@ $(slibdir)/libc-$(version).so: $(common-objpfx)libc.so; $(do-install-program)
|
||||
install: $(slibdir)/libc.so$(libc.so-version)
|
||||
|
||||
ifndef subdir
|
||||
# What we install as libc.so for programs to link against is in fact an
|
||||
# archive. It contains the various $(static-only-routines) objects, and
|
||||
# the special object libc-syms.so that contains just the dynamic symbol
|
||||
# table of the shared libc object.
|
||||
# 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) \
|
||||
@@ -622,6 +652,7 @@ object-suffixes-left := $(versioned)
|
||||
include $(o-iterator)
|
||||
|
||||
|
||||
ifeq (,$($(subdir)-version))
|
||||
define o-iterator-doit
|
||||
$(libdir)/$o$($o-version): $(libdir)/$(o:.so=)-$(version).so; $$(make-link)
|
||||
endef
|
||||
@@ -633,6 +664,21 @@ $(libdir)/$(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)
|
||||
endef
|
||||
object-suffixes-left := $(versioned)
|
||||
include $(o-iterator)
|
||||
|
||||
define o-iterator-doit
|
||||
$(libdir)/$(o:.so=)-$($(subdir)-version).so: $(objpfx)$o;
|
||||
$$(do-install-program)
|
||||
endef
|
||||
object-suffixes-left := $(versioned)
|
||||
include $(o-iterator)
|
||||
endif
|
||||
endif
|
||||
|
||||
define do-install-so
|
||||
@@ -717,12 +763,7 @@ cd $(@D); $(BUILD_CC) $(BUILD_CFLAGS) $(<:$(common-objpfx)%=%) -o $(@F)
|
||||
endef
|
||||
|
||||
# We always want to use configuration definitions.
|
||||
ifdef objdir
|
||||
# This is always used in $(common-objdir), so we use no directory name.
|
||||
BUILD_CFLAGS = -include config.h
|
||||
else
|
||||
BUILD_CFLAGS = -include $(..)config.h
|
||||
endif
|
||||
BUILD_CFLAGS = -include $(common-objpfx)config.h
|
||||
|
||||
# Support the GNU standard name for this target.
|
||||
.PHONY: check
|
||||
@@ -754,7 +795,7 @@ common-mostlyclean:
|
||||
$(addsuffix .o,$(tests) $(others)) \
|
||||
$(addsuffix .out,$(tests)))
|
||||
-rm -f $(addprefix $(objpfx),$(extra-objs) $(install-lib))
|
||||
-rm -f core $(objpfx)stub-$(subdir)
|
||||
-rm -f core $(common-objpfx)stub-$(subdir)
|
||||
$(rmobjs)
|
||||
define rmobjs
|
||||
$(foreach o,$(object-suffixes),
|
||||
@@ -764,6 +805,7 @@ endef
|
||||
# Also remove the dependencies and generated source files.
|
||||
common-clean: common-mostlyclean
|
||||
-rm -f $(addprefix $(objpfx),$(generated)) $(+depfiles)
|
||||
-rm -f $(addprefix $(common-objpfx),$(common-generated))
|
||||
-rm -f $(common-objpfx)distinfo-$(subdir)
|
||||
|
||||
# Produce a file `stub-$(subdir)' which contains `#define __stub_FUNCTION'
|
||||
@@ -777,7 +819,7 @@ s = $(sysdep_dir)/stub
|
||||
$(common-objpfx)stub-$(subdir): $(+depfiles)
|
||||
# Use /dev/null since `...` might expand to empty.
|
||||
(s=`cd $s; /bin/pwd`; \
|
||||
$(patsubst %,cd %;,$(objdir)) \
|
||||
$(patsubst %/,cd %;,$(objpfx)) \
|
||||
sed -n 's/^stub_warning *(\([^)]*\).*$$/#define __stub_\1/p' \
|
||||
`sed -n 's@^.*$s/\([a-z0-9_-]*\.c\).*$$@'"$$s"/'\1@p' \
|
||||
$(patsubst $(objpfx)%,%,$^) /dev/null` \
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
GNU C Library NEWS -- history of user-visible changes. 24 June 1996
|
||||
GNU C Library NEWS -- history of user-visible changes. 25 August 1996
|
||||
|
||||
Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
|
||||
See the end for copying conditions.
|
||||
@@ -20,8 +20,8 @@ Version 2.0
|
||||
of many files which contained only symbol aliases, reducing the size of
|
||||
the source and the compiled library; many other files were renamed to
|
||||
less cryptic names previously occupied by the symbol alias files.
|
||||
There is a new header file <elf.h> and new library `-lelf' for
|
||||
programs which operate on files in the ELF format.
|
||||
There is a new header file <elf.h> for programs which operate on
|
||||
files in the ELF format.
|
||||
|
||||
* Converted to Autoconf version 2, so `configure' has more options.
|
||||
Run `configure --help' to see the details.
|
||||
@@ -104,7 +104,7 @@ 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.4-T3B release.
|
||||
* The resolver code has been updated from the BIND 4.9.5-T4B release.
|
||||
|
||||
* The new function `malloc_find_object_address' finds the starting address
|
||||
of a malloc'd block, given any address within the block;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Open jobs for finishing GNU libc:
|
||||
---------------------------------
|
||||
Status: July 1996
|
||||
Status: August 1996
|
||||
|
||||
If you have time and talent to take over any of the jobs below please
|
||||
contact <bug-glibc@prep.ai.mit.edu>
|
||||
@@ -32,41 +32,16 @@ contact <bug-glibc@prep.ai.mit.edu>
|
||||
Implementation idea: use some functions from bash.
|
||||
|
||||
|
||||
[ 5] Write reentrant versions of crypt() et.al.
|
||||
|
||||
Implementation idea: Define in <crypt.h>
|
||||
|
||||
struct crypt_data
|
||||
{
|
||||
<... all the needed data ...>
|
||||
};
|
||||
|
||||
and define additional functions
|
||||
|
||||
char *crypt_r (__const char *__key, __const char *__salt,
|
||||
struct crypt_data *__data);
|
||||
|
||||
void setkey_r (__const char *__key, struct crypt_data *__data);
|
||||
|
||||
void encrypt_r (char *__block, int __edflag,
|
||||
struct crypt_data *__data);
|
||||
|
||||
If possible the non-reentrant functions should use the reentrant
|
||||
ones.
|
||||
|
||||
Because of the US export restrictions it might be a good idea if
|
||||
some non-american person does this job.
|
||||
|
||||
|
||||
[ 6] Write `long double' versions of the math functions. This should be
|
||||
[ 5] Write `long double' versions of the math functions. This should be
|
||||
done in collaboration with the NetBSD and FreeBSD people.
|
||||
|
||||
The libm is in fact fdlibm (not the same as in Linux libc).
|
||||
|
||||
**** Partly done.
|
||||
**** Partly done. But we need someone with numerical experiences for
|
||||
the rest.
|
||||
|
||||
|
||||
[ 7] If you enjoy assembler programming (as I do --drepper :-) you might
|
||||
[ 6] If you enjoy assembler programming (as I do --drepper :-) you might
|
||||
be interested in writing optimized versions for some functions.
|
||||
Especially the string handling functions can be optimized a lot.
|
||||
|
||||
@@ -77,23 +52,25 @@ contact <bug-glibc@prep.ai.mit.edu>
|
||||
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.
|
||||
|
||||
|
||||
[ 8] Write nftw() function. Perhaps it might be good to reimplement the
|
||||
[ 7] Write nftw() function. Perhaps it might be good to reimplement the
|
||||
ftw() function as well to share most of the code.
|
||||
|
||||
**** Almost done!
|
||||
|
||||
|
||||
[ 9] Write AVL-tree based tsearch() et.al. functions. Currently only
|
||||
[ 8] Write AVL-tree based tsearch() et.al. functions. Currently only
|
||||
a very simple algorithm is used.
|
||||
There is a public domain version but using this would cause problems
|
||||
with the assignment.
|
||||
|
||||
[10] Extend regex and/or rx to work with wide characters.
|
||||
[ 9] Extend regex and/or rx to work with wide characters.
|
||||
|
||||
|
||||
[11] Add mmap() support to malloc().
|
||||
[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
|
||||
@@ -102,14 +79,10 @@ contact <bug-glibc@prep.ai.mit.edu>
|
||||
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.
|
||||
|
||||
[12] Implement shadow password handling. There exist some but I don't
|
||||
know of any falling under LGPL and where the author is willing to
|
||||
contribute it to the FSF.
|
||||
|
||||
|
||||
[13] Write access function for shadow, netmasks, bootparams, netgroup,
|
||||
publickey, automount, aliases databases for nss_files and nss_db
|
||||
module.
|
||||
[11] Write access function for netmasks, bootparams, publickey, automount,
|
||||
and aliases 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.
|
||||
|
||||
@@ -1,22 +1,29 @@
|
||||
This directory contains the version 1.93 test release of the GNU C Library.
|
||||
This directory contains the version 1.94 test release of the GNU C Library.
|
||||
Many bugs have been fixed since the last release.
|
||||
Some bugs surely remain.
|
||||
|
||||
As of this release, the GNU C library has been ported to the following
|
||||
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
|
||||
|
||||
|
||||
Former releases of this library (version 1.09.1 and perhaps earlier
|
||||
versions) used to run on the following configurations:
|
||||
|
||||
alpha-dec-osf1
|
||||
i[345]86-*-bsd4.3
|
||||
i[345]86-*-gnu
|
||||
i[345]86-*-isc2.2
|
||||
i[345]86-*-isc3
|
||||
i[345]86-*-linux
|
||||
i[345]86-*-sco3.2
|
||||
i[345]86-*-sco3.2v4
|
||||
i[345]86-*-sysv
|
||||
i[345]86-*-sysv4
|
||||
i[345]86-force_cpu386-none
|
||||
i[345]86-sequent-bsd
|
||||
i[3456]86-*-bsd4.3
|
||||
i[3456]86-*-isc2.2
|
||||
i[3456]86-*-isc3
|
||||
i[3456]86-*-sco3.2
|
||||
i[3456]86-*-sco3.2v4
|
||||
i[3456]86-*-sysv
|
||||
i[3456]86-*-sysv4
|
||||
i[3456]86-force_cpu386-none
|
||||
i[3456]86-sequent-bsd
|
||||
i960-nindy960-none
|
||||
m68k-hp-bsd4.3
|
||||
m68k-mvme135-none
|
||||
@@ -29,8 +36,9 @@ configurations:
|
||||
sparc-sun-solaris2
|
||||
sparc-sun-sunos4
|
||||
|
||||
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
|
||||
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.
|
||||
|
||||
The GNU C library now includes Michael Glad's Ultra Fast Crypt, which
|
||||
@@ -38,7 +46,7 @@ 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.93-crypt.tar.gz'. You can just unpack the crypt
|
||||
called `glibc-1.94-crypt.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
|
||||
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
The following functions for the `long double' versions of the libm
|
||||
function have to be written:
|
||||
|
||||
e_acosl.c
|
||||
e_asinl.c
|
||||
e_atan2l.c
|
||||
e_expl.c
|
||||
e_fmodl.c
|
||||
e_hypotl.c
|
||||
e_j0l.c
|
||||
e_j1l.c
|
||||
e_jnl.c
|
||||
e_lgammal_r.c
|
||||
e_logl.c
|
||||
e_log10l.c
|
||||
e_powl.c
|
||||
e_rem_pio2l.c
|
||||
e_sinhl.c
|
||||
e_sqrtl.c
|
||||
|
||||
k_cosl.c
|
||||
k_rem_pio2l.c
|
||||
k_sinl.c
|
||||
k_tanl.c
|
||||
|
||||
s_atanl.c
|
||||
s_erfl.c
|
||||
s_expm1l.c
|
||||
s_log1pl.c
|
||||
+22
-14
@@ -2,21 +2,28 @@ This directory contains the version VERSION test release of the GNU C Library.
|
||||
Many bugs have been fixed since the last release.
|
||||
Some bugs surely remain.
|
||||
|
||||
As of this release, the GNU C library has been ported to the following
|
||||
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
|
||||
|
||||
|
||||
Former releases of this library (version 1.09.1 and perhaps earlier
|
||||
versions) used to run on the following configurations:
|
||||
|
||||
alpha-dec-osf1
|
||||
i[345]86-*-bsd4.3
|
||||
i[345]86-*-gnu
|
||||
i[345]86-*-isc2.2
|
||||
i[345]86-*-isc3
|
||||
i[345]86-*-linux
|
||||
i[345]86-*-sco3.2
|
||||
i[345]86-*-sco3.2v4
|
||||
i[345]86-*-sysv
|
||||
i[345]86-*-sysv4
|
||||
i[345]86-force_cpu386-none
|
||||
i[345]86-sequent-bsd
|
||||
i[3456]86-*-bsd4.3
|
||||
i[3456]86-*-isc2.2
|
||||
i[3456]86-*-isc3
|
||||
i[3456]86-*-sco3.2
|
||||
i[3456]86-*-sco3.2v4
|
||||
i[3456]86-*-sysv
|
||||
i[3456]86-*-sysv4
|
||||
i[3456]86-force_cpu386-none
|
||||
i[3456]86-sequent-bsd
|
||||
i960-nindy960-none
|
||||
m68k-hp-bsd4.3
|
||||
m68k-mvme135-none
|
||||
@@ -29,8 +36,9 @@ configurations:
|
||||
sparc-sun-solaris2
|
||||
sparc-sun-sunos4
|
||||
|
||||
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
|
||||
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.
|
||||
|
||||
The GNU C library now includes Michael Glad's Ultra Fast Crypt, which
|
||||
|
||||
@@ -49,6 +49,10 @@ ifneq "$(findstring env,$(origin generated))" ""
|
||||
generated :=
|
||||
endif
|
||||
|
||||
ifneq "$(findstring env,$(origin common-generated))" ""
|
||||
common-generated :=
|
||||
endif
|
||||
|
||||
ifeq "$(strip $(headers))" ""
|
||||
ifneq "$(wildcard $(subdir).h)" ""
|
||||
override headers := $(subdir).h
|
||||
@@ -62,16 +66,16 @@ subdir_lib: lib-noranlib
|
||||
|
||||
# Some subdirs need to install a dummy library.
|
||||
# They can use "$(objpfx)libfnord.a: $(dep-dummy-lib); $(make-dummy-lib)".
|
||||
dep-dummy-lib = $(objpfx)dummy.o
|
||||
dep-dummy-lib = $(common-objpfx)dummy.o
|
||||
define make-dummy-lib
|
||||
$(AR) cr$(verbose) $@ $<
|
||||
endef
|
||||
$(objpfx)dummy.c:
|
||||
$(common-objpfx)dummy.c:
|
||||
rm -f $@
|
||||
echo 'void __dummy__ () { }' > $@
|
||||
$(objpfx)empty.c:
|
||||
$(common-objpfx)empty.c:
|
||||
cp -f /dev/null $@
|
||||
generated := $(generated) dummy.o dummy.c empty.c empty.o
|
||||
common-generated := $(common-generated) dummy.o dummy.c empty.c empty.o
|
||||
|
||||
# This makes all the auxilliary and test programs.
|
||||
|
||||
@@ -85,7 +89,8 @@ endif
|
||||
|
||||
ifneq "$(strip $(others) $(tests))" ""
|
||||
$(addprefix $(objpfx),$(others) $(tests)): %: %.o \
|
||||
$(sort $(filter $(common-objpfx)libc%,$(link-libc)))
|
||||
$(sort $(filter $(common-objpfx)libc%,$(link-libc))) \
|
||||
$(addprefix $(csu-objpfx),start.o) $(+preinit) $(+postinit)
|
||||
$(+link)
|
||||
endif
|
||||
|
||||
@@ -117,7 +122,7 @@ subdir_echo-headers: echo-headers
|
||||
.PHONY: subdir_echo-distinfo
|
||||
subdir_echo-distinfo:
|
||||
@echo $(addprefix +header+,$(headers)) \
|
||||
$(addprefix +nodist+,$(generated) $(dont_distribute))
|
||||
$(addprefix +nodist+,$(generated) $(common-generated) $(dont_distribute))
|
||||
|
||||
# We want to install everything except the library itself, but update all
|
||||
# our portions of the library because the parent make will install it later
|
||||
@@ -131,7 +136,8 @@ subdir_dist: dist
|
||||
|
||||
# Convenient target to update all the generated source files.
|
||||
.PHONY: generated
|
||||
generated: $(addprefix $(objpfx),$(generated))
|
||||
generated: $(addprefix $(common-objpfx),$(common-generated)) \
|
||||
$(addprefix $(objpfx),$(generated))
|
||||
|
||||
ifndef libc.so-version
|
||||
# Undefine this because it can't work when we libc.so is unversioned.
|
||||
@@ -141,7 +147,7 @@ endif
|
||||
ifdef static-only-routines
|
||||
# These routines are to be omitted from the shared library object,
|
||||
# so we replace the PIC objects for them with the empty object file.
|
||||
$(static-only-routines:%=$(objpfx)%.so): %.so: $(objpfx)empty.o
|
||||
$(static-only-routines:%=$(objpfx)%.so): %.so: $(common-objpfx)empty.o
|
||||
rm -f $@
|
||||
ln $< $@
|
||||
endif
|
||||
|
||||
Executable
+45
@@ -0,0 +1,45 @@
|
||||
#! /bin/sh
|
||||
# interlock - wrap program invocation in lock to allow
|
||||
# parallel builds to work.
|
||||
# Written by Tom Tromey <tromey@cygnus.com>, Aug 10 1996
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# Usage:
|
||||
# interlock lock-dir-name program args-to-program...
|
||||
|
||||
dirname="$1"
|
||||
program="$2"
|
||||
|
||||
shift
|
||||
shift
|
||||
|
||||
while (mkdir $dirname > /dev/null 2>&1 && exit 1 || exit 0); do
|
||||
# Wait a bit.
|
||||
sleep 1
|
||||
done
|
||||
|
||||
# Race condition here: if interrupted after the loop but before this
|
||||
# trap, the lock can be left around.
|
||||
trap "rmdir $dirname > /dev/null 2>&1" 1 2 3 15
|
||||
|
||||
# We have the lock, so run the program.
|
||||
$program ${1+"$@"}
|
||||
ret=$?
|
||||
|
||||
# Release the lock.
|
||||
rmdir $dirname > /dev/null 2>&1
|
||||
|
||||
exit $ret
|
||||
+1
-1
@@ -48,7 +48,7 @@ $(objpfx)lib$(config-vendor).a: $(bare-routines:%=$(objpfx)%.o)
|
||||
# from scratch each time.
|
||||
rm -f $@
|
||||
ifdef objdir
|
||||
cd $(objdir); $(AR) cq$(verbose) $@ $(^:$(objpfx)%=%)
|
||||
cd $(objpfx); $(AR) cq$(verbose) $(@:$(objpfx)%=%) $(^:$(objpfx)%=%)
|
||||
else
|
||||
$(AR) cq$(verbose) $@ $^
|
||||
endif
|
||||
|
||||
+6
-6
@@ -34,14 +34,14 @@ catopen (const char *cat_name, int flag)
|
||||
__nl_catd result;
|
||||
const char *env_var;
|
||||
|
||||
result = (__nl_catd) malloc (sizeof (__nl_catd));
|
||||
result = (__nl_catd) malloc (sizeof (*result));
|
||||
if (result == NULL)
|
||||
/* We cannot get enough memory. */
|
||||
return (nl_catd) -1;
|
||||
|
||||
result->status = closed;
|
||||
|
||||
result->cat_name = strdup (cat_name);
|
||||
result->cat_name = __strdup (cat_name);
|
||||
if (result->cat_name == NULL)
|
||||
{
|
||||
free (result);
|
||||
@@ -71,7 +71,7 @@ catopen (const char *cat_name, int flag)
|
||||
env_var = "C";
|
||||
}
|
||||
|
||||
result->env_var = strdup (env_var);
|
||||
result->env_var = __strdup (env_var);
|
||||
if (result->env_var == NULL)
|
||||
{
|
||||
free ((void *) result->cat_name);
|
||||
@@ -79,10 +79,10 @@ catopen (const char *cat_name, int flag)
|
||||
return (nl_catd) -1;
|
||||
}
|
||||
|
||||
if (getenv ("NLSPATH") != NULL)
|
||||
result->nlspath = strdup (getenv ("NLSPATH"));
|
||||
if (__secure_getenv ("NLSPATH") != NULL)
|
||||
result->nlspath = __strdup (getenv ("NLSPATH"));
|
||||
else
|
||||
result->nlspath = strdup (NLSPATH);
|
||||
result->nlspath = __strdup (NLSPATH);
|
||||
|
||||
if (result->nlspath == NULL)
|
||||
{
|
||||
|
||||
+14
-4
@@ -165,8 +165,14 @@ main (int argc, char *argv[])
|
||||
/* Version information is requested. */
|
||||
if (do_version)
|
||||
{
|
||||
fprintf (stderr, "%s - GNU %s %s\n", program_invocation_name,
|
||||
"libc", VERSION);
|
||||
printf ("gencat (GNU %s) %s\n", PACKAGE, VERSION);
|
||||
printf (_("\
|
||||
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");
|
||||
printf (_("Written by %s.\n"), "Ulrich Drepper");
|
||||
|
||||
exit (EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
@@ -202,7 +208,8 @@ usage (int status)
|
||||
fprintf (stderr, gettext ("Try `%s --help' for more information.\n"),
|
||||
program_invocation_name);
|
||||
else
|
||||
printf(gettext ("\
|
||||
{
|
||||
printf (gettext ("\
|
||||
Usage: %s [OPTION]... -o OUTPUT-FILE [INPUT-FILE]...\n\
|
||||
%s [OPTION]... [OUTPUT-FILE [INPUT-FILE]...]\n\
|
||||
Mandatory arguments to long options are mandatory for short options too.\n\
|
||||
@@ -213,7 +220,10 @@ Mandatory arguments to long options are mandatory for short options too.\n\
|
||||
-V, --version output version information and exit\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);
|
||||
program_invocation_name, program_invocation_name);
|
||||
fputs (gettext ("Report bugs to <bug-glibc@prep.ai.mit.edu>.\n"),
|
||||
stdout);
|
||||
}
|
||||
|
||||
exit (status);
|
||||
}
|
||||
|
||||
+10
-10
@@ -79,12 +79,12 @@ __open_catalog (__nl_catd catalog, int with_path)
|
||||
case 'N':
|
||||
/* Use the catalog name. */
|
||||
ENOUGH (strlen (catalog->cat_name));
|
||||
bufact = stpcpy (&buf[bufact], catalog->cat_name) - buf;
|
||||
bufact = __stpcpy (&buf[bufact], catalog->cat_name) - buf;
|
||||
break;
|
||||
case 'L':
|
||||
/* Use the current locale category value. */
|
||||
ENOUGH (strlen (catalog->env_var));
|
||||
bufact = stpcpy (&buf[bufact], catalog->env_var) - buf;
|
||||
bufact = __stpcpy (&buf[bufact], catalog->env_var) - buf;
|
||||
break;
|
||||
case 'l':
|
||||
/* Use language element of locale category value. */
|
||||
@@ -152,7 +152,7 @@ __open_catalog (__nl_catd catalog, int with_path)
|
||||
|
||||
if (bufact != 0)
|
||||
{
|
||||
fd = open (buf, O_RDONLY);
|
||||
fd = __open (buf, O_RDONLY);
|
||||
if (fd >= 0)
|
||||
break;
|
||||
}
|
||||
@@ -161,7 +161,7 @@ __open_catalog (__nl_catd catalog, int with_path)
|
||||
}
|
||||
}
|
||||
|
||||
if (fd < 0 || fstat (fd, &st) < 0)
|
||||
if (fd < 0 || __fstat (fd, &st) < 0)
|
||||
{
|
||||
catalog->status = nonexisting;
|
||||
return;
|
||||
@@ -181,8 +181,8 @@ __open_catalog (__nl_catd catalog, int with_path)
|
||||
#endif
|
||||
catalog->file_size = st.st_size;
|
||||
catalog->file_ptr =
|
||||
(struct catalog_obj *) mmap (NULL, st.st_size, PROT_READ,
|
||||
MAP_FILE|MAP_COPY|MAP_INHERIT, fd, 0);
|
||||
(struct catalog_obj *) __mmap (NULL, st.st_size, PROT_READ,
|
||||
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;
|
||||
@@ -201,8 +201,8 @@ __open_catalog (__nl_catd catalog, int with_path)
|
||||
/* Save read, handle partial reads. */
|
||||
do
|
||||
{
|
||||
size_t now = read (fd, (((char *) &catalog->file_ptr)
|
||||
+ (st.st_size - todo)), todo);
|
||||
size_t now = __read (fd, (((char *) &catalog->file_ptr)
|
||||
+ (st.st_size - todo)), todo);
|
||||
if (now == 0)
|
||||
{
|
||||
free ((void *) catalog->file_ptr);
|
||||
@@ -216,7 +216,7 @@ __open_catalog (__nl_catd catalog, int with_path)
|
||||
}
|
||||
|
||||
/* We don't need the file anymore. */
|
||||
close (fd);
|
||||
__close (fd);
|
||||
|
||||
/* Determine whether the file is a catalog file and if yes whether
|
||||
it is written using the correct byte order. Else we have to swap
|
||||
@@ -230,7 +230,7 @@ __open_catalog (__nl_catd catalog, int with_path)
|
||||
/* Illegal file. Free he resources and mark catalog as not
|
||||
usable. */
|
||||
if (catalog->status == mmaped)
|
||||
munmap ((void *) catalog->file_ptr, catalog->file_size);
|
||||
__munmap ((void *) catalog->file_ptr, catalog->file_size);
|
||||
else
|
||||
free (catalog->file_ptr);
|
||||
catalog->status = nonexisting;
|
||||
|
||||
Vendored
+22
-22
@@ -81,7 +81,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit 0 ;;
|
||||
i86pc:SunOS:5.*:*)
|
||||
echo i386-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit 0 ;;
|
||||
sun4*:SunOS:6*:*)
|
||||
# According to config.sub, this is the proper way to canonicalize
|
||||
@@ -332,7 +332,7 @@ EOF
|
||||
echo m68k-hp-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
i[34]86:BSD/386:*:* | *:BSD/OS:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
|
||||
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*:FreeBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
|
||||
@@ -341,7 +341,7 @@ EOF
|
||||
echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
|
||||
exit 0 ;;
|
||||
i*:CYGWIN*:*)
|
||||
echo i386-unknown-cygwin32
|
||||
echo i386-pc-cygwin32
|
||||
exit 0 ;;
|
||||
p*:CYGWIN*:*)
|
||||
echo powerpcle-unknown-cygwin32
|
||||
@@ -357,26 +357,26 @@ EOF
|
||||
# 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
|
||||
echo "${UNAME_MACHINE}-unknown-linux" ; exit 0
|
||||
echo "${UNAME_MACHINE}-pc-linux-gnu" ; exit 0
|
||||
elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i[345]86linux"; then
|
||||
echo "${UNAME_MACHINE}-unknown-linuxaout" ; exit 0
|
||||
echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0
|
||||
elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i[345]86coff"; then
|
||||
echo "${UNAME_MACHINE}-unknown-linuxcoff" ; exit 0
|
||||
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" ; exit 0
|
||||
echo "${UNAME_MACHINE}-unknown-linux-gnu" ; exit 0
|
||||
elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68klinux"; then
|
||||
echo "${UNAME_MACHINE}-unknown-linuxaout" ; exit 0
|
||||
echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0
|
||||
elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: elf32ppc"; then
|
||||
echo "powerpc-unknown-linux" ; exit 0
|
||||
echo "powerpc-unknown-linux-gnu" ; exit 0
|
||||
elif test "${UNAME_MACHINE}" = "alpha" ; then
|
||||
echo alpha-unknown-linux ; exit 0
|
||||
echo alpha-unknown-linux-gnu ; exit 0
|
||||
elif test "${UNAME_MACHINE}" = "sparc" ; then
|
||||
echo sparc-unknown-linux ; exit 0
|
||||
echo sparc-unknown-linux-gnu ; exit 0
|
||||
else
|
||||
# Either a pre-BFD a.out linker (linuxoldld) or one that does not give us
|
||||
# useful --help. Gcc wants to distinguish between linuxoldld and linuxaout.
|
||||
# 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.
|
||||
test ! -d /usr/lib/ldscripts/. \
|
||||
&& echo "${UNAME_MACHINE}-unknown-linuxoldld" && exit 0
|
||||
&& echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
|
||||
# Determine whether the default compiler is a.out or elf
|
||||
cat >dummy.c <<EOF
|
||||
main(argc, argv)
|
||||
@@ -384,9 +384,9 @@ int argc;
|
||||
char *argv[];
|
||||
{
|
||||
#ifdef __ELF__
|
||||
printf ("%s-unknown-linux\n", argv[1]);
|
||||
printf ("%s-pc-linux-gnu\n", argv[1]);
|
||||
#else
|
||||
printf ("%s-unknown-linuxaout\n", argv[1]);
|
||||
printf ("%s-pc-linux-gnuaout\n", argv[1]);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
@@ -403,25 +403,25 @@ EOF
|
||||
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
|
||||
echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
|
||||
else
|
||||
echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}
|
||||
echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
|
||||
fi
|
||||
exit 0 ;;
|
||||
i[34]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}-unknown-isc$UNAME_REL
|
||||
echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
|
||||
elif /bin/uname -X 2>/dev/null >/dev/null ; then
|
||||
UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
|
||||
(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
|
||||
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
|
||||
&& UNAME_MACHINE=i586
|
||||
echo ${UNAME_MACHINE}-unknown-sco$UNAME_REL
|
||||
echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
|
||||
else
|
||||
echo ${UNAME_MACHINE}-unknown-sysv32
|
||||
echo ${UNAME_MACHINE}-pc-sysv32
|
||||
fi
|
||||
exit 0 ;;
|
||||
Intel:Mach:3*:*)
|
||||
echo i386-unknown-mach3
|
||||
echo i386-pc-mach3
|
||||
exit 0 ;;
|
||||
paragon:*:*:*)
|
||||
echo i860-intel-osf1
|
||||
@@ -547,7 +547,7 @@ main ()
|
||||
#endif
|
||||
|
||||
#if defined (__386BSD__)
|
||||
printf ("i386-unknown-bsd\n"); exit (0);
|
||||
printf ("i386-pc-bsd\n"); exit (0);
|
||||
#endif
|
||||
|
||||
#if defined (sequent)
|
||||
|
||||
+2
-1
@@ -13,12 +13,13 @@ config-vendor = @host_vendor@
|
||||
config-os = @host_os@
|
||||
config-sysdirs = @sysnames@
|
||||
|
||||
config-defines = @DEFS@
|
||||
defines = @DEFINES@
|
||||
|
||||
elf = @elf@
|
||||
have-initfini = @libc_cv_have_initfini@
|
||||
|
||||
have-no-whole-archive = @libc_cv_ld_no_whole_archive@
|
||||
have-no-exceptions = @libc_cv_gcc_no_exceptions@
|
||||
|
||||
# Configuration options.
|
||||
gnu-as = @gnu_as@
|
||||
|
||||
Vendored
+46
-22
@@ -41,6 +41,8 @@
|
||||
# The goal of this file is to map all the various variations of a given
|
||||
# machine specification into a single specification in the form:
|
||||
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
|
||||
# or in some cases, the newer four-part form:
|
||||
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
|
||||
# It is wrong to echo any other type of specification.
|
||||
|
||||
if [ x$1 = x ]
|
||||
@@ -62,11 +64,21 @@ case $1 in
|
||||
;;
|
||||
esac
|
||||
|
||||
# Separate what the user gave into CPU-COMPANY and OS (if any).
|
||||
basic_machine=`echo $1 | sed 's/-[^-]*$//'`
|
||||
if [ $basic_machine != $1 ]
|
||||
then os=`echo $1 | sed 's/.*-/-/'`
|
||||
else os=; fi
|
||||
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
|
||||
# Here we must recognize all the valid KERNEL-OS combinations.
|
||||
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
|
||||
case $maybe_os in
|
||||
linux-gnu*)
|
||||
os=-$maybe_os
|
||||
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
|
||||
;;
|
||||
*)
|
||||
basic_machine=`echo $1 | sed 's/-[^-]*$//'`
|
||||
if [ $basic_machine != $1 ]
|
||||
then os=`echo $1 | sed 's/.*-/-/'`
|
||||
else os=; fi
|
||||
;;
|
||||
esac
|
||||
|
||||
### Let's recognize common machines as not being operating systems so
|
||||
### that things like config.sub decstation-3100 work. We also
|
||||
@@ -91,33 +103,33 @@ case $os in
|
||||
;;
|
||||
-sco5)
|
||||
os=sco3.2v5
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-sco4)
|
||||
os=-sco3.2v4
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-sco3.2.[4-9]*)
|
||||
os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-sco3.2v[4-9]*)
|
||||
# Don't forget version if it is 3.2v4 or newer.
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-sco*)
|
||||
os=-sco3.2v2
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-isc)
|
||||
os=-isc2.2
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-clix*)
|
||||
basic_machine=clipper-intergraph
|
||||
;;
|
||||
-isc*)
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-lynx*)
|
||||
os=-lynxos
|
||||
@@ -137,7 +149,7 @@ esac
|
||||
case $basic_machine in
|
||||
# Recognize the basic CPU types without company name.
|
||||
# Some are omitted here because they have special meanings below.
|
||||
tahoe | i[3456]86 | i860 | m68k | m68000 | m88k | ns32k | arm \
|
||||
tahoe | i860 | m68k | m68000 | m88k | ns32k | arm \
|
||||
| arme[lb] | pyramid \
|
||||
| tron | a29k | 580 | i960 | h8300 | hppa1.0 | hppa1.1 \
|
||||
| alpha | we32k | ns16k | clipper | i370 | sh \
|
||||
@@ -146,6 +158,12 @@ case $basic_machine in
|
||||
| sparc | sparclet | sparclite | sparc64)
|
||||
basic_machine=$basic_machine-unknown
|
||||
;;
|
||||
# We use `pc' rather than `unknown'
|
||||
# because (1) that's what they normally are, and
|
||||
# (2) the word "unknown" tends to confuse beginning users.
|
||||
i[3456]86)
|
||||
basic_machine=$basic_machine-pc
|
||||
;;
|
||||
# Object if more than one company name word.
|
||||
*-*-*)
|
||||
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
|
||||
@@ -325,19 +343,19 @@ case $basic_machine in
|
||||
;;
|
||||
# I'm not sure what "Sysv32" means. Should this be sysv3.2?
|
||||
i[3456]86v32)
|
||||
basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
|
||||
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
||||
os=-sysv32
|
||||
;;
|
||||
i[3456]86v4*)
|
||||
basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
|
||||
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
||||
os=-sysv4
|
||||
;;
|
||||
i[3456]86v)
|
||||
basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
|
||||
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
||||
os=-sysv
|
||||
;;
|
||||
i[3456]86sol2)
|
||||
basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
|
||||
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
||||
os=-solaris2
|
||||
;;
|
||||
iris | iris4d)
|
||||
@@ -635,6 +653,8 @@ esac
|
||||
if [ x"$os" != x"" ]
|
||||
then
|
||||
case $os in
|
||||
# First match some system type aliases
|
||||
# that might get confused with valid system types.
|
||||
# -solaris* is a basic system type, with this one exception.
|
||||
-solaris1 | -solaris1.*)
|
||||
os=`echo $os | sed -e 's|solaris1|sunos4|'`
|
||||
@@ -646,7 +666,7 @@ case $os in
|
||||
os=-sysv4
|
||||
;;
|
||||
-gnu/linux*)
|
||||
os=`echo $os | sed -e 's|gnu/linux|linux|'`
|
||||
os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
|
||||
;;
|
||||
# First accept the basic system types.
|
||||
# The portable systems comes first.
|
||||
@@ -656,15 +676,19 @@ case $os in
|
||||
| -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
|
||||
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
|
||||
| -amigados* | -msdos* | -newsos* | -unicos* | -aof* | -aos* \
|
||||
| -nindy* | -vxworks* | -ebmon* | -hms* | -mvs* | -clix* \
|
||||
| -riscos* | -linux* | -uniplus* | -iris* | -rtu* | -xenix* \
|
||||
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
|
||||
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
|
||||
| -hiux* | -386bsd* | -netbsd* | -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*)
|
||||
| -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
|
||||
| -linux-gnu*)
|
||||
# Remember, each alternative MUST END IN *, to match a version number.
|
||||
;;
|
||||
-linux*)
|
||||
os=`echo $os | sed -e 's|linux|linux-gnu|'`
|
||||
;;
|
||||
-sunos5*)
|
||||
os=`echo $os | sed -e 's|sunos5|solaris2|'`
|
||||
;;
|
||||
@@ -883,7 +907,7 @@ case $basic_machine in
|
||||
-ptx*)
|
||||
vendor=sequent
|
||||
;;
|
||||
-vxworks*)
|
||||
-vxsim* | -vxworks*)
|
||||
vendor=wrs
|
||||
;;
|
||||
-aux*)
|
||||
|
||||
@@ -662,9 +662,9 @@ fi
|
||||
# Check whether --enable-add-ons or --disable-add-ons was given.
|
||||
if test "${enable_add_ons+set}" = set; then
|
||||
enableval="$enable_add_ons"
|
||||
add_ons=`echo "$enableval" | sed 's/
|
||||
add_ons=`echo "$enableval" | sed 's/,/ /g'`
|
||||
else
|
||||
/ /g'`
|
||||
add_ons=
|
||||
fi
|
||||
|
||||
ac_aux_dir=
|
||||
@@ -682,12 +682,19 @@ 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.
|
||||
|
||||
subdirs="$add_ons"
|
||||
|
||||
add_ons_pfx=
|
||||
if test x"$add_ons" != x; then
|
||||
for f in $add_ons; do
|
||||
add_ons_pfx="$add_ons_pfx $f/"
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
# Make sure we can run config.sub.
|
||||
@@ -710,9 +717,9 @@ NONE)
|
||||
esac
|
||||
|
||||
host=`$ac_config_sub $host_alias`
|
||||
host_cpu=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
|
||||
host_vendor=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
|
||||
host_os=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
|
||||
host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
|
||||
host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
|
||||
host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
|
||||
echo "$ac_t""$host" 1>&6
|
||||
|
||||
# We keep the original values in `$config_*' and never modify them, so we
|
||||
@@ -745,7 +752,7 @@ case "$machine" in
|
||||
a29k | am29000) base_machine=a29k machine=a29k ;;
|
||||
alpha*) base_machine=alpha machine=alpha/$machine ;;
|
||||
hppa*) base_machine=hppa machine=hppa/$machine ;;
|
||||
i[345]86) base_machine=i386 machine=i386/$machine ;;
|
||||
i[3456]86) base_machine=i386 machine=i386/$machine ;;
|
||||
m680?0) base_machine=m68k machine=m68k/$machine ;;
|
||||
m68k) base_machine=m68k machine=m68k/m68020 ;;
|
||||
m88???) base_machine=m88k machine=m88k/$machine ;;
|
||||
@@ -792,6 +799,11 @@ o=`echo $tail | sed 's/[0-9]*$//'`
|
||||
if test $o != $tail; then
|
||||
ostry="$ostry /$o"
|
||||
fi
|
||||
# For linux-gnu, try linux-gnu, then linux.
|
||||
o=`echo $tail | sed 's/-.*$//'`
|
||||
if test $o != $tail; then
|
||||
ostry="$ostry /$o"
|
||||
fi
|
||||
|
||||
# For unix/sysv/sysv4, try unix/sysv/sysv4, then unix/sysv, then unix.
|
||||
base=
|
||||
@@ -818,23 +830,34 @@ done
|
||||
|
||||
# Find what sysdep directories exist.
|
||||
sysnames=
|
||||
for b in $base ''; do
|
||||
for m0 in $mach ''; do
|
||||
for v in /$vendor ''; do
|
||||
for o in /$ostry ''; do
|
||||
for m in $mach ''; do
|
||||
try="$m0$b$v$o$m"
|
||||
test -n "$enable_debug_configure" && echo "$0 DEBUG: try $try" >&2
|
||||
if test -d $sysdep_dir$try; then
|
||||
sysnames="$sysnames $try"
|
||||
{ test -n "$o" || test -n "$b"; } && os_used=t
|
||||
{ test -n "$m" || test -n "$m0"; } && machine_used=t
|
||||
fi
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
|
||||
for d in $add_ons_pfx ''; do
|
||||
for b in $base ''; do
|
||||
for m0 in $mach ''; do
|
||||
for v in /$vendor ''; do
|
||||
for o in /$ostry ''; do
|
||||
for m in $mach ''; do
|
||||
if test "$m0$b$v$o$m"; then
|
||||
try="${d}sysdeps$m0$b$v$o$m"
|
||||
test -n "$enable_debug_configure" &&
|
||||
echo "$0 DEBUG: try $try" >&2
|
||||
case $try in
|
||||
/*) dest=$try ;;
|
||||
*) dest=$srcdir/$try ;;
|
||||
esac
|
||||
if test -d $dest; then
|
||||
sysnames="$sysnames $try"
|
||||
{ test -n "$o" || test -n "$b"; } && os_used=t
|
||||
{ test -n "$m" || test -n "$m0"; } && machine_used=t
|
||||
fi
|
||||
fi
|
||||
done
|
||||
done
|
||||
done
|
||||
done
|
||||
done
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
|
||||
if test -z "$os_used" && test "$os" != none; then
|
||||
{ echo "configure: error: Operating system $os is not supported." 1>&2; exit 1; }
|
||||
@@ -853,19 +876,21 @@ fi
|
||||
# machine (otherwise what's the point of an ABI?).
|
||||
if test "$elf" = yes; then
|
||||
elf_dirs=
|
||||
for m in $mach; do
|
||||
if test -d $sysdep_dir$m/elf; then
|
||||
elf_dirs="$elf_dirs $m/elf"
|
||||
fi
|
||||
for d in $add_ons_pfx ''; do
|
||||
case $d in
|
||||
/*) xsrcdir= ;;
|
||||
*) xsrcdir=$srcdir/ ;;
|
||||
esac
|
||||
for m in $mach; do
|
||||
if test -d $xsrcdir${d}sysdeps$m/elf; then
|
||||
elf_dirs="$elf_dirs ${d}sysdeps$m/elf"
|
||||
fi
|
||||
done
|
||||
done
|
||||
sysnames="`echo $elf_dirs | sed -e 's,^/,,' -e 's, /,,g'` $sysnames"
|
||||
sysnames="`echo $elf_dirs | sed -e 's,//,/,g'` $sysnames"
|
||||
fi
|
||||
|
||||
|
||||
# Remove the leading slashes.
|
||||
sysnames="`echo $sysnames | sed -e 's@^/@@' -e 's@ /@ @g'`"
|
||||
|
||||
|
||||
# Expand the list of system names into a full list of directories
|
||||
# from each element's parent name and Implies file (if present).
|
||||
set $sysnames
|
||||
@@ -882,13 +907,25 @@ while test $# -gt 0; do
|
||||
# Report each name as we discover it, so there is no long pause in output.
|
||||
echo $ac_n "$name $ac_c" >&6
|
||||
|
||||
if test -f $sysdep_dir/$name/Implies; then
|
||||
name_base=`echo $name | sed -e 's@\(.*sysdeps\)/.*@\1@'`
|
||||
|
||||
case $name in
|
||||
/*) xsrcdir= ;;
|
||||
*) xsrcdir=$srcdir/ ;;
|
||||
esac
|
||||
test -n "$enable_debug_configure" &&
|
||||
echo "DEBUG: name/Implies $xsrcdir$name/Implies" >&2
|
||||
|
||||
if test -f $xsrcdir$name/Implies; then
|
||||
# Collect more names from the `Implies' file (removing comments).
|
||||
implied="`sed 's/#.*$//' < $sysdep_dir/$name/Implies`"
|
||||
for x in $implied; do
|
||||
test -d $sysdep_dir/$x || {
|
||||
echo "configure: warning: sysdeps/$name/Implies specifies nonexistent $x" 1>&2
|
||||
}
|
||||
implied_candidate="`sed 's/#.*$//' < $xsrcdir$name/Implies`"
|
||||
implied=
|
||||
for x in $implied_candidate; do
|
||||
if test -d $xsrcdir$name_base/$x; then
|
||||
implied="$implied $name_base/$x";
|
||||
else
|
||||
echo "configure: warning: $name/Implies specifies nonexistent $x" 1>&2
|
||||
fi
|
||||
done
|
||||
else
|
||||
implied=
|
||||
@@ -898,7 +935,7 @@ while test $# -gt 0; do
|
||||
names="$names $name"
|
||||
|
||||
# Find the parent of NAME, using the empty string if it has none.
|
||||
parent="`echo $name | sed -n -e '/\//!q' -e 's=/[^/]*$==p'`"
|
||||
parent="`echo $name | sed -n -e 's=/[^/]*$==' -e '/sysdeps$/q' -e p`"
|
||||
|
||||
# Add the names implied by NAME, and NAME's parent (if it has one), to
|
||||
# the list of names to be processed (the argument list). We prepend the
|
||||
@@ -912,10 +949,10 @@ while test $# -gt 0; do
|
||||
done
|
||||
|
||||
# Add the default directories.
|
||||
sysnames="$names generic stub"
|
||||
sysnames="$names sysdeps/generic sysdeps/stub"
|
||||
|
||||
# The other names were emitted during the scan.
|
||||
echo "$ac_t""generic stub" 1>&6
|
||||
echo "$ac_t""sysdeps/generic sysdeps/stub" 1>&6
|
||||
|
||||
|
||||
### Locate tools.
|
||||
@@ -973,6 +1010,10 @@ 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}'
|
||||
@@ -1049,9 +1090,9 @@ NONE)
|
||||
esac
|
||||
|
||||
build=`$ac_config_sub $build_alias`
|
||||
build_cpu=`echo $build | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
|
||||
build_vendor=`echo $build | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
|
||||
build_os=`echo $build | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
|
||||
build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
|
||||
build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
|
||||
build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
|
||||
echo "$ac_t""$build" 1>&6
|
||||
|
||||
if test $host != $build; then
|
||||
@@ -1134,13 +1175,13 @@ else
|
||||
# On the NeXT, cc -E runs the code through the compiler's parser,
|
||||
# not just through cpp.
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1138 "configure"
|
||||
#line 1179 "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:1144: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:1185: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out`
|
||||
if test -z "$ac_err"; then
|
||||
:
|
||||
@@ -1149,13 +1190,13 @@ else
|
||||
rm -rf conftest*
|
||||
CPP="${CC-cc} -E -traditional-cpp"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1153 "configure"
|
||||
#line 1194 "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:1159: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:1200: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out`
|
||||
if test -z "$ac_err"; then
|
||||
:
|
||||
@@ -1297,7 +1338,7 @@ 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 1301 "configure"
|
||||
#line 1342 "configure"
|
||||
#include "confdefs.h"
|
||||
#define __need_size_t
|
||||
#define __need_wchar_t
|
||||
@@ -1313,7 +1354,7 @@ size_t size; wchar_t wchar;
|
||||
if (&size == NULL || &wchar == NULL) abort ();
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1317: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:1358: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
libc_cv_friendly_stddef=yes
|
||||
else
|
||||
@@ -1420,7 +1461,7 @@ 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 1424 "configure"
|
||||
#line 1465 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
int main() { return 0; }
|
||||
@@ -1430,7 +1471,7 @@ asm (".section .init");
|
||||
asm (".text");
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1434: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:1475: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
libc_cv_have_initfini=yes
|
||||
else
|
||||
@@ -1458,7 +1499,7 @@ 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 1462 "configure"
|
||||
#line 1503 "configure"
|
||||
#include "confdefs.h"
|
||||
asm ("_glibc_foobar:");
|
||||
int main() { return 0; }
|
||||
@@ -1466,7 +1507,7 @@ int t() {
|
||||
glibc_foobar ();
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
|
||||
if { (eval echo configure:1511: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
libc_cv_asm_underscores=yes
|
||||
else
|
||||
@@ -1555,10 +1596,12 @@ if eval "test \"`echo '$''{'libc_cv_ld_no_whole_archive'+set}'`\" = set"; then
|
||||
else
|
||||
cat > conftest.c <<\EOF
|
||||
_start () {}
|
||||
int __eh_pc;
|
||||
__throw () {}
|
||||
EOF
|
||||
if { ac_try='${CC-cc} $CFLAGS
|
||||
-nostdlib -nostartfiles -Wl,--no-whole-archive
|
||||
-o conftest conftest.c'; { (eval echo configure:1562: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
|
||||
-o conftest conftest.c'; { (eval echo configure:1605: \"$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
|
||||
@@ -1568,6 +1611,27 @@ fi
|
||||
|
||||
echo "$ac_t""$libc_cv_ld_no_whole_archive" 1>&6
|
||||
|
||||
echo $ac_n "checking for gcc -fno-exceptions""... $ac_c" 1>&6
|
||||
if eval "test \"`echo '$''{'libc_cv_gcc_no_exceptions'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.c <<\EOF
|
||||
_start () {}
|
||||
int __eh_pc;
|
||||
__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
|
||||
libc_cv_gcc_no_exceptions=yes
|
||||
else
|
||||
libc_cv_gcc_no_exceptions=no
|
||||
fi
|
||||
rm -f conftest*
|
||||
fi
|
||||
|
||||
echo "$ac_t""$libc_cv_gcc_no_exceptions" 1>&6
|
||||
|
||||
### End of automated tests.
|
||||
### Now run sysdeps configure fragments.
|
||||
|
||||
@@ -1579,9 +1643,13 @@ libc_link_sources=
|
||||
# configure fragments, and looking for a uname implementation.
|
||||
uname=
|
||||
for dir in $sysnames; do
|
||||
if test -r $sysdep_dir/$dir/configure; then
|
||||
echo "$ac_t""running configure fragment for $dir" 1>&6
|
||||
. $sysdep_dir/$dir/configure
|
||||
case $dir in
|
||||
/*) dest=$dir ;;
|
||||
*) dest=$srcdir/$dir ;;
|
||||
esac
|
||||
if test -r $dest/configure; then
|
||||
echo "$ac_t""running configure fragment for $dest" 1>&6
|
||||
. $dest/configure
|
||||
fi
|
||||
|
||||
if test -z "$uname"; then
|
||||
@@ -1687,6 +1755,8 @@ fi
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if test "`(cd $srcdir; pwd)`" = "`pwd`"; then
|
||||
config_makefile=
|
||||
else
|
||||
@@ -1834,6 +1904,7 @@ s%@AR@%$AR%g
|
||||
s%@RANLIB@%$RANLIB%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
|
||||
s%@uname_sysname@%$uname_sysname%g
|
||||
s%@uname_release@%$uname_release%g
|
||||
s%@uname_version@%$uname_version%g
|
||||
@@ -1844,6 +1915,7 @@ s%@elf@%$elf%g
|
||||
s%@shared@%$shared%g
|
||||
s%@profile@%$profile%g
|
||||
s%@omitfp@%$omitfp%g
|
||||
s%@DEFINES@%$DEFINES%g
|
||||
|
||||
CEOF
|
||||
EOF
|
||||
|
||||
+95
-34
@@ -77,6 +77,12 @@ AC_ARG_ENABLE(add-ons, dnl
|
||||
[add_ons=`echo "$enableval" | sed 's/,/ /g'`],
|
||||
[add_ons=])
|
||||
AC_CONFIG_SUBDIRS($add_ons)
|
||||
add_ons_pfx=
|
||||
if test x"$add_ons" != x; then
|
||||
for f in $add_ons; do
|
||||
add_ons_pfx="$add_ons_pfx $f/"
|
||||
done
|
||||
fi
|
||||
|
||||
AC_CANONICAL_HOST
|
||||
# We keep the original values in `$config_*' and never modify them, so we
|
||||
@@ -111,7 +117,7 @@ case "$machine" in
|
||||
a29k | am29000) base_machine=a29k machine=a29k ;;
|
||||
alpha*) base_machine=alpha machine=alpha/$machine ;;
|
||||
hppa*) base_machine=hppa machine=hppa/$machine ;;
|
||||
i[345]86) base_machine=i386 machine=i386/$machine ;;
|
||||
i[3456]86) base_machine=i386 machine=i386/$machine ;;
|
||||
m680?0) base_machine=m68k machine=m68k/$machine ;;
|
||||
m68k) base_machine=m68k machine=m68k/m68020 ;;
|
||||
m88???) base_machine=m88k machine=m88k/$machine ;;
|
||||
@@ -161,6 +167,11 @@ o=`echo $tail | sed 's/[0-9]*$//'`
|
||||
if test $o != $tail; then
|
||||
ostry="$ostry /$o"
|
||||
fi
|
||||
# For linux-gnu, try linux-gnu, then linux.
|
||||
o=`echo $tail | sed 's/-.*$//'`
|
||||
if test $o != $tail; then
|
||||
ostry="$ostry /$o"
|
||||
fi
|
||||
|
||||
# For unix/sysv/sysv4, try unix/sysv/sysv4, then unix/sysv, then unix.
|
||||
base=
|
||||
@@ -189,23 +200,34 @@ changequote([,])dnl
|
||||
|
||||
# Find what sysdep directories exist.
|
||||
sysnames=
|
||||
for b in $base ''; do
|
||||
for m0 in $mach ''; do
|
||||
for v in /$vendor ''; do
|
||||
for o in /$ostry ''; do
|
||||
for m in $mach ''; do
|
||||
try="$m0$b$v$o$m"
|
||||
test -n "$enable_debug_configure" && echo "$0 [DEBUG]: try $try" >&2
|
||||
if test -d $sysdep_dir$try; then
|
||||
sysnames="$sysnames $try"
|
||||
{ test -n "$o" || test -n "$b"; } && os_used=t
|
||||
{ test -n "$m" || test -n "$m0"; } && machine_used=t
|
||||
fi
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
|
||||
for d in $add_ons_pfx ''; do
|
||||
for b in $base ''; do
|
||||
for m0 in $mach ''; do
|
||||
for v in /$vendor ''; do
|
||||
for o in /$ostry ''; do
|
||||
for m in $mach ''; do
|
||||
if test "$m0$b$v$o$m"; then
|
||||
try="${d}sysdeps$m0$b$v$o$m"
|
||||
test -n "$enable_debug_configure" &&
|
||||
echo "$0 [DEBUG]: try $try" >&2
|
||||
case $try in
|
||||
/*) dest=$try ;;
|
||||
*) dest=$srcdir/$try ;;
|
||||
esac
|
||||
if test -d $dest; then
|
||||
sysnames="$sysnames $try"
|
||||
{ test -n "$o" || test -n "$b"; } && os_used=t
|
||||
{ test -n "$m" || test -n "$m0"; } && machine_used=t
|
||||
fi
|
||||
fi
|
||||
done
|
||||
done
|
||||
done
|
||||
done
|
||||
done
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
|
||||
if test -z "$os_used" && test "$os" != none; then
|
||||
AC_MSG_ERROR(Operating system $os is not supported.)
|
||||
@@ -224,19 +246,21 @@ fi
|
||||
# machine (otherwise what's the point of an ABI?).
|
||||
if test "$elf" = yes; then
|
||||
elf_dirs=
|
||||
for m in $mach; do
|
||||
if test -d $sysdep_dir$m/elf; then
|
||||
elf_dirs="$elf_dirs $m/elf"
|
||||
fi
|
||||
for d in $add_ons_pfx ''; do
|
||||
case $d in
|
||||
/*) xsrcdir= ;;
|
||||
*) xsrcdir=$srcdir/ ;;
|
||||
esac
|
||||
for m in $mach; do
|
||||
if test -d $xsrcdir${d}sysdeps$m/elf; then
|
||||
elf_dirs="$elf_dirs ${d}sysdeps$m/elf"
|
||||
fi
|
||||
done
|
||||
done
|
||||
sysnames="`echo $elf_dirs | sed -e 's,^/,,' -e 's, /,,g'` $sysnames"
|
||||
sysnames="`echo $elf_dirs | sed -e 's,//,/,g'` $sysnames"
|
||||
fi
|
||||
|
||||
|
||||
# Remove the leading slashes.
|
||||
sysnames="`echo $sysnames | sed -e 's@^/@@' -e 's@ /@ @g'`"
|
||||
|
||||
|
||||
# Expand the list of system names into a full list of directories
|
||||
# from each element's parent name and Implies file (if present).
|
||||
set $sysnames
|
||||
@@ -253,13 +277,25 @@ while test $# -gt 0; do
|
||||
# Report each name as we discover it, so there is no long pause in output.
|
||||
echo $ac_n "$name $ac_c" >&AC_FD_MSG
|
||||
|
||||
if test -f $sysdep_dir/$name/Implies; then
|
||||
name_base=`echo $name | sed -e 's@\(.*sysdeps\)/.*@\1@'`
|
||||
|
||||
case $name in
|
||||
/*) xsrcdir= ;;
|
||||
*) xsrcdir=$srcdir/ ;;
|
||||
esac
|
||||
test -n "$enable_debug_configure" &&
|
||||
echo "[DEBUG]: name/Implies $xsrcdir$name/Implies" >&2
|
||||
|
||||
if test -f $xsrcdir$name/Implies; then
|
||||
# Collect more names from the `Implies' file (removing comments).
|
||||
implied="`sed 's/#.*$//' < $sysdep_dir/$name/Implies`"
|
||||
for x in $implied; do
|
||||
test -d $sysdep_dir/$x || {
|
||||
AC_MSG_WARN(sysdeps/$name/Implies specifies nonexistent $x)
|
||||
}
|
||||
implied_candidate="`sed 's/#.*$//' < $xsrcdir$name/Implies`"
|
||||
implied=
|
||||
for x in $implied_candidate; do
|
||||
if test -d $xsrcdir$name_base/$x; then
|
||||
implied="$implied $name_base/$x";
|
||||
else
|
||||
AC_MSG_WARN($name/Implies specifies nonexistent $x)
|
||||
fi
|
||||
done
|
||||
else
|
||||
implied=
|
||||
@@ -270,7 +306,7 @@ while test $# -gt 0; do
|
||||
|
||||
# Find the parent of NAME, using the empty string if it has none.
|
||||
changequote(,)dnl
|
||||
parent="`echo $name | sed -n -e '/\//!q' -e 's=/[^/]*$==p'`"
|
||||
parent="`echo $name | sed -n -e 's=/[^/]*$==' -e '/sysdeps$/q' -e p`"
|
||||
changequote([,])dnl
|
||||
|
||||
# Add the names implied by NAME, and NAME's parent (if it has one), to
|
||||
@@ -285,10 +321,10 @@ changequote([,])dnl
|
||||
done
|
||||
|
||||
# Add the default directories.
|
||||
sysnames="$names generic stub"
|
||||
sysnames="$names sysdeps/generic sysdeps/stub"
|
||||
AC_SUBST(sysnames)
|
||||
# The other names were emitted during the scan.
|
||||
AC_MSG_RESULT(generic stub)
|
||||
AC_MSG_RESULT(sysdeps/generic sysdeps/stub)
|
||||
|
||||
|
||||
### Locate tools.
|
||||
@@ -483,6 +519,8 @@ fi
|
||||
AC_CACHE_CHECK(for ld --no-whole-archive, libc_cv_ld_no_whole_archive, [dnl
|
||||
cat > conftest.c <<\EOF
|
||||
_start () {}
|
||||
int __eh_pc;
|
||||
__throw () {}
|
||||
EOF
|
||||
dnl No \ in command here because it ends up inside ''.
|
||||
if AC_TRY_COMMAND([${CC-cc} $CFLAGS
|
||||
@@ -495,6 +533,23 @@ fi
|
||||
rm -f conftest*])
|
||||
AC_SUBST(libc_cv_ld_no_whole_archive)dnl
|
||||
|
||||
AC_CACHE_CHECK(for gcc -fno-exceptions, libc_cv_gcc_no_exceptions, [dnl
|
||||
cat > conftest.c <<\EOF
|
||||
_start () {}
|
||||
int __eh_pc;
|
||||
__throw () {}
|
||||
EOF
|
||||
dnl No \ in command here because it ends up inside ''.
|
||||
if AC_TRY_COMMAND([${CC-cc} $CFLAGS
|
||||
-nostdlib -nostartfiles -fno-exceptions
|
||||
-o conftest conftest.c]); then
|
||||
libc_cv_gcc_no_exceptions=yes
|
||||
else
|
||||
libc_cv_gcc_no_exceptions=no
|
||||
fi
|
||||
rm -f conftest*])
|
||||
AC_SUBST(libc_cv_gcc_no_exceptions)dnl
|
||||
|
||||
### End of automated tests.
|
||||
### Now run sysdeps configure fragments.
|
||||
|
||||
@@ -506,9 +561,13 @@ libc_link_sources=
|
||||
# configure fragments, and looking for a uname implementation.
|
||||
uname=
|
||||
for dir in $sysnames; do
|
||||
if test -r $sysdep_dir/$dir/configure; then
|
||||
AC_MSG_RESULT(running configure fragment for $dir)
|
||||
. $sysdep_dir/$dir/configure
|
||||
case $dir in
|
||||
/*) dest=$dir ;;
|
||||
*) dest=$srcdir/$dir ;;
|
||||
esac
|
||||
if test -r $dest/configure; then
|
||||
AC_MSG_RESULT(running configure fragment for $dest)
|
||||
. $dest/configure
|
||||
fi
|
||||
[
|
||||
if test -z "$uname"; then
|
||||
@@ -610,6 +669,8 @@ fi
|
||||
AC_SUBST(profile)
|
||||
AC_SUBST(omitfp)
|
||||
|
||||
AC_SUBST(DEFINES)
|
||||
|
||||
if test "`(cd $srcdir; pwd)`" = "`pwd`"; then
|
||||
config_makefile=
|
||||
else
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
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.07-crypt.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 maintainers are encouraged to copy
|
||||
this distribution to their archives outside the USA. Please get it from
|
||||
ftp.uni-c.dk; 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.
|
||||
+1
-1
@@ -80,7 +80,7 @@ define initfini
|
||||
-rm -f $(objpfx)crtcommon.tmp
|
||||
(echo 'cat > crtcommon.tmp <<\EOF_common'; \
|
||||
$(CC) $< $(CPPFLAGS) $(CFLAGS) \
|
||||
-fPIC -finhibit-size-directive -g0 -S -o -; \
|
||||
-fPIC -finhibit-size-directive $(no-exceptions) -g0 -S -o -; \
|
||||
echo 'EOF_common') | (cd $(@D); $(SHELL))
|
||||
cat $(objpfx)crtcommon.tmp >> $(objpfx)crti.s-new
|
||||
cat $(objpfx)crtcommon.tmp >> $(objpfx)crtn.s-new
|
||||
|
||||
+9
-1
@@ -40,6 +40,15 @@ void __gmon_start__ (void) __attribute__ ((constructor));
|
||||
void
|
||||
__gmon_start__ (void)
|
||||
{
|
||||
#ifdef HAVE_INITFINI
|
||||
/* Protect from being called more than once. Since crti.o is linked
|
||||
into every shared library, each of their init functions will call us. */
|
||||
static int called;
|
||||
|
||||
if (called++)
|
||||
return;
|
||||
#endif
|
||||
|
||||
/* Start keeping profiling records. */
|
||||
monstartup ((u_long) &_start, (u_long) &etext);
|
||||
|
||||
@@ -47,4 +56,3 @@ __gmon_start__ (void)
|
||||
collected data. */
|
||||
atexit (&_mcleanup);
|
||||
}
|
||||
|
||||
|
||||
@@ -66,6 +66,17 @@ useless_function (void)
|
||||
}
|
||||
asm ("\nEOF.end\n");
|
||||
|
||||
/* Find out how much alignment is produced by the compiler. */
|
||||
asm ("align=`awk '$1==\".align\" { if ($2>max) max=$2; } END { print max; }' \
|
||||
<<\\EOF.align");
|
||||
void
|
||||
useless_function2 (void (*foo) (void))
|
||||
{
|
||||
if (foo)
|
||||
(*foo) ();
|
||||
}
|
||||
asm ("\nEOF.align\n`\n");
|
||||
|
||||
/* Append the .init prologue to crti.s-new. */
|
||||
asm ("cat >> crti.s-new <<\\EOF.crti.init");
|
||||
|
||||
@@ -88,6 +99,7 @@ _init (void)
|
||||
to crtn.s-new, followed by the function epilogue. */
|
||||
asm ("\n\
|
||||
EOF.crti.init\n\
|
||||
test -n \"$align\" && echo .align $align >> crti.s-new\n\
|
||||
test -n \"$need_end\" && echo .end _init >> crti.s-new\n\
|
||||
fgrep .init crti.s-new >>crtn.s-new\n\
|
||||
fgrep -v .end >> crtn.s-new <<\\EOF.crtn.init");
|
||||
@@ -107,6 +119,7 @@ _fini (void)
|
||||
Then fetch the .section directive just written and append that
|
||||
to crtn.s-new, followed by the function epilogue. */
|
||||
asm ("\nEOF.crti.fini\n\
|
||||
test -n \"$align\" && echo .align $align >> crti.s-new\n\
|
||||
test -n \"$need_end\" && echo .end _fini >> crti.s-new\n\
|
||||
cat > /dev/null <<\\EOF.fini.skip");
|
||||
|
||||
|
||||
+10
@@ -9,6 +9,7 @@ subdir-dirs = btree db hash mpool recno
|
||||
vpath %.c $(subdir-dirs)
|
||||
|
||||
extra-libs := libdb
|
||||
extra-libs-others := $(extra-libs)
|
||||
libdb-routines := bt_close bt_conv bt_debug bt_delete bt_get \
|
||||
bt_open bt_overflow bt_page bt_put bt_search \
|
||||
bt_seq bt_split bt_utils \
|
||||
@@ -25,6 +26,9 @@ distribute := compat.h \
|
||||
hash/extern.h hash/hash.h hash/page.h \
|
||||
recno/extern.h recno/recno.h
|
||||
|
||||
others := makedb
|
||||
install-bin := makedb
|
||||
|
||||
include ../Rules
|
||||
|
||||
CPPFLAGS += -D__DBINTERFACE_PRIVATE
|
||||
@@ -35,3 +39,9 @@ CFLAGS-hash_func.c := -Wno-unused
|
||||
|
||||
# The db code outsmarts the compiler frequently.
|
||||
override CFLAGS += -Wno-uninitialized
|
||||
|
||||
ifeq ($(build-shared),yes)
|
||||
$(objpfx)makedb: $(objpfx)libdb.so$(libdb.so-version)
|
||||
else
|
||||
$(objpfx)makedb: $(objpfx)libdb.a
|
||||
endif
|
||||
|
||||
+42
-10
@@ -25,6 +25,7 @@ Boston, MA 02111-1307, USA. */
|
||||
#include <fcntl.h>
|
||||
#include <getopt.h>
|
||||
#include <libintl.h>
|
||||
#include <locale.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -32,6 +33,7 @@ Boston, MA 02111-1307, USA. */
|
||||
/* Get libc version number. */
|
||||
#include "../version.h"
|
||||
|
||||
#define PACKAGE _libc_intl_domainname
|
||||
|
||||
/* Long options. */
|
||||
static const struct option long_options[] =
|
||||
@@ -39,15 +41,16 @@ static const struct option long_options[] =
|
||||
{ "help", no_argument, NULL, 'h' },
|
||||
{ "fold-case", no_argument, NULL, 'f' },
|
||||
{ "output", required_argument, NULL, 'o' },
|
||||
{ "quiet", no_argument, NULL, 'q' },
|
||||
{ "undo", no_argument, NULL, 'u' },
|
||||
{ "version", no_argument, NULL, 'V' },
|
||||
{ NULL, }
|
||||
{ NULL, 0, NULL, 0}
|
||||
};
|
||||
|
||||
/* Prototypes for local functions. */
|
||||
static void usage __P ((int status)) __attribute__ ((noreturn));
|
||||
static int process_input __P ((FILE *input, const char *inname, DB *output,
|
||||
int to_lowercase));
|
||||
int to_lowercase, int be_quiet));
|
||||
static int print_database __P ((DB *db));
|
||||
|
||||
|
||||
@@ -64,6 +67,7 @@ main (argc, argv)
|
||||
int do_version;
|
||||
int to_lowercase;
|
||||
int do_undo;
|
||||
int be_quiet;
|
||||
int status;
|
||||
int opt;
|
||||
|
||||
@@ -78,6 +82,7 @@ main (argc, argv)
|
||||
do_version = 0;
|
||||
to_lowercase = 0;
|
||||
do_undo = 0;
|
||||
be_quiet = 0;
|
||||
output_name = NULL;
|
||||
|
||||
while ((opt = getopt_long (argc, argv, "fho:uV", long_options, NULL)) != EOF)
|
||||
@@ -94,6 +99,9 @@ main (argc, argv)
|
||||
case 'o':
|
||||
output_name = optarg;
|
||||
break;
|
||||
case 'q':
|
||||
be_quiet = 1;
|
||||
break;
|
||||
case 'u':
|
||||
do_undo = 1;
|
||||
break;
|
||||
@@ -106,7 +114,17 @@ main (argc, argv)
|
||||
|
||||
/* Version information is requested. */
|
||||
if (do_version)
|
||||
printf ("%s - GNU %s %s\n", program_invocation_name, "libc", VERSION);
|
||||
{
|
||||
printf ("makedb (GNU %s) %s\n", PACKAGE, VERSION);
|
||||
printf (_("\
|
||||
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");
|
||||
printf (_("Written by %s.\n"), "Ulrich Drepper");
|
||||
|
||||
exit (EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
/* Help is requested. */
|
||||
if (do_help)
|
||||
@@ -170,7 +188,8 @@ main (argc, argv)
|
||||
error (EXIT_FAILURE, errno, gettext ("cannot open output file `%s'"));
|
||||
|
||||
/* Start the real work. */
|
||||
status = process_input (input_file, input_name, db_file, to_lowercase);
|
||||
status = process_input (input_file, input_name, db_file, to_lowercase,
|
||||
be_quiet);
|
||||
|
||||
/* Close files. */
|
||||
if (input_file != stdin)
|
||||
@@ -189,7 +208,8 @@ usage (status)
|
||||
fprintf (stderr, gettext ("Try `%s --help' for more information.\n"),
|
||||
program_invocation_name);
|
||||
else
|
||||
printf (gettext ("\
|
||||
{
|
||||
printf (gettext ("\
|
||||
Usage: %s [OPTION]... INPUT-FILE OUTPUT-FILE\n\
|
||||
%s [OPTION]... -o OUTPUT-FILE INPUT-FILE\n\
|
||||
%s [OPTION]... -u INPUT-FILE\n\
|
||||
@@ -197,22 +217,27 @@ Mandatory arguments to long options are mandatory for short options too.\n\
|
||||
-f, --fold-case convert key to lower case\n\
|
||||
-h, --help display this help and exit\n\
|
||||
-o, --output=NAME write output to file NAME\n\
|
||||
--quiet don't print messages while building database\n\
|
||||
-u, --undo print content of database file, one entry a line\n\
|
||||
-V, --version output version information and exit\n\
|
||||
If INPUT-FILE is -, input is read from standard input.\n"),
|
||||
program_invocation_name, program_invocation_name,
|
||||
program_invocation_name);
|
||||
program_invocation_name, program_invocation_name,
|
||||
program_invocation_name);
|
||||
fputs (gettext ("Report bugs to <bug-glibc@prep.ai.mit.edu>.\n"),
|
||||
stdout);
|
||||
}
|
||||
|
||||
exit (status);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
process_input (input, inname, output, to_lowercase)
|
||||
process_input (input, inname, output, to_lowercase, be_quiet)
|
||||
FILE *input;
|
||||
const char *inname;
|
||||
DB *output;
|
||||
int to_lowercase;
|
||||
int be_quiet;
|
||||
{
|
||||
char *line;
|
||||
size_t linelen;
|
||||
@@ -278,11 +303,18 @@ process_input (input, inname, output, to_lowercase)
|
||||
if (status != 0)
|
||||
{
|
||||
if (status == 1)
|
||||
error_at_line (0, 0, inname, linenr, gettext ("duplicate key"));
|
||||
{
|
||||
if (!be_quiet)
|
||||
error_at_line (0, 0, inname, linenr,
|
||||
gettext ("duplicate key"));
|
||||
/* This is no real error. Just give a warning. */
|
||||
status = 0;
|
||||
}
|
||||
else
|
||||
error (0, errno, gettext ("while writing data base file"));
|
||||
|
||||
status = EXIT_FAILURE;
|
||||
status = status ? EXIT_FAILURE : EXIT_SUCCESS;
|
||||
|
||||
clearerr (input);
|
||||
break;
|
||||
}
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@
|
||||
subdir := dirent
|
||||
|
||||
headers := dirent.h direntry.h
|
||||
routines := opendir closedir readdir rewinddir \
|
||||
routines := opendir closedir readdir readdir_r rewinddir \
|
||||
seekdir telldir scandir alphasort \
|
||||
getdents dirfd
|
||||
distribute := dirstream.h
|
||||
|
||||
@@ -101,18 +101,28 @@ typedef struct __dirstream DIR;
|
||||
|
||||
/* Open a directory stream on NAME.
|
||||
Return a DIR stream on the directory, or NULL if it could not be opened. */
|
||||
extern DIR *__opendir __P ((__const char *__name));
|
||||
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));
|
||||
|
||||
/* 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));
|
||||
|
||||
#ifdef __USE_REENTRANT
|
||||
/* Reentrant versio 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
|
||||
|
||||
/* Rewind DIRP to the beginning of the directory. */
|
||||
extern void rewinddir __P ((DIR * __dirp));
|
||||
|
||||
|
||||
+9
-10
@@ -16,18 +16,17 @@ 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. */
|
||||
|
||||
#include <ansidecl.h>
|
||||
#include <dirent.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
int
|
||||
DEFUN(scandir, (dir, namelist, select, cmp),
|
||||
CONST char *dir AND
|
||||
struct dirent ***namelist AND
|
||||
int EXFUN((*select), (struct dirent *)) AND
|
||||
int EXFUN((*cmp), (CONST PTR, CONST PTR)))
|
||||
scandir (dir, namelist, select, cmp)
|
||||
const char *dir;
|
||||
struct dirent ***namelist;
|
||||
int (*select) __P ((struct dirent *));
|
||||
int (*cmp) __P ((const void *, const void *));
|
||||
{
|
||||
DIR *dp = opendir (dir);
|
||||
struct dirent **v = NULL;
|
||||
@@ -39,7 +38,7 @@ DEFUN(scandir, (dir, namelist, select, cmp),
|
||||
return -1;
|
||||
|
||||
save = errno;
|
||||
errno = 0;
|
||||
__set_errno (0);
|
||||
|
||||
i = 0;
|
||||
while ((d = readdir (dp)) != NULL)
|
||||
@@ -58,7 +57,7 @@ DEFUN(scandir, (dir, namelist, select, cmp),
|
||||
if (new == NULL)
|
||||
{
|
||||
lose:
|
||||
errno = ENOMEM;
|
||||
__set_errno (ENOMEM);
|
||||
break;
|
||||
}
|
||||
v = new;
|
||||
@@ -79,12 +78,12 @@ DEFUN(scandir, (dir, namelist, select, cmp),
|
||||
while (i > 0)
|
||||
free (v[--i]);
|
||||
free (v);
|
||||
errno = save;
|
||||
__set_errno (save);
|
||||
return -1;
|
||||
}
|
||||
|
||||
(void) closedir (dp);
|
||||
errno = save;
|
||||
__set_errno (save);
|
||||
|
||||
/* Sort the list if we have a comparison function to sort with. */
|
||||
if (cmp != NULL)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
int
|
||||
main ()
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
|
||||
DIR * dirp;
|
||||
@@ -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);
|
||||
|
||||
+3
-4
@@ -37,7 +37,8 @@ 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
|
||||
|
||||
extra-libs = libdl
|
||||
extra-libs = libdl
|
||||
extra-libs-others = $(extra-libs)
|
||||
libdl-routines := dlopen dlclose dlsym dlerror dladdr
|
||||
|
||||
|
||||
@@ -46,7 +47,7 @@ all: # Make this the default target; it will be defined in Rules.
|
||||
include ../Makeconfig
|
||||
|
||||
ifeq (yes,$(build-shared))
|
||||
extra-objs = $(rtld-routines:=.so) soinit.so sofini.so
|
||||
extra-objs = $(rtld-routines:=.so) soinit.so sofini.so eval.so
|
||||
generated = librtld.so dl-allobjs.so
|
||||
install-others = $(slibdir)/$(rtld-installed-name)
|
||||
install-bin = ldd
|
||||
@@ -69,8 +70,6 @@ $(objpfx)dl-allobjs.so: $(rtld-routines:%=$(objpfx)%.so)
|
||||
$(reloc-link) $^
|
||||
|
||||
# Link together the dynamic linker into a single relocatable object.
|
||||
# We use this to produce both the ABI-compliant and Linux-compatible
|
||||
# dynamic linker shared objects below.
|
||||
$(objpfx)librtld.so: $(objpfx)dl-allobjs.so $(common-objpfx)libc_pic.a
|
||||
$(reloc-link) '-Wl,-(' $^ -lgcc '-Wl,-)'
|
||||
|
||||
|
||||
+2
-1
@@ -99,7 +99,8 @@ _dl_close (struct link_map *map)
|
||||
}
|
||||
|
||||
/* Finally, unlink the data structure and free it. */
|
||||
map->l_prev->l_next = map->l_next;
|
||||
if (map->l_prev)
|
||||
map->l_prev->l_next = map->l_next;
|
||||
if (map->l_next)
|
||||
map->l_next->l_prev = map->l_prev;
|
||||
if (map->l_searchlist)
|
||||
|
||||
+13
-5
@@ -20,13 +20,15 @@ Cambridge, MA 02139, USA. */
|
||||
#include <stddef.h>
|
||||
#include <link.h>
|
||||
#include <setjmp.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
/* This structure communicates state between _dl_catch_error and
|
||||
_dl_signal_error. */
|
||||
struct catch
|
||||
{
|
||||
const char *errstring, *objname; /* Error detail filled in here. */
|
||||
char *errstring; /* Error detail filled in here. */
|
||||
const char *objname;
|
||||
jmp_buf env; /* longjmp here on error. */
|
||||
};
|
||||
|
||||
@@ -46,8 +48,13 @@ _dl_signal_error (int errcode,
|
||||
|
||||
if (catch)
|
||||
{
|
||||
/* We are inside _dl_catch_error. Return to it. */
|
||||
catch->errstring = errstring;
|
||||
/* We are inside _dl_catch_error. Return to it. We have to
|
||||
duplicate the error string since it might be allocated on the
|
||||
stack. */
|
||||
size_t len = strlen (errstring) + 1;
|
||||
catch->errstring = malloc (len);
|
||||
if (catch->errstring != NULL)
|
||||
memcpy (catch->errstring, errstring, len);
|
||||
catch->objname = objname;
|
||||
longjmp (catch->env, errcode ?: -1);
|
||||
}
|
||||
@@ -64,7 +71,7 @@ _dl_signal_error (int errcode,
|
||||
}
|
||||
|
||||
int
|
||||
_dl_catch_error (const char **errstring,
|
||||
_dl_catch_error (char **errstring,
|
||||
const char **objname,
|
||||
void (*operate) (void))
|
||||
{
|
||||
@@ -77,7 +84,8 @@ _dl_catch_error (const char **errstring,
|
||||
catch = &c;
|
||||
(*operate) ();
|
||||
catch = NULL;
|
||||
*errstring = *objname = NULL;
|
||||
*errstring = NULL;
|
||||
*objname = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
+34
-13
@@ -70,11 +70,25 @@ int _dl_zerofd = -1;
|
||||
size_t _dl_pagesize;
|
||||
|
||||
|
||||
/* Local version of `strdup' function. */
|
||||
static inline char *
|
||||
local_strdup (const char *s)
|
||||
{
|
||||
size_t len = strlen (s) + 1;
|
||||
void *new = malloc (len);
|
||||
|
||||
if (new == NULL)
|
||||
return NULL;
|
||||
|
||||
return (char *) memcpy (new, s, len);
|
||||
}
|
||||
|
||||
|
||||
/* Map in the shared object NAME, actually located in REALNAME, and already
|
||||
opened on FD. */
|
||||
|
||||
struct link_map *
|
||||
_dl_map_object_from_fd (const char *name, int fd, char *realname,
|
||||
_dl_map_object_from_fd (char *name, int fd, char *realname,
|
||||
struct link_map *loader, int l_type)
|
||||
{
|
||||
struct link_map *l = NULL;
|
||||
@@ -96,6 +110,7 @@ _dl_map_object_from_fd (const char *name, int fd, char *realname,
|
||||
l->l_next->l_prev = l->l_prev;
|
||||
free (l);
|
||||
}
|
||||
free (name);
|
||||
free (realname);
|
||||
_dl_signal_error (code, name, msg);
|
||||
}
|
||||
@@ -142,6 +157,7 @@ _dl_map_object_from_fd (const char *name, int fd, char *realname,
|
||||
/* The object is already loaded.
|
||||
Just bump its reference count and return it. */
|
||||
__close (fd);
|
||||
free (name);
|
||||
free (realname);
|
||||
++l->l_opencount;
|
||||
return l;
|
||||
@@ -402,7 +418,7 @@ open_path (const char *name, size_t namelen,
|
||||
p = dirpath;
|
||||
if (p == NULL || *p == '\0')
|
||||
{
|
||||
errno = ENOENT;
|
||||
__set_errno (ENOENT);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -465,6 +481,7 @@ _dl_map_object (struct link_map *loader, const char *name, int type)
|
||||
{
|
||||
int fd;
|
||||
char *realname;
|
||||
char *name_copy;
|
||||
struct link_map *l;
|
||||
|
||||
/* Look for this name among those already loaded. */
|
||||
@@ -524,11 +541,8 @@ _dl_map_object (struct link_map *loader, const char *name, int type)
|
||||
fd = __open (cached, O_RDONLY);
|
||||
if (fd != -1)
|
||||
{
|
||||
size_t cl = strlen (cached) + 1;
|
||||
realname = malloc (cl);
|
||||
if (realname)
|
||||
memcpy (realname, cached, cl);
|
||||
else
|
||||
realname = local_strdup (cached);
|
||||
if (realname == NULL)
|
||||
{
|
||||
__close (fd);
|
||||
fd = -1;
|
||||
@@ -548,11 +562,8 @@ _dl_map_object (struct link_map *loader, const char *name, int type)
|
||||
fd = __open (name, O_RDONLY);
|
||||
if (fd != -1)
|
||||
{
|
||||
size_t len = strlen (name) + 1;
|
||||
realname = malloc (len);
|
||||
if (realname)
|
||||
memcpy (realname, name, len);
|
||||
else
|
||||
realname = local_strdup (name);
|
||||
if (realname == NULL)
|
||||
{
|
||||
__close (fd);
|
||||
fd = -1;
|
||||
@@ -560,8 +571,18 @@ _dl_map_object (struct link_map *loader, const char *name, int type)
|
||||
}
|
||||
}
|
||||
|
||||
if (fd != -1)
|
||||
{
|
||||
name_copy = local_strdup (name);
|
||||
if (name_copy == NULL)
|
||||
{
|
||||
__close (fd);
|
||||
fd = -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (fd == -1)
|
||||
_dl_signal_error (errno, name, "cannot open shared object file");
|
||||
|
||||
return _dl_map_object_from_fd (name, fd, realname, loader, type);
|
||||
return _dl_map_object_from_fd (name_copy, fd, realname, loader, type);
|
||||
}
|
||||
|
||||
+11
-8
@@ -45,16 +45,16 @@ _dl_elf_hash (const char *name)
|
||||
}
|
||||
|
||||
/* Search loaded objects' symbol tables for a definition of the symbol
|
||||
UNDEF_NAME. The chosen value can't be RELOC_ADDR. If NOPLT is nonzero,
|
||||
then a PLT entry cannot satisfy the reference; some different binding
|
||||
must be found. */
|
||||
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
|
||||
copy relocs. If DL_LOOKUP_NOPLT is set, then a PLT entry cannot
|
||||
satisfy the reference; some different binding must be found. */
|
||||
|
||||
ElfW(Addr)
|
||||
_dl_lookup_symbol (const char *undef_name, const ElfW(Sym) **ref,
|
||||
struct link_map *symbol_scope[],
|
||||
const char *reference_name,
|
||||
ElfW(Addr) reloc_addr,
|
||||
int noplt)
|
||||
int flags)
|
||||
{
|
||||
const unsigned long int hash = _dl_elf_hash (undef_name);
|
||||
struct
|
||||
@@ -75,6 +75,10 @@ _dl_lookup_symbol (const char *undef_name, const ElfW(Sym) **ref,
|
||||
|
||||
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);
|
||||
|
||||
@@ -87,9 +91,8 @@ _dl_lookup_symbol (const char *undef_name, const ElfW(Sym) **ref,
|
||||
const ElfW(Sym) *sym = &symtab[symidx];
|
||||
|
||||
if (sym->st_value == 0 || /* No value. */
|
||||
/* Cannot resolve to the location being filled in. */
|
||||
reloc_addr == map->l_addr + sym->st_value ||
|
||||
(noplt && sym->st_shndx == SHN_UNDEF)) /* Reject PLT. */
|
||||
((flags & DL_LOOKUP_NOPLT) != 0 /* Reject PLT entry. */
|
||||
&& sym->st_shndx == SHN_UNDEF))
|
||||
continue;
|
||||
|
||||
switch (ELFW(ST_TYPE) (sym->st_info))
|
||||
|
||||
+18
-3
@@ -22,6 +22,16 @@ Cambridge, MA 02139, USA. */
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
|
||||
|
||||
weak_extern (_DYNAMIC)
|
||||
|
||||
extern int __libc_multiple_libcs; /* Defined in init-first.c. */
|
||||
|
||||
extern int __libc_argc;
|
||||
extern char **__libc_argv;
|
||||
|
||||
extern char **__environ;
|
||||
|
||||
size_t _dl_global_scope_alloc;
|
||||
|
||||
struct link_map *
|
||||
@@ -31,7 +41,6 @@ _dl_open (const char *file, int mode)
|
||||
ElfW(Addr) init;
|
||||
struct r_debug *r;
|
||||
|
||||
|
||||
/* Load the named object. */
|
||||
new = _dl_map_object (NULL, file, lt_loaded);
|
||||
if (new->l_searchlist)
|
||||
@@ -97,7 +106,7 @@ _dl_open (const char *file, int mode)
|
||||
else
|
||||
{
|
||||
if (_dl_global_scope_alloc <
|
||||
_dl_global_scope_end - _dl_global_scope + 2)
|
||||
(size_t) (_dl_global_scope_end - _dl_global_scope + 2))
|
||||
{
|
||||
/* Must extend the list. */
|
||||
struct link_map **new = realloc (_dl_global_scope,
|
||||
@@ -129,7 +138,13 @@ _dl_open (const char *file, int mode)
|
||||
|
||||
/* Run the initializer functions of new objects. */
|
||||
while (init = _dl_init_next (new))
|
||||
(*(void (*) (void)) init) ();
|
||||
(*(void (*) (int, char **, char **)) init) (__libc_argc, __libc_argv,
|
||||
__environ);
|
||||
|
||||
if (_DYNAMIC == 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;
|
||||
}
|
||||
|
||||
+2
-2
@@ -57,9 +57,9 @@ _dl_relocate_object (struct link_map *l, struct link_map *scope[], int lazy)
|
||||
= ((void *) l->l_addr + l->l_info[DT_STRTAB]->d_un.d_ptr);
|
||||
|
||||
/* This macro is used as a callback from the ELF_DYNAMIC_RELOCATE code. */
|
||||
#define RESOLVE(ref, reloc_addr, noplt) \
|
||||
#define RESOLVE(ref, flags) \
|
||||
(_dl_lookup_symbol (strtab + (*ref)->st_name, ref, scope, \
|
||||
l->l_name, reloc_addr, noplt))
|
||||
l->l_name, flags))
|
||||
|
||||
#include "dynamic-link.h"
|
||||
ELF_DYNAMIC_RELOCATE (l, lazy);
|
||||
|
||||
+2
-2
@@ -122,9 +122,9 @@ fixup (
|
||||
|
||||
{
|
||||
/* This macro is used as a callback from the elf_machine_relplt code. */
|
||||
#define RESOLVE(ref, reloc_addr, noplt) \
|
||||
#define RESOLVE(ref, flags) \
|
||||
(_dl_lookup_symbol (strtab + (*ref)->st_name, ref, scope, \
|
||||
l->l_name, reloc_addr, noplt))
|
||||
l->l_name, flags))
|
||||
#include "dynamic-link.h"
|
||||
|
||||
/* Perform the specified relocation. */
|
||||
|
||||
@@ -20,6 +20,8 @@ Cambridge, MA 02139, USA. */
|
||||
#include <assert.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
/* This file defines some things that for the dynamic linker are defined in
|
||||
rtld.c and dl-sysdep.c in ways appropriate to bootstrap dynamic linking. */
|
||||
@@ -46,3 +48,38 @@ _dl_sysdep_fatal (void)
|
||||
{
|
||||
assert (! "_dl_sysdep_fatal called");
|
||||
}
|
||||
|
||||
/* Read the whole contents of FILE into new mmap'd space with given
|
||||
protections. *SIZEP gets the size of the file. */
|
||||
|
||||
void *
|
||||
_dl_sysdep_read_whole_file (const char *file, size_t *sizep, int prot)
|
||||
{
|
||||
void *result;
|
||||
struct stat st;
|
||||
int fd = __open (file, O_RDONLY);
|
||||
if (fd < 0)
|
||||
return NULL;
|
||||
if (__fstat (fd, &st) < 0)
|
||||
result = NULL;
|
||||
else
|
||||
{
|
||||
/* Map a copy of the file contents. */
|
||||
result = __mmap (0, st.st_size, prot,
|
||||
#ifdef MAP_COPY
|
||||
MAP_COPY
|
||||
#else
|
||||
MAP_PRIVATE
|
||||
#endif
|
||||
#ifdef MAP_FILE
|
||||
| MAP_FILE
|
||||
#endif
|
||||
, fd, 0);
|
||||
if (result == (void *) -1)
|
||||
result = NULL;
|
||||
else
|
||||
*sizep = st.st_size;
|
||||
}
|
||||
__close (fd);
|
||||
return result;
|
||||
}
|
||||
|
||||
+1
-1
@@ -28,6 +28,6 @@ _dl_symbol_value (struct link_map *map, const char *name)
|
||||
ElfW(Addr) loadbase;
|
||||
const ElfW(Sym) *ref = NULL;
|
||||
struct link_map *scope[2] = { map, NULL };
|
||||
loadbase = _dl_lookup_symbol (name, &ref, scope, map->l_name, 0, 0);
|
||||
loadbase = _dl_lookup_symbol (name, &ref, scope, map->l_name, 0);
|
||||
return loadbase + ref->st_value;
|
||||
}
|
||||
|
||||
+8
-2
@@ -1,5 +1,5 @@
|
||||
/* dlerror -- Return error detail for failing <dlfcn.h> functions.
|
||||
Copyright (C) 1995 Free Software Foundation, Inc.
|
||||
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
|
||||
@@ -24,7 +24,7 @@ Cambridge, MA 02139, USA. */
|
||||
#include <stdlib.h>
|
||||
|
||||
static int last_errcode;
|
||||
static const char *last_errstring;
|
||||
static char *last_errstring;
|
||||
static const char *last_object_name;
|
||||
|
||||
char *
|
||||
@@ -58,6 +58,7 @@ dlerror (void)
|
||||
? NULL : buf);
|
||||
|
||||
/* Reset the error indicator. */
|
||||
free (last_errstring);
|
||||
last_errstring = NULL;
|
||||
return ret;
|
||||
}
|
||||
@@ -65,6 +66,11 @@ dlerror (void)
|
||||
int
|
||||
_dlerror_run (void (*operate) (void))
|
||||
{
|
||||
if (last_errstring != NULL)
|
||||
/* Free the error string from the last failed command. This can
|
||||
happen if `dlerror' was not run after an error was found. */
|
||||
free (last_errstring);
|
||||
|
||||
last_errcode = _dl_catch_error (&last_errstring, &last_object_name,
|
||||
operate);
|
||||
return last_errstring != NULL;
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ dlsym (void *handle, const char *name)
|
||||
scope = &(_dl_global_scope ?: _dl_default_scope)[2];
|
||||
owner = NULL;
|
||||
}
|
||||
loadbase = _dl_lookup_symbol (name, &ref, scope, owner, 0, 0);
|
||||
loadbase = _dl_lookup_symbol (name, &ref, scope, owner, 0);
|
||||
}
|
||||
|
||||
return _dlerror_run (doit) ? NULL : (void *) (loadbase + ref->st_value);
|
||||
|
||||
+29
-1
@@ -1,6 +1,27 @@
|
||||
/* 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.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If
|
||||
not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <dlfcn.h>
|
||||
|
||||
static void *funcall (char **stringp);
|
||||
@@ -27,6 +48,13 @@ funcall (char **stringp)
|
||||
/* Swallow closing paren. */
|
||||
++*stringp;
|
||||
|
||||
if (args[0] == NULL)
|
||||
{
|
||||
static const char unknown[] = "Unknown function\n";
|
||||
write (1, unknown, sizeof unknown - 1);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Do it to it. */
|
||||
__builtin_return (__builtin_apply (args[0],
|
||||
&argcookie,
|
||||
@@ -81,7 +109,7 @@ eval (char **stringp)
|
||||
value = p;
|
||||
do
|
||||
++p;
|
||||
while (*p != '\0' && !isspace (*p) && !ispunct (*p));
|
||||
while (*p != '\0' && !isspace (*p) && (!ispunct (*p) || *p == '_'));
|
||||
c = *p;
|
||||
*p = '\0';
|
||||
value = dlsym (NULL, value);
|
||||
|
||||
+2
-2
@@ -18,7 +18,7 @@ case $# in
|
||||
*) file="./$1" ;;
|
||||
esac
|
||||
if ${RTLD} --verify "$file"; then
|
||||
LD_TRACE_LOADED_OBJECTS=1 exec "$file" && exit 1
|
||||
LD_TRACE_LOADED_OBJECTS=1 exec ${RTLD} "$file" && exit 1
|
||||
else
|
||||
echo ' not a dynamic executable'
|
||||
fi
|
||||
@@ -32,7 +32,7 @@ case $# in
|
||||
*) file="./$file" ;;
|
||||
esac
|
||||
if ${RTLD} --verify "$file"; then
|
||||
LD_TRACE_LOADED_OBJECTS=1 "$file"
|
||||
LD_TRACE_LOADED_OBJECTS=1 ${RTLD} "$file"
|
||||
else
|
||||
echo ' not a dynamic executable'
|
||||
fi
|
||||
|
||||
+11
-8
@@ -178,8 +178,9 @@ extern void _dl_signal_error (int errcode,
|
||||
/* 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
|
||||
*OBJECT are set to the strings passed to _dl_signal_error, and the error
|
||||
code passed is the return value. */
|
||||
extern int _dl_catch_error (const char **errstring,
|
||||
code passed is the return value. ERRSTRING if nonzero points to a
|
||||
malloc'ed string which the caller has to free after use. */
|
||||
extern int _dl_catch_error (char **errstring,
|
||||
const char **object,
|
||||
void (*operate) (void));
|
||||
|
||||
@@ -224,16 +225,18 @@ extern void _dl_close (struct link_map *map);
|
||||
null-terminated list of object scopes to search; each object's
|
||||
l_searchlist (i.e. the segment of the dependency tree starting at that
|
||||
object) is searched in turn. REFERENCE_NAME should name the object
|
||||
containing the reference; it is used in error messages. RELOC_ADDR is
|
||||
the address being fixed up and the chosen symbol cannot be one with this
|
||||
value. If NOPLT is nonzero, then the reference must not be resolved to
|
||||
a PLT entry. */
|
||||
containing the reference; it is used in error messages. FLAGS is a
|
||||
set of flags: */
|
||||
#define DL_LOOKUP_NOEXEC 1 /* Don't search the executable for a
|
||||
definition; this is used for copy
|
||||
relocs. */
|
||||
#define DL_LOOKUP_NOPLT 2 /* The reference must not be resolved
|
||||
to a PLT entry. */
|
||||
extern ElfW(Addr) _dl_lookup_symbol (const char *undef,
|
||||
const ElfW(Sym) **sym,
|
||||
struct link_map *symbol_scope[],
|
||||
const char *reference_name,
|
||||
ElfW(Addr) reloc_addr,
|
||||
int noplt);
|
||||
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);
|
||||
|
||||
+132
-35
@@ -38,10 +38,25 @@ extern ElfW(Addr) _dl_sysdep_start (void **start_argptr,
|
||||
ElfW(Addr) *user_entry));
|
||||
extern void _dl_sysdep_start_cleanup (void);
|
||||
|
||||
/* System-dependent function to read a file's whole contents
|
||||
in the most convenient manner available. */
|
||||
extern void *_dl_sysdep_read_whole_file (const char *filename,
|
||||
size_t *filesize_ptr,
|
||||
int mmap_prot);
|
||||
|
||||
int _dl_argc;
|
||||
char **_dl_argv;
|
||||
const char *_dl_rpath;
|
||||
|
||||
/* Set nonzero during loading and initialization of executable and
|
||||
libraries, cleared before the executable's entry point runs. This
|
||||
must not be initialized to nonzero, because the unused dynamic
|
||||
linker loaded in for libc.so's "ld.so.1" dep will provide the
|
||||
definition seen by libc.so's initializer; that value must be zero,
|
||||
and will be since that dynamic linker's _dl_start and dl_main will
|
||||
never be called. */
|
||||
int _dl_starting_up;
|
||||
|
||||
static void dl_main (const ElfW(Phdr) *phdr,
|
||||
ElfW(Half) phent,
|
||||
ElfW(Addr) *user_entry);
|
||||
@@ -62,7 +77,7 @@ _dl_start (void *arg)
|
||||
/* This #define produces dynamic linking inline functions for
|
||||
bootstrap relocation instead of general-purpose relocation. */
|
||||
#define RTLD_BOOTSTRAP
|
||||
#define RESOLVE(sym, reloc_addr, noplt) bootstrap_map.l_addr
|
||||
#define RESOLVE(sym, flags) bootstrap_map.l_addr
|
||||
#include "dynamic-link.h"
|
||||
|
||||
/* Figure out the run-time load address of the dynamic linker itself. */
|
||||
@@ -126,9 +141,13 @@ dl_main (const ElfW(Phdr) *phdr,
|
||||
const ElfW(Phdr) *ph;
|
||||
struct link_map *l;
|
||||
int lazy;
|
||||
enum { normal, list, verify } mode = normal;
|
||||
enum { normal, list, verify, trace } mode;
|
||||
struct link_map **preloads;
|
||||
unsigned int npreloads;
|
||||
size_t file_size;
|
||||
char *file;
|
||||
|
||||
mode = getenv ("LD_TRACE_LOADED_OBJECTS") != NULL ? trace : normal;
|
||||
|
||||
if (*user_entry == (ElfW(Addr)) &_start)
|
||||
{
|
||||
@@ -187,7 +206,25 @@ of this helper program; chances are you did not intend to run this program.\n",
|
||||
--_dl_argc;
|
||||
++_dl_argv;
|
||||
|
||||
l = _dl_map_object (NULL, _dl_argv[0], lt_library);
|
||||
if (mode == verify)
|
||||
{
|
||||
void doit (void)
|
||||
{
|
||||
l = _dl_map_object (NULL, _dl_argv[0], lt_library);
|
||||
}
|
||||
char *err_str = NULL;
|
||||
const char *obj_name __attribute__ ((unused));
|
||||
|
||||
(void) _dl_catch_error (&err_str, &obj_name, doit);
|
||||
if (err_str != NULL)
|
||||
{
|
||||
free (err_str);
|
||||
_exit (EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
else
|
||||
l = _dl_map_object (NULL, _dl_argv[0], lt_library);
|
||||
|
||||
phdr = l->l_phdr;
|
||||
phent = l->l_phnum;
|
||||
l->l_name = (char *) "";
|
||||
@@ -197,7 +234,7 @@ 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_library);
|
||||
l = _dl_new_object ((char *) "", "", lt_executable);
|
||||
l->l_phdr = phdr;
|
||||
l->l_phnum = phent;
|
||||
l->l_entry = *user_entry;
|
||||
@@ -267,8 +304,12 @@ of this helper program; chances are you did not intend to run this program.\n",
|
||||
l->l_next = &_dl_rtld_map;
|
||||
_dl_rtld_map.l_prev = l;
|
||||
|
||||
/* We have two ways to specify objects to preload: via environment
|
||||
variable and via the file /etc/ld.so.preload. The later can also
|
||||
be used when security is enabled. */
|
||||
preloads = NULL;
|
||||
npreloads = 0;
|
||||
|
||||
if (! __libc_enable_secure)
|
||||
{
|
||||
const char *preloadlist = getenv ("LD_PRELOAD");
|
||||
@@ -284,23 +325,88 @@ of this helper program; chances are you did not intend to run this program.\n",
|
||||
(void) _dl_map_object (NULL, p, lt_library);
|
||||
++npreloads;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (npreloads != 0)
|
||||
/* Read the contents of the file. */
|
||||
file = _dl_sysdep_read_whole_file ("/etc/ld.so.preload", &file_size,
|
||||
PROT_READ | PROT_WRITE);
|
||||
if (file)
|
||||
{
|
||||
/* Parse the file. It contains names of libraries to be loaded,
|
||||
separated by white spaces or `:'. It may also contain
|
||||
comments introduced by `#'. */
|
||||
char *problem;
|
||||
char *runp;
|
||||
size_t rest;
|
||||
|
||||
/* Eliminate comments. */
|
||||
runp = file;
|
||||
rest = file_size;
|
||||
while (rest > 0)
|
||||
{
|
||||
char *comment = memchr (runp, '#', rest);
|
||||
if (comment == NULL)
|
||||
break;
|
||||
|
||||
rest -= comment - runp;
|
||||
do
|
||||
*comment = ' ';
|
||||
while (--rest > 0 && *++comment != '\n');
|
||||
}
|
||||
|
||||
/* We have one problematic case: if we have a name at the end of
|
||||
the file without a trailing terminating characters, we cannot
|
||||
place the \0. Handle the case separately. */
|
||||
if (file[file_size - 1] != ' ' && file[file_size] != '\t'
|
||||
&& file[file_size] != '\n')
|
||||
{
|
||||
problem = &file[file_size];
|
||||
while (problem > file && problem[-1] != ' ' && problem[-1] != '\t'
|
||||
&& problem[-1] != '\n')
|
||||
--problem;
|
||||
|
||||
if (problem > file)
|
||||
problem[-1] = '\0';
|
||||
}
|
||||
else
|
||||
problem = NULL;
|
||||
|
||||
if (file != problem)
|
||||
{
|
||||
char *p;
|
||||
runp = file;
|
||||
while ((p = strsep (&runp, ": \t\n")) != NULL)
|
||||
{
|
||||
/* Set up PRELOADS with a vector of the preloaded libraries. */
|
||||
struct link_map *l;
|
||||
unsigned int i;
|
||||
preloads = __alloca (npreloads * sizeof preloads[0]);
|
||||
l = _dl_rtld_map.l_next; /* End of the chain before preloads. */
|
||||
i = 0;
|
||||
do
|
||||
{
|
||||
preloads[i++] = l;
|
||||
l = l->l_next;
|
||||
} while (l);
|
||||
assert (i == npreloads);
|
||||
(void) _dl_map_object (NULL, p, lt_library);
|
||||
++npreloads;
|
||||
}
|
||||
}
|
||||
|
||||
if (problem != NULL)
|
||||
{
|
||||
char *p = strndupa (problem, file_size - (problem - file));
|
||||
(void) _dl_map_object (NULL, p, lt_library);
|
||||
}
|
||||
|
||||
/* We don't need the file anymore. */
|
||||
__munmap (file, file_size);
|
||||
}
|
||||
|
||||
if (npreloads != 0)
|
||||
{
|
||||
/* Set up PRELOADS with a vector of the preloaded libraries. */
|
||||
struct link_map *l;
|
||||
unsigned int i;
|
||||
preloads = __alloca (npreloads * sizeof preloads[0]);
|
||||
l = _dl_rtld_map.l_next; /* End of the chain before preloads. */
|
||||
i = 0;
|
||||
do
|
||||
{
|
||||
preloads[i++] = l;
|
||||
l = l->l_next;
|
||||
} while (l);
|
||||
assert (i == npreloads);
|
||||
}
|
||||
|
||||
/* Load all the libraries specified by DT_NEEDED entries. If LD_PRELOAD
|
||||
@@ -340,7 +446,7 @@ of this helper program; chances are you did not intend to run this program.\n",
|
||||
}
|
||||
}
|
||||
|
||||
if (mode != normal || getenv ("LD_TRACE_LOADED_OBJECTS") != NULL)
|
||||
if (mode != normal)
|
||||
{
|
||||
/* We were run just to list the shared libraries. It is
|
||||
important that we do this before real relocation, because the
|
||||
@@ -357,28 +463,29 @@ of this helper program; chances are you did not intend to run this program.\n",
|
||||
char buf[20], *bp;
|
||||
buf[sizeof buf - 1] = '\0';
|
||||
bp = _itoa (l->l_addr, &buf[sizeof buf - 1], 16, 0);
|
||||
while (&buf[sizeof buf - 1] - bp < sizeof l->l_addr * 2)
|
||||
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 != normal)
|
||||
if (mode != trace)
|
||||
for (i = 1; i < _dl_argc; ++i)
|
||||
{
|
||||
const ElfW(Sym) *ref = NULL;
|
||||
ElfW(Addr) loadbase = _dl_lookup_symbol (_dl_argv[i], &ref,
|
||||
&_dl_default_scope[2],
|
||||
"argument", 0, 0);
|
||||
"argument",
|
||||
DL_LOOKUP_NOPLT);
|
||||
char buf[20], *bp;
|
||||
buf[sizeof buf - 1] = '\0';
|
||||
bp = _itoa (ref->st_value, &buf[sizeof buf - 1], 16, 0);
|
||||
while (&buf[sizeof buf - 1] - bp < sizeof loadbase * 2)
|
||||
while ((size_t) (&buf[sizeof buf - 1] - bp) < sizeof loadbase * 2)
|
||||
*--bp = '0';
|
||||
_dl_sysdep_message (_dl_argv[i], " found at 0x", bp, NULL);
|
||||
buf[sizeof buf - 1] = '\0';
|
||||
bp = _itoa (loadbase, &buf[sizeof buf - 1], 16, 0);
|
||||
while (&buf[sizeof buf - 1] - bp < sizeof loadbase * 2)
|
||||
while ((size_t) (&buf[sizeof buf - 1] - bp) < sizeof loadbase * 2)
|
||||
*--bp = '0';
|
||||
_dl_sysdep_message (" in object at 0x", bp, "\n", NULL);
|
||||
}
|
||||
@@ -456,18 +563,8 @@ of this helper program; chances are you did not intend to run this program.\n",
|
||||
_dl_debug_state ();
|
||||
}
|
||||
|
||||
if (_dl_rtld_map.l_info[DT_INIT])
|
||||
{
|
||||
/* Call the initializer for the compatibility version of the
|
||||
dynamic linker. There is no additional initialization
|
||||
required for the ABI-compliant dynamic linker. */
|
||||
|
||||
(*(void (*) (void)) (_dl_rtld_map.l_addr +
|
||||
_dl_rtld_map.l_info[DT_INIT]->d_un.d_ptr)) ();
|
||||
|
||||
/* Clear the field so a future dlopen won't run it again. */
|
||||
_dl_rtld_map.l_info[DT_INIT] = NULL;
|
||||
}
|
||||
/* 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. */
|
||||
|
||||
+5
-1
@@ -29,6 +29,8 @@ Cambridge, MA 02139, USA. */
|
||||
_BSD_SOURCE ANSI, POSIX, and 4.3BSD things.
|
||||
_SVID_SOURCE ANSI, 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.
|
||||
|
||||
The `-ansi' switch to the GNU C compiler defines __STRICT_ANSI__.
|
||||
If none of these are defined, the default is all but _GNU_SOURCE.
|
||||
@@ -137,7 +139,7 @@ Cambridge, MA 02139, USA. */
|
||||
#define __USE_GNU 1
|
||||
#endif
|
||||
|
||||
#if defined (__USE_GNU) || defined (__USE_MISC)
|
||||
#if defined (_REENTRANT) || defined (_THREAD_SAFE)
|
||||
#define __USE_REENTRANT 1
|
||||
#endif
|
||||
|
||||
@@ -160,7 +162,9 @@ Cambridge, MA 02139, USA. */
|
||||
|
||||
|
||||
/* This is here only because every header file already includes this one. */
|
||||
#ifndef __ASSEMBLER__
|
||||
#include <sys/cdefs.h>
|
||||
#endif
|
||||
|
||||
/* This is here only because every header file already includes this one. */
|
||||
#ifndef _LIBC
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ subdir := gmon
|
||||
|
||||
headers := sys/gmon.h sys/gmon_out.h
|
||||
distribute := machine-gmon.h profil-counter.h
|
||||
routines := gmon mcount profil bb_init_func bb_exit_func
|
||||
routines := gmon mcount profil bb_init_func bb_exit_func prof-freq
|
||||
|
||||
include ../Rules
|
||||
|
||||
|
||||
+27
-46
@@ -35,7 +35,6 @@
|
||||
#include <sys/gmon.h>
|
||||
#include <sys/gmon_out.h>
|
||||
|
||||
#include <ansidecl.h>
|
||||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
@@ -45,6 +44,8 @@
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
extern int __profile_frequency __P ((void));
|
||||
|
||||
struct __bb *__bb_head; /* Head of basic-block list or NULL. */
|
||||
|
||||
struct gmonparam _gmonparam = { GMON_PROF_OFF };
|
||||
@@ -55,28 +56,7 @@ struct gmonparam _gmonparam = { GMON_PROF_OFF };
|
||||
static int s_scale;
|
||||
#define SCALE_1_TO_1 0x10000L
|
||||
|
||||
#define ERR(s) write(2, s, sizeof(s))
|
||||
|
||||
/*
|
||||
* Discover the tick frequency of the machine if something goes wrong,
|
||||
* we return 0, an impossible hertz.
|
||||
*/
|
||||
static int
|
||||
DEFUN_VOID(hertz)
|
||||
{
|
||||
struct itimerval tim;
|
||||
|
||||
tim.it_interval.tv_sec = 0;
|
||||
tim.it_interval.tv_usec = 1;
|
||||
tim.it_value.tv_sec = 0;
|
||||
tim.it_value.tv_usec = 0;
|
||||
setitimer(ITIMER_REAL, &tim, 0);
|
||||
setitimer(ITIMER_REAL, 0, &tim);
|
||||
if (tim.it_interval.tv_usec < 2)
|
||||
return 0;
|
||||
return (1000000 / tim.it_interval.tv_usec);
|
||||
}
|
||||
|
||||
#define ERR(s) write(2, s, sizeof(s) - 1)
|
||||
|
||||
/*
|
||||
* Control profiling
|
||||
@@ -84,7 +64,8 @@ DEFUN_VOID(hertz)
|
||||
* all the data structures are ready.
|
||||
*/
|
||||
void
|
||||
DEFUN(moncontrol, (mode), int mode)
|
||||
moncontrol (mode)
|
||||
int mode;
|
||||
{
|
||||
struct gmonparam *p = &_gmonparam;
|
||||
|
||||
@@ -104,7 +85,9 @@ DEFUN(moncontrol, (mode), int mode)
|
||||
|
||||
|
||||
void
|
||||
DEFUN(monstartup, (lowpc, highpc), u_long lowpc AND u_long highpc)
|
||||
monstartup (lowpc, highpc)
|
||||
u_long lowpc;
|
||||
u_long highpc;
|
||||
{
|
||||
register int o;
|
||||
char *cp;
|
||||
@@ -149,7 +132,7 @@ DEFUN(monstartup, (lowpc, highpc), u_long lowpc AND u_long highpc)
|
||||
p->tos[0].link = 0;
|
||||
|
||||
o = p->highpc - p->lowpc;
|
||||
if (p->kcountsize < o)
|
||||
if (p->kcountsize < (u_long) o)
|
||||
{
|
||||
#ifndef hp300
|
||||
s_scale = ((float)p->kcountsize / o ) * SCALE_1_TO_1;
|
||||
@@ -174,21 +157,19 @@ DEFUN(monstartup, (lowpc, highpc), u_long lowpc AND u_long highpc)
|
||||
|
||||
|
||||
static void
|
||||
DEFUN(write_hist, (fd), int fd)
|
||||
write_hist (fd)
|
||||
int fd;
|
||||
{
|
||||
const u_char tag = GMON_TAG_TIME_HIST;
|
||||
struct gmon_hist_hdr thdr;
|
||||
int size, rate;
|
||||
|
||||
if (_gmonparam.kcountsize > 0)
|
||||
{
|
||||
size = _gmonparam.kcountsize / sizeof(HISTCOUNTER);
|
||||
rate = hertz();
|
||||
bcopy(&_gmonparam.lowpc, &thdr.low_pc, sizeof(thdr.low_pc));
|
||||
bcopy(&_gmonparam.highpc, &thdr.high_pc, sizeof(thdr.high_pc));
|
||||
bcopy(&size, &thdr.hist_size, sizeof(thdr.hist_size));
|
||||
bcopy(&rate, &thdr.prof_rate, sizeof(thdr.prof_rate));
|
||||
strcpy(thdr.dimen, "seconds");
|
||||
thdr.low_pc = _gmonparam.lowpc;
|
||||
thdr.high_pc = _gmonparam.highpc;
|
||||
thdr.hist_size = _gmonparam.kcountsize / sizeof(HISTCOUNTER);
|
||||
thdr.prof_rate = __profile_frequency();
|
||||
strncpy(thdr.dimen, "seconds", sizeof(thdr.dimen));
|
||||
thdr.dimen_abbrev = 's';
|
||||
|
||||
write(fd, &tag, sizeof(tag));
|
||||
@@ -199,7 +180,8 @@ DEFUN(write_hist, (fd), int fd)
|
||||
|
||||
|
||||
static void
|
||||
DEFUN(write_call_graph, (fd), int fd)
|
||||
write_call_graph (fd)
|
||||
int fd;
|
||||
{
|
||||
const u_char tag = GMON_TAG_CG_ARC;
|
||||
struct gmon_cg_arc_record raw_arc;
|
||||
@@ -219,11 +201,9 @@ DEFUN(write_call_graph, (fd), int fd)
|
||||
to_index != 0;
|
||||
to_index = _gmonparam.tos[to_index].link)
|
||||
{
|
||||
bcopy(&frompc, &raw_arc.from_pc, sizeof(raw_arc.from_pc));
|
||||
bcopy(&_gmonparam.tos[to_index].selfpc, &raw_arc.self_pc,
|
||||
sizeof(raw_arc.self_pc));
|
||||
bcopy(&_gmonparam.tos[to_index].count, &raw_arc.count,
|
||||
sizeof(raw_arc.count));
|
||||
raw_arc.from_pc = frompc;
|
||||
raw_arc.self_pc = _gmonparam.tos[to_index].selfpc;
|
||||
raw_arc.count = _gmonparam.tos[to_index].count;
|
||||
|
||||
write(fd, &tag, sizeof(tag));
|
||||
write(fd, &raw_arc, sizeof(raw_arc));
|
||||
@@ -233,7 +213,8 @@ DEFUN(write_call_graph, (fd), int fd)
|
||||
|
||||
|
||||
static void
|
||||
DEFUN(write_bb_counts, (fd), int fd)
|
||||
write_bb_counts (fd)
|
||||
int fd;
|
||||
{
|
||||
struct __bb *grp;
|
||||
const u_char tag = GMON_TAG_BB_COUNT;
|
||||
@@ -258,9 +239,8 @@ DEFUN(write_bb_counts, (fd), int fd)
|
||||
|
||||
|
||||
void
|
||||
DEFUN_VOID(_mcleanup)
|
||||
_mcleanup ()
|
||||
{
|
||||
const int version = GMON_VERSION;
|
||||
struct gmon_hdr ghdr;
|
||||
int fd;
|
||||
|
||||
@@ -273,8 +253,9 @@ DEFUN_VOID(_mcleanup)
|
||||
}
|
||||
|
||||
/* write gmon.out header: */
|
||||
bcopy(GMON_MAGIC, &ghdr.cookie[0], 4);
|
||||
bcopy(&version, &ghdr.version, sizeof(version));
|
||||
memset(&ghdr, 0, sizeof(ghdr));
|
||||
memcpy(&ghdr.cookie[0], GMON_MAGIC, sizeof(ghdr.cookie));
|
||||
ghdr.version = GMON_VERSION;
|
||||
write(fd, &ghdr, sizeof(ghdr));
|
||||
|
||||
/* write PC histogram: */
|
||||
|
||||
@@ -58,7 +58,6 @@ static char sccsid[] = "@(#)mcount.c 8.1 (Berkeley) 6/4/93";
|
||||
* perform this optimization.
|
||||
*/
|
||||
_MCOUNT_DECL(frompc, selfpc) /* _mcount; may be static, inline, etc */
|
||||
register u_long frompc, selfpc;
|
||||
{
|
||||
register u_short *frompcindex;
|
||||
register struct tostruct *top, *prevtop;
|
||||
|
||||
+5
-3
@@ -33,10 +33,12 @@
|
||||
* @(#)gmon.h 8.2 (Berkeley) 1/4/94
|
||||
*/
|
||||
|
||||
#ifndef _SYS_GMON_H_
|
||||
#define _SYS_GMON_H_
|
||||
#ifndef _SYS_GMON_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#define _SYS_GMON_H_ 1
|
||||
#include <features.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
/*
|
||||
* See gmon_out.h for gmon.out format.
|
||||
|
||||
+9
-9
@@ -39,8 +39,8 @@ identifying the type of records, followed by records specific data. */
|
||||
*/
|
||||
struct gmon_hdr {
|
||||
char cookie[4];
|
||||
char version[4];
|
||||
char spare[3 * 4];
|
||||
int version;
|
||||
int spare[3];
|
||||
};
|
||||
|
||||
/* types of records in this file: */
|
||||
@@ -49,18 +49,18 @@ typedef enum {
|
||||
} GMON_Record_Tag;
|
||||
|
||||
struct gmon_hist_hdr {
|
||||
char low_pc[sizeof (char *)]; /* base pc address of sample buffer */
|
||||
char high_pc[sizeof (char *)]; /* max pc address of sampled buffer */
|
||||
char hist_size[4]; /* size of sample buffer */
|
||||
char prof_rate[4]; /* profiling clock rate */
|
||||
unsigned long low_pc; /* base pc address of sample buffer */
|
||||
unsigned long high_pc; /* max pc address of sampled buffer */
|
||||
int hist_size; /* size of sample buffer */
|
||||
int prof_rate; /* profiling clock rate */
|
||||
char dimen[15]; /* phys. dim., usually "seconds" */
|
||||
char dimen_abbrev; /* usually 's' for "seconds" */
|
||||
};
|
||||
|
||||
struct gmon_cg_arc_record {
|
||||
char from_pc[sizeof (char *)]; /* address within caller's body */
|
||||
char self_pc[sizeof (char *)]; /* address within callee's body */
|
||||
char count[4]; /* number of arc traversals */
|
||||
unsigned long from_pc; /* address within caller's body */
|
||||
unsigned long self_pc; /* address within callee's body */
|
||||
int count; /* number of arc traversals */
|
||||
};
|
||||
|
||||
#endif /* !_SYS_GMON_OUT_H_ */
|
||||
|
||||
-75
@@ -1,75 +0,0 @@
|
||||
#error This file is obsolete.
|
||||
|
||||
/* Copyright (C) 1991, 1992, 1994 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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
|
||||
#ifndef __GNU_STABS_H
|
||||
|
||||
#define __GNU_STABS_H 1
|
||||
|
||||
#ifdef HAVE_GNU_LD
|
||||
|
||||
/* Alias a function:
|
||||
function_alias(creat, _creat, int, (file, mode),
|
||||
DEFUN(creat, (file, mode),
|
||||
CONST char *file AND int mode))
|
||||
Yes, this is very repetitive. Nothing you can do about it, so shut up. */
|
||||
#define function_alias(name, _name, type, args, defun) \
|
||||
symbol_alias (_name, name);
|
||||
|
||||
#define function_alias_void(name, _name, args, defun) \
|
||||
symbol_alias (_name, name);
|
||||
|
||||
#ifdef NO_UNDERSCORES
|
||||
#define __SYMBOL_PREFIX
|
||||
#else
|
||||
#define __SYMBOL_PREFIX "_"
|
||||
#endif
|
||||
|
||||
/* Make references to ALIAS refer to SYMBOL. */
|
||||
#define symbol_alias(symbol, alias) \
|
||||
asm(".stabs \"" __SYMBOL_PREFIX #alias "\",11,0,0,0\n"\
|
||||
".stabs \"" __SYMBOL_PREFIX #symbol "\",1,0,0,0")
|
||||
|
||||
/* Issue a warning message from the linker whenever SYMBOL is referenced. */
|
||||
#define warn_references(symbol, msg) \
|
||||
asm(".stabs \"" msg "\",30,0,0,0\n" \
|
||||
".stabs \"" __SYMBOL_PREFIX #symbol "\",1,0,0,0")
|
||||
|
||||
#define stub_warning(name) \
|
||||
warn_references(name, \
|
||||
"warning: " #name " is not implemented and will always fail")
|
||||
|
||||
#define text_set_element(set, symbol) \
|
||||
asm(".stabs \"" __SYMBOL_PREFIX #set "\",23,0,0," __SYMBOL_PREFIX #symbol)
|
||||
#define data_set_element(set, symbol) \
|
||||
asm(".stabs \"" __SYMBOL_PREFIX #set "\",25,0,0," __SYMBOL_PREFIX #symbol)
|
||||
#define bss_set_element(set, symbol) \
|
||||
asm(".stabs \"" __SYMBOL_PREFIX #set "\",27,0,0," __SYMBOL_PREFIX #symbol)
|
||||
|
||||
#else /* No GNU stabs. */
|
||||
|
||||
#define function_alias(name, _name, type, args, defun) \
|
||||
type defun { return _name args; }
|
||||
|
||||
#define function_alias_void(name, _name, args, defun) \
|
||||
void defun { _name args; }
|
||||
|
||||
#endif /* GNU stabs. */
|
||||
|
||||
#endif /* gnu-stabs.h */
|
||||
+1
-1
@@ -23,7 +23,7 @@ subdir := grp
|
||||
|
||||
routines := fgetgrent initgroups setgroups \
|
||||
getgrent getgrgid getgrnam \
|
||||
getgrent_r getgrgid_r getgrnam_r
|
||||
getgrent_r getgrgid_r getgrnam_r fgetgrent_r
|
||||
|
||||
tests := testgrp
|
||||
|
||||
|
||||
+2
-34
@@ -16,25 +16,8 @@ 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. */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <grp.h>
|
||||
|
||||
/* Define a line parsing function using the common code
|
||||
used in the nss_files module. */
|
||||
|
||||
#define STRUCTURE group
|
||||
#define ENTNAME grent
|
||||
struct grent_data {};
|
||||
|
||||
#define TRAILING_LIST_MEMBER gr_mem
|
||||
#define TRAILING_LIST_SEPARATOR_P(c) ((c) == ',')
|
||||
#include "../nss/nss_files/files-parse.c"
|
||||
LINE_PARSER
|
||||
(,
|
||||
STRING_FIELD (result->gr_name, ISCOLON, 0);
|
||||
STRING_FIELD (result->gr_passwd, ISCOLON, 0);
|
||||
INT_FIELD (result->gr_gid, ISCOLON, 0, 10,);
|
||||
)
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
/* Read one entry from the given stream. */
|
||||
@@ -43,21 +26,6 @@ fgetgrent (FILE *stream)
|
||||
{
|
||||
static char buffer[BUFSIZ];
|
||||
static struct group result;
|
||||
char *p;
|
||||
|
||||
do
|
||||
{
|
||||
p = fgets (buffer, sizeof buffer, stream);
|
||||
if (p == NULL)
|
||||
return NULL;
|
||||
|
||||
/* Skip leading blanks. */
|
||||
while (isspace (*p))
|
||||
++p;
|
||||
} 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, sizeof buffer));
|
||||
|
||||
return &result;
|
||||
return __fgetgrent_r (stream, &result, buffer, sizeof buffer);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
/* Copyright (C) 1991, 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 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. */
|
||||
|
||||
#include <ctype.h>
|
||||
#include <grp.h>
|
||||
#include <stdio.h>
|
||||
|
||||
/* Define a line parsing function using the common code
|
||||
used in the nss_files module. */
|
||||
|
||||
#define STRUCTURE group
|
||||
#define ENTNAME grent
|
||||
struct grent_data {};
|
||||
|
||||
#define TRAILING_LIST_MEMBER gr_mem
|
||||
#define TRAILING_LIST_SEPARATOR_P(c) ((c) == ',')
|
||||
#include "../nss/nss_files/files-parse.c"
|
||||
LINE_PARSER
|
||||
(,
|
||||
STRING_FIELD (result->gr_name, ISCOLON, 0);
|
||||
STRING_FIELD (result->gr_passwd, ISCOLON, 0);
|
||||
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)
|
||||
{
|
||||
char *p;
|
||||
|
||||
do
|
||||
{
|
||||
p = fgets (buffer, buflen, stream);
|
||||
if (p == NULL)
|
||||
return NULL;
|
||||
|
||||
/* Skip leading blanks. */
|
||||
while (isspace (*p))
|
||||
++p;
|
||||
} 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));
|
||||
|
||||
return result;
|
||||
}
|
||||
weak_alias (__fgetgrent_r, fgetgrent_r)
|
||||
+1
-1
@@ -25,6 +25,6 @@ Boston, MA 02111-1307, USA. */
|
||||
#define GETFUNC_NAME getgrent
|
||||
#define ENDFUNC_NAME endgrent
|
||||
#define DATABASE_NAME group
|
||||
#define BUFLEN 1024
|
||||
#define BUFLEN NSS_BUFLEN_GROUP
|
||||
|
||||
#include "../nss/getXXent.c"
|
||||
|
||||
+1
-1
@@ -25,6 +25,6 @@ Boston, MA 02111-1307, USA. */
|
||||
#define GETFUNC_NAME getgrent
|
||||
#define ENDFUNC_NAME endgrent
|
||||
#define DATABASE_NAME group
|
||||
#define BUFLEN 1024
|
||||
#define BUFLEN NSS_BUFLEN_GROUP
|
||||
|
||||
#include "../nss/getXXent_r.c"
|
||||
|
||||
+1
-1
@@ -25,6 +25,6 @@ Boston, MA 02111-1307, USA. */
|
||||
#define DATABASE_NAME group
|
||||
#define ADD_PARAMS gid_t gid
|
||||
#define ADD_VARIABLES gid
|
||||
#define BUFLEN 1024
|
||||
#define BUFLEN NSS_BUFLEN_GROUP
|
||||
|
||||
#include "../nss/getXXbyYY.c"
|
||||
|
||||
+1
-1
@@ -25,6 +25,6 @@ Boston, MA 02111-1307, USA. */
|
||||
#define DATABASE_NAME group
|
||||
#define ADD_PARAMS gid_t gid
|
||||
#define ADD_VARIABLES gid
|
||||
#define BUFLEN 1024
|
||||
#define BUFLEN NSS_BUFLEN_GROUP
|
||||
|
||||
#include "../nss/getXXbyYY_r.c"
|
||||
|
||||
+1
-1
@@ -25,6 +25,6 @@ Boston, MA 02111-1307, USA. */
|
||||
#define DATABASE_NAME group
|
||||
#define ADD_PARAMS const char *name
|
||||
#define ADD_VARIABLES name
|
||||
#define BUFLEN 1024
|
||||
#define BUFLEN NSS_BUFLEN_GROUP
|
||||
|
||||
#include "../nss/getXXbyYY.c"
|
||||
|
||||
@@ -85,6 +85,43 @@ 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
|
||||
/* Reasonable value for the buffer sized used in the reentrant
|
||||
functions below. But better use `sysconf'. */
|
||||
#define NSS_BUFLEN_GROUP 1024
|
||||
|
||||
/* 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. */
|
||||
|
||||
#if defined(__USE_SVID) || defined(__USE_MISC) || defined (__USE_BSD)
|
||||
extern struct group *getgrent_r __P ((struct group *__resultbuf,
|
||||
char *buffer, int __buflen));
|
||||
#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));
|
||||
|
||||
/* 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));
|
||||
|
||||
#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));
|
||||
#endif
|
||||
|
||||
#endif /* reentrant */
|
||||
|
||||
|
||||
#ifdef __USE_BSD
|
||||
|
||||
|
||||
+14
-2
@@ -49,7 +49,7 @@ routines = hurdstartup hurdinit \
|
||||
privports \
|
||||
msgportdemux \
|
||||
fopenport \
|
||||
vpprintf \
|
||||
vpprintf \
|
||||
ports-get ports-set hurdports hurdmsg \
|
||||
$(sig) $(dtable) hurdinline port-cleanup report-wait
|
||||
sig = hurdsig hurdfault siginfo hurd-raise preempt-sig \
|
||||
@@ -59,7 +59,7 @@ dtable = dtable port2fd new-fd alloc-fd intern-fd \
|
||||
getdport openport \
|
||||
fd-close fd-read fd-write hurdioctl ctty-input ctty-output
|
||||
distribute = hurdstartup.h hurdfault.h hurdhost.h \
|
||||
faultexc.defs intr-rpc.defs intr-rpc.h
|
||||
faultexc.defs intr-rpc.defs intr-rpc.h intr-msg.h Notes
|
||||
|
||||
# XXX this is a temporary hack; see hurdmalloc.h
|
||||
routines += hurdmalloc
|
||||
@@ -68,6 +68,18 @@ distribute += hurdmalloc.h
|
||||
include ../mach/Machrules
|
||||
include ../Rules
|
||||
|
||||
# XXX sunrpc doesn't build yet for Hurd, but its headers are
|
||||
# crucial nontheless. So sysdeps/mach/hurd/Makefile elides sunrpc
|
||||
# from $(subdirs), and this rule arranges for the headers in question
|
||||
# to get installed.
|
||||
sunrpc-headers = netdb.h pmap_prot.h xdr.h types.h auth.h \
|
||||
rpc_msg.h auth_unix.h
|
||||
installed-sunrpc-headers = $(addprefix $(includedir)/rpc/,$(sunrpc-headers))
|
||||
install-headers-nosubdir: $(installed-sunrpc-headers)
|
||||
$(installed-sunrpc-headers): $(includedir)/%: $(..)sunrpc/%
|
||||
$(do-install)
|
||||
|
||||
|
||||
# intr-rpc.defs defines the INTR_INTERFACE macro to make the generated RPC
|
||||
# stubs import <hurd/signal.h> and #define __mach_msg to
|
||||
# _hurd_intr_rpc_mach_msg.
|
||||
|
||||
+4
-2
@@ -31,6 +31,8 @@ struct hurd_port *_hurd_ports;
|
||||
unsigned int _hurd_nports;
|
||||
mode_t _hurd_umask;
|
||||
sigset_t _hurdsig_traced;
|
||||
char **__libc_argv;
|
||||
|
||||
|
||||
error_t
|
||||
_hurd_ports_use (int which, error_t (*operate) (mach_port_t))
|
||||
@@ -175,8 +177,8 @@ _hurd_setproc (process_t procserver)
|
||||
|
||||
/* Tell the proc server where our args and environment are. */
|
||||
if (err = __proc_set_arg_locations (procserver,
|
||||
/* We don't know the ARGV location. */
|
||||
(vm_address_t) 0,
|
||||
_hide_arguments ? 0 :
|
||||
(vm_address_t) __libc_argv,
|
||||
_hide_environment ? 0 :
|
||||
(vm_address_t) __environ))
|
||||
return err;
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#undef _EXTERN_INLINE
|
||||
#define _EXTERN_INLINE /* Define the real function. */
|
||||
|
||||
#include "hurd.h"
|
||||
#include "hurd/fd.h"
|
||||
#include "hurd/signal.h"
|
||||
#include "hurd/userlink.h"
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
BEGIN { intr=0; wantcall=0; calls=""; }
|
||||
|
||||
$1 == "/*" && $2 == "INTR" && $3 == "*/" { intr=1; }
|
||||
|
||||
NF == 1 && $1 == "routine" { wantcall=1; next; }
|
||||
|
||||
intr != 0 && wantcall == 0 && NF >= 2 && $1 == "routine" \
|
||||
{
|
||||
if (substr($2, length($2)-2, 1) == "(")
|
||||
calls = calls " " substr($2, 0, length($2)-1);
|
||||
else calls = calls " " $2;
|
||||
intr=0;
|
||||
}
|
||||
|
||||
wantcall != 0 && NF >= 1 \
|
||||
{
|
||||
if (substr($1, length($1)-2, 1) == "(")
|
||||
calls = calls " " substr($1, 0, length($1)-1);
|
||||
else calls = calls " " $1;
|
||||
intr=0;
|
||||
}
|
||||
|
||||
{ wantcall=0; }
|
||||
|
||||
END { print varname " :=" calls; }
|
||||
@@ -1,45 +0,0 @@
|
||||
# Icky intimate knowledge of MiG output.
|
||||
|
||||
BEGIN \
|
||||
{
|
||||
nprotolines=0; proto=0;
|
||||
args=""; echo=1; isintr=0;
|
||||
intrcall = "__hurd_intr_rpc_" call;
|
||||
print "#include <hurd/signal.h>";
|
||||
}
|
||||
|
||||
$NF == intrcall { isintr=1; }
|
||||
|
||||
NF == 1 && $1 == ")" { proto=0; }
|
||||
proto \
|
||||
{
|
||||
protolines[nprotolines++] = $0;
|
||||
arg = $NF;
|
||||
if (substr(arg, 1, 1) == "*")
|
||||
arg = substr(arg, 2, length(arg)-1);
|
||||
args = args arg;
|
||||
}
|
||||
NF == 1 && $1 == "(" { proto=1; }
|
||||
|
||||
NF == 3 && $1 == "InP->Head.msgh_request_port" \
|
||||
{ portarg = substr($3, 1, length($3)-1); }
|
||||
|
||||
{ print $0; }
|
||||
|
||||
END \
|
||||
{
|
||||
if (isintr)
|
||||
{
|
||||
print "\n\n/* User-callable interrupt-handling stub. */";
|
||||
print "kern_return_t __" call;
|
||||
print "(";
|
||||
for (i = 0; i < nprotolines; ++i)
|
||||
print protolines[i];
|
||||
print ")";
|
||||
print "{";
|
||||
print " return HURD_EINTR_RPC (" portarg ", " \
|
||||
intrcall "(" args "));";
|
||||
print "}";
|
||||
}
|
||||
print "weak_alias (__" call ", " call ")"
|
||||
}
|
||||
+5
-2
@@ -22,7 +22,9 @@
|
||||
subdir := inet
|
||||
|
||||
headers := netinet/ether.h netinet/in.h netinet/if_ether.h \
|
||||
$(wildcard arpa/*.h protocols/*.h)
|
||||
netinet/tcp.h $(wildcard arpa/*.h protocols/*.h)
|
||||
|
||||
distribute := netgroup.h
|
||||
|
||||
routines := ntohl ntohs htonl htons \
|
||||
inet_lnaof inet_mkadr \
|
||||
@@ -38,7 +40,8 @@ routines := ntohl ntohs htonl htons \
|
||||
getrpcent_r getrpcbyname_r getrpcbynumber_r \
|
||||
ether_aton ether_aton_r ether_hton ether_line \
|
||||
ether_ntoa ether_ntoa_r ether_ntoh \
|
||||
rcmd rexec ruserpass
|
||||
rcmd rexec ruserpass \
|
||||
getnetgrent_r getnetgrent
|
||||
|
||||
# No warnings about losing BSD code.
|
||||
override +gccwarn := -w
|
||||
|
||||
+7
-4
@@ -46,13 +46,16 @@ u_long inet_addr __P((const char *));
|
||||
int inet_aton __P((const char *, struct in_addr *));
|
||||
u_int32_t inet_lnaof __P((struct in_addr));
|
||||
struct in_addr inet_makeaddr __P((u_int32_t , u_int32_t));
|
||||
char * inet_neta __P((u_long, char *, size_t));
|
||||
u_int32_t inet_netof __P((struct in_addr));
|
||||
u_int32_t inet_network __P((const char *));
|
||||
char *inet_net_ntop __P((int, const void *, int, char *, size_t));
|
||||
int inet_net_pton __P((int, const char *, void *, size_t));
|
||||
char *inet_ntoa __P((struct in_addr));
|
||||
int inet_pton __P((int af, const char *src, void *dst));
|
||||
const char *inet_ntop __P((int af, const void *src, char *dst, size_t s));
|
||||
u_int inet_nsap_addr __P((const char *, u_char *, int maxlen));
|
||||
char *inet_nsap_ntoa __P((int, const u_char *, char *ascii));
|
||||
int inet_pton __P((int, const char *, void *));
|
||||
const char *inet_ntop __P((int, const void *, char *, size_t));
|
||||
u_int inet_nsap_addr __P((const char *, u_char *, int));
|
||||
char *inet_nsap_ntoa __P((int, const u_char *, char *));
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_INET_H_ */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
|
||||
/* 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
|
||||
@@ -13,19 +13,16 @@ 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. */
|
||||
not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <netdb.h>
|
||||
|
||||
#include <ansidecl.h>
|
||||
#include <math.h>
|
||||
|
||||
/* Return 0 if VALUE is finite or NaN, +1 if it
|
||||
is +Infinity, -1 if it is -Infinity. */
|
||||
int
|
||||
DEFUN(__isinf, (value), double value)
|
||||
getnetgrent (char **hostp, char **userp, char **domainp)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
weak_alias (__isinf, isinf)
|
||||
static char buffer[1024]; /* All three strings shouldn't use 1kB. */
|
||||
|
||||
stub_warning (__isinf)
|
||||
return __getnetgrent_r (hostp, userp, domainp, buffer, sizeof (buffer));
|
||||
}
|
||||
@@ -0,0 +1,218 @@
|
||||
/* 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 distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If
|
||||
not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <libc-lock.h>
|
||||
#include <netdb.h>
|
||||
#include "netgroup.h"
|
||||
#include "nsswitch.h"
|
||||
|
||||
|
||||
/* Protect above variable against multiple uses at the same time. */
|
||||
__libc_lock_define_initialized (static, lock)
|
||||
|
||||
/* This handle for the NSS data base is shared between all
|
||||
set/get/endXXXent functions. */
|
||||
static service_user *nip;
|
||||
/* Remember the first service_entry, it's always the same. */
|
||||
static service_user *startp;
|
||||
|
||||
|
||||
/* The lookup function for the first entry of this service. */
|
||||
extern int __nss_netgroup_lookup (service_user **nip, const char *name,
|
||||
void **fctp);
|
||||
|
||||
/* Set up NIP to run through the services. If ALL is zero, use NIP's
|
||||
current location if it's not nil. Return nonzero if there are no
|
||||
services (left). */
|
||||
static enum nss_status
|
||||
setup (void **fctp, const char *func_name, int all)
|
||||
{
|
||||
int no_more;
|
||||
if (startp == NULL)
|
||||
{
|
||||
no_more = __nss_netgroup_lookup (&nip, func_name, fctp);
|
||||
startp = no_more ? (service_user *) -1 : nip;
|
||||
}
|
||||
else if (startp == (service_user *) -1)
|
||||
/* No services at all. */
|
||||
return 1;
|
||||
else
|
||||
{
|
||||
if (all || !nip)
|
||||
/* Reset to the beginning of the service list. */
|
||||
nip = startp;
|
||||
/* Look up the first function. */
|
||||
no_more = __nss_lookup (&nip, func_name, fctp);
|
||||
}
|
||||
return no_more;
|
||||
}
|
||||
|
||||
int
|
||||
setnetgrent (const char *group)
|
||||
{
|
||||
enum nss_status (*fct) (const char *);
|
||||
enum nss_status status = NSS_STATUS_UNAVAIL;
|
||||
int no_more;
|
||||
|
||||
__libc_lock_lock (lock);
|
||||
|
||||
/* Cycle through all the services and run their setnetgrent functions. */
|
||||
no_more = setup ((void **) &fct, "setnetgrent", 1);
|
||||
while (! no_more)
|
||||
{
|
||||
/* Ignore status, we force check in __NSS_NEXT. */
|
||||
status = (*fct) (group);
|
||||
|
||||
no_more = __nss_next (&nip, "setnetgrent", (void **) &fct, status, 0);
|
||||
}
|
||||
|
||||
__libc_lock_unlock (lock);
|
||||
|
||||
return status == NSS_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
endnetgrent (void)
|
||||
{
|
||||
service_user *old_nip;
|
||||
enum nss_status (*fct) (void);
|
||||
int no_more;
|
||||
|
||||
__libc_lock_lock (lock);
|
||||
|
||||
/* Remember which was the last used service. */
|
||||
old_nip = nip;
|
||||
|
||||
/* Cycle through all the services and run their setnetgrent functions. */
|
||||
no_more = setup ((void **) &fct, "endnetgrent", 1);
|
||||
while (! no_more)
|
||||
{
|
||||
/* Ignore status, we force check in __NSS_NEXT. */
|
||||
(void) (*fct) ();
|
||||
|
||||
no_more = (nip == old_nip
|
||||
|| __nss_next (&nip, "endnetgrent", (void **) &fct, 0, 1));
|
||||
}
|
||||
|
||||
__libc_lock_unlock (lock);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
__getnetgrent_r (char **hostp, char **userp, char **domainp,
|
||||
char *buffer, int buflen)
|
||||
{
|
||||
enum nss_status (*fct) (struct __netgrent *, char *, int);
|
||||
struct __netgrent result;
|
||||
int no_more;
|
||||
|
||||
/* Initialize status to return if no more functions are found. */
|
||||
enum nss_status status = NSS_STATUS_NOTFOUND;
|
||||
|
||||
__libc_lock_lock (lock);
|
||||
|
||||
/* Run through available functions, starting with the same function last
|
||||
run. We will repeat each function as long as it succeeds, and then go
|
||||
on to the next service action. */
|
||||
no_more = setup ((void **) &fct, "getnetgrent_r", 0);
|
||||
while (! no_more)
|
||||
{
|
||||
status = (*fct) (&result, buffer, buflen);
|
||||
|
||||
no_more = __nss_next (&nip, "getnetgrent_r", (void **) &fct, status, 0);
|
||||
}
|
||||
|
||||
if (status == NSS_STATUS_SUCCESS)
|
||||
{
|
||||
*hostp = result.host;
|
||||
*userp = result.user;
|
||||
*domainp = result.domain;
|
||||
}
|
||||
|
||||
__libc_lock_unlock (lock);
|
||||
|
||||
return status == NSS_STATUS_SUCCESS ? 1 : 0;
|
||||
}
|
||||
weak_alias (__getnetgrent_r, getnetgrent_r)
|
||||
|
||||
/* Test whether given (host,user,domain) triple is in NETGROUP. */
|
||||
int
|
||||
innetgr (const char *netgroup, const char *host, const char *user,
|
||||
const char *domain)
|
||||
{
|
||||
int (*setfct) (const char *);
|
||||
void (*endfct) (void);
|
||||
int (*getfct) (struct __netgrent *, char *, int);
|
||||
int result = 0;
|
||||
int no_more;
|
||||
|
||||
__libc_lock_lock (lock);
|
||||
|
||||
/* Walk through the services until we found an answer or we shall
|
||||
not work further. We can do some optimization here. Since all
|
||||
services must provide the `setnetgrent' function we can do all
|
||||
the work during one walk through the service list. */
|
||||
no_more = setup ((void **) &setfct, "setnetgrent", 1);
|
||||
while (! no_more)
|
||||
{
|
||||
enum nss_status status;
|
||||
|
||||
/* Open netgroup. */
|
||||
status = (*setfct) (netgroup);
|
||||
if (status == NSS_STATUS_SUCCESS
|
||||
&& __nss_lookup (&nip, "getnetgrent_r", (void **) &getfct) == 0)
|
||||
{
|
||||
char buffer[1024];
|
||||
struct __netgrent entry;
|
||||
|
||||
while ((*getfct) (&entry, buffer, sizeof buffer)
|
||||
== NSS_STATUS_SUCCESS)
|
||||
{
|
||||
if ((entry.host == NULL || host == NULL
|
||||
|| strcmp (entry.host, host) == 0)
|
||||
&& (entry.user == NULL || user == NULL
|
||||
|| strcmp (entry.user, user) == 0)
|
||||
&& (entry.domain == NULL || domain == NULL
|
||||
|| strcmp (entry.domain, domain) == 0))
|
||||
{
|
||||
result = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (result != 0)
|
||||
break;
|
||||
|
||||
/* If we found one service which does know the given
|
||||
netgroup we don't try further. */
|
||||
status = NSS_STATUS_RETURN;
|
||||
}
|
||||
|
||||
/* Free all resources of the service. */
|
||||
if (__nss_lookup (&nip, "endnetgrent", (void **) &endfct) == 0)
|
||||
(*endfct) ();
|
||||
|
||||
/* Look for the next service. */
|
||||
no_more = __nss_next (&nip, "setnetgrent", (void **) &setfct, status, 0);
|
||||
}
|
||||
|
||||
__libc_lock_unlock (lock);
|
||||
|
||||
return result;
|
||||
}
|
||||
+13
-1
@@ -16,7 +16,19 @@ License along with the GNU C Library; see the file COPYING.LIB. If
|
||||
not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <features.h>
|
||||
|
||||
/* We need to have the error status variable of the resolver
|
||||
accessible in the libc. */
|
||||
int h_errno;
|
||||
int __h_errno = 0;
|
||||
strong_alias (__h_errno, h_errno)
|
||||
|
||||
/* When threaded, h_errno may be a per-process variable. */
|
||||
#ifdef __USE_REENTRANT
|
||||
int *
|
||||
weak_const_function
|
||||
__h_errno_location (void)
|
||||
{
|
||||
return &__h_errno;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/* Copyright (C) 1992, 1995 Free Software Foundation, Inc.
|
||||
/* Internal header for netgroup related functions.
|
||||
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
|
||||
@@ -13,20 +14,17 @@ 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. */
|
||||
not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <ansidecl.h>
|
||||
#include <errno.h>
|
||||
#include <math.h>
|
||||
#ifndef _NETGROUP_H
|
||||
#define _NETGROUP_H 1
|
||||
|
||||
/* Return the cube root of X. */
|
||||
double
|
||||
DEFUN(cbrt, (x), double x)
|
||||
struct __netgrent
|
||||
{
|
||||
errno = ENOSYS;
|
||||
return 0.0;
|
||||
}
|
||||
const char *host;
|
||||
const char *user;
|
||||
const char *domain;
|
||||
};
|
||||
|
||||
|
||||
stub_warning (cbrt)
|
||||
#endif /* netgroup.h */
|
||||
+9
-6
@@ -52,6 +52,7 @@ static char sccsid[] = "@(#)rcmd.c 8.3 (Berkeley) 3/26/94";
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
int __ivaliduser __P((FILE *, u_int32_t, const char *, const char *));
|
||||
static int __icheckhost __P((u_int32_t, char *));
|
||||
|
||||
@@ -92,7 +93,8 @@ rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
|
||||
}
|
||||
fcntl(s, F_SETOWN, pid);
|
||||
sin.sin_family = hp->h_addrtype;
|
||||
bcopy(hp->h_addr_list[0], &sin.sin_addr, hp->h_length);
|
||||
bcopy(hp->h_addr_list[0], &sin.sin_addr,
|
||||
MIN (sizeof (sin.sin_addr), hp->h_length));
|
||||
sin.sin_port = rport;
|
||||
if (connect(s, (struct sockaddr *)&sin, sizeof(sin)) >= 0)
|
||||
break;
|
||||
@@ -111,10 +113,11 @@ rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
|
||||
|
||||
(void)fprintf(stderr, _("connect to address %s: "),
|
||||
inet_ntoa(sin.sin_addr));
|
||||
errno = oerrno;
|
||||
__set_errno (oerrno);
|
||||
perror(0);
|
||||
hp->h_addr_list++;
|
||||
bcopy(hp->h_addr_list[0], &sin.sin_addr, hp->h_length);
|
||||
bcopy(hp->h_addr_list[0], &sin.sin_addr,
|
||||
MIN (sizeof (sin.sin_addr), hp->h_length));
|
||||
(void)fprintf(stderr, _("Trying %s...\n"),
|
||||
inet_ntoa(sin.sin_addr));
|
||||
continue;
|
||||
@@ -146,7 +149,7 @@ rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
|
||||
FD_ZERO(&reads);
|
||||
FD_SET(s, &reads);
|
||||
FD_SET(s2, &reads);
|
||||
errno = 0;
|
||||
__set_errno (0);
|
||||
if (select(1 + (s > s2 ? s : s2), &reads, 0, 0, 0) < 1 ||
|
||||
!FD_ISSET(s2, &reads)) {
|
||||
if (errno != 0)
|
||||
@@ -173,7 +176,7 @@ rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
|
||||
from.sin_port >= IPPORT_RESERVED ||
|
||||
from.sin_port < IPPORT_RESERVED / 2) {
|
||||
(void)fprintf(stderr,
|
||||
_("socket: protocol failure in circuit setup.\n"));
|
||||
_("socket: protocol failure in circuit setup\n"));
|
||||
goto bad2;
|
||||
}
|
||||
}
|
||||
@@ -227,7 +230,7 @@ rresvport(alport)
|
||||
(*alport)--;
|
||||
if (*alport == IPPORT_RESERVED/2) {
|
||||
(void)close(s);
|
||||
errno = EAGAIN; /* close */
|
||||
__set_errno (EAGAIN); /* close */
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -91,9 +91,9 @@ retry:
|
||||
(void) write(s, "", 1);
|
||||
port = 0;
|
||||
} else {
|
||||
char num[8];
|
||||
char num[32];
|
||||
int s2, sin2len;
|
||||
|
||||
|
||||
s2 = socket(AF_INET, SOCK_STREAM, 0);
|
||||
if (s2 < 0) {
|
||||
(void) close(s);
|
||||
|
||||
+23
-14
@@ -38,8 +38,9 @@ static char sccsid[] = "@(#)ruserpass.c 8.3 (Berkeley) 4/2/94";
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
/*#include <err.h> */
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -81,19 +82,27 @@ int
|
||||
ruserpass(host, aname, apass)
|
||||
char *host, **aname, **apass;
|
||||
{
|
||||
char *hdir, buf[BUFSIZ], *tmp;
|
||||
char *hdir, *buf, *tmp;
|
||||
char myname[1024], *mydomain;
|
||||
int t, i, c, usedefault = 0;
|
||||
struct stat stb;
|
||||
|
||||
hdir = getenv("HOME");
|
||||
if (hdir == NULL)
|
||||
hdir = ".";
|
||||
hdir = __secure_getenv("HOME");
|
||||
if (hdir == NULL) {
|
||||
/* If we can't get HOME, fail instead of trying ".",
|
||||
which is no improvement. This really should call
|
||||
getpwuid(getuid()). */
|
||||
/*hdir = ".";*/
|
||||
return -1;
|
||||
}
|
||||
|
||||
buf = alloca (strlen (hdir) + 8);
|
||||
|
||||
(void) sprintf(buf, "%s/.netrc", hdir);
|
||||
cfile = fopen(buf, "r");
|
||||
if (cfile == NULL) {
|
||||
/* if (errno != ENOENT)
|
||||
warn("%s", buf);*/
|
||||
if (errno != ENOENT)
|
||||
warn("%s", buf);
|
||||
return (0);
|
||||
}
|
||||
if (gethostname(myname, sizeof(myname)) < 0)
|
||||
@@ -113,13 +122,13 @@ next:
|
||||
continue;
|
||||
/*
|
||||
* Allow match either for user's input host name
|
||||
* or official hostname. Also allow match of
|
||||
* or official hostname. Also allow match of
|
||||
* incompletely-specified host in local domain.
|
||||
*/
|
||||
if (strcasecmp(host, tokval) == 0)
|
||||
goto match;
|
||||
/* if (strcasecmp(hostname, tokval) == 0)
|
||||
goto match;
|
||||
goto match;
|
||||
if ((tmp = strchr(hostname, '.')) != NULL &&
|
||||
strcasecmp(tmp, mydomain) == 0 &&
|
||||
strncasecmp(hostname, tokval, tmp-hostname) == 0 &&
|
||||
@@ -137,7 +146,7 @@ next:
|
||||
|
||||
case LOGIN:
|
||||
if (token())
|
||||
if (*aname == 0) {
|
||||
if (*aname == 0) {
|
||||
*aname = malloc((unsigned) strlen(tokval) + 1);
|
||||
(void) strcpy(*aname, tokval);
|
||||
} else {
|
||||
@@ -149,8 +158,8 @@ next:
|
||||
if (strcmp(*aname, "anonymous") &&
|
||||
fstat(fileno(cfile), &stb) >= 0 &&
|
||||
(stb.st_mode & 077) != 0) {
|
||||
/* warnx("Error: .netrc file is readable by others.");
|
||||
warnx("Remove password or make file unreadable by others.");*/
|
||||
warnx(_("Error: .netrc file is readable by others."));
|
||||
warnx(_("Remove password or make file unreadable by others."));
|
||||
goto bad;
|
||||
}
|
||||
if (token() && *apass == 0) {
|
||||
@@ -177,7 +186,7 @@ next:
|
||||
if (proxy) {
|
||||
(void) fclose(cfile);
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
while ((c=getc(cfile)) != EOF && c == ' ' || c == '\t');
|
||||
if (c == EOF || c == '\n') {
|
||||
printf("Missing macdef name argument.\n");
|
||||
@@ -234,7 +243,7 @@ next:
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
/* warnx("Unknown .netrc keyword %s", tokval);*/
|
||||
warnx(_("Unknown .netrc keyword %s"), tokval);
|
||||
break;
|
||||
}
|
||||
goto done;
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
/* interp - add information about dynamic loader to shared libray obejcts.
|
||||
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 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. */
|
||||
|
||||
const char __invoke_dynamic_linker__[] __attribute__ ((section (".interp")))
|
||||
= RUNTIME_LINKER;
|
||||
+8
-5
@@ -46,6 +46,9 @@ char *alloca ();
|
||||
#ifndef errno
|
||||
extern int errno;
|
||||
#endif
|
||||
#ifndef __set_errno
|
||||
# define __set_errno(val) errno = (val)
|
||||
#endif
|
||||
|
||||
#if defined STDC_HEADERS || defined _LIBC
|
||||
# include <stdlib.h>
|
||||
@@ -277,13 +280,13 @@ DCGETTEXT (domainname, msgid, category)
|
||||
dirname = (char *) alloca (path_max + dirname_len);
|
||||
ADD_BLOCK (block_list, dirname);
|
||||
|
||||
errno = 0;
|
||||
__set_errno (0);
|
||||
while ((ret = getcwd (dirname, path_max)) == NULL && errno == ERANGE)
|
||||
{
|
||||
path_max += PATH_INCR;
|
||||
dirname = (char *) alloca (path_max + dirname_len);
|
||||
ADD_BLOCK (block_list, dirname);
|
||||
errno = 0;
|
||||
__set_errno (0);
|
||||
}
|
||||
|
||||
if (ret == NULL)
|
||||
@@ -291,7 +294,7 @@ DCGETTEXT (domainname, msgid, category)
|
||||
/* We cannot get the current working directory. Don't signal an
|
||||
error but simply return the default string. */
|
||||
FREE_BLOCKS (block_list);
|
||||
errno = saved_errno;
|
||||
__set_errno (saved_errno);
|
||||
return (char *) msgid;
|
||||
}
|
||||
|
||||
@@ -352,7 +355,7 @@ DCGETTEXT (domainname, msgid, category)
|
||||
|| strcmp (single_locale, "POSIX") == 0)
|
||||
{
|
||||
FREE_BLOCKS (block_list);
|
||||
errno = saved_errno;
|
||||
__set_errno (saved_errno);
|
||||
return (char *) msgid;
|
||||
}
|
||||
|
||||
@@ -381,7 +384,7 @@ DCGETTEXT (domainname, msgid, category)
|
||||
if (retval != NULL)
|
||||
{
|
||||
FREE_BLOCKS (block_list);
|
||||
errno = saved_errno;
|
||||
__set_errno (saved_errno);
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -369,7 +369,7 @@ _nl_normalize_codeset (codeset, name_len)
|
||||
if (retval != NULL)
|
||||
{
|
||||
if (only_digit)
|
||||
wp = stpcpy (retval, "ISO");
|
||||
wp = stpcpy (retval, "iso");
|
||||
else
|
||||
wp = retval;
|
||||
|
||||
|
||||
+5
-4
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1991 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1991, 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
|
||||
@@ -16,7 +16,6 @@ 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. */
|
||||
|
||||
#include <ansidecl.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
@@ -24,7 +23,9 @@ Cambridge, MA 02139, USA. */
|
||||
|
||||
/* Create FILE with protections MODE. */
|
||||
int
|
||||
DEFUN(creat, (file, mode), CONST char *file AND mode_t mode)
|
||||
creat (file, mode)
|
||||
const char *file;
|
||||
mode_t mode;
|
||||
{
|
||||
return __open(file, O_WRONLY|O_CREAT|O_TRUNC, mode);
|
||||
return __open (file, O_WRONLY|O_CREAT|O_TRUNC, mode);
|
||||
}
|
||||
|
||||
+2
-3
@@ -43,7 +43,6 @@ __BEGIN_DECLS
|
||||
#endif
|
||||
#endif /* Use misc. */
|
||||
|
||||
|
||||
/* Do the file control operation described by CMD on FD.
|
||||
The remaining arguments are interpreted depending on CMD. */
|
||||
extern int __fcntl __P ((int __fd, int __cmd, ...));
|
||||
@@ -52,8 +51,8 @@ extern int fcntl __P ((int __fd, int __cmd, ...));
|
||||
/* Open FILE and return a new file descriptor for it, or -1 on error.
|
||||
OFLAG determines the type of access used. If O_CREAT is on OFLAG,
|
||||
the third argument is taken as a `mode_t', the mode of the created file. */
|
||||
extern int __open __P ((__const char *__file, int __oflag,...));
|
||||
extern int open __P ((__const char *__file, int __oflag,...));
|
||||
extern int __open __P ((__const char *__file, int __oflag, ...));
|
||||
extern int open __P ((__const char *__file, int __oflag, ...));
|
||||
|
||||
/* Create and open FILE, with mode MODE.
|
||||
This takes an `int' MODE argument because that is
|
||||
|
||||
@@ -100,7 +100,7 @@ fts_open(argv, options, compar)
|
||||
|
||||
/* Options check. */
|
||||
if (options & ~FTS_OPTIONMASK) {
|
||||
errno = EINVAL;
|
||||
__set_errno (EINVAL);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ fts_open(argv, options, compar)
|
||||
for (root = NULL, nitems = 0; *argv; ++argv, ++nitems) {
|
||||
/* Don't allow zero-length paths. */
|
||||
if ((len = strlen(*argv)) == 0) {
|
||||
errno = ENOENT;
|
||||
__set_errno (ENOENT);
|
||||
goto mem3;
|
||||
}
|
||||
|
||||
@@ -262,7 +262,7 @@ fts_close(sp)
|
||||
|
||||
/* Set errno and return. */
|
||||
if (!ISSET(FTS_NOCHDIR) && saved_errno) {
|
||||
errno = saved_errno;
|
||||
__set_errno (saved_errno);
|
||||
return (-1);
|
||||
}
|
||||
return (0);
|
||||
@@ -425,7 +425,7 @@ name: t = sp->fts_path + NAPPEND(p->fts_parent);
|
||||
* can distinguish between error and EOF.
|
||||
*/
|
||||
free(p);
|
||||
errno = 0;
|
||||
__set_errno (0);
|
||||
return (sp->fts_cur = NULL);
|
||||
}
|
||||
|
||||
@@ -446,7 +446,7 @@ name: t = sp->fts_path + NAPPEND(p->fts_parent);
|
||||
if (FCHDIR(sp, p->fts_symfd)) {
|
||||
saved_errno = errno;
|
||||
(void)close(p->fts_symfd);
|
||||
errno = saved_errno;
|
||||
__set_errno (saved_errno);
|
||||
SET(FTS_STOP);
|
||||
return (NULL);
|
||||
}
|
||||
@@ -476,7 +476,7 @@ fts_set(sp, p, instr)
|
||||
{
|
||||
if (instr && instr != FTS_AGAIN && instr != FTS_FOLLOW &&
|
||||
instr != FTS_NOINSTR && instr != FTS_SKIP) {
|
||||
errno = EINVAL;
|
||||
__set_errno (EINVAL);
|
||||
return (1);
|
||||
}
|
||||
p->fts_instr = instr;
|
||||
@@ -492,7 +492,7 @@ fts_children(sp, instr)
|
||||
int fd;
|
||||
|
||||
if (instr && instr != FTS_NAMEONLY) {
|
||||
errno = EINVAL;
|
||||
__set_errno (EINVAL);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
@@ -503,7 +503,7 @@ fts_children(sp, instr)
|
||||
* Errno set to 0 so user can distinguish empty directory from
|
||||
* an error.
|
||||
*/
|
||||
errno = 0;
|
||||
__set_errno (0);
|
||||
|
||||
/* Fatal errors stop here. */
|
||||
if (ISSET(FTS_STOP))
|
||||
@@ -681,7 +681,7 @@ mem1: saved_errno = errno;
|
||||
free(p);
|
||||
fts_lfree(head);
|
||||
(void)closedir(dirp);
|
||||
errno = saved_errno;
|
||||
__set_errno (saved_errno);
|
||||
cur->fts_info = FTS_ERR;
|
||||
SET(FTS_STOP);
|
||||
return (NULL);
|
||||
@@ -803,7 +803,7 @@ fts_stat(sp, p, follow)
|
||||
if (stat(p->fts_accpath, sbp)) {
|
||||
saved_errno = errno;
|
||||
if (!lstat(p->fts_accpath, sbp)) {
|
||||
errno = 0;
|
||||
__set_errno (0);
|
||||
return (FTS_SLNONE);
|
||||
}
|
||||
p->fts_errno = saved_errno;
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#define _FTS_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
typedef struct {
|
||||
struct _ftsent *fts_cur; /* current node */
|
||||
|
||||
@@ -47,7 +47,7 @@ DEFUN (ftw_dir, (dirs, level, descriptors, dir, len, func),
|
||||
|
||||
got = 0;
|
||||
|
||||
errno = 0;
|
||||
__set_errno (0);
|
||||
|
||||
while ((entry = readdir (dirs[level])) != NULL)
|
||||
{
|
||||
@@ -61,7 +61,7 @@ DEFUN (ftw_dir, (dirs, level, descriptors, dir, len, func),
|
||||
&& (entry->d_name[1] == '\0' ||
|
||||
(entry->d_name[1] == '.' && entry->d_name[2] == '\0')))
|
||||
{
|
||||
errno = 0;
|
||||
__set_errno (0);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -70,9 +70,9 @@ DEFUN (ftw_dir, (dirs, level, descriptors, dir, len, func),
|
||||
if (namlen + len + 1 > PATH_MAX)
|
||||
{
|
||||
#ifdef ENAMETOOLONG
|
||||
errno = ENAMETOOLONG;
|
||||
__set_errno (ENAMETOOLONG);
|
||||
#else
|
||||
errno = ENOMEM;
|
||||
__set_errno (ENOMEM);
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
@@ -120,7 +120,7 @@ DEFUN (ftw_dir, (dirs, level, descriptors, dir, len, func),
|
||||
|
||||
save = errno;
|
||||
closedir (dirs[newlev]);
|
||||
errno = save;
|
||||
__set_errno (save);
|
||||
dirs[newlev] = NULL;
|
||||
}
|
||||
}
|
||||
@@ -139,13 +139,13 @@ DEFUN (ftw_dir, (dirs, level, descriptors, dir, len, func),
|
||||
skip = got;
|
||||
while (skip-- != 0)
|
||||
{
|
||||
errno = 0;
|
||||
__set_errno (0);
|
||||
if (readdir (dirs[level]) == NULL)
|
||||
return errno == 0 ? 0 : -1;
|
||||
}
|
||||
}
|
||||
|
||||
errno = 0;
|
||||
__set_errno (0);
|
||||
}
|
||||
|
||||
return errno == 0 ? 0 : -1;
|
||||
@@ -211,7 +211,7 @@ DEFUN(ftw, (dir, func, descriptors),
|
||||
|
||||
save = errno;
|
||||
closedir (dirs[0]);
|
||||
errno = save;
|
||||
__set_errno (save);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+16
-9
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1991, 1992, 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
|
||||
@@ -16,7 +16,6 @@ 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. */
|
||||
|
||||
#include <ansidecl.h>
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#include <string.h>
|
||||
@@ -26,22 +25,30 @@ Cambridge, MA 02139, USA. */
|
||||
If successful, return BUF. If not, put an error message in
|
||||
BUF and return NULL. BUF should be at least PATH_MAX bytes long. */
|
||||
char *
|
||||
DEFUN(getwd, (buf), char *buf)
|
||||
getwd (buf)
|
||||
char *buf;
|
||||
{
|
||||
#ifndef PATH_MAX
|
||||
#define PATH_MAX 1024
|
||||
char fetchbuf[PATH_MAX];
|
||||
#else
|
||||
#define fetchbuf buf
|
||||
#endif
|
||||
|
||||
if (buf == NULL)
|
||||
{
|
||||
errno = EINVAL;
|
||||
__set_errno (EINVAL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifndef PATH_MAX
|
||||
#define PATH_MAX 1024 /* Arbitrary; this function is unreliable. */
|
||||
#endif
|
||||
if (getcwd (buf, PATH_MAX) == NULL)
|
||||
if (getcwd (fetchbuf, PATH_MAX) == NULL)
|
||||
{
|
||||
(void) strncpy (buf, strerror (errno), PATH_MAX);
|
||||
strncpy (buf, strerror (errno), PATH_MAX);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (fetchbuf != buf)
|
||||
strcpy (buf, fetchbuf);
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1994 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1994, 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
|
||||
@@ -37,7 +37,7 @@ lockf (int fd, int cmd, off_t len)
|
||||
return -1;
|
||||
if (fl.l_type == F_UNLCK || fl.l_pid == getpid ())
|
||||
return 0;
|
||||
errno = EACCES;
|
||||
__set_errno (EACCES);
|
||||
return -1;
|
||||
|
||||
case F_ULOCK:
|
||||
@@ -54,7 +54,7 @@ lockf (int fd, int cmd, off_t len)
|
||||
break;
|
||||
|
||||
default:
|
||||
errno = EINVAL;
|
||||
__set_errno (EINVAL);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1994 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1994, 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
|
||||
@@ -22,7 +22,7 @@ Cambridge, MA 02139, USA. */
|
||||
#include <unistd.h>
|
||||
|
||||
int
|
||||
main ()
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
char file[L_tmpnam];
|
||||
struct utimbuf ut;
|
||||
|
||||
@@ -48,6 +48,8 @@ Cambridge, MA 02139, USA. */
|
||||
|
||||
/* Enable declarations of GNU extensions, since we are compiling them. */
|
||||
#define _GNU_SOURCE 1
|
||||
/* And we also need the data for the reentrant functions. */
|
||||
#define _REENTRANT 1
|
||||
|
||||
#include <config.h>
|
||||
/*
|
||||
@@ -202,6 +204,7 @@ extern const char _libc_intl_domainname[];
|
||||
/* This comes between the return type and function name in
|
||||
a function definition to make that definition weak. */
|
||||
#define weak_function __attribute__ ((weak))
|
||||
#define weak_const_function __attribute__ ((weak, __const__))
|
||||
|
||||
#endif /* HAVE_WEAK_SYMBOLS. */
|
||||
#endif /* Not ASSEMBLER, and GCC 2.7 or later. */
|
||||
@@ -213,6 +216,7 @@ extern const char _libc_intl_domainname[];
|
||||
directive for the function symbol, and a `.weak' directive in addition
|
||||
will produce an error from the assembler. */
|
||||
#define weak_function /* empty */
|
||||
#define weak_const_function /* empty */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
GNU libio by Per Bothner
|
||||
+12
-1
@@ -36,9 +36,20 @@ routines := \
|
||||
\
|
||||
libc_fatal
|
||||
|
||||
all: # Make this the default target; it will be defined in Rules.
|
||||
|
||||
include ../Makeconfig
|
||||
|
||||
ifneq (,$(filter %REENTRANT, $(defines)))
|
||||
routines += clearerr_u feof_u ferror_u fputc_u getc_u getchar_u \
|
||||
iofflush_u putc_u putchar_u
|
||||
|
||||
CPPFLAGS += -D_IO_MTSAFE_IO
|
||||
endif
|
||||
|
||||
aux := \
|
||||
cleanup fileops genops stdfiles stdio strops
|
||||
|
||||
distribute := iolibio.h libioP.h strfile.h
|
||||
distribute := iolibio.h libioP.h strfile.h Banner
|
||||
|
||||
include ../Rules
|
||||
|
||||
+2
-2
@@ -24,9 +24,9 @@ clearerr (fp)
|
||||
FILE *fp;
|
||||
{
|
||||
CHECK_FILE (fp, /*nothing*/);
|
||||
flockfile (fp);
|
||||
_IO_flockfile (fp);
|
||||
_IO_clearerr (fp);
|
||||
funlockfile (fp);
|
||||
_IO_funlockfile (fp);
|
||||
}
|
||||
|
||||
#ifdef _IO_MTSAFE_IO
|
||||
|
||||
+1
-3
@@ -20,11 +20,9 @@ Boston, MA 02111-1307, USA. */
|
||||
#include "stdio.h"
|
||||
|
||||
void
|
||||
__clearerr_unlocked (fp)
|
||||
clearerr_unlocked (fp)
|
||||
FILE *fp;
|
||||
{
|
||||
CHECK_FILE (fp, /*nothing*/);
|
||||
_IO_clearerr (fp);
|
||||
}
|
||||
|
||||
weak_alias (clearerr_unlocked, __clearerr_unlocked)
|
||||
|
||||
@@ -24,6 +24,8 @@ the executable file might be covered by the GNU General Public License. */
|
||||
#include "libioP.h"
|
||||
#include "stdio.h"
|
||||
|
||||
#undef feof_unlocked
|
||||
|
||||
int
|
||||
feof_unlocked (fp)
|
||||
_IO_FILE* fp;
|
||||
|
||||
@@ -24,6 +24,8 @@ the executable file might be covered by the GNU General Public License. */
|
||||
#include "libioP.h"
|
||||
#include "stdio.h"
|
||||
|
||||
#undef ferror_unlocked
|
||||
|
||||
int
|
||||
ferror_unlocked (fp)
|
||||
_IO_FILE* fp;
|
||||
|
||||
+3
-2
@@ -31,8 +31,9 @@ fgetc (fp)
|
||||
{
|
||||
int result;
|
||||
CHECK_FILE (fp, EOF);
|
||||
flockfile (fp);
|
||||
__libc_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
|
||||
_IO_flockfile (fp);
|
||||
result = _IO_getc_unlocked (fp);
|
||||
funlockfile (fp);
|
||||
__libc_cleanup_region_end (1);
|
||||
return result;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user