summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2003-03-15 10:41:10 +0000
committerJim Meyering <jim@meyering.net>2003-03-15 10:41:10 +0000
commita32544a77f3f9d85270944204de4983e6feec31d (patch)
treeb1198311eea6a689553479b29b87ec15c2faf90a
parent3b424797bc7f2eb9b19282ad783b17baf1ed95db (diff)
downloadcoreutils-a32544a77f3f9d85270944204de4983e6feec31d.tar.xz
.
-rw-r--r--aclocal.m4162
-rw-r--r--config.hin31
-rw-r--r--lib/Makefile.in64
-rw-r--r--src/Makefile.in2
4 files changed, 38 insertions, 221 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index 956382c1d..2e23779fe 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -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
diff --git a/config.hin b/config.hin
index 1d3e4da81..312b40f99 100644
--- a/config.hin
+++ b/config.hin
@@ -183,10 +183,6 @@
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
@@ -255,10 +251,6 @@
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
@@ -392,9 +384,6 @@
/* 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
@@ -679,24 +668,15 @@
/* 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
@@ -1039,9 +1019,6 @@
/* 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
@@ -1099,14 +1076,6 @@
/* 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
diff --git a/lib/Makefile.in b/lib/Makefile.in
index 22007b591..7202f7859 100644
--- a/lib/Makefile.in
+++ b/lib/Makefile.in
@@ -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@
diff --git a/src/Makefile.in b/src/Makefile.in
index edff8c8d5..dfccf1aad 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -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 \