You've already forked linux-packaging-mono
Merge branch 'upstream'
Former-commit-id: 41da44c4d7736cf9b84d16501a727a41bd15ba5d
This commit is contained in:
@@ -644,9 +644,17 @@ GC_stop_func stop_func;
|
||||
}
|
||||
}
|
||||
|
||||
void (*GC_notify_event) GC_PROTO((GCEventType e));
|
||||
void (*GC_notify_event) GC_PROTO((GC_EventType e));
|
||||
void (*GC_on_heap_resize) GC_PROTO((size_t new_size));
|
||||
|
||||
GC_API void GC_set_on_collection_event (void (*fn) (GC_EventType))
|
||||
{
|
||||
DCL_LOCK_STATE;
|
||||
LOCK();
|
||||
GC_notify_event = fn;
|
||||
UNLOCK();
|
||||
}
|
||||
|
||||
/* Finish up a collection. Assumes lock is held, signals are disabled, */
|
||||
/* but the world is otherwise running. */
|
||||
void GC_finish_collection()
|
||||
|
837
libgc/depcomp
837
libgc/depcomp
File diff suppressed because it is too large
Load Diff
@@ -313,7 +313,7 @@ typedef struct {
|
||||
GC_hidden_pointer weak_ref;
|
||||
} GCToggleRef;
|
||||
|
||||
static int (*GC_toggleref_callback) (GC_PTR obj);
|
||||
static GC_ToggleRefStatus (*GC_toggleref_callback) (GC_PTR obj);
|
||||
static GCToggleRef *GC_toggleref_array;
|
||||
static int GC_toggleref_array_size;
|
||||
static int GC_toggleref_array_capacity;
|
||||
@@ -326,7 +326,7 @@ GC_process_togglerefs (void)
|
||||
int toggle_ref_counts [3] = { 0, 0, 0 };
|
||||
|
||||
for (i = w = 0; i < GC_toggleref_array_size; ++i) {
|
||||
int res;
|
||||
GC_ToggleRefStatus res;
|
||||
GCToggleRef r = GC_toggleref_array [i];
|
||||
|
||||
GC_PTR obj;
|
||||
@@ -341,14 +341,14 @@ GC_process_togglerefs (void)
|
||||
res = GC_toggleref_callback (obj);
|
||||
++toggle_ref_counts [res];
|
||||
switch (res) {
|
||||
case 0:
|
||||
case GC_TOGGLE_REF_DROP:
|
||||
break;
|
||||
case 1:
|
||||
case GC_TOGGLE_REF_STRONG:
|
||||
GC_toggleref_array [w].strong_ref = obj;
|
||||
GC_toggleref_array [w].weak_ref = (GC_hidden_pointer)NULL;
|
||||
++w;
|
||||
break;
|
||||
case 2:
|
||||
case GC_TOGGLE_REF_WEAK:
|
||||
GC_toggleref_array [w].strong_ref = NULL;
|
||||
GC_toggleref_array [w].weak_ref = HIDE_POINTER (obj);
|
||||
++w;
|
||||
@@ -370,7 +370,7 @@ GC_process_togglerefs (void)
|
||||
static void (*GC_object_finalized_proc) (GC_PTR obj);
|
||||
|
||||
void
|
||||
GC_set_finalizer_notify_proc (void (*proc) (GC_PTR obj))
|
||||
GC_set_await_finalize_proc (void (*proc) (GC_PTR obj))
|
||||
{
|
||||
GC_object_finalized_proc = proc;
|
||||
}
|
||||
@@ -423,17 +423,19 @@ static void GC_clear_togglerefs ()
|
||||
|
||||
|
||||
|
||||
void GC_toggleref_register_callback(int (*proccess_toggleref) (GC_PTR obj))
|
||||
void GC_set_toggleref_func(GC_ToggleRefStatus (*proccess_toggleref) (GC_PTR obj))
|
||||
{
|
||||
GC_toggleref_callback = proccess_toggleref;
|
||||
}
|
||||
|
||||
static void
|
||||
static GC_bool
|
||||
ensure_toggleref_capacity (int capacity)
|
||||
{
|
||||
if (!GC_toggleref_array) {
|
||||
GC_toggleref_array_capacity = 32;
|
||||
GC_toggleref_array = (GCToggleRef *) GC_INTERNAL_MALLOC_IGNORE_OFF_PAGE (GC_toggleref_array_capacity * sizeof (GCToggleRef), NORMAL);
|
||||
if (!GC_toggleref_array)
|
||||
return FALSE;
|
||||
}
|
||||
if (GC_toggleref_array_size + capacity >= GC_toggleref_array_capacity) {
|
||||
GCToggleRef *tmp;
|
||||
@@ -442,15 +444,19 @@ ensure_toggleref_capacity (int capacity)
|
||||
GC_toggleref_array_capacity *= 2;
|
||||
|
||||
tmp = (GCToggleRef *) GC_INTERNAL_MALLOC_IGNORE_OFF_PAGE (GC_toggleref_array_capacity * sizeof (GCToggleRef), NORMAL);
|
||||
if (!tmp)
|
||||
return FALSE;
|
||||
memcpy (tmp, GC_toggleref_array, GC_toggleref_array_size * sizeof (GCToggleRef));
|
||||
GC_INTERNAL_FREE (GC_toggleref_array);
|
||||
GC_toggleref_array = tmp;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
int
|
||||
GC_toggleref_add (GC_PTR object, int strong_ref)
|
||||
{
|
||||
int res = GC_SUCCESS;
|
||||
DCL_LOCK_STATE;
|
||||
# ifdef THREADS
|
||||
DISABLE_SIGNALS();
|
||||
@@ -460,7 +466,10 @@ GC_toggleref_add (GC_PTR object, int strong_ref)
|
||||
if (!GC_toggleref_callback)
|
||||
goto end;
|
||||
|
||||
ensure_toggleref_capacity (1);
|
||||
if (!ensure_toggleref_capacity (1)) {
|
||||
res = GC_NO_MEMORY;
|
||||
goto end;
|
||||
}
|
||||
GC_toggleref_array [GC_toggleref_array_size].strong_ref = strong_ref ? object : NULL;
|
||||
GC_toggleref_array [GC_toggleref_array_size].weak_ref = strong_ref ? (GC_hidden_pointer)NULL : HIDE_POINTER (object);
|
||||
++GC_toggleref_array_size;
|
||||
@@ -470,6 +479,7 @@ end:
|
||||
UNLOCK();
|
||||
ENABLE_SIGNALS();
|
||||
# endif
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -104,11 +104,11 @@ typedef enum {
|
||||
GC_EVENT_POST_STOP_WORLD,
|
||||
GC_EVENT_PRE_START_WORLD,
|
||||
GC_EVENT_POST_START_WORLD
|
||||
} GCEventType;
|
||||
} GC_EventType;
|
||||
|
||||
GC_API void (*GC_notify_event) GC_PROTO((GCEventType event_type));
|
||||
/* Invoked at specific points during every collection.
|
||||
*/
|
||||
GC_API void GC_set_on_collection_event GC_PROTO((void (*) (GC_EventType)));
|
||||
/* Set callback invoked at specific points */
|
||||
/* during every collection. */
|
||||
|
||||
GC_API void (*GC_on_heap_resize) GC_PROTO((size_t new_size));
|
||||
/* Invoked when the heap grows or shrinks */
|
||||
@@ -431,7 +431,10 @@ int GC_get_suspend_signal GC_PROTO((void));
|
||||
|
||||
/* Return the signal used by the gc to resume threads on posix platforms. */
|
||||
/* Return -1 otherwise. */
|
||||
int GC_get_restart_signal GC_PROTO((void));
|
||||
int GC_get_thr_restart_signal GC_PROTO((void));
|
||||
|
||||
/* Explicitly enable GC_register_my_thread() invocation. */
|
||||
GC_API void GC_allow_register_threads GC_PROTO((void));
|
||||
|
||||
/* Disable garbage collection. Even GC_gcollect calls will be */
|
||||
/* ineffective. */
|
||||
@@ -773,13 +776,21 @@ GC_API int GC_unregister_disappearing_link GC_PROTO((GC_PTR * /* link */));
|
||||
GC_API int GC_register_long_link GC_PROTO((GC_PTR * /* link */, GC_PTR obj));
|
||||
GC_API int GC_unregister_long_link GC_PROTO((GC_PTR * /* link */));
|
||||
|
||||
typedef enum {
|
||||
GC_TOGGLE_REF_DROP,
|
||||
GC_TOGGLE_REF_STRONG,
|
||||
GC_TOGGLE_REF_WEAK
|
||||
} GC_ToggleRefStatus;
|
||||
|
||||
/* toggleref support */
|
||||
GC_API void GC_toggleref_register_callback GC_PROTO((int (*proccess_toggleref) (GC_PTR obj)));
|
||||
GC_API void GC_toggleref_add (GC_PTR object, int strong_ref);
|
||||
GC_API void GC_set_toggleref_func GC_PROTO(
|
||||
(GC_ToggleRefStatus (*proccess_toggleref) (GC_PTR obj)));
|
||||
GC_API int GC_toggleref_add (GC_PTR object, int strong_ref);
|
||||
/* Returns GC_SUCCESS if registration succeeded (or no callback */
|
||||
/* registered yet), GC_NO_MEMORY if failed for lack of memory. */
|
||||
|
||||
/* finalizer callback support */
|
||||
GC_API void GC_set_finalizer_notify_proc GC_PROTO((void (*object_finalized) (GC_PTR obj)));
|
||||
GC_API void GC_set_await_finalize_proc GC_PROTO((void (*object_finalized) (GC_PTR obj)));
|
||||
|
||||
|
||||
/* Returns !=0 if GC_invoke_finalizers has something to do. */
|
||||
@@ -859,6 +870,21 @@ GC_API GC_PTR GC_is_visible GC_PROTO((GC_PTR p));
|
||||
/* Always returns its argument. */
|
||||
GC_API GC_PTR GC_is_valid_displacement GC_PROTO((GC_PTR p));
|
||||
|
||||
#define GC_SUCCESS 0
|
||||
#define GC_DUPLICATE 1 /* Was already registered. */
|
||||
#define GC_NO_MEMORY 2 /* Failure due to lack of memory. */
|
||||
#define GC_UNIMPLEMENTED 3 /* Not yet implemented on the platform. */
|
||||
|
||||
/* Structure representing the base of a thread stack. */
|
||||
struct GC_stack_base {
|
||||
void * mem_base; /* Base of memory stack. */
|
||||
};
|
||||
|
||||
/* Register the current thread, with the indicated stack base. */
|
||||
/* Returns GC_SUCCESS on success, GC_DUPLICATE if already registered. */
|
||||
/* On some platforms it returns GC_UNIMPLEMENTED. */
|
||||
GC_API int GC_register_my_thread GC_PROTO((struct GC_stack_base *));
|
||||
|
||||
/* Returns 1 if the calling thread is registered with the GC, 0 otherwise */
|
||||
GC_API int GC_thread_is_registered GC_PROTO((void));
|
||||
|
||||
@@ -949,7 +975,9 @@ extern void GC_thr_init(void); /* Needed for Solaris/X86 */
|
||||
#if defined(GC_WIN32_THREADS) && !defined(__CYGWIN32__) && !defined(__CYGWIN__)
|
||||
# include <windows.h>
|
||||
|
||||
# ifdef GC_INSIDE_DLL
|
||||
BOOL WINAPI GC_DllMain(HINSTANCE inst, ULONG reason, LPVOID reserved);
|
||||
# endif
|
||||
|
||||
/*
|
||||
* All threads must be created using GC_CreateThread, so that they will be
|
||||
|
@@ -1214,6 +1214,8 @@ extern long GC_large_alloc_warn_suppressed;
|
||||
extern GC_bool GC_world_stopped;
|
||||
#endif
|
||||
|
||||
extern void (*GC_notify_event) GC_PROTO((GC_EventType));
|
||||
|
||||
/* Operations */
|
||||
# ifndef abs
|
||||
# define abs(x) ((x) < 0? (-(x)) : (x))
|
||||
|
@@ -16,6 +16,23 @@
|
||||
|
||||
/* We use the allocation lock to protect thread-related data structures. */
|
||||
|
||||
#ifdef THREAD_LOCAL_ALLOC
|
||||
# if CPP_WORDSZ == 64 && defined(ALIGN_DOUBLE)
|
||||
# define GRANULARITY 16
|
||||
# define NFREELISTS 49
|
||||
# else
|
||||
# define GRANULARITY 8
|
||||
# define NFREELISTS 65
|
||||
# endif
|
||||
struct thread_local_freelists {
|
||||
ptr_t ptrfree_freelists[NFREELISTS];
|
||||
ptr_t normal_freelists[NFREELISTS];
|
||||
# ifdef GC_GCJ_SUPPORT
|
||||
ptr_t gcj_freelists[NFREELISTS];
|
||||
# endif
|
||||
};
|
||||
#endif
|
||||
|
||||
/* The set of all known threads. We intercept thread creation and */
|
||||
/* joins. */
|
||||
/* Protected by allocation/GC lock. */
|
||||
@@ -60,23 +77,12 @@ typedef struct GC_Thread_Rep {
|
||||
/* reclamation of any data it might */
|
||||
/* reference. */
|
||||
# ifdef THREAD_LOCAL_ALLOC
|
||||
# if CPP_WORDSZ == 64 && defined(ALIGN_DOUBLE)
|
||||
# define GRANULARITY 16
|
||||
# define NFREELISTS 49
|
||||
# else
|
||||
# define GRANULARITY 8
|
||||
# define NFREELISTS 65
|
||||
# endif
|
||||
/* The ith free list corresponds to size i*GRANULARITY */
|
||||
# define INDEX_FROM_BYTES(n) ((ADD_SLOP(n) + GRANULARITY - 1)/GRANULARITY)
|
||||
# define BYTES_FROM_INDEX(i) ((i) * GRANULARITY - EXTRA_BYTES)
|
||||
# define SMALL_ENOUGH(bytes) (ADD_SLOP(bytes) <= \
|
||||
(NFREELISTS-1)*GRANULARITY)
|
||||
ptr_t ptrfree_freelists[NFREELISTS];
|
||||
ptr_t normal_freelists[NFREELISTS];
|
||||
# ifdef GC_GCJ_SUPPORT
|
||||
ptr_t gcj_freelists[NFREELISTS];
|
||||
# endif
|
||||
struct thread_local_freelists tlfs;
|
||||
/* Free lists contain either a pointer or a small count */
|
||||
/* reflecting the number of granules allocated at that */
|
||||
/* size. */
|
||||
|
@@ -480,7 +480,7 @@ int GC_get_suspend_signal GC_PROTO(())
|
||||
#endif
|
||||
}
|
||||
|
||||
int GC_get_restart_signal GC_PROTO(())
|
||||
int GC_get_thr_restart_signal GC_PROTO(())
|
||||
{
|
||||
#if defined(SIG_THR_RESTART) && defined(GC_PTHREADS) && !defined(GC_MACOSX_THREADS) && !defined(GC_OPENBSD_THREADS)
|
||||
return SIG_THR_RESTART;
|
||||
|
457
libgc/missing
457
libgc/missing
@@ -1,7 +1,10 @@
|
||||
#! /bin/sh
|
||||
# Common stub for a few missing GNU programs while installing.
|
||||
# Copyright 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
|
||||
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
|
||||
# Common wrapper for a few potentially missing GNU programs.
|
||||
|
||||
scriptversion=2012-06-26.16; # UTC
|
||||
|
||||
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
|
||||
# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 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
|
||||
@@ -14,9 +17,7 @@
|
||||
# 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.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
@@ -24,313 +25,191 @@
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
if test $# -eq 0; then
|
||||
echo 1>&2 "Try \`$0 --help' for more information"
|
||||
echo 1>&2 "Try '$0 --help' for more information"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
run=:
|
||||
case $1 in
|
||||
|
||||
# In the cases where this matters, `missing' is being run in the
|
||||
# srcdir already.
|
||||
if test -f configure.ac; then
|
||||
configure_ac=configure.ac
|
||||
else
|
||||
configure_ac=configure.in
|
||||
fi
|
||||
--is-lightweight)
|
||||
# Used by our autoconf macros to check whether the available missing
|
||||
# script is modern enough.
|
||||
exit 0
|
||||
;;
|
||||
|
||||
case "$1" in
|
||||
--run)
|
||||
# Try to run requested program, and just exit if it succeeds.
|
||||
run=
|
||||
shift
|
||||
"$@" && exit 0
|
||||
;;
|
||||
esac
|
||||
|
||||
# If it does not exist, or fails to run (possibly an outdated version),
|
||||
# try to emulate it.
|
||||
case "$1" in
|
||||
--run)
|
||||
# Back-compat with the calling convention used by older automake.
|
||||
shift
|
||||
;;
|
||||
|
||||
-h|--h|--he|--hel|--help)
|
||||
echo "\
|
||||
$0 [OPTION]... PROGRAM [ARGUMENT]...
|
||||
|
||||
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
|
||||
error status if there is no known handling for PROGRAM.
|
||||
Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
|
||||
to PROGRAM being missing or too old.
|
||||
|
||||
Options:
|
||||
-h, --help display this help and exit
|
||||
-v, --version output version information and exit
|
||||
--run try to run the given command, and emulate it if it fails
|
||||
|
||||
Supported PROGRAM values:
|
||||
aclocal touch file \`aclocal.m4'
|
||||
autoconf touch file \`configure'
|
||||
autoheader touch file \`config.h.in'
|
||||
automake touch all \`Makefile.in' files
|
||||
bison create \`y.tab.[ch]', if possible, from existing .[ch]
|
||||
flex create \`lex.yy.c', if possible, from existing .c
|
||||
help2man touch the output file
|
||||
lex create \`lex.yy.c', if possible, from existing .c
|
||||
makeinfo touch the output file
|
||||
tar try tar, gnutar, gtar, then tar without non-portable flags
|
||||
yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
|
||||
aclocal autoconf autoheader autom4te automake makeinfo
|
||||
bison yacc flex lex help2man
|
||||
|
||||
Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
|
||||
'g' are ignored when checking the name.
|
||||
|
||||
Send bug reports to <bug-automake@gnu.org>."
|
||||
exit $?
|
||||
;;
|
||||
|
||||
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
|
||||
echo "missing 0.4 - GNU automake"
|
||||
echo "missing $scriptversion (GNU Automake)"
|
||||
exit $?
|
||||
;;
|
||||
|
||||
-*)
|
||||
echo 1>&2 "$0: Unknown \`$1' option"
|
||||
echo 1>&2 "Try \`$0 --help' for more information"
|
||||
echo 1>&2 "$0: unknown '$1' option"
|
||||
echo 1>&2 "Try '$0 --help' for more information"
|
||||
exit 1
|
||||
;;
|
||||
|
||||
aclocal*)
|
||||
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
||||
# We have it, but it failed.
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
|
||||
to install the \`Automake' and \`Perl' packages. Grab them from
|
||||
any GNU archive site."
|
||||
touch aclocal.m4
|
||||
;;
|
||||
|
||||
autoconf)
|
||||
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
||||
# We have it, but it failed.
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified \`${configure_ac}'. You might want to install the
|
||||
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
|
||||
archive site."
|
||||
touch configure
|
||||
;;
|
||||
|
||||
autoheader)
|
||||
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
||||
# We have it, but it failed.
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified \`acconfig.h' or \`${configure_ac}'. You might want
|
||||
to install the \`Autoconf' and \`GNU m4' packages. Grab them
|
||||
from any GNU archive site."
|
||||
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
|
||||
test -z "$files" && files="config.h"
|
||||
touch_files=
|
||||
for f in $files; do
|
||||
case "$f" in
|
||||
*:*) touch_files="$touch_files "`echo "$f" |
|
||||
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
|
||||
*) touch_files="$touch_files $f.in";;
|
||||
esac
|
||||
done
|
||||
touch $touch_files
|
||||
;;
|
||||
|
||||
automake*)
|
||||
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
||||
# We have it, but it failed.
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
|
||||
You might want to install the \`Automake' and \`Perl' packages.
|
||||
Grab them from any GNU archive site."
|
||||
find . -type f -name Makefile.am -print |
|
||||
sed 's/\.am$/.in/' |
|
||||
while read f; do touch "$f"; done
|
||||
;;
|
||||
|
||||
autom4te)
|
||||
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
||||
# We have it, but it failed.
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is needed, and you do not seem to have it handy on your
|
||||
system. You might have modified some files without having the
|
||||
proper tools for further handling them.
|
||||
You can get \`$1Help2man' as part of \`Autoconf' from any GNU
|
||||
archive site."
|
||||
|
||||
file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
|
||||
test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
|
||||
if test -f "$file"; then
|
||||
touch $file
|
||||
else
|
||||
test -z "$file" || exec >$file
|
||||
echo "#! /bin/sh"
|
||||
echo "# Created by GNU Automake missing as a replacement of"
|
||||
echo "# $ $@"
|
||||
echo "exit 0"
|
||||
chmod +x $file
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
bison|yacc)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified a \`.y' file. You may need the \`Bison' package
|
||||
in order for those modifications to take effect. You can get
|
||||
\`Bison' from any GNU archive site."
|
||||
rm -f y.tab.c y.tab.h
|
||||
if [ $# -ne 1 ]; then
|
||||
eval LASTARG="\${$#}"
|
||||
case "$LASTARG" in
|
||||
*.y)
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
|
||||
if [ -f "$SRCFILE" ]; then
|
||||
cp "$SRCFILE" y.tab.c
|
||||
fi
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
|
||||
if [ -f "$SRCFILE" ]; then
|
||||
cp "$SRCFILE" y.tab.h
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if [ ! -f y.tab.h ]; then
|
||||
echo >y.tab.h
|
||||
fi
|
||||
if [ ! -f y.tab.c ]; then
|
||||
echo 'main() { return 0; }' >y.tab.c
|
||||
fi
|
||||
;;
|
||||
|
||||
lex|flex)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified a \`.l' file. You may need the \`Flex' package
|
||||
in order for those modifications to take effect. You can get
|
||||
\`Flex' from any GNU archive site."
|
||||
rm -f lex.yy.c
|
||||
if [ $# -ne 1 ]; then
|
||||
eval LASTARG="\${$#}"
|
||||
case "$LASTARG" in
|
||||
*.l)
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
|
||||
if [ -f "$SRCFILE" ]; then
|
||||
cp "$SRCFILE" lex.yy.c
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if [ ! -f lex.yy.c ]; then
|
||||
echo 'main() { return 0; }' >lex.yy.c
|
||||
fi
|
||||
;;
|
||||
|
||||
help2man)
|
||||
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
||||
# We have it, but it failed.
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified a dependency of a manual page. You may need the
|
||||
\`Help2man' package in order for those modifications to take
|
||||
effect. You can get \`Help2man' from any GNU archive site."
|
||||
|
||||
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
|
||||
if test -z "$file"; then
|
||||
file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
|
||||
fi
|
||||
if [ -f "$file" ]; then
|
||||
touch $file
|
||||
else
|
||||
test -z "$file" || exec >$file
|
||||
echo ".ab help2man is required to generate this page"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
makeinfo)
|
||||
if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then
|
||||
# We have makeinfo, but it failed.
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified a \`.texi' or \`.texinfo' file, or any other file
|
||||
indirectly affecting the aspect of the manual. The spurious
|
||||
call might also be the consequence of using a buggy \`make' (AIX,
|
||||
DU, IRIX). You might want to install the \`Texinfo' package or
|
||||
the \`GNU make' package. Grab either from any GNU archive site."
|
||||
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
|
||||
if test -z "$file"; then
|
||||
file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
|
||||
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
|
||||
fi
|
||||
touch $file
|
||||
;;
|
||||
|
||||
tar)
|
||||
shift
|
||||
if test -n "$run"; then
|
||||
echo 1>&2 "ERROR: \`tar' requires --run"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# We have already tried tar in the generic part.
|
||||
# Look for gnutar/gtar before invocation to avoid ugly error
|
||||
# messages.
|
||||
if (gnutar --version > /dev/null 2>&1); then
|
||||
gnutar ${1+"$@"} && exit 0
|
||||
fi
|
||||
if (gtar --version > /dev/null 2>&1); then
|
||||
gtar ${1+"$@"} && exit 0
|
||||
fi
|
||||
firstarg="$1"
|
||||
if shift; then
|
||||
case "$firstarg" in
|
||||
*o*)
|
||||
firstarg=`echo "$firstarg" | sed s/o//`
|
||||
tar "$firstarg" ${1+"$@"} && exit 0
|
||||
;;
|
||||
esac
|
||||
case "$firstarg" in
|
||||
*h*)
|
||||
firstarg=`echo "$firstarg" | sed s/h//`
|
||||
tar "$firstarg" ${1+"$@"} && exit 0
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
echo 1>&2 "\
|
||||
WARNING: I can't seem to be able to run \`tar' with the given arguments.
|
||||
You may want to install GNU tar or Free paxutils, or check the
|
||||
command line arguments."
|
||||
exit 1
|
||||
;;
|
||||
|
||||
*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is needed, and you do not seem to have it handy on your
|
||||
system. You might have modified some files without having the
|
||||
proper tools for further handling them. Check the \`README' file,
|
||||
it often tells you about the needed prerequirements for installing
|
||||
this package. You may also peek at any GNU archive site, in case
|
||||
some other package would contain this missing \`$1' program."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
# Run the given program, remember its exit status.
|
||||
"$@"; st=$?
|
||||
|
||||
# If it succeeded, we are done.
|
||||
test $st -eq 0 && exit 0
|
||||
|
||||
# Also exit now if we it failed (or wasn't found), and '--version' was
|
||||
# passed; such an option is passed most likely to detect whether the
|
||||
# program is present and works.
|
||||
case $2 in --version|--help) exit $st;; esac
|
||||
|
||||
# Exit code 63 means version mismatch. This often happens when the user
|
||||
# tries to use an ancient version of a tool on a file that requires a
|
||||
# minimum version.
|
||||
if test $st -eq 63; then
|
||||
msg="probably too old"
|
||||
elif test $st -eq 127; then
|
||||
# Program was missing.
|
||||
msg="missing on your system"
|
||||
else
|
||||
# Program was found and executed, but failed. Give up.
|
||||
exit $st
|
||||
fi
|
||||
|
||||
perl_URL=http://www.perl.org/
|
||||
flex_URL=http://flex.sourceforge.net/
|
||||
gnu_software_URL=http://www.gnu.org/software
|
||||
|
||||
program_details ()
|
||||
{
|
||||
case $1 in
|
||||
aclocal|automake)
|
||||
echo "The '$1' program is part of the GNU Automake package:"
|
||||
echo "<$gnu_software_URL/automake>"
|
||||
echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
|
||||
echo "<$gnu_software_URL/autoconf>"
|
||||
echo "<$gnu_software_URL/m4/>"
|
||||
echo "<$perl_URL>"
|
||||
;;
|
||||
autoconf|autom4te|autoheader)
|
||||
echo "The '$1' program is part of the GNU Autoconf package:"
|
||||
echo "<$gnu_software_URL/autoconf/>"
|
||||
echo "It also requires GNU m4 and Perl in order to run:"
|
||||
echo "<$gnu_software_URL/m4/>"
|
||||
echo "<$perl_URL>"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
give_advice ()
|
||||
{
|
||||
# Normalize program name to check for.
|
||||
normalized_program=`echo "$1" | sed '
|
||||
s/^gnu-//; t
|
||||
s/^gnu//; t
|
||||
s/^g//; t'`
|
||||
|
||||
printf '%s\n' "'$1' is $msg."
|
||||
|
||||
configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
|
||||
case $normalized_program in
|
||||
autoconf*)
|
||||
echo "You should only need it if you modified 'configure.ac',"
|
||||
echo "or m4 files included by it."
|
||||
program_details 'autoconf'
|
||||
;;
|
||||
autoheader*)
|
||||
echo "You should only need it if you modified 'acconfig.h' or"
|
||||
echo "$configure_deps."
|
||||
program_details 'autoheader'
|
||||
;;
|
||||
automake*)
|
||||
echo "You should only need it if you modified 'Makefile.am' or"
|
||||
echo "$configure_deps."
|
||||
program_details 'automake'
|
||||
;;
|
||||
aclocal*)
|
||||
echo "You should only need it if you modified 'acinclude.m4' or"
|
||||
echo "$configure_deps."
|
||||
program_details 'aclocal'
|
||||
;;
|
||||
autom4te*)
|
||||
echo "You might have modified some maintainer files that require"
|
||||
echo "the 'automa4te' program to be rebuilt."
|
||||
program_details 'autom4te'
|
||||
;;
|
||||
bison*|yacc*)
|
||||
echo "You should only need it if you modified a '.y' file."
|
||||
echo "You may want to install the GNU Bison package:"
|
||||
echo "<$gnu_software_URL/bison/>"
|
||||
;;
|
||||
lex*|flex*)
|
||||
echo "You should only need it if you modified a '.l' file."
|
||||
echo "You may want to install the Fast Lexical Analyzer package:"
|
||||
echo "<$flex_URL>"
|
||||
;;
|
||||
help2man*)
|
||||
echo "You should only need it if you modified a dependency" \
|
||||
"of a man page."
|
||||
echo "You may want to install the GNU Help2man package:"
|
||||
echo "<$gnu_software_URL/help2man/>"
|
||||
;;
|
||||
makeinfo*)
|
||||
echo "You should only need it if you modified a '.texi' file, or"
|
||||
echo "any other file indirectly affecting the aspect of the manual."
|
||||
echo "You might want to install the Texinfo package:"
|
||||
echo "<$gnu_software_URL/texinfo/>"
|
||||
echo "The spurious makeinfo call might also be the consequence of"
|
||||
echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
|
||||
echo "want to install GNU make:"
|
||||
echo "<$gnu_software_URL/make/>"
|
||||
;;
|
||||
*)
|
||||
echo "You might have modified some files without having the proper"
|
||||
echo "tools for further handling them. Check the 'README' file, it"
|
||||
echo "often tells you about the needed prerequisites for installing"
|
||||
echo "this package. You may also peek at any GNU archive site, in"
|
||||
echo "case some other package contains this missing '$1' program."
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
give_advice "$1" | sed -e '1s/^/WARNING: /' \
|
||||
-e '2,$s/^/ /' >&2
|
||||
|
||||
# Propagate the correct exit status (expected to be 127 for a program
|
||||
# not found, 63 for a program that failed due to version mismatch).
|
||||
exit $st
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
||||
|
@@ -294,17 +294,17 @@ void GC_init_thread_local(GC_thread p)
|
||||
ABORT("Failed to set thread specific allocation pointers");
|
||||
}
|
||||
for (i = 1; i < NFREELISTS; ++i) {
|
||||
p -> ptrfree_freelists[i] = (ptr_t)1;
|
||||
p -> normal_freelists[i] = (ptr_t)1;
|
||||
p -> tlfs.ptrfree_freelists[i] = (ptr_t)1;
|
||||
p -> tlfs.normal_freelists[i] = (ptr_t)1;
|
||||
# ifdef GC_GCJ_SUPPORT
|
||||
p -> gcj_freelists[i] = (ptr_t)1;
|
||||
p -> tlfs.gcj_freelists[i] = (ptr_t)1;
|
||||
# endif
|
||||
}
|
||||
/* Set up the size 0 free lists. */
|
||||
p -> ptrfree_freelists[0] = (ptr_t)(&size_zero_object);
|
||||
p -> normal_freelists[0] = (ptr_t)(&size_zero_object);
|
||||
p -> tlfs.ptrfree_freelists[0] = (ptr_t)(&size_zero_object);
|
||||
p -> tlfs.normal_freelists[0] = (ptr_t)(&size_zero_object);
|
||||
# ifdef GC_GCJ_SUPPORT
|
||||
p -> gcj_freelists[0] = (ptr_t)(-1);
|
||||
p -> tlfs.gcj_freelists[0] = (ptr_t)(-1);
|
||||
# endif
|
||||
}
|
||||
|
||||
@@ -320,10 +320,10 @@ void GC_destroy_thread_local(GC_thread p)
|
||||
# ifndef HANDLE_FORK
|
||||
GC_ASSERT(GC_getspecific(GC_thread_key) == (void *)p);
|
||||
# endif
|
||||
return_freelists(p -> ptrfree_freelists, GC_aobjfreelist);
|
||||
return_freelists(p -> normal_freelists, GC_objfreelist);
|
||||
return_freelists(p -> tlfs.ptrfree_freelists, GC_aobjfreelist);
|
||||
return_freelists(p -> tlfs.normal_freelists, GC_objfreelist);
|
||||
# ifdef GC_GCJ_SUPPORT
|
||||
return_freelists(p -> gcj_freelists, GC_gcjobjfreelist);
|
||||
return_freelists(p -> tlfs.gcj_freelists, GC_gcjobjfreelist);
|
||||
# endif
|
||||
}
|
||||
|
||||
@@ -357,7 +357,7 @@ GC_PTR GC_local_malloc(size_t bytes)
|
||||
GC_ASSERT(tsd == (void *)GC_lookup_thread(pthread_self()));
|
||||
UNLOCK();
|
||||
# endif
|
||||
my_fl = ((GC_thread)tsd) -> normal_freelists + index;
|
||||
my_fl = ((GC_thread)tsd) -> tlfs.normal_freelists + index;
|
||||
my_entry = *my_fl;
|
||||
if (EXPECT((word)my_entry >= HBLKSIZE, 1)) {
|
||||
ptr_t next = obj_link(my_entry);
|
||||
@@ -384,7 +384,7 @@ GC_PTR GC_local_malloc_atomic(size_t bytes)
|
||||
} else {
|
||||
int index = INDEX_FROM_BYTES(bytes);
|
||||
ptr_t * my_fl = ((GC_thread)GC_getspecific(GC_thread_key))
|
||||
-> ptrfree_freelists + index;
|
||||
-> tlfs.ptrfree_freelists + index;
|
||||
ptr_t my_entry = *my_fl;
|
||||
|
||||
if (EXPECT((word)my_entry >= HBLKSIZE, 1)) {
|
||||
@@ -424,7 +424,7 @@ GC_PTR GC_local_gcj_malloc(size_t bytes,
|
||||
} else {
|
||||
int index = INDEX_FROM_BYTES(bytes);
|
||||
ptr_t * my_fl = ((GC_thread)GC_getspecific(GC_thread_key))
|
||||
-> gcj_freelists + index;
|
||||
-> tlfs.gcj_freelists + index;
|
||||
ptr_t my_entry = *my_fl;
|
||||
if (EXPECT((word)my_entry >= HBLKSIZE, 1)) {
|
||||
GC_PTR result = (GC_PTR)my_entry;
|
||||
@@ -463,7 +463,7 @@ GC_PTR GC_local_gcj_malloc(size_t bytes,
|
||||
void * GC_local_gcj_fast_malloc(size_t lw, void * ptr_to_struct_containing_descr)
|
||||
{
|
||||
ptr_t * my_fl = ((GC_thread)GC_getspecific(GC_thread_key))
|
||||
-> gcj_freelists + lw;
|
||||
-> tlfs.gcj_freelists + lw;
|
||||
ptr_t my_entry = *my_fl;
|
||||
|
||||
GC_ASSERT(GC_gcj_malloc_initialized);
|
||||
@@ -666,12 +666,12 @@ void GC_mark_thread_local_free_lists(void)
|
||||
for (i = 0; i < THREAD_TABLE_SZ; ++i) {
|
||||
for (p = GC_threads[i]; 0 != p; p = p -> next) {
|
||||
for (j = 1; j < NFREELISTS; ++j) {
|
||||
q = p -> ptrfree_freelists[j];
|
||||
q = p -> tlfs.ptrfree_freelists[j];
|
||||
if ((word)q > HBLKSIZE) GC_set_fl_marks(q);
|
||||
q = p -> normal_freelists[j];
|
||||
q = p -> tlfs.normal_freelists[j];
|
||||
if ((word)q > HBLKSIZE) GC_set_fl_marks(q);
|
||||
# ifdef GC_GCJ_SUPPORT
|
||||
q = p -> gcj_freelists[j];
|
||||
q = p -> tlfs.gcj_freelists[j];
|
||||
if ((word)q > HBLKSIZE) GC_set_fl_marks(q);
|
||||
# endif /* GC_GCJ_SUPPORT */
|
||||
}
|
||||
@@ -1462,13 +1462,18 @@ void * GC_start_routine_head(void * arg, void *base_addr,
|
||||
return me;
|
||||
}
|
||||
|
||||
int GC_thread_register_foreign (void *base_addr)
|
||||
void GC_allow_register_threads (void)
|
||||
{
|
||||
/* No-op for GC pre-v7. */
|
||||
}
|
||||
|
||||
int GC_register_my_thread (struct GC_stack_base *sb)
|
||||
{
|
||||
struct start_info si = { 0, }; /* stacked for legibility & locking */
|
||||
GC_thread me;
|
||||
|
||||
# ifdef DEBUG_THREADS
|
||||
GC_printf1( "GC_thread_register_foreign %p\n", &si );
|
||||
GC_printf1( "GC_register_my_thread %p\n", &si );
|
||||
# endif
|
||||
|
||||
si.flags = FOREIGN_THREAD;
|
||||
@@ -1476,12 +1481,13 @@ int GC_thread_register_foreign (void *base_addr)
|
||||
if (!parallel_initialized) GC_init_parallel();
|
||||
LOCK();
|
||||
if (!GC_thr_initialized) GC_thr_init();
|
||||
|
||||
me = GC_lookup_thread(pthread_self());
|
||||
UNLOCK();
|
||||
if (me != NULL)
|
||||
return GC_DUPLICATE;
|
||||
|
||||
me = GC_start_routine_head(&si, base_addr, NULL, NULL);
|
||||
|
||||
return me != NULL;
|
||||
(void)GC_start_routine_head(&si, sb -> mem_base, NULL, NULL);
|
||||
return GC_SUCCESS;
|
||||
}
|
||||
|
||||
void * GC_start_routine(void * arg)
|
||||
|
@@ -642,10 +642,15 @@ int GC_thread_is_registered (void)
|
||||
return ptr ? 1 : 0;
|
||||
}
|
||||
|
||||
int GC_thread_register_foreign (void *base_addr)
|
||||
void GC_allow_register_threads (void)
|
||||
{
|
||||
/* No-op for GC pre-v7. */
|
||||
}
|
||||
|
||||
int GC_register_my_thread (struct GC_stack_base *sb)
|
||||
{
|
||||
/* FIXME: */
|
||||
return 0;
|
||||
return GC_UNIMPLEMENTED;
|
||||
}
|
||||
|
||||
void GC_register_altstack (void *stack, int stack_size, void *altstack, int altstack_size)
|
||||
|
@@ -85,6 +85,22 @@ int GC_thread_is_registered (void)
|
||||
#endif
|
||||
}
|
||||
|
||||
void GC_allow_register_threads (void)
|
||||
{
|
||||
/* No-op for GC pre-v7. */
|
||||
}
|
||||
|
||||
int GC_register_my_thread (struct GC_stack_base *sb)
|
||||
{
|
||||
# if defined(GC_DLL) || defined(GC_INSIDE_DLL)
|
||||
/* Registered by DllMain. */
|
||||
return GC_DUPLICATE;
|
||||
# else
|
||||
/* TODO: Implement. */
|
||||
return GC_UNIMPLEMENTED;
|
||||
# endif
|
||||
}
|
||||
|
||||
void GC_register_altstack (void *stack, int stack_size, void *altstack, int altstack_size)
|
||||
{
|
||||
}
|
||||
|
Reference in New Issue
Block a user