]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
.
authorJim Meyering <jim@meyering.net>
Sat, 15 Mar 2003 10:41:10 +0000 (10:41 +0000)
committerJim Meyering <jim@meyering.net>
Sat, 15 Mar 2003 10:41:10 +0000 (10:41 +0000)
aclocal.m4
config.hin
lib/Makefile.in
src/Makefile.in

index 956382c1dad8f5902f78fca3d273f37d6fc50bbb..2e23779fe6661869dfcd3589ed8c889eadaf4cdc 100644 (file)
@@ -1791,10 +1791,11 @@ AC_DEFUN([_jm_DECL_HEADERS],
                    unistd.h sys/time.h utmp.h utmpx.h)
 ])
 
-#serial 30
+#serial 31
 
 dnl We use jm_ for non Autoconf macros.
 m4_pattern_forbid([^jm_[ABCDEFGHIJKLMNOPQRSTUVXYZ]])dnl
+m4_pattern_forbid([^gl_[ABCDEFGHIJKLMNOPQRSTUVXYZ]])dnl
 
 # These are the prerequisite macros for files in the lib/
 # directory of the coreutils package.
@@ -1802,7 +1803,10 @@ m4_pattern_forbid([^jm_[ABCDEFGHIJKLMNOPQRSTUVXYZ]])dnl
 AC_DEFUN([jm_PREREQ],
 [
   AC_REQUIRE([jm_PREREQ_ADDEXT])
-  AC_REQUIRE([jm_PREREQ_C_STACK])
+
+  # We don't yet use c-stack.c.
+  # AC_REQUIRE([jm_PREREQ_C_STACK])
+
   AC_REQUIRE([jm_PREREQ_CANON_HOST])
   AC_REQUIRE([jm_PREREQ_DIRNAME])
   AC_REQUIRE([jm_PREREQ_ERROR])
@@ -2056,160 +2060,6 @@ AC_DEFUN([jm_PREREQ_XREADLINK],
   AC_CHECK_HEADERS(limits.h stdlib.h sys/types.h unistd.h)
 ])
 
-# Check prerequisites for compiling lib/c-stack.c.
-
-# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
-
-# 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.
-
-# Written by Paul Eggert.
-
-AC_DEFUN([AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC],
-  [# for STACK_DIRECTION
-   AC_REQUIRE([AC_FUNC_ALLOCA])
-   AC_CHECK_FUNCS(setrlimit)
-
-   AC_CACHE_CHECK([for working C stack overflow detection],
-     ac_cv_sys_xsi_stack_overflow_heuristic,
-     [AC_TRY_RUN(
-       [
-        #include <unistd.h>
-        #include <signal.h>
-        #include <ucontext.h>
-        #if HAVE_SETRLIMIT
-        # include <sys/types.h>
-        # include <sys/time.h>
-        # include <sys/resource.h>
-        #endif
-
-        static union
-        {
-          char buffer[SIGSTKSZ];
-          long double ld;
-          long u;
-          void *p;
-        } alternate_signal_stack;
-
-        #if STACK_DIRECTION
-        # define find_stack_direction(ptr) STACK_DIRECTION
-        #else
-        static int
-        find_stack_direction (char const *addr)
-        {
-          char dummy;
-          return (! addr ? find_stack_direction (&dummy)
-                  : addr < &dummy ? 1 : -1);
-        }
-        #endif
-
-        static void
-        segv_handler (int signo, siginfo_t *info, void *context)
-        {
-          if (0 < info->si_code)
-            {
-              ucontext_t const *user_context = context;
-              char const *stack_min = user_context->uc_stack.ss_sp;
-              size_t stack_size = user_context->uc_stack.ss_size;
-              char const *faulting_address = info->si_addr;
-              size_t s = faulting_address - stack_min;
-              size_t page_size = sysconf (_SC_PAGESIZE);
-              if (find_stack_direction (0) < 0)
-                s += page_size;
-              if (s < stack_size + page_size)
-                _exit (0);
-            }
-
-          _exit (1);
-        }
-
-        static int
-        c_stack_action (void)
-        {
-          stack_t st;
-          struct sigaction act;
-          int r;
-
-          st.ss_flags = 0;
-          st.ss_sp = alternate_signal_stack.buffer;
-          st.ss_size = sizeof alternate_signal_stack.buffer;
-          r = sigaltstack (&st, 0);
-          if (r != 0)
-            return r;
-
-          sigemptyset (&act.sa_mask);
-          act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND | SA_SIGINFO;
-          act.sa_sigaction = segv_handler;
-          return sigaction (SIGSEGV, &act, 0);
-        }
-
-        static int
-        recurse (char *p)
-        {
-          char array[500];
-          array[0] = 1;
-          return *p + recurse (array);
-        }
-
-        int
-        main (void)
-        {
-          #if HAVE_SETRLIMIT && defined RLIMIT_STACK
-          /* Before starting the endless recursion, try to be friendly
-             to the user's machine.  On some Linux 2.2.x systems, there
-             is no stack limit for user processes at all.  We don't want
-             to kill such systems.  */
-          struct rlimit rl;
-          rl.rlim_cur = rl.rlim_max = 0x100000; /* 1 MB */
-          setrlimit (RLIMIT_STACK, &rl);
-          #endif
-
-          c_stack_action ();
-          return recurse ("\1");
-        }
-       ],
-       [ac_cv_sys_xsi_stack_overflow_heuristic=yes],
-       [ac_cv_sys_xsi_stack_overflow_heuristic=no],
-       [ac_cv_sys_xsi_stack_overflow_heuristic=cross-compiling])])
-
-   if test $ac_cv_sys_xsi_stack_overflow_heuristic = yes; then
-     AC_DEFINE(HAVE_XSI_STACK_OVERFLOW_HEURISTIC, 1,
-       [Define to 1 if extending the stack slightly past the limit causes
-       a SIGSEGV, and an alternate stack can be established with sigaltstack,
-       and the signal handler is passed a context that specifies the
-       run time stack.  This behavior is defined by POSIX 1003.1-2001
-        with the X/Open System Interface (XSI) option
-       and is a standardized way to implement a SEGV-based stack
-        overflow detection heuristic.])
-   fi])
-
-
-AC_DEFUN([jm_PREREQ_C_STACK],
-  [AC_REQUIRE([AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC])
-
-   # for STACK_DIRECTION
-   AC_REQUIRE([AC_FUNC_ALLOCA])
-
-   AC_CHECK_FUNCS(getcontext sigaltstack)
-   AC_CHECK_DECLS([getcontext], , , [#include <ucontext.h>])
-   AC_CHECK_DECLS([sigaltstack], , , [#include <signal.h>])
-
-   AC_CHECK_HEADERS(sys/resource.h ucontext.h unistd.h)
-
-   AC_CHECK_TYPES([stack_t], , , [#include <signal.h>])])
-
 #serial 5
 
 dnl FIXME: put these prerequisite-only *.m4 files in a separate
index 1d3e4da81742eab1bf08c18631b4d7771540120e..312b40f99f254c3253d28f008d6578edf88957f8 100644 (file)
    you don't. */
 #undef HAVE_DECL_GETCHAR_UNLOCKED
 
-/* Define to 1 if you have the declaration of `getcontext', and to 0 if you
-   don't. */
-#undef HAVE_DECL_GETCONTEXT
-
 /* Define to 1 if you have the declaration of `getcwd', and to 0 if you don't.
    */
 #undef HAVE_DECL_GETCWD
    don't. */
 #undef HAVE_DECL_REALLOC
 
-/* Define to 1 if you have the declaration of `sigaltstack', and to 0 if you
-   don't. */
-#undef HAVE_DECL_SIGALTSTACK
-
 /* Define to 1 if you have the declaration of `stpcpy', and to 0 if you don't.
    */
 #undef HAVE_DECL_STPCPY
 /* Define if struct statfs has the f_fstypename member. */
 #undef HAVE_F_FSTYPENAME_IN_STATFS
 
-/* Define to 1 if you have the `getcontext' function. */
-#undef HAVE_GETCONTEXT
-
 /* Define to 1 if you have the `getcwd' function. */
 #undef HAVE_GETCWD
 
 /* Define to 1 if you have the `setreuid' function. */
 #undef HAVE_SETREUID
 
-/* Define to 1 if you have the `setrlimit' function. */
-#undef HAVE_SETRLIMIT
-
 /* Define to 1 if you have the <shadow.h> header file. */
 #undef HAVE_SHADOW_H
 
 /* Define to 1 if you have the `sig2str' function. */
 #undef HAVE_SIG2STR
 
-/* Define to 1 if you have the `sigaltstack' function. */
-#undef HAVE_SIGALTSTACK
-
 /* Define to 1 if you have the `sqrt' function. */
 #undef HAVE_SQRT
 
-/* Define to 1 if the system has the type `stack_t'. */
-#undef HAVE_STACK_T
-
 /* Define to 1 if you have the `statvfs' function. */
 #undef HAVE_STATVFS
 
 /* Define to 1 if you have the `tzset' function. */
 #undef HAVE_TZSET
 
-/* Define to 1 if you have the <ucontext.h> header file. */
-#undef HAVE_UCONTEXT_H
-
 /* Define to 1 if you have the `uname' function. */
 #undef HAVE_UNAME
 
 /* Define to 1 if you have the `wmempcpy' function. */
 #undef HAVE_WMEMPCPY
 
-/* Define to 1 if extending the stack slightly past the limit causes a
-   SIGSEGV, and an alternate stack can be established with sigaltstack, and
-   the signal handler is passed a context that specifies the run time stack.
-   This behavior is defined by POSIX 1003.1-2001 with the X/Open System
-   Interface (XSI) option and is a standardized way to implement a SEGV-based
-   stack overflow detection heuristic. */
-#undef HAVE_XSI_STACK_OVERFLOW_HEURISTIC
-
 /* Define to 1 if you have the external variable, _system_configuration with a
    member named physmem. */
 #undef HAVE__SYSTEM_CONFIGURATION
index 22007b591cccfe814340112e44f940bec5fc8623..7202f785970c1067b57f64f3b345e0deb49f3749 100644 (file)
@@ -171,7 +171,6 @@ libfetish_a_SOURCES = \
   basename.c \
   bumpalloc.h \
   canon-host.c \
-  c-stack.c c-stack.h \
   canonicalize.h \
   closeout.c closeout.h \
   cycle-check.c cycle-check.h \
@@ -288,27 +287,27 @@ am_libfetish_a_OBJECTS = acl.$(OBJEXT) getdate.$(OBJEXT) \
        getopt.$(OBJEXT) getopt1.$(OBJEXT) hash.$(OBJEXT) \
        hash-pjw.$(OBJEXT) addext.$(OBJEXT) argmatch.$(OBJEXT) \
        backupfile.$(OBJEXT) basename.$(OBJEXT) canon-host.$(OBJEXT) \
-       c-stack.$(OBJEXT) closeout.$(OBJEXT) cycle-check.$(OBJEXT) \
-       diacrit.$(OBJEXT) dirname.$(OBJEXT) dup-safer.$(OBJEXT) \
-       exclude.$(OBJEXT) exitfail.$(OBJEXT) filemode.$(OBJEXT) \
-       file-type.$(OBJEXT) fopen-safer.$(OBJEXT) full-read.$(OBJEXT) \
-       full-write.$(OBJEXT) getstr.$(OBJEXT) gettime.$(OBJEXT) \
-       getugroups.$(OBJEXT) hard-locale.$(OBJEXT) human.$(OBJEXT) \
-       idcache.$(OBJEXT) isdir.$(OBJEXT) imaxtostr.$(OBJEXT) \
-       linebuffer.$(OBJEXT) localcharset.$(OBJEXT) \
-       long-options.$(OBJEXT) makepath.$(OBJEXT) mbswidth.$(OBJEXT) \
-       md5.$(OBJEXT) memcasecmp.$(OBJEXT) memcoll.$(OBJEXT) \
-       modechange.$(OBJEXT) offtostr.$(OBJEXT) path-concat.$(OBJEXT) \
-       physmem.$(OBJEXT) quote.$(OBJEXT) quotearg.$(OBJEXT) \
-       readtokens.$(OBJEXT) safe-read.$(OBJEXT) safe-write.$(OBJEXT) \
-       same.$(OBJEXT) save-cwd.$(OBJEXT) savedir.$(OBJEXT) \
-       settime.$(OBJEXT) sha.$(OBJEXT) stripslash.$(OBJEXT) \
-       umaxtostr.$(OBJEXT) unicodeio.$(OBJEXT) userspec.$(OBJEXT) \
-       version-etc.$(OBJEXT) xgetcwd.$(OBJEXT) xgethostname.$(OBJEXT) \
-       xmalloc.$(OBJEXT) xmemcoll.$(OBJEXT) xnanosleep.$(OBJEXT) \
-       xreadlink.$(OBJEXT) xstrdup.$(OBJEXT) xstrtod.$(OBJEXT) \
-       xstrtol.$(OBJEXT) xstrtoul.$(OBJEXT) xstrtoimax.$(OBJEXT) \
-       xstrtoumax.$(OBJEXT) yesno.$(OBJEXT)
+       closeout.$(OBJEXT) cycle-check.$(OBJEXT) diacrit.$(OBJEXT) \
+       dirname.$(OBJEXT) dup-safer.$(OBJEXT) exclude.$(OBJEXT) \
+       exitfail.$(OBJEXT) filemode.$(OBJEXT) file-type.$(OBJEXT) \
+       fopen-safer.$(OBJEXT) full-read.$(OBJEXT) full-write.$(OBJEXT) \
+       getstr.$(OBJEXT) gettime.$(OBJEXT) getugroups.$(OBJEXT) \
+       hard-locale.$(OBJEXT) human.$(OBJEXT) idcache.$(OBJEXT) \
+       isdir.$(OBJEXT) imaxtostr.$(OBJEXT) linebuffer.$(OBJEXT) \
+       localcharset.$(OBJEXT) long-options.$(OBJEXT) \
+       makepath.$(OBJEXT) mbswidth.$(OBJEXT) md5.$(OBJEXT) \
+       memcasecmp.$(OBJEXT) memcoll.$(OBJEXT) modechange.$(OBJEXT) \
+       offtostr.$(OBJEXT) path-concat.$(OBJEXT) physmem.$(OBJEXT) \
+       quote.$(OBJEXT) quotearg.$(OBJEXT) readtokens.$(OBJEXT) \
+       safe-read.$(OBJEXT) safe-write.$(OBJEXT) same.$(OBJEXT) \
+       save-cwd.$(OBJEXT) savedir.$(OBJEXT) settime.$(OBJEXT) \
+       sha.$(OBJEXT) stripslash.$(OBJEXT) umaxtostr.$(OBJEXT) \
+       unicodeio.$(OBJEXT) userspec.$(OBJEXT) version-etc.$(OBJEXT) \
+       xgetcwd.$(OBJEXT) xgethostname.$(OBJEXT) xmalloc.$(OBJEXT) \
+       xmemcoll.$(OBJEXT) xnanosleep.$(OBJEXT) xreadlink.$(OBJEXT) \
+       xstrdup.$(OBJEXT) xstrtod.$(OBJEXT) xstrtol.$(OBJEXT) \
+       xstrtoul.$(OBJEXT) xstrtoimax.$(OBJEXT) xstrtoumax.$(OBJEXT) \
+       yesno.$(OBJEXT)
 libfetish_a_OBJECTS = $(am_libfetish_a_OBJECTS)
 
 DEFAULT_INCLUDES =  -I. -I$(srcdir) -I$(top_builddir)
@@ -352,16 +351,16 @@ am__depfiles_maybe = depfiles
 @AMDEP_TRUE@   $(DEPDIR)/utime.Po ./$(DEPDIR)/acl.Po \
 @AMDEP_TRUE@   ./$(DEPDIR)/addext.Po ./$(DEPDIR)/argmatch.Po \
 @AMDEP_TRUE@   ./$(DEPDIR)/backupfile.Po ./$(DEPDIR)/basename.Po \
-@AMDEP_TRUE@   ./$(DEPDIR)/c-stack.Po ./$(DEPDIR)/canon-host.Po \
-@AMDEP_TRUE@   ./$(DEPDIR)/closeout.Po ./$(DEPDIR)/cycle-check.Po \
-@AMDEP_TRUE@   ./$(DEPDIR)/diacrit.Po ./$(DEPDIR)/dirname.Po \
-@AMDEP_TRUE@   ./$(DEPDIR)/dup-safer.Po ./$(DEPDIR)/exclude.Po \
-@AMDEP_TRUE@   ./$(DEPDIR)/exitfail.Po ./$(DEPDIR)/file-type.Po \
-@AMDEP_TRUE@   ./$(DEPDIR)/filemode.Po ./$(DEPDIR)/fopen-safer.Po \
-@AMDEP_TRUE@   ./$(DEPDIR)/full-read.Po ./$(DEPDIR)/full-write.Po \
-@AMDEP_TRUE@   ./$(DEPDIR)/getdate.Po ./$(DEPDIR)/getopt.Po \
-@AMDEP_TRUE@   ./$(DEPDIR)/getopt1.Po ./$(DEPDIR)/getstr.Po \
-@AMDEP_TRUE@   ./$(DEPDIR)/gettime.Po ./$(DEPDIR)/getugroups.Po \
+@AMDEP_TRUE@   ./$(DEPDIR)/canon-host.Po ./$(DEPDIR)/closeout.Po \
+@AMDEP_TRUE@   ./$(DEPDIR)/cycle-check.Po ./$(DEPDIR)/diacrit.Po \
+@AMDEP_TRUE@   ./$(DEPDIR)/dirname.Po ./$(DEPDIR)/dup-safer.Po \
+@AMDEP_TRUE@   ./$(DEPDIR)/exclude.Po ./$(DEPDIR)/exitfail.Po \
+@AMDEP_TRUE@   ./$(DEPDIR)/file-type.Po ./$(DEPDIR)/filemode.Po \
+@AMDEP_TRUE@   ./$(DEPDIR)/fopen-safer.Po ./$(DEPDIR)/full-read.Po \
+@AMDEP_TRUE@   ./$(DEPDIR)/full-write.Po ./$(DEPDIR)/getdate.Po \
+@AMDEP_TRUE@   ./$(DEPDIR)/getopt.Po ./$(DEPDIR)/getopt1.Po \
+@AMDEP_TRUE@   ./$(DEPDIR)/getstr.Po ./$(DEPDIR)/gettime.Po \
+@AMDEP_TRUE@   ./$(DEPDIR)/getugroups.Po \
 @AMDEP_TRUE@   ./$(DEPDIR)/hard-locale.Po ./$(DEPDIR)/hash-pjw.Po \
 @AMDEP_TRUE@   ./$(DEPDIR)/hash.Po ./$(DEPDIR)/human.Po \
 @AMDEP_TRUE@   ./$(DEPDIR)/idcache.Po ./$(DEPDIR)/imaxtostr.Po \
@@ -512,7 +511,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/argmatch.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/backupfile.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/basename.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c-stack.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/canon-host.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/closeout.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cycle-check.Po@am__quote@
index edff8c8d56afbce6c115a35845503f18740b1d6a..dfccf1aad625333f1a7945039369e6e2c65b94a1 100644 (file)
@@ -843,7 +843,7 @@ uninstall-binPROGRAMS:
        done
 
 clean-binPROGRAMS:
-       -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+       -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) > /dev/null 2>&1 || /bin/rm -f $(bin_PROGRAMS)
 
 installcheck-binPROGRAMS: $(bin_PROGRAMS)
        bad=0; pid=$$$$; list="$(bin_PROGRAMS)"; for p in $$list; do \