3
0
Fork 0
forked from mirrors/nixpkgs

added glibc-2.13 again

svn path=/nixpkgs/branches/stdenv-updates/; revision=30030
This commit is contained in:
Peter Simons 2011-10-26 10:47:19 +00:00
parent 4353727ac8
commit 51e5c3b73d
10 changed files with 729 additions and 0 deletions

View file

@ -0,0 +1,55 @@
# Glibc cannot have itself in its RPATH.
export NIX_NO_SELF_RPATH=1
source $stdenv/setup
postConfigure() {
# Hack: get rid of the `-static' flag set by the bootstrap stdenv.
# This has to be done *after* `configure' because it builds some
# test binaries.
export NIX_CFLAGS_LINK=
export NIX_LDFLAGS_BEFORE=
export NIX_DONT_SET_RPATH=1
unset CFLAGS
}
postInstall() {
if test -n "$installLocales"; then
make -j${NIX_BUILD_CORES:-1} -l${NIX_BUILD_CORES:-1} localedata/install-locales
fi
test -f $out/etc/ld.so.cache && rm $out/etc/ld.so.cache
# FIXME: Use `test -n $linuxHeaders' when `kernelHeaders' has been
# renamed.
if test -z "$hurdHeaders"; then
# Include the Linux kernel headers in Glibc, except the `scsi'
# subdirectory, which Glibc provides itself.
(cd $out/include && \
ln -sv $(ls -d $kernelHeaders/include/* | grep -v 'scsi$') .)
fi
if test -f "$out/lib/libhurduser.so"; then
# libc.so, libhurduser.so, and libmachuser.so depend on each
# other, so add them to libc.so (a RUNPATH on libc.so.0.3
# would be ignored by the cross-linker.)
echo "adding \`libhurduser.so' and \`libmachuser.so' to the \`libc.so' linker script..."
sed -i "$out/lib/libc.so" \
-e"s|\(libc\.so\.[^ ]\+\>\)|\1 $out/lib/libhurduser.so $out/lib/libmachuser.so|g"
fi
# Fix for NIXOS-54 (ldd not working on x86_64). Make a symlink
# "lib64" to "lib".
if test -n "$is64bit"; then
ln -s lib $out/lib64
fi
# This file, that should not remain in the glibc derivation,
# may have not been created during the preInstall
rm -f $out/lib/libgcc_s.so.1
}
genericBuild

View file

@ -0,0 +1,210 @@
/* Build configuration used to build glibc, Info files, and locale
information. */
cross :
{ name, fetchurl, stdenv, installLocales ? false
, gccCross ? null, kernelHeaders ? null
, machHeaders ? null, hurdHeaders ? null, mig ? null, fetchgit ? null
, profilingLibraries ? false, meta
, preConfigure ? "", ... }@args :
let
# For GNU/Hurd, see below.
version = if hurdHeaders != null then "20100512" else "2.13";
needsPortsNative = stdenv.isMips || stdenv.isArm;
needsPortsCross = cross.arch == "mips" || cross.arch == "arm";
needsPorts = if (stdenv ? cross) && stdenv.cross != null then true
else if cross == null then needsPortsNative
else needsPortsCross;
srcPorts = fetchurl {
url = "mirror://gnu/glibc/glibc-ports-2.13.tar.bz2";
sha256 = "0npffql62m1xba15l1wkaqf2p0l2bvb33720gx28764jmq0la75i";
};
in
assert (cross != null) -> (gccCross != null);
assert (mig != null) -> (machHeaders != null);
assert (machHeaders != null) -> (hurdHeaders != null);
assert (hurdHeaders != null) -> (fetchgit != null);
stdenv.mkDerivation ({
inherit kernelHeaders installLocales;
# The host/target system.
crossConfig = if (cross != null) then cross.config else null;
inherit (stdenv) is64bit;
enableParallelBuilding = true;
patches =
stdenv.lib.optional (fetchgit == null)
/* Fix for NIXPKGS-79: when doing host name lookups, when
nsswitch.conf contains a line like
hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
don't return an error when mdns4_minimal can't be found. This
is a bug in Glibc: when a service can't be found, NSS should
continue to the next service unless "UNAVAIL=return" is set.
("NOTFOUND=return" refers to the service returning a NOTFOUND
error, not the service itself not being found.) The reason is
that the "status" variable (while initialised to UNAVAIL) is
outside of the loop that iterates over the services, the
"files" service sets status to NOTFOUND. So when the call to
find "mdns4_minimal" fails, "status" will still be NOTFOUND,
and it will return instead of continuing to "dns". Thus, the
line
hosts: mdns4_minimal [NOTFOUND=return] dns mdns4
does work because "status" will contain UNAVAIL after the
failure to find mdns4_minimal. */
./nss-skip-unavail.patch
++ [
/* Have rpcgen(1) look for cpp(1) in $PATH. */
./rpcgen-path.patch
/* Allow nixos and nix handle the locale-archive. */
./nix-locale-archive.patch
/* Without this patch many KDE binaries crash. */
./glibc-elf-localscope.patch
];
postPatch = ''
# Needed for glibc to build with the gnumake 3.82
# http://comments.gmane.org/gmane.linux.lfs.support/31227
sed -i 's/ot \$/ot:\n\ttouch $@\n$/' manual/Makefile
# nscd needs libgcc, and we don't want it dynamically linked
# because we don't want it to depend on bootstrap-tools libs.
echo "LDFLAGS-nscd += -static-libgcc" >> nscd/Makefile
'';
configureFlags = [
"-C"
"--enable-add-ons"
"--localedir=/var/run/current-system/sw/lib/locale"
(if kernelHeaders != null
then "--with-headers=${kernelHeaders}/include"
else "--without-headers")
(if profilingLibraries
then "--enable-profile"
else "--disable-profile")
] ++ stdenv.lib.optionals (cross != null) [
(if cross.withTLS then "--with-tls" else "--without-tls")
(if cross.float == "soft" then "--without-fp" else "--with-fp")
"--enable-kernel=2.6.0"
"--with-__thread"
] ++ stdenv.lib.optionals (stdenv.system == "armv5tel-linux") [
"--host=arm-linux-gnueabi"
"--build=arm-linux-gnueabi"
"--without-fp"
# To avoid linking with -lgcc_s (dynamic link)
# so the glibc does not depend on its compiler store path
"libc_cv_as_needed=no"
];
buildInputs = stdenv.lib.optionals (cross != null) [ gccCross ]
++ stdenv.lib.optional (mig != null) mig;
# Needed to install share/zoneinfo/zone.tab. Set to impure /bin/sh to
# prevent a retained dependency on the bootstrap tools in the stdenv-linux
# bootstrap.
BASH_SHELL = "/bin/sh";
# Workaround for this bug:
# http://sourceware.org/bugzilla/show_bug.cgi?id=411
# I.e. when gcc is compiled with --with-arch=i686, then the
# preprocessor symbol `__i686' will be defined to `1'. This causes
# the symbol __i686.get_pc_thunk.dx to be mangled.
NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (stdenv.system == "i686-linux") "-U__i686";
}
# Remove the `gccCross' attribute so that the *native* glibc store path
# doesn't depend on whether `gccCross' is null or not.
// (removeAttrs args [ "gccCross" ]) //
{
name = name + "-${version}" +
stdenv.lib.optionalString (cross != null) "-${cross.config}";
src =
if hurdHeaders != null
then fetchgit {
# Shamefully the "official" glibc won't build on GNU, so use the one
# maintained by the Hurd folks, `tschwinge/Roger_Whittaker' branch.
# See <http://www.gnu.org/software/hurd/source_repositories/glibc.html>.
url = "git://git.sv.gnu.org/hurd/glibc.git";
sha256 = "f3590a54a9d897d121f91113949edbaaf3e30cdeacbb8d0a44de7b6564f6643e";
rev = "df4c3faf0ccc848b5a8086c222bdb42679a9798f";
}
else fetchurl {
url = "mirror://gnu/glibc/glibc-${version}.tar.bz2";
sha256 = "1cnv319ysc8nkwpqw6f6ymb6b8hbl0nyvyx48sddkrj50lmcjwq1";
};
# `fetchurl' is a function and thus should not be passed to the
# `derivation' primitive.
fetchurl = null;
# Remove absolute paths from `configure' & co.; build out-of-tree.
preConfigure = ''
export PWD_P=$(type -tP pwd)
for i in configure io/ftwtest-sh; do
# Can't use substituteInPlace here because replace hasn't been
# built yet in the bootstrap.
sed -i "$i" -e "s^/bin/pwd^$PWD_P^g"
done
${if needsPorts then "tar xvf ${srcPorts}" else ""}
mkdir ../build
cd ../build
configureScript="`pwd`/../$sourceRoot/configure"
${preConfigure}
'';
meta = {
homepage = http://www.gnu.org/software/libc/;
description = "The GNU C Library";
longDescription =
'' Any Unix-like operating system needs a C library: the library which
defines the "system calls" and other basic facilities such as
open, malloc, printf, exit...
The GNU C library is used as the C library in the GNU system and
most systems with the Linux kernel.
'';
license = "LGPLv2+";
maintainers = [ stdenv.lib.maintainers.ludo ];
platforms = stdenv.lib.platforms.linux;
} // meta;
}
//
(if hurdHeaders != null
then {
# Work around the fact that the configure snippet that looks for
# <hurd/version.h> does not honor `--with-headers=$sysheaders' and that
# glibc expects both Mach and Hurd headers to be in the same place.
CPATH = "${hurdHeaders}/include:${machHeaders}/include";
# `fetchgit' is a function and thus should not be passed to the
# `derivation' primitive.
fetchgit = null;
}
else { }))

View file

@ -0,0 +1,83 @@
{ stdenv, fetchurl, kernelHeaders
, machHeaders ? null, hurdHeaders ? null, mig ? null, fetchgit ? null
, installLocales ? true
, profilingLibraries ? false
, gccCross ? null
}:
assert stdenv.gcc.gcc != null;
let
build = import ./common.nix;
cross = if gccCross != null then gccCross.target else null;
in
build cross ({
name = "glibc";
inherit fetchurl stdenv kernelHeaders installLocales profilingLibraries
gccCross;
builder = ./builder.sh;
# When building glibc from bootstrap-tools, we need libgcc_s at RPATH for
# any program we run, because the gcc will have been placed at a new
# store path than that determined when built (as a source for the
# bootstrap-tools tarball)
# Building from a proper gcc staying in the path where it was installed,
# libgcc_s will not be at {gcc}/lib, and gcc's libgcc will be found without
# any special hack.
preInstall = ''
if [ -f ${stdenv.gcc.gcc}/lib/libgcc_s.so.1 ]; then
ensureDir $out/lib
ln -s ${stdenv.gcc.gcc}/lib/libgcc_s.so.1 $out/lib/libgcc_s.so.1
fi
'';
meta.description = "The GNU C Library";
}
//
(if hurdHeaders != null
then rec {
inherit machHeaders hurdHeaders mig fetchgit;
propagatedBuildInputs = [ machHeaders hurdHeaders ];
passthru = {
# When building GCC itself `propagatedBuildInputs' above is not
# honored, so we pass it here so that the GCC builder can do the right
# thing.
inherit propagatedBuildInputs;
};
}
else { })
//
(if cross != null
then {
preConfigure = ''
sed -i s/-lgcc_eh//g "../$sourceRoot/Makeconfig"
cat > config.cache << "EOF"
libc_cv_forced_unwind=yes
libc_cv_c_cleanup=yes
libc_cv_gnu89_inline=yes
# Only due to a problem in gcc configure scripts:
libc_cv_sparc64_tls=${if cross.withTLS then "yes" else "no"}
EOF
export BUILD_CC=gcc
export CC="$crossConfig-gcc"
export AR="$crossConfig-ar"
export RANLIB="$crossConfig-ranlib"
dontStrip=1
'';
# To avoid a dependency on the build system 'bash'.
preFixup = ''
rm $out/bin/{ldd,tzselect,catchsegv,xtrace}
'';
}
else {}))

View file

@ -0,0 +1,82 @@
diff -ru a/elf/dl-close.c b/elf/dl-close.c
--- a/elf/dl-close.c 2011-02-04 00:35:03.000000000 +0100
+++ b/elf/dl-close.c 2011-02-22 02:16:12.367883000 +0100
@@ -180,24 +186,28 @@
/* Signal the object is still needed. */
l->l_idx = IDX_STILL_USED;
+#define mark_used(dmap) \
+ do { \
+ if ((dmap)->l_idx != IDX_STILL_USED) \
+ { \
+ assert ((dmap)->l_idx >= 0 && (dmap)->l_idx < nloaded); \
+ \
+ if (!used[(dmap)->l_idx]) \
+ { \
+ used[(dmap)->l_idx] = 1; \
+ if ((dmap)->l_idx - 1 < done_index) \
+ done_index = (dmap)->l_idx - 1; \
+ } \
+ } \
+ } while (0)
+
/* Mark all dependencies as used. */
if (l->l_initfini != NULL)
{
struct link_map **lp = &l->l_initfini[1];
while (*lp != NULL)
{
- if ((*lp)->l_idx != IDX_STILL_USED)
- {
- assert ((*lp)->l_idx >= 0 && (*lp)->l_idx < nloaded);
-
- if (!used[(*lp)->l_idx])
- {
- used[(*lp)->l_idx] = 1;
- if ((*lp)->l_idx - 1 < done_index)
- done_index = (*lp)->l_idx - 1;
- }
- }
-
+ mark_used(*lp);
++lp;
}
}
@@ -206,19 +216,25 @@
for (unsigned int j = 0; j < l->l_reldeps->act; ++j)
{
struct link_map *jmap = l->l_reldeps->list[j];
-
- if (jmap->l_idx != IDX_STILL_USED)
- {
- assert (jmap->l_idx >= 0 && jmap->l_idx < nloaded);
-
- if (!used[jmap->l_idx])
- {
- used[jmap->l_idx] = 1;
- if (jmap->l_idx - 1 < done_index)
- done_index = jmap->l_idx - 1;
- }
- }
+ mark_used(jmap);
}
+ /* And the same for owners of our scopes; normally, our last
+ scope provider would render us unused, but this can be
+ prevented by the NODELETE flag. */
+ if (__builtin_expect(l->l_type == lt_loaded
+ && (l->l_flags_1 & DF_1_NODELETE), 0))
+ for (size_t cnt = 0; l->l_scope[cnt] != NULL; ++cnt)
+ /* This relies on l_scope[] entries being always set either
+ to its own l_symbolic_searchlist address, or some map's
+ l_searchlist address. */
+ if (l->l_scope[cnt] != &l->l_symbolic_searchlist)
+ {
+ struct link_map *ls = (struct link_map *)
+ ((char *) l->l_scope[cnt]
+ - offsetof (struct link_map, l_searchlist));
+ assert (ls->l_ns == nsid);
+ mark_used(ls);
+ }
}
/* Sort the entries. */

View file

@ -0,0 +1,26 @@
{ stdenv, fetchurl, texinfo, perl }:
let build = import ./common.nix;
in
/* null cross builder */
build null {
name = "glibc-info";
inherit fetchurl stdenv;
configureFlags = [ "--enable-add-ons" ];
buildInputs = [ texinfo perl ];
buildPhase = "make info";
# I don't know why the info is not generated in 'build'
# Somehow building the info still does not work, because the final
# libc.info hasn't a Top node.
installPhase = ''
ensureDir "$out/share/info"
cp -v "../$sourceRoot/manual/"*.info* "$out/share/info"
'';
meta.description = "GNU Info manual of the GNU C Library";
}

View file

@ -0,0 +1,17 @@
# Glibc cannot have itself in its RPATH.
export NIX_NO_SELF_RPATH=1
source $stdenv/setup
postConfigure() {
# Hack: get rid of the `-static' flag set by the bootstrap stdenv.
# This has to be done *after* `configure' because it builds some
# test binaries.
export NIX_CFLAGS_LINK=
export NIX_LDFLAGS_BEFORE=
export NIX_DONT_SET_RPATH=1
unset CFLAGS
}
genericBuild

View file

@ -0,0 +1,47 @@
/* This function builds just the `lib/locale/locale-archive' file from
Glibc and nothing else. If `allLocales' is true, all supported
locales are included; otherwise, just the locales listed in
`locales'. See localedata/SUPPORTED in the Glibc source tree for
the list of all supported locales:
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/localedata/SUPPORTED?cvsroot=glibc
*/
{ stdenv, fetchurl, allLocales ? true, locales ? ["en_US.UTF-8/UTF-8"] }:
let build = import ./common.nix;
in
build null {
name = "glibc-locales";
inherit fetchurl stdenv;
installLocales = true;
builder = ./locales-builder.sh;
# Awful hack: `localedef' doesn't allow the path to `locale-archive'
# to be overriden, but you *can* specify a prefix, i.e. it will use
# <prefix>/<path-to-glibc>/lib/locale/locale-archive. So we use
# $TMPDIR as a prefix, meaning that the locale-archive is placed in
# $TMPDIR/nix/store/...-glibc-.../lib/locale/locale-archive.
buildPhase =
''
mkdir -p $TMPDIR/"$(dirname $(readlink -f $(type -p localedef)))/../lib/locale"
# Hack to allow building of the locales (needed since glibc-2.12)
sed -i -e "s,^LOCALEDEF=.*,LOCALEDEF=localedef --prefix=$TMPDIR," -e \
/library-path/d ../glibc-2*/localedata/Makefile
${if allLocales then "" else
"echo SUPPORTED-LOCALES=\"${toString locales}\" > ../glibc-2*/localedata/SUPPORTED"}
make localedata/install-locales \
localedir=$out/lib/locale \
'';
installPhase =
''
ensureDir "$out/lib/locale"
cp -v "$TMPDIR/nix/store/"*"/lib/locale/locale-archive" "$out/lib/locale"
'';
meta.description = "Locale information for the GNU C Library";
}

View file

@ -0,0 +1,116 @@
diff --git a/locale/loadarchive.c b/locale/loadarchive.c
index d545f17..0d8638a 100644
--- a/locale/loadarchive.c
+++ b/locale/loadarchive.c
@@ -124,6 +124,25 @@ calculate_head_size (const struct locarhead *h)
}
+static int
+open_locale_archive ()
+{
+ int fd = -1;
+ char *path = getenv ("LOCALE_ARCHIVE_2_11");
+ char *path2 = getenv ("LOCALE_ARCHIVE");
+ const char *usualpath = "/usr/lib/locale/locale-archive";
+ if (path)
+ fd = open_not_cancel_2 (path, O_RDONLY|O_LARGEFILE);
+ if (path2 && fd < 0)
+ fd = open_not_cancel_2 (path2, O_RDONLY|O_LARGEFILE);
+ if (fd < 0)
+ fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE);
+ if (fd < 0)
+ fd = open_not_cancel_2 (usualpath, O_RDONLY|O_LARGEFILE);
+ return fd;
+}
+
+
/* Find the locale *NAMEP in the locale archive, and return the
internalized data structure for its CATEGORY data. If this locale has
already been loaded from the archive, just returns the existing data
@@ -203,7 +222,7 @@ _nl_load_locale_from_archive (int category, const char **namep)
archmapped = &headmap;
/* The archive has never been opened. */
- fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE);
+ fd = open_locale_archive ();
if (fd < 0)
/* Cannot open the archive, for whatever reason. */
return NULL;
@@ -394,7 +413,7 @@ _nl_load_locale_from_archive (int category, const char **namep)
if (fd == -1)
{
struct stat64 st;
- fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE);
+ fd = open_locale_archive ();
if (fd == -1)
/* Cannot open the archive, for whatever reason. */
return NULL;
diff --git a/locale/programs/locale.c b/locale/programs/locale.c
index 77262b7..fddc00d 100644
--- a/locale/programs/locale.c
+++ b/locale/programs/locale.c
@@ -628,6 +628,20 @@ nameentcmp (const void *a, const void *b)
((const struct nameent *) b)->name);
}
+static int
+open_nix_locale_archive (const char * fname, int access)
+{
+ int fd = -1;
+ char *path = getenv ("LOCALE_ARCHIVE_2_11");
+ char *path2 = getenv ("LOCALE_ARCHIVE");
+ if (path)
+ fd = open64 (path, access);
+ if (path2 && fd < 0)
+ fd = open64 (path2, access);
+ if (fd < 0)
+ fd = open64 (fname, access);
+ return fd;
+}
static int
write_archive_locales (void **all_datap, char *linebuf)
@@ -641,7 +658,7 @@ write_archive_locales (void **all_datap, char *linebuf)
int fd, ret = 0;
uint32_t cnt;
- fd = open64 (ARCHIVE_NAME, O_RDONLY);
+ fd = open_nix_locale_archive (ARCHIVE_NAME, O_RDONLY);
if (fd < 0)
return 0;
diff --git a/locale/programs/locarchive.c b/locale/programs/locarchive.c
index 85ba77d..3ad2af8 100644
--- a/locale/programs/locarchive.c
+++ b/locale/programs/locarchive.c
@@ -512,6 +512,20 @@ enlarge_archive (struct locarhandle *ah, const struct locarhead *head)
*ah = new_ah;
}
+static int
+open_nix_locale_archive (const char * fname, int access)
+{
+ int fd = -1;
+ char *path = getenv ("LOCALE_ARCHIVE_2_11");
+ char *path2 = getenv ("LOCALE_ARCHIVE");
+ if (path)
+ fd = open64 (path, access);
+ if (path2 && fd < 0)
+ fd = open64 (path2, access);
+ if (fd < 0)
+ fd = open64 (fname, access);
+ return fd;
+}
void
open_archive (struct locarhandle *ah, bool readonly)
@@ -531,7 +548,7 @@ open_archive (struct locarhandle *ah, bool readonly)
while (1)
{
/* Open the archive. We must have exclusive write access. */
- fd = open64 (archivefname, readonly ? O_RDONLY : O_RDWR);
+ fd = open_nix_locale_archive (archivefname, readonly ? O_RDONLY : O_RDWR);
if (fd == -1)
{
/* Maybe the file does not yet exist. */

View file

@ -0,0 +1,21 @@
diff -ru glibc-2.11.2-orig/sysdeps/posix/getaddrinfo.c glibc-2.11.2/sysdeps/posix/getaddrinfo.c
--- glibc-2.11.2-orig/sysdeps/posix/getaddrinfo.c 2010-05-19 22:38:20.000000000 +0200
+++ glibc-2.11.2/sysdeps/posix/getaddrinfo.c 2010-08-05 18:39:54.259556327 +0200
@@ -505,8 +505,6 @@
int no_data = 0;
int no_inet6_data = 0;
service_user *nip = NULL;
- enum nss_status inet6_status = NSS_STATUS_UNAVAIL;
- enum nss_status status = NSS_STATUS_UNAVAIL;
int no_more;
int old_res_options;
@@ -702,6 +700,8 @@
while (!no_more)
{
+ enum nss_status inet6_status = NSS_STATUS_UNAVAIL;
+ enum nss_status status = NSS_STATUS_UNAVAIL;
no_data = 0;
nss_gethostbyname4_r fct4
= __nss_lookup_function (nip, "gethostbyname4_r");

View file

@ -0,0 +1,72 @@
By default, rpcgen(1) looks for cpp(1) from a list of fixed absolute paths
(`/lib/cpp', etc.), which may only be overrided with the `-Y' option. This
patch makes it run any `cpp' command found in $PATH.
--- glibc-2.7/sunrpc/rpc_main.c 2006-11-10 21:54:46.000000000 +0100
+++ glibc-2.7/sunrpc/rpc_main.c 2009-04-22 14:32:10.000000000 +0200
@@ -79,7 +79,7 @@ static const char *cmdname;
static const char *svcclosetime = "120";
static int cppDefined; /* explicit path for C preprocessor */
-static const char *CPP = SUNOS_CPP;
+static const char *CPP = "cpp";
static const char CPPFLAGS[] = "-C";
static char *pathbuf;
static int cpp_pid;
@@ -108,7 +108,6 @@ static char *extendfile (const char *fil
static void open_output (const char *infile, const char *outfile);
static void add_warning (void);
static void clear_args (void);
-static void find_cpp (void);
static void open_input (const char *infile, const char *define);
static int check_nettype (const char *name, const char *list_to_check[]);
static void c_output (const char *infile, const char *define,
@@ -327,31 +326,6 @@ clear_args (void)
argcount = FIXEDARGS;
}
-/* make sure that a CPP exists */
-static void
-find_cpp (void)
-{
- struct stat buf;
-
- if (stat (CPP, &buf) < 0)
- { /* /lib/cpp or explicit cpp does not exist */
- if (cppDefined)
- {
- fprintf (stderr, _ ("cannot find C preprocessor: %s \n"), CPP);
- crash ();
- }
- else
- { /* try the other one */
- CPP = SVR4_CPP;
- if (stat (CPP, &buf) < 0)
- { /* can't find any cpp */
- fputs (_ ("cannot find any C preprocessor (cpp)\n"), stdout);
- crash ();
- }
- }
- }
-}
-
/*
* Open input file with given define for C-preprocessor
*/
@@ -370,7 +344,6 @@ open_input (const char *infile, const ch
switch (cpp_pid)
{
case 0:
- find_cpp ();
putarg (0, CPP);
putarg (1, CPPFLAGS);
addarg (define);
@@ -380,7 +353,7 @@ open_input (const char *infile, const ch
close (1);
dup2 (pd[1], 1);
close (pd[0]);
- execv (arglist[0], (char **) arglist);
+ execvp (arglist[0], (char **) arglist);
perror ("execv");
exit (1);
case -1: