OBS User unknown 2008-07-25 02:42:31 +00:00 committed by Git OBS Bridge
parent 7867b98826
commit a08bcf9cd0
61 changed files with 355 additions and 18552 deletions

1
.gitattributes vendored
View File

@ -23,4 +23,3 @@
*.zst filter=lfs diff=lfs merge=lfs -text
## Specific LFS patterns
kvm_bios.bin filter=lfs diff=lfs merge=lfs -text
zx-rom.bin filter=lfs diff=lfs merge=lfs -text

View File

@ -1,4 +0,0 @@
Amstrad have kindly given their permission for the redistribution of their
copyrighted material but retain that copyright.
http://www.worldofspectrum.org/permits/amstrad-roms.txt

View File

@ -1,68 +0,0 @@
From: Chris Wright <chrisw@redhat.com>
Subject: [PATCH] add format= to drive options
A guest with a raw format disk can write any format header to that device.
A subsequent restart of the guest will cause qemu to interpret the format
header and could allow the guest read access to any host file. Add a
format= drive option to allow host to specify, e.g. format=raw, to give
qemu a hint to choose a specific block format driver. Originially noted
by Avi Kivity <avi@qumranet.com>.
Signed-off-by: Chris Wright <chrisw@redhat.com>
[Aurelien Jarno: port to SVN tip for QEMU)
================================================================================
--- qemu-0.9.1/qemu-doc.texi
+++ qemu-0.9.1/qemu-doc.texi
@@ -252,6 +252,10 @@
@var{snapshot} is "on" or "off" and allows to enable snapshot for given drive (see @option{-snapshot}).
@item cache=@var{cache}
@var{cache} is "on" or "off" and allows to disable host cache to access data.
+@item format=@var{format}
+Specify which disk @var{format} will be used rather than detecting
+the format. Can be used to specifiy format=raw to avoid interpreting
+an untrusted format header.
@end table
Instead of @option{-cdrom} you can use:
--- qemu-0.9.1/vl.c
+++ qemu-0.9.1/vl.c
@@ -4877,13 +4877,14 @@
int bus_id, unit_id;
int cyls, heads, secs, translation;
BlockDriverState *bdrv;
+ BlockDriver *drv = NULL;
int max_devs;
int index;
int cache;
int bdrv_flags;
char *params[] = { "bus", "unit", "if", "index", "cyls", "heads",
"secs", "trans", "media", "snapshot", "file",
- "cache", NULL };
+ "cache", "format", NULL };
if (check_params(buf, sizeof(buf), params, str) < 0) {
fprintf(stderr, "qemu: unknowm parameter '%s' in '%s'\n",
@@ -5051,6 +5052,14 @@
}
}
+ if (get_param_value(buf, sizeof(buf), "format", str)) {
+ drv = bdrv_find_format(buf);
+ if (!drv) {
+ fprintf(stderr, "qemu: '%s' invalid format\n", buf);
+ return -1;
+ }
+ }
+
get_param_value(file, sizeof(file), "file", str);
/* compute bus and unit according index */
@@ -5150,7 +5159,7 @@
bdrv_flags |= BDRV_O_SNAPSHOT;
if (!cache)
bdrv_flags |= BDRV_O_DIRECT;
- if (bdrv_open(bdrv, file, bdrv_flags) < 0 || qemu_key_check(bdrv, file)) {
+ if (bdrv_open2(bdrv, file, bdrv_flags, drv) < 0 || qemu_key_check(bdrv, file)) {
fprintf(stderr, "qemu: could not open disk image %s\n",
file);
return -1;

View File

@ -1,233 +0,0 @@
--- gcc/config/rs6000/darwin-ldouble.c
+++ gcc/config/rs6000/darwin-ldouble.c
@@ -1,4 +1,208 @@
/* 128-bit long double support routines for Darwin.
+ Copyright (C) 1993, 2003, 2004, 2005, 2006
+ Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC 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.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file. (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+GCC 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 GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA. */
+
+/* Implementations of floating-point long double basic arithmetic
+ functions called by the IBM C compiler when generating code for
+ PowerPC platforms. In particular, the following functions are
+ implemented: __gcc_qadd, __gcc_qsub, __gcc_qmul, and __gcc_qdiv.
+ Double-double algorithms are based on the paper "Doubled-Precision
+ IEEE Standard 754 Floating-Point Arithmetic" by W. Kahan, February 26,
+ 1987. An alternative published reference is "Software for
+ Doubled-Precision Floating-Point Computations", by Seppo Linnainmaa,
+ ACM TOMS vol 7 no 3, September 1981, pages 272-283. */
+
+/* Each long double is made up of two IEEE doubles. The value of the
+ long double is the sum of the values of the two parts. The most
+ significant part is required to be the value of the long double
+ rounded to the nearest double, as specified by IEEE. For Inf
+ values, the least significant part is required to be one of +0.0 or
+ -0.0. No other requirements are made; so, for example, 1.0 may be
+ represented as (1.0, +0.0) or (1.0, -0.0), and the low part of a
+ NaN is don't-care.
+
+ This code currently assumes big-endian. */
+
+#if (!defined (__NO_FPRS__) && !defined (__LITTLE_ENDIAN__) \
+ && (defined (__MACH__) || defined (__powerpc__) || defined (_AIX)))
+
+#define fabs(x) __builtin_fabs(x)
+#define isless(x, y) __builtin_isless (x, y)
+#define inf() __builtin_inf()
+
+#define unlikely(x) __builtin_expect ((x), 0)
+
+#define nonfinite(a) unlikely (! isless (fabs (a), inf ()))
+
+/* All these routines actually take two long doubles as parameters,
+ but GCC currently generates poor code when a union is used to turn
+ a long double into a pair of doubles. */
+
+extern long double __gcc_qadd (double, double, double, double);
+extern long double __gcc_qsub (double, double, double, double);
+extern long double __gcc_qmul (double, double, double, double);
+extern long double __gcc_qdiv (double, double, double, double);
+
+#if defined __ELF__ && defined SHARED \
+ && (defined __powerpc64__ || !(defined __linux__ || defined __gnu_hurd__))
+/* Provide definitions of the old symbol names to satisfy apps and
+ shared libs built against an older libgcc. To access the _xlq
+ symbols an explicit version reference is needed, so these won't
+ satisfy an unadorned reference like _xlqadd. If dot symbols are
+ not needed, the assembler will remove the aliases from the symbol
+ table. */
+__asm__ (".symver __gcc_qadd,_xlqadd@GCC_3.4\n\t"
+ ".symver __gcc_qsub,_xlqsub@GCC_3.4\n\t"
+ ".symver __gcc_qmul,_xlqmul@GCC_3.4\n\t"
+ ".symver __gcc_qdiv,_xlqdiv@GCC_3.4\n\t"
+ ".symver .__gcc_qadd,._xlqadd@GCC_3.4\n\t"
+ ".symver .__gcc_qsub,._xlqsub@GCC_3.4\n\t"
+ ".symver .__gcc_qmul,._xlqmul@GCC_3.4\n\t"
+ ".symver .__gcc_qdiv,._xlqdiv@GCC_3.4");
+#endif
+
+typedef union
+{
+ long double ldval;
+ double dval[2];
+} longDblUnion;
+
+/* Add two 'long double' values and return the result. */
+long double
+__gcc_qadd (double a, double aa, double c, double cc)
+{
+ longDblUnion x;
+ double z, q, zz, xh;
+
+ z = a + c;
+
+ if (nonfinite (z))
+ {
+ z = cc + aa + c + a;
+ if (nonfinite (z))
+ return z;
+ x.dval[0] = z; /* Will always be DBL_MAX. */
+ zz = aa + cc;
+ if (fabs(a) > fabs(c))
+ x.dval[1] = a - z + c + zz;
+ else
+ x.dval[1] = c - z + a + zz;
+ }
+ else
+ {
+ q = a - z;
+ zz = q + c + (a - (q + z)) + aa + cc;
+
+ /* Keep -0 result. */
+ if (zz == 0.0)
+ return z;
+
+ xh = z + zz;
+ if (nonfinite (xh))
+ return xh;
+
+ x.dval[0] = xh;
+ x.dval[1] = z - xh + zz;
+ }
+ return x.ldval;
+}
+
+long double
+__gcc_qsub (double a, double b, double c, double d)
+{
+ return __gcc_qadd (a, b, -c, -d);
+}
+
+long double
+__gcc_qmul (double a, double b, double c, double d)
+{
+ longDblUnion z;
+ double t, tau, u, v, w;
+
+ t = a * c; /* Highest order double term. */
+
+ if (unlikely (t == 0) /* Preserve -0. */
+ || nonfinite (t))
+ return t;
+
+ /* Sum terms of two highest orders. */
+
+ /* Use fused multiply-add to get low part of a * c. */
+ asm ("fmsub %0,%1,%2,%3" : "=f"(tau) : "f"(a), "f"(c), "f"(t));
+ v = a*d;
+ w = b*c;
+ tau += v + w; /* Add in other second-order terms. */
+ u = t + tau;
+
+ /* Construct long double result. */
+ if (nonfinite (u))
+ return u;
+ z.dval[0] = u;
+ z.dval[1] = (t - u) + tau;
+ return z.ldval;
+}
+
+long double
+__gcc_qdiv (double a, double b, double c, double d)
+{
+ longDblUnion z;
+ double s, sigma, t, tau, u, v, w;
+
+ t = a / c; /* highest order double term */
+
+ if (unlikely (t == 0) /* Preserve -0. */
+ || nonfinite (t))
+ return t;
+
+ /* Finite nonzero result requires corrections to the highest order term. */
+
+ s = c * t; /* (s,sigma) = c*t exactly. */
+ w = -(-b + d * t); /* Written to get fnmsub for speed, but not
+ numerically necessary. */
+
+ /* Use fused multiply-add to get low part of c * t. */
+ asm ("fmsub %0,%1,%2,%3" : "=f"(sigma) : "f"(c), "f"(t), "f"(s));
+ v = a - s;
+
+ tau = ((v-sigma)+w)/c; /* Correction to t. */
+ u = t + tau;
+
+ /* Construct long double result. */
+ if (nonfinite (u))
+ return u;
+ z.dval[0] = u;
+ z.dval[1] = (t - u) + tau;
+ return z.ldval;
+}
+
+#endif
+/* 128-bit long double support routines for Darwin.
Copyright (C) 1993, 2003, 2004 Free Software Foundation, Inc.
This file is part of GCC.
--- gcc/config/rs6000/t-newas
+++ gcc/config/rs6000/t-newas
@@ -42,6 +42,9 @@
LIBGCC = stmp-multilib
INSTALL_LIBGCC = install-multilib
+# GCC 128-bit long double support routines.
+LIB2FUNCS_EXTRA = $(srcdir)/config/rs6000/darwin-ldouble.c
+
# Aix 3.2.x needs milli.exp for -mcpu=common
EXTRA_PARTS = milli.exp
milli.exp: $(srcdir)/config/rs6000/milli.exp
--- gcc/config/rs6000/t-ppccomm
+++ gcc/config/rs6000/t-ppccomm
@@ -1,6 +1,6 @@
# Common support for PowerPC ELF targets (both EABI and SVR4).
-LIB2FUNCS_EXTRA = tramp.S
+LIB2FUNCS_EXTRA = tramp.S $(srcdir)/config/rs6000/darwin-ldouble.c
# This one can't end up in shared libgcc
LIB2FUNCS_STATIC_EXTRA = eabi.S

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4ae90c6948d2654a254116fabb0cc7e474abf51ea841e6ef5cd8e6c161a9fa74
size 23833856

View File

@ -1,10 +0,0 @@
--- gcc-3.3.5/gcc/cppexp.c
+++ gcc-3.3.5/gcc/cppexp.c
@@ -1448,6 +1448,7 @@
result.high += HIGH_PART (middle[0]);
result.high += HIGH_PART (middle[1]);
result.unsignedp = 1;
+ result.overflow = 0;
return result;
}

View File

@ -1,42 +0,0 @@
Index: emit-rtl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/emit-rtl.c,v
retrieving revision 1.302.2.4
diff -u -p -r1.302.2.4 emit-rtl.c
--- gcc/emit-rtl.c 1 May 2003 09:55:39 -0000 1.302.2.4
+++ gcc/emit-rtl.c 28 Jul 2003 18:30:35 -0000
@@ -1684,6 +1684,22 @@ component_ref_for_mem_expr (ref)
TREE_OPERAND (ref, 1));
}
+static int indirect_ref_nonzero_ofs_p PARAMS ((tree));
+static int
+indirect_ref_nonzero_ofs_p (t)
+ tree t;
+{
+ tree op0, op1;
+ t = TREE_OPERAND (t, 0);
+ if (TREE_CODE (t) != PLUS_EXPR)
+ return 0;
+ op0 = TREE_OPERAND (t, 0);
+ op1 = TREE_OPERAND (t, 1);
+ if (TREE_CODE (op1) == INTEGER_CST && (1 || !integer_zerop (op1)))
+ return 1;
+ return 0;
+}
+
/* Given REF, a MEM, and T, either the type of X or the expression
corresponding to REF, set the memory attributes. OBJECTP is nonzero
if we are making a new object of this type. BITPOS is nonzero if
@@ -1911,6 +1930,11 @@ set_mem_attributes_minus_bitpos (ref, t,
else if (TREE_CODE (t) == COMPONENT_REF || TREE_CODE (t) == ARRAY_REF
|| TREE_CODE (t) == ARRAY_RANGE_REF
|| TREE_CODE (t) == BIT_FIELD_REF)
+ MEM_IN_STRUCT_P (ref) = 1;
+ /* An INDIRECT_REF of an PLUS expression of something with a
+ non-zero offset also is part of an aggregate. */
+ else if (TREE_CODE (t) == INDIRECT_REF
+ && indirect_ref_nonzero_ofs_p (t))
MEM_IN_STRUCT_P (ref) = 1;
}

View File

@ -1,91 +0,0 @@
Index: rtl.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/rtl.h,v
retrieving revision 1.374.2.10
diff -u -p -r1.374.2.10 rtl.h
--- gcc/rtl.h 21 Jun 2003 22:47:01 -0000 1.374.2.10
+++ gcc/rtl.h 10 Aug 2003 21:20:12 -0000
@@ -141,7 +141,8 @@ struct rtx_def GTY((chain_next ("RTX_NEX
In a CODE_LABEL, part of the two-bit alternate entry field. */
unsigned int jump : 1;
/* In a CODE_LABEL, part of the two-bit alternate entry field.
- 1 in a MEM if it cannot trap. */
+ 1 in a MEM if it cannot trap.
+ 1 in a SYMBOL_REF which refers to a read-only object. */
unsigned int call : 1;
/* 1 in a REG, MEM, or CONCAT if the value is set at most once, anywhere.
1 in a SUBREG if it references an unsigned object whose mode has been
@@ -1241,6 +1242,10 @@ do { \
/* 1 if RTX is a symbol_ref for a weak symbol. */
#define SYMBOL_REF_WEAK(RTX) \
(RTL_FLAG_CHECK1("SYMBOL_REF_WEAK", (RTX), SYMBOL_REF)->integrated)
+
+/* 1 if RTX is a symbol_ref for a readonly object. */
+#define SYMBOL_REF_READONLY(RTX) \
+ (RTL_FLAG_CHECK1("SYMBOL_REF_READONLY", (RTX), SYMBOL_REF)->call)
/* Define a macro to look for REG_INC notes,
but save time on machines where they never exist. */
Index: alias.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/alias.c,v
retrieving revision 1.180.2.4
diff -u -p -r1.180.2.4 alias.c
--- gcc/alias.c 21 Jun 2003 22:47:00 -0000 1.180.2.4
+++ gcc/alias.c 10 Aug 2003 21:20:12 -0000
@@ -2071,7 +2071,7 @@ true_dependence (mem, mem_mode, x, varie
int (*varies) PARAMS ((rtx, int));
{
rtx x_addr, mem_addr;
- rtx base;
+ rtx base, mem_base;
if (MEM_VOLATILE_P (x) && MEM_VOLATILE_P (mem))
return 1;
@@ -2109,9 +2109,12 @@ true_dependence (mem, mem_mode, x, varie
mem_addr = get_addr (XEXP (mem, 0));
base = find_base_term (x_addr);
+ mem_base = find_base_term (mem_addr);
if (base && (GET_CODE (base) == LABEL_REF
|| (GET_CODE (base) == SYMBOL_REF
- && CONSTANT_POOL_ADDRESS_P (base))))
+ && ((SYMBOL_REF_READONLY (base)
+ && !rtx_equal_p (base, mem_base))
+ || CONSTANT_POOL_ADDRESS_P (base)))))
return 0;
if (! base_alias_check (x_addr, mem_addr, GET_MODE (x), mem_mode))
Index: varasm.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/varasm.c,v
retrieving revision 1.318.2.11
diff -u -p -r1.318.2.11 varasm.c
--- gcc/varasm.c 19 Jul 2003 14:57:43 -0000 1.318.2.11
+++ gcc/varasm.c 10 Aug 2003 21:20:12 -0000
@@ -941,6 +941,8 @@ make_decl_rtl (decl, asmspec)
SYMBOL_REF_WEAK (XEXP (x, 0)) = DECL_WEAK (decl);
if (TREE_CODE (decl) != FUNCTION_DECL)
set_mem_attributes (x, decl, 1);
+ if (RTX_UNCHANGING_P (x))
+ SYMBOL_REF_READONLY (XEXP (x, 0)) = 1;
SET_DECL_RTL (decl, x);
/* Optionally set flags or add text to the name to record information
@@ -2731,6 +2733,8 @@ output_constant_def (exp, defer)
gen_rtx_SYMBOL_REF (Pmode, desc->label));
set_mem_attributes (rtl, exp, 1);
+ if (RTX_UNCHANGING_P (rtl))
+ SYMBOL_REF_READONLY (XEXP (rtl, 0)) = 1;
set_mem_alias_set (rtl, 0);
set_mem_alias_set (rtl, const_alias_set);
@@ -3299,6 +3303,7 @@ force_const_mem (mode, x)
set_mem_alias_set (def, const_alias_set);
set_mem_attributes (def, (*lang_hooks.types.type_for_mode) (mode, 0), 1);
RTX_UNCHANGING_P (def) = 1;
+ SYMBOL_REF_READONLY (XEXP (def, 0)) = 1;
/* Add label to symbol hash table. */
hash = SYMHASH (XSTR (XEXP (def, 0), 0));

View File

@ -1,269 +0,0 @@
Index: fold-const.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fold-const.c,v
retrieving revision 1.226.2.9
diff -u -p -r1.226.2.9 fold-const.c
--- gcc/fold-const.c 21 Jul 2003 19:07:12 -0000 1.226.2.9
+++ gcc/fold-const.c 30 Jul 2003 21:29:05 -0000
@@ -1011,6 +1011,233 @@ associate_trees (t1, t2, code, type)
return fold (build (code, type, convert (type, t1), convert (type, t2)));
}
+
+static tree tree_get_index PARAMS ((tree));
+static int indirect_ref_zero_ofs_p PARAMS ((tree));
+static int indirect_ref_nonzero_ofs_p PARAMS ((tree));
+static tree associate_trees_refs PARAMS ((tree, tree, enum tree_code, tree));
+static void split_tree_indirect_refs PARAMS ((tree, enum tree_code, tree));
+static void split_tree_for_reorder PARAMS ((tree, enum tree_code, tree));
+static int compare_trees PARAMS ((const PTR, const PTR));
+static tree reorder_memrefs PARAMS ((tree, tree, enum tree_code, tree));
+static tree reorder_summands PARAMS ((tree, tree, enum tree_code, tree));
+
+static tree
+tree_get_index (t)
+ tree t;
+{
+ if (TREE_CODE (t) == ARRAY_REF)
+ return TREE_OPERAND (t, 1);
+ else
+ {
+ t = TREE_OPERAND (t, 0);
+ if (TREE_CODE (t) != PLUS_EXPR)
+ return NULL_TREE;
+ return TREE_OPERAND (t, 1);
+ }
+}
+
+static int
+indirect_ref_nonzero_ofs_p (t)
+ tree t;
+{
+ tree i = tree_get_index (t);
+ if (i && TREE_CODE (i) == INTEGER_CST && !integer_zerop (i))
+ return 1;
+ return 0;
+}
+
+static int
+indirect_ref_zero_ofs_p (t)
+ tree t;
+{
+ tree i = tree_get_index (t);
+ if (!i)
+ return 1;
+ if (TREE_CODE (i) == INTEGER_CST && integer_zerop (i))
+ return 1;
+ return 0;
+}
+
+static tree
+associate_trees_refs (t1, t2, code, type)
+ tree t1, t2;
+ enum tree_code code;
+ tree type;
+{
+ if (t1 == 0)
+ return t2;
+ else if (t2 == 0)
+ return t1;
+ return build (code, type, convert (type, t1), convert (type, t2));
+}
+
+#define MAX_SUMMANDS 100
+static tree merged_z, merged_nz, merged_rest;
+static tree summands[MAX_SUMMANDS];
+static int num_summands;
+static void
+split_tree_indirect_refs (in, code, type)
+ tree in;
+ enum tree_code code;
+ tree type;
+{
+ /* Strip any conversions that don't change the machine mode or signedness. */
+ STRIP_SIGN_NOPS (in);
+
+ if (TREE_CODE (in) == INDIRECT_REF || TREE_CODE (in) == ARRAY_REF)
+ {
+ if (indirect_ref_zero_ofs_p (in))
+ merged_z = associate_trees_refs (merged_z, in, code, type);
+ else if (indirect_ref_nonzero_ofs_p (in))
+ merged_nz = associate_trees_refs (merged_nz, in, code, type);
+ else
+ merged_rest = associate_trees_refs (merged_rest, in, code, type);
+ }
+ else if (TREE_CODE (in) == code)
+ {
+ tree op0 = TREE_OPERAND (in, 0);
+ tree op1 = TREE_OPERAND (in, 1);
+ split_tree_indirect_refs (op0, code, type);
+ split_tree_indirect_refs (op1, code, type);
+ }
+ else
+ merged_rest = associate_trees_refs (merged_rest, in, code, type);
+}
+
+static void
+split_tree_for_reorder (in, code, type)
+ tree in;
+ enum tree_code code;
+ tree type;
+{
+ /* Strip any conversions that don't change the machine mode or signedness. */
+ STRIP_SIGN_NOPS (in);
+
+ if ((TREE_CODE (in) == INDIRECT_REF
+ || TREE_CODE (in) == ARRAY_REF
+ || TREE_CODE (in) == VAR_DECL)
+ && num_summands < MAX_SUMMANDS)
+ summands[num_summands++] = in;
+ else if (TREE_CODE (in) == code)
+ {
+ tree op0 = TREE_OPERAND (in, 0);
+ tree op1 = TREE_OPERAND (in, 1);
+ split_tree_for_reorder (op0, code, type);
+ split_tree_for_reorder (op1, code, type);
+ }
+ else
+ merged_rest = associate_trees_refs (merged_rest, in, code, type);
+}
+
+static int
+compare_trees (v1, v2)
+ const PTR v1;
+ const PTR v2;
+{
+ tree t1 = *((const tree *) v1);
+ tree t2 = *((const tree *) v2);
+
+ if (t1 == t2)
+ return 0;
+ /* Everything besides var_decls and indirect_refs last. */
+ if (TREE_CODE (t1) != INDIRECT_REF
+ && TREE_CODE (t1) != ARRAY_REF
+ && TREE_CODE (t1) != VAR_DECL)
+ return 1;
+ if (TREE_CODE (t2) != INDIRECT_REF
+ && TREE_CODE (t2) != ARRAY_REF
+ && TREE_CODE (t2) != VAR_DECL)
+ return -1;
+ /* All indirect_refs with nonzero index before var_decls.
+ All indirect_refs with zero index after var_decls. */
+ if (TREE_CODE (t1) != TREE_CODE (t2))
+ {
+ if (TREE_CODE (t1) == INDIRECT_REF || TREE_CODE (t1) == ARRAY_REF)
+ {
+ if (indirect_ref_nonzero_ofs_p (t1))
+ return -1;
+ else
+ return 1;
+ }
+ /* t2 is a INDIRECT_REF or ARRAY_REF, so we can call that without
+ checking. */
+ else if (indirect_ref_nonzero_ofs_p (t2))
+ return 1;
+ else
+ return -1;
+ }
+ if (TREE_CODE (t1) == VAR_DECL)
+ {
+ if (IDENTIFIER_HASH_VALUE (DECL_NAME (t1))
+ < IDENTIFIER_HASH_VALUE (DECL_NAME (t2)))
+ return -1;
+ else
+ return 1;
+ }
+ /* We have two indirect_refs here. */
+ if (indirect_ref_nonzero_ofs_p (t1) && indirect_ref_nonzero_ofs_p (t2))
+ /* As both had non-zero index, we know that tree_get_index() really
+ returns INTEGER_CST. */
+ return tree_int_cst_compare (tree_get_index (t1), tree_get_index (t2));
+ else if (indirect_ref_zero_ofs_p (t1))
+ return 1;
+ else
+ return -1;
+}
+
+static tree
+reorder_memrefs (in0, in1, code, type)
+ tree in0, in1;
+ enum tree_code code;
+ tree type;
+{
+ tree ret = 0;
+ merged_z = 0;
+ merged_nz = 0;
+ merged_rest = 0;
+ /* XXX We can't yet handle MINUS_EXPR. */
+ if (code == MINUS_EXPR)
+ return 0;
+ if (in0)
+ split_tree_indirect_refs (in0, code, type);
+ if (in1)
+ split_tree_indirect_refs (in1, code, type);
+ if (merged_nz || merged_z)
+ {
+ ret = associate_trees_refs (merged_nz, merged_z, code, type);
+ ret = associate_trees_refs (ret, merged_rest, code, type);
+ }
+ return ret;
+}
+
+static tree
+reorder_summands (in0, in1, code, type)
+ tree in0, in1;
+ enum tree_code code;
+ tree type;
+{
+ tree ret = 0;
+ merged_rest = 0;
+ num_summands = 0;
+ /* XXX We can't yet handle MINUS_EXPR. */
+ if (code == MINUS_EXPR)
+ return 0;
+ if (in0)
+ split_tree_for_reorder (in0, code, type);
+ if (in1)
+ split_tree_for_reorder (in1, code, type);
+ if (num_summands > 2)
+ {
+ int i;
+ qsort (summands, num_summands, sizeof (tree), compare_trees);
+ ret = summands[0];
+ for (i = 1; i < num_summands; i++)
+ ret = associate_trees_refs (ret, summands[i], code, type);
+ ret = associate_trees_refs (ret, merged_rest, code, type);
+ }
+ return ret;
+}
/* Combine two integer constants ARG1 and ARG2 under operation CODE
to produce a new constant.
@@ -5378,11 +5605,16 @@ fold (expr)
+ (lit0 != 0) + (lit1 != 0)
+ (minus_lit0 != 0) + (minus_lit1 != 0)))
{
+ tree tmp;
+ tmp = reorder_summands (var0, var1, code, type);
/* Recombine MINUS_EXPR operands by using PLUS_EXPR. */
if (code == MINUS_EXPR)
code = PLUS_EXPR;
- var0 = associate_trees (var0, var1, code, type);
+ if (tmp)
+ var0 = tmp;
+ else
+ var0 = associate_trees (var0, var1, code, type);
con0 = associate_trees (con0, con1, code, type);
lit0 = associate_trees (lit0, lit1, code, type);
minus_lit0 = associate_trees (minus_lit0, minus_lit1, code, type);
@@ -5424,6 +5656,9 @@ fold (expr)
con0 = associate_trees (con0, lit0, code, type);
return convert (type, associate_trees (var0, con0, code, type));
}
+ var0 = reorder_summands (arg0, arg1, code, type);
+ if (var0)
+ return convert (type, var0);
}
binary:

File diff suppressed because it is too large Load Diff

View File

@ -1,31 +0,0 @@
============================================================
Index: gcc/gccbug.in
--- gcc/gccbug.in 12 Jan 2003 14:24:16 -0000 1.15.28.1
+++ gcc/gccbug.in 18 Aug 2003 16:54:46 -0000
@@ -28,7 +28,7 @@ VERSION=3.113
SUBMITTER=net
# The default mail address for PR submissions.
-GNATS_ADDR=gcc-gnats@gcc.gnu.org
+GNATS_ADDR=feedback@suse.de
# The default release for this host.
DEFAULT_RELEASE="@gcc_version_full@"
@@ -305,6 +305,7 @@ Subject:
From: $FROM
Reply-To: $REPLYTO
Cc: $CC
+X-Feedback-Type: GCC-Bug
X-send-pr-version: $VERSION
X-GNATS-Notify:
============================================================
Index: gcc/version.c
--- gcc/version.c 14 Aug 2003 13:20:18 -0000 1.1778.2.30
+++ gcc/version.c 18 Aug 2003 16:54:46 -0000
@@ -15,4 +15,4 @@ const char version_string[] = "3.3.1-ham
forward us bugs reported to you, if you determine that they are
not bugs in your modifications.) */
-const char bug_report_url[] = "<URL:http://gcc.gnu.org/bugs.html>";
+const char bug_report_url[] = "<URL:http://www.suse.de/feedback>";

View File

@ -1,12 +0,0 @@
--- gcc/c-decl.c.orig 2003-03-12 18:05:07.000000000 +0100
+++ gcc/c-decl.c 2003-03-12 18:07:18.000000000 +0100
@@ -3549,7 +3549,8 @@ grokdeclarator (declarator, declspecs, d
}
else if (specbits & (1 << (int) i))
{
- if (i == RID_CONST || i == RID_VOLATILE || i == RID_RESTRICT)
+ if (i == RID_CONST || i == RID_VOLATILE || i == RID_RESTRICT
+ || i == RID_INLINE)
{
if (!flag_isoc99)
pedwarn ("duplicate `%s'", IDENTIFIER_POINTER (id));

View File

@ -1,17 +0,0 @@
Index: gcc/cppexp.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cppexp.c,v
retrieving revision 1.136
diff -u -p -r1.136 cppexp.c
--- gcc/cppexp.c 19 Dec 2002 05:18:04 -0000 1.136
+++ gcc/cppexp.c 13 Mar 2003 20:41:04 -0000
@@ -175,7 +175,8 @@ cpp_classify_number (pfile, token)
str++;
/* Require at least one hex digit to classify it as hex. */
- if ((*str == 'x' || *str == 'X') && ISXDIGIT (str[1]))
+ if ((*str == 'x' || *str == 'X')
+ && (str[1] == '.' || ISXDIGIT (str[1])))
{
radix = 16;
str++;

View File

@ -1,446 +0,0 @@
This is Andi's backport for unused types pruning. I (matz) have only added
the option to disable it again.
From: Andi Kleen <ak@suse.de>
Subject: More compact dwarf2 information for gcc (with patch)
Date: Sun, 2 Mar 2003 07:43:14 +0100
I ported Scott Snyder's dwarf2 compression patch that was recently
posted on the gcc mailing list to the SuSE gcc. What it does is to
not dump types to the debugging information that are not referenced
to dwarf2.
The main change compared to the patch (which was against 3.4 mainline)
was to not use varrays which do not seem to exist in that tree.
I just cloned the file_table dynamic array instead.
I enabled it by default. In theory it makes a difference when you try
to reference a type that is not used in the program from gdb,
but referencing just types seems to be somewhat pointless
to me (especially when such a obscure feature eats >100MB of disk space
in the build), so I just enabled it by default.
gcc also seems to have an -feliminate-dwarf2-dups option which may
further help (but is off by default for some reason). Perhaps
it can be considered for turning on too? Or is there some problem
with it I am missing?
Just applying the patch makes a nice difference (without
-feliminate-dwarf2-dups)
e.g. this is a simple x86-64 kernel compilation with -g. The tree
is stripped down with only minimal drivers enabled.
before:
build tree size 528M
-rwxr-xr-x 1 ak users 44M 2003-03-02 02:25 vmlinux
random object file:
1356440 276 -rw-r--r-- 2 ak users 276312 Mar 2 01:45 ./kernel/sys
after:
ld tree size 411M
-rwxr-xr-x 1 ak users 30M 2003-03-02 07:26 vmlinux
-rw-r--r-- 2 ak users 206096 2003-03-02 07:22 kernel/sys.o
Both the final executable and the object files shrink nicely.
Also the compilation is faster because gcc has to do much less IO
(compilation with -g seems to be mostly IO bound)
Can we please consider this patch for inclusion into the 3.3 SuSE gcc ?
-Andi
Index: gcc/flags.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/flags.h,v
retrieving revision 1.93.2.13
diff -u -p -r1.93.2.13 flags.h
--- gcc/flags.h 2 Feb 2004 16:25:40 -0000 1.93.2.13
+++ gcc/flags.h 21 May 2004 12:58:25 -0000
@@ -677,6 +677,10 @@ extern int flag_speculative_prefetching;
extern int flag_eliminate_dwarf2_dups;
+/* Nonzero means we should do unused type elimination. */
+
+extern int flag_eliminate_unused_debug_types;
+
/* Nonzero means to collect statistics which might be expensive
and to print them when we are done. */
extern int flag_detailed_statistics;
Index: gcc/toplev.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/toplev.c,v
retrieving revision 1.688.2.50
diff -u -p -r1.688.2.50 toplev.c
--- gcc/toplev.c 21 Apr 2004 15:17:24 -0000 1.688.2.50
+++ gcc/toplev.c 21 May 2004 12:58:26 -0000
@@ -383,6 +383,10 @@ tree current_function_func_begin_label;
int flag_eliminate_dwarf2_dups = 0;
+/* Nonzero if doing unused type elimination. */
+
+int flag_eliminate_unused_debug_types = 1;
+
/* Nonzero if generating code to do profiling. */
int profile_flag = 0;
@@ -1054,6 +1058,8 @@ static const lang_independent_options f_
{
{"eliminate-dwarf2-dups", &flag_eliminate_dwarf2_dups, 1,
N_("Perform DWARF2 duplicate elimination") },
+ {"eliminate-unused-debug-types", &flag_eliminate_unused_debug_types, 1,
+ N_("Eliminate debug info of unused types") },
{"float-store", &flag_float_store, 1,
N_("Do not store floats in registers") },
{"volatile", &flag_volatile, 1,
Index: gcc/dwarf2out.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/dwarf2out.c,v
retrieving revision 1.389.2.20
diff -u -p -r1.389.2.20 dwarf2out.c
--- gcc/dwarf2out.c 29 Apr 2004 15:20:33 -0000 1.389.2.20
+++ gcc/dwarf2out.c 21 May 2004 12:58:26 -0000
@@ -3397,6 +3397,7 @@ struct file_table
/* Filenames referenced by this compilation unit. */
static struct file_table file_table;
+static struct file_table file_table_emitted;
/* Local pointer to the name of the main input file. Initialized in
dwarf2out_init. */
@@ -3796,6 +3797,14 @@ static void output_loc_list PARAMS ((dw
static char *gen_internal_sym PARAMS ((const char *));
static void mark_limbo_die_list PARAMS ((void *));
+static void prune_unmark_dies PARAMS ((dw_die_ref));
+static void prune_unused_types_mark PARAMS ((dw_die_ref, int));
+static void prune_unused_types_walk PARAMS ((dw_die_ref));
+static void prune_unused_types_walk_attribs PARAMS ((dw_die_ref));
+static void prune_unused_types_prune PARAMS ((dw_die_ref));
+static void prune_unused_types PARAMS ((void));
+static unsigned long maybe_emit_file PARAMS ((int));
+
/* Section names used to hold DWARF debugging information. */
#ifndef DEBUG_INFO_SECTION
#define DEBUG_INFO_SECTION ".debug_info"
@@ -5172,6 +5181,7 @@ splice_child_die (parent, child)
break;
}
+ child->die_parent = parent;
child->die_sib = parent->die_child;
parent->die_child = child;
}
@@ -12746,13 +12756,21 @@ lookup_filename (file_name)
file_table.in_use = i + 1;
file_table.last_lookup_index = i;
- if (DWARF2_ASM_LINE_DEBUG_INFO)
+ /* Prepare to add a new table entry by making sure there is enough space in
+ the table to do so. If not, expand the current table. */
+ if (i >= file_table_emitted.allocated)
{
- fprintf (asm_out_file, "\t.file %u ", i);
- output_quoted_string (asm_out_file, file_name);
- fputc ('\n', asm_out_file);
+ file_table_emitted.allocated = i + FILE_TABLE_INCREMENT;
+ file_table_emitted.table = (char **)
+ xrealloc (file_table_emitted.table,
+ file_table_emitted.allocated * sizeof (char *));
}
+ /* Add the new entry to the end of the filename table. */
+ file_table_emitted.table[i] = NULL;
+ file_table_emitted.in_use = i + 1;
+ file_table_emitted.last_lookup_index = i;
+
return i;
}
@@ -12763,9 +12781,38 @@ init_file_table ()
file_table.table = (char **) xcalloc (FILE_TABLE_INCREMENT, sizeof (char *));
file_table.allocated = FILE_TABLE_INCREMENT;
+ file_table_emitted.table = (char **) xcalloc (FILE_TABLE_INCREMENT, sizeof (char *));
+ file_table_emitted.allocated = FILE_TABLE_INCREMENT;
+
/* Skip the first entry - file numbers begin at 1. */
file_table.in_use = 1;
file_table.last_lookup_index = 0;
+
+ file_table_emitted.in_use = 1;
+ file_table_emitted.last_lookup_index = 0;
+}
+
+static unsigned long
+maybe_emit_file (fileno)
+ int fileno;
+{
+ static int emitcount = 0;
+ if (DWARF2_ASM_LINE_DEBUG_INFO && fileno > 0)
+ {
+ if (!file_table_emitted.table[fileno])
+ {
+ file_table_emitted.table[fileno] = (char *)++emitcount;
+ fprintf (asm_out_file, "\t.file %lu ",
+ (unsigned long)
+ file_table_emitted.table[fileno]);
+ output_quoted_string (asm_out_file,
+ file_table.table[fileno]);
+ fputc ('\n', asm_out_file);
+ }
+ return (unsigned long)file_table_emitted.table[fileno];
+ }
+ else
+ return fileno;
}
/* Called by the final INSN scan whenever we see a var location. We
@@ -12847,6 +12894,8 @@ dwarf2out_source_line (line, filename)
{
unsigned file_num = lookup_filename (filename);
+ file_num = maybe_emit_file (file_num);
+
/* Emit the .loc directive understood by GNU as. */
fprintf (asm_out_file, "\t.loc %d %d 0\n", file_num, line);
@@ -12932,6 +12981,7 @@ dwarf2out_start_source_file (lineno, fil
dw2_asm_output_data (1, DW_MACINFO_start_file, "Start new file");
dw2_asm_output_data_uleb128 (lineno, "Included from line number %d",
lineno);
+ maybe_emit_file (lookup_filename (filename));
dw2_asm_output_data_uleb128 (lookup_filename (filename),
"Filename we just started");
}
@@ -13122,6 +13172,213 @@ output_indirect_string (pfile, h, v)
return 1;
}
+
+/* Clear the marks for a die and its children.
+ Be cool if the mark isn't set. */
+
+static void
+prune_unmark_dies (die)
+ dw_die_ref die;
+{
+ dw_die_ref c;
+ die->die_mark = 0;
+ for (c = die->die_child; c; c = c->die_sib)
+ prune_unmark_dies (c);
+}
+
+
+/* Given DIE that we're marking as used, find any other dies
+ it references as attributes and mark them as used. */
+
+static void
+prune_unused_types_walk_attribs (die)
+ dw_die_ref die;
+{
+ dw_attr_ref a;
+
+ for (a = die->die_attr; a != NULL; a = a->dw_attr_next)
+ {
+ if (a->dw_attr_val.val_class == dw_val_class_die_ref)
+ {
+ /* A reference to another DIE.
+ Make sure that it will get emitted. */
+ prune_unused_types_mark (a->dw_attr_val.v.val_die_ref.die, 1);
+ }
+ else if (a->dw_attr == DW_AT_decl_file)
+ {
+ /* A reference to a file. Make sure the file name is emitted. */
+ a->dw_attr_val.v.val_unsigned =
+ maybe_emit_file (a->dw_attr_val.v.val_unsigned);
+ }
+ }
+}
+
+
+/* Mark DIE as being used. If DOKIDS is true, then walk down
+ to DIE's children. */
+
+static void
+prune_unused_types_mark (die, dokids)
+ dw_die_ref die;
+ int dokids;
+{
+ dw_die_ref c;
+
+ if (die->die_mark == 0) {
+ /* We haven't done this node yet. Mark it as used. */
+ die->die_mark = 1;
+
+ /* We also have to mark its parents as used.
+ (But we don't want to mark our parents' kids due to this.) */
+ if (die->die_parent)
+ prune_unused_types_mark (die->die_parent, 0);
+
+ /* Mark any referenced nodes. */
+ prune_unused_types_walk_attribs (die);
+ }
+
+ if (dokids && die->die_mark != 2)
+ {
+ /* We need to walk the children, but haven't done so yet.
+ Remember that we've walked the kids. */
+ die->die_mark = 2;
+
+ /* Walk them. */
+ for (c = die->die_child; c; c = c->die_sib)
+ {
+ /* If this is an array type, we need to make sure our
+ kids get marked, even if they're types. */
+ if (die->die_tag == DW_TAG_array_type)
+ prune_unused_types_mark (c, 1);
+ else
+ prune_unused_types_walk (c);
+ }
+ }
+}
+
+
+/* Walk the tree DIE and mark types that we actually use. */
+
+static void
+prune_unused_types_walk (die)
+ dw_die_ref die;
+{
+ dw_die_ref c;
+
+ /* Don't do anything if this node is already marked. */
+ if (die->die_mark)
+ return;
+
+ switch (die->die_tag) {
+ case DW_TAG_const_type:
+ case DW_TAG_packed_type:
+ case DW_TAG_pointer_type:
+ case DW_TAG_reference_type:
+ case DW_TAG_volatile_type:
+ case DW_TAG_typedef:
+ case DW_TAG_array_type:
+ case DW_TAG_structure_type:
+ case DW_TAG_union_type:
+ case DW_TAG_class_type:
+ case DW_TAG_friend:
+ case DW_TAG_variant_part:
+ case DW_TAG_enumeration_type:
+ case DW_TAG_subroutine_type:
+ case DW_TAG_string_type:
+ case DW_TAG_set_type:
+ case DW_TAG_subrange_type:
+ case DW_TAG_ptr_to_member_type:
+ case DW_TAG_file_type:
+ /* It's a type node --- don't mark it. */
+ return;
+
+ default:
+ /* Mark everything else. */
+ break;
+ }
+
+ die->die_mark = 1;
+
+ /* Now, mark any dies referenced from here. */
+ prune_unused_types_walk_attribs (die);
+
+ /* Mark children. */
+ for (c = die->die_child; c; c = c->die_sib)
+ prune_unused_types_walk (c);
+}
+
+
+/* Remove from the tree DIE any dies that aren't marked. */
+
+static void
+prune_unused_types_prune (die)
+ dw_die_ref die;
+{
+ dw_die_ref c, p, n;
+ if (!die->die_mark)
+ abort();
+
+ p = NULL;
+ for (c = die->die_child; c; c = n)
+ {
+ n = c->die_sib;
+ if (c->die_mark)
+ {
+ prune_unused_types_prune (c);
+ p = c;
+ }
+ else
+ {
+ if (p)
+ p->die_sib = n;
+ else
+ die->die_child = n;
+ free_die (c);
+ }
+ }
+}
+
+
+/* Remove dies representing declarations that we never use. */
+
+static void
+prune_unused_types ()
+{
+ unsigned int i;
+ limbo_die_node *node;
+
+ /* Clear all the marks. */
+ prune_unmark_dies (comp_unit_die);
+ for (node = limbo_die_list; node; node = node->next)
+ prune_unmark_dies (node->die);
+
+ /* Set the mark on nodes that are actually used. */
+ prune_unused_types_walk (comp_unit_die);
+ for (node = limbo_die_list; node; node = node->next)
+ prune_unused_types_walk (node->die);
+
+ /* Also set the mark on nodes referenced from the
+ pubname_table or arange_table. */
+ for (i=0; i < pubname_table_in_use; i++)
+ {
+ prune_unused_types_mark (pubname_table[i].die, 1);
+ }
+ for (i=0; i < arange_table_in_use; i++)
+ {
+ prune_unused_types_mark (arange_table[i], 1);
+ }
+
+ /* Get rid of nodes that aren't marked. */
+ prune_unused_types_prune (comp_unit_die);
+ for (node = limbo_die_list; node; node = node->next)
+ prune_unused_types_prune (node->die);
+
+ /* Leave the marks clear. */
+ prune_unmark_dies (comp_unit_die);
+ for (node = limbo_die_list; node; node = node->next)
+ prune_unmark_dies (node->die);
+}
+
/* Output stuff that dwarf requires at the end of every file,
and generate the DWARF-2 debugging info. */
@@ -13196,6 +13453,9 @@ dwarf2out_finish (input_filename)
/* We need to reverse all the dies before break_out_includes, or
we'll see the end of an include file before the beginning. */
reverse_all_dies (comp_unit_die);
+
+ if (flag_eliminate_unused_debug_types)
+ prune_unused_types ();
/* Generate separate CUs for each of the include files we've seen.
They will go into limbo_die_list. */

View File

@ -1,10 +0,0 @@
--- gcc/config.gcc.~1.259.4.26.~ 2004-06-22 21:47:05.000000000 +0200
+++ gcc/config.gcc 2004-08-02 00:46:20.468908063 +0200
@@ -175,6 +175,7 @@
# system normally uses GNU ld.
out_file=
+md_file=
xmake_file=
tmake_file=
extra_headers=

View File

@ -1,13 +0,0 @@
diff -up gcc/cse.c.orig gcc/cse.c
--- gcc/cse.c.orig 2003-08-11 00:02:24.000000000 +0200
+++ gcc/cse.c 2003-07-31 23:49:21.000000000 +0200
@@ -6682,7 +6682,8 @@ invalidate_skipped_set (dest, set, data)
a BLKmode or nonscalar memory reference or a reference to a
variable address. */
&& (MEM_IN_STRUCT_P (dest) || GET_MODE (dest) == BLKmode
- || cse_rtx_varies_p (XEXP (dest, 0), 0)))
+ || cse_rtx_varies_p (XEXP (dest, 0), 0))
+ && !MEM_EXPR (dest))
{
invalidate_memory ();
return;

View File

@ -1,27 +0,0 @@
Index: gcc/expr.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/expr.c,v
retrieving revision 1.492.2.19
diff -c -3 -p -r1.492.2.19 expr.c
*** gcc/expr.c 14 Aug 2003 13:20:12 -0000 1.492.2.19
--- gcc/expr.c 5 Sep 2003 11:03:33 -0000
*************** emit_block_move_via_loop (x, y, size, al
*** 2066,2073 ****
if (tmp != iter)
emit_move_insn (iter, tmp);
- emit_note (NULL, NOTE_INSN_LOOP_CONT);
emit_label (cmp_label);
emit_cmp_and_jump_insns (iter, size, LT, NULL_RTX, iter_mode,
true, top_label);
--- 2066,2073 ----
if (tmp != iter)
emit_move_insn (iter, tmp);
emit_label (cmp_label);
+ emit_note (NULL, NOTE_INSN_LOOP_CONT);
emit_cmp_and_jump_insns (iter, size, LT, NULL_RTX, iter_mode,
true, top_label);

View File

@ -1,10 +0,0 @@
--- libffi/src/ia64/ffi.c 11 Mar 2004 15:27:24 +0100 1.3.18.1
+++ libffi/src/ia64/ffi.c 17 Apr 2004 10:09:06 +0200
@@ -65,6 +65,7 @@ static size_t float_type_size(unsigned s
#endif
default:
FFI_ASSERT(0);
+ abort();
}
}

View File

@ -1,446 +0,0 @@
2003-08-05 Alexandre Oliva <aoliva@redhat.com>
* c.opt: Introduce -fworking-directory.
* doc/cpp.texi, doc/invoke.texi, doc/cppopts.texi: Document it.
* c-common.h (flag_working_directory): Declare.
* c-common.c (flag_working_directory): Define.
* c-opts.c (c_common_handle_options): Set it.
(sanitize_cpp_opts): Set...
* cpplib.h (struct cpp_options): ... working_directory option.
(struct cpp_callbacks): Add dir_change.
* cppinit.c (read_original_filename): Call...
(read_original_directory): New. Look for # 1 "directory//"
and process it.
(cpp_read_main_file): Call dir_change callback if working_directory
option is set.
* gcc.c (cpp_unique_options): Pass -g*.
* c-lex.c (cb_dir_change): New.
(init_c_lex): Set dir_change callback.
* toplev.c (src_pwd): New static variable.
(set_src_pwd, get_src_pwd): New functions.
* toplev.h (get_src_pwd, set_src_pwd): Declare.
* dbxout.c (dbxout_init): Call get_src_pwd() instead of getpwd().
* dwarf2out.c (gen_compile_unit_die): Likewise.
* dwarfout.c (output_compile_unit_die, dwarfout_init): Likewise.
================================================================================
--- gcc-3.3.4/gcc/c-common.c
+++ gcc-3.3.4/gcc/c-common.c
@@ -548,6 +548,13 @@
int flag_weak = 1;
+/* 0 means we want the preprocessor to not emit line directives for
+ the current working directory. 1 means we want it to do it. -1
+ means we should decide depending on whether debugging information
+ is being emitted or not. */
+
+int flag_working_directory = -1;
+
/* Nonzero to use __cxa_atexit, rather than atexit, to register
destructors for local statics and global objects. */
--- gcc-3.3.4/gcc/c-common.h
+++ gcc-3.3.4/gcc/c-common.h
@@ -711,6 +711,13 @@
extern int flag_weak;
+/* 0 means we want the preprocessor to not emit line directives for
+ the current working directory. 1 means we want it to do it. -1
+ means we should decide depending on whether debugging information
+ is being emitted or not. */
+
+extern int flag_working_directory;
+
/* Nonzero to use __cxa_atexit, rather than atexit, to register
destructors for local statics and global objects. */
--- gcc-3.3.4/gcc/c-lex.c
+++ gcc-3.3.4/gcc/c-lex.c
@@ -82,6 +82,7 @@
static void update_header_times PARAMS ((const char *));
static int dump_one_header PARAMS ((splay_tree_node, void *));
static void cb_line_change PARAMS ((cpp_reader *, const cpp_token *, int));
+static void cb_dir_change PARAMS ((cpp_reader *, const char *));
static void cb_ident PARAMS ((cpp_reader *, unsigned int,
const cpp_string *));
static void cb_file_change PARAMS ((cpp_reader *, const struct line_map *));
@@ -119,6 +120,7 @@
cb = cpp_get_callbacks (parse_in);
cb->line_change = cb_line_change;
+ cb->dir_change = cb_dir_change;
cb->ident = cb_ident;
cb->file_change = cb_file_change;
cb->def_pragma = cb_def_pragma;
@@ -206,6 +208,13 @@
return 0;
}
+static void
+cb_dir_change (cpp_reader *pfile ATTRIBUTE_UNUSED, const char *dir)
+{
+ if (! set_src_pwd (dir))
+ warning ("too late for # directive to set debug directory");
+}
+
void
dump_time_statistics ()
{
--- gcc-3.3.4/gcc/c-opts.c
+++ gcc-3.3.4/gcc/c-opts.c
@@ -124,6 +124,7 @@
OPT("MQ", CL_ALL | CL_ARG, OPT_MQ) \
OPT("MT", CL_ALL | CL_ARG, OPT_MT) \
OPT("P", CL_ALL, OPT_P) \
+ OPT("fworking-directory", CL_ALL, OPT_fworking_directory) \
OPT("Wabi", CL_CXX, OPT_Wabi) \
OPT("Wall", CL_ALL, OPT_Wall) \
OPT("Wbad-function-cast", CL_C, OPT_Wbad_function_cast) \
@@ -686,6 +687,10 @@
cpp_opts->no_line_commands = 1;
break;
+ case OPT_fworking_directory:
+ flag_working_directory = on;
+ break;
+
case OPT_Wabi:
warn_abi = on;
break;
@@ -1587,6 +1592,15 @@
and/or -Wtraditional, whatever the ordering. */
cpp_opts->warn_long_long
= warn_long_long && ((!flag_isoc99 && pedantic) || warn_traditional);
+
+ /* If we're generating preprocessor output, emit current directory
+ if explicitly requested or if debugging information is enabled.
+ ??? Maybe we should only do it for debugging formats that
+ actually output the current directory? */
+ if (flag_working_directory == -1)
+ flag_working_directory = (debug_info_level != DINFO_LEVEL_NONE);
+ cpp_opts->working_directory
+ = flag_preprocess_only && flag_working_directory;
}
/* Set the C 89 standard (with 1994 amendments if C94, without GNU
@@ -1790,6 +1804,10 @@
-dI Include #include directives in the output\n\
"), stdout);
fputs (_("\
+ -fworking-directory Generate a #line directive pointing at the\n\
+ current working directory\n\
+"), stdout);
+ fputs (_("\
-f[no-]preprocessed Treat the input file as already preprocessed\n\
-ftabstop=<number> Distance between tab stops for column reporting\n\
-P Do not generate #line directives\n\
--- gcc-3.3.4/gcc/cppinit.c
+++ gcc-3.3.4/gcc/cppinit.c
@@ -107,6 +107,7 @@
static void free_chain PARAMS ((struct pending_option *));
static void init_standard_includes PARAMS ((cpp_reader *));
static void read_original_filename PARAMS ((cpp_reader *));
+static void read_original_directory PARAMS ((cpp_reader *));
static void new_pending_directive PARAMS ((struct cpp_pending *,
const char *,
cl_directive_handler));
@@ -1026,6 +1027,24 @@
if (CPP_OPTION (pfile, preprocessed))
read_original_filename (pfile);
+ if (CPP_OPTION (pfile, working_directory))
+ {
+ const char *name = pfile->map->to_file;
+ const char *dir = getpwd ();
+ char *dir_with_slashes = alloca (strlen (dir) + 3);
+
+ memcpy (dir_with_slashes, dir, strlen (dir));
+ memcpy (dir_with_slashes + strlen (dir), "//", 3);
+
+ if (pfile->cb.dir_change)
+ pfile->cb.dir_change (pfile, dir);
+ /* Emit file renames that will be recognized by
+ read_directory_filename, since dir_change doesn't output
+ anything. */
+ _cpp_do_file_change (pfile, LC_RENAME, dir_with_slashes, 1, 0);
+ _cpp_do_file_change (pfile, LC_RENAME, name, 1, 0);
+ }
+
return pfile->map->to_file;
}
@@ -1051,6 +1070,7 @@
if (token1->type == CPP_NUMBER)
{
_cpp_handle_directive (pfile, token->flags & PREV_WHITE);
+ read_original_directory (pfile);
return;
}
}
@@ -1059,6 +1079,61 @@
_cpp_backup_tokens (pfile, 1);
}
+/* For preprocessed files, if the tokens following the first filename
+ line is of the form # <line> "/path/name//", handle the
+ directive so we know the original current directory. */
+static void
+read_original_directory (pfile)
+ cpp_reader *pfile;
+{
+ const cpp_token *hash, *token;
+
+ /* Lex ahead; if the first tokens are of the form # NUM, then
+ process the directive, otherwise back up. */
+ hash = _cpp_lex_direct (pfile);
+ if (hash->type != CPP_HASH)
+ {
+ _cpp_backup_tokens (pfile, 1);
+ return;
+ }
+
+ token = _cpp_lex_direct (pfile);
+
+ if (token->type != CPP_NUMBER)
+ {
+ _cpp_backup_tokens (pfile, 2);
+ return;
+ }
+
+ token = _cpp_lex_direct (pfile);
+
+ if (token->type != CPP_STRING
+ || ! (token->val.str.len >= 5
+ && token->val.str.text[token->val.str.len-2] == '/'
+ && token->val.str.text[token->val.str.len-3] == '/'))
+ {
+ _cpp_backup_tokens (pfile, 3);
+ return;
+ }
+
+ if (pfile->cb.dir_change)
+ {
+ char *debugdir = alloca (token->val.str.len - 3);
+
+ memcpy (debugdir, (const char *) token->val.str.text + 1,
+ token->val.str.len - 4);
+ debugdir[token->val.str.len - 4] = '\0';
+
+ pfile->cb.dir_change (pfile, debugdir);
+ }
+
+ /* We want to process the fake line changes as regular changes, to
+ get them output. */
+ _cpp_backup_tokens (pfile, 3);
+
+ CPP_OPTION (pfile, working_directory) = false;
+}
+
/* Handle pending command line options: -D, -U, -A, -imacros and
-include. This should be called after debugging has been properly
set up in the front ends. */
--- gcc-3.3.4/gcc/cpplib.h
+++ gcc-3.3.4/gcc/cpplib.h
@@ -407,6 +407,11 @@
/* Nonzero means __STDC__ should have the value 0 in system headers. */
unsigned char stdc_0_in_system_headers;
+
+ /* Nonzero means output a directory line marker right after the
+ initial file name line marker, and before a duplicate initial
+ line marker. */
+ bool working_directory;
};
/* Call backs. */
@@ -415,6 +420,7 @@
/* Called when a new line of preprocessed output is started. */
void (*line_change) PARAMS ((cpp_reader *, const cpp_token *, int));
void (*file_change) PARAMS ((cpp_reader *, const struct line_map *));
+ void (*dir_change) PARAMS ((cpp_reader *, const char *));
void (*include) PARAMS ((cpp_reader *, unsigned int,
const unsigned char *, const cpp_token *));
void (*define) PARAMS ((cpp_reader *, unsigned int, cpp_hashnode *));
--- gcc-3.3.4/gcc/dbxout.c
+++ gcc-3.3.4/gcc/dbxout.c
@@ -438,7 +438,8 @@
if (use_gnu_debug_info_extensions)
#endif
{
- if (!cwd && (cwd = getpwd ()) && (!*cwd || cwd[strlen (cwd) - 1] != '/'))
+ if (!cwd && (cwd = get_src_pwd ())
+ && (!*cwd || cwd[strlen (cwd) - 1] != '/'))
cwd = concat (cwd, FILE_NAME_JOINER, NULL);
if (cwd)
{
--- gcc-3.3.4/gcc/doc/cpp.texi
+++ gcc-3.3.4/gcc/doc/cpp.texi
@@ -4066,7 +4066,9 @@
cpp [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}]
[@option{-I}@var{dir}@dots{}] [@option{-W}@var{warn}@dots{}]
[@option{-M}|@option{-MM}] [@option{-MG}] [@option{-MF} @var{filename}]
- [@option{-MP}] [@option{-MQ} @var{target}@dots{}] [@option{-MT} @var{target}@dots{}]
+ [@option{-MP}] [@option{-MQ} @var{target}@dots{}]
+ [@option{-MT} @var{target}@dots{}]
+ [@option{-P}] [@option{-fno-working-directory}]
[@option{-x} @var{language}] [@option{-std=}@var{standard}]
@var{infile} @var{outfile}
--- gcc-3.3.4/gcc/doc/cppopts.texi
+++ gcc-3.3.4/gcc/doc/cppopts.texi
@@ -1,4 +1,4 @@
-@c Copyright (c) 1999, 2000, 2001, 2002
+@c Copyright (c) 1999, 2000, 2001, 2002, 2003
@c Free Software Foundation, Inc.
@c This is part of the CPP and GCC manuals.
@c For copying conditions, see the file gcc.texi.
@@ -470,6 +470,22 @@
line. If the value is less than 1 or greater than 100, the option is
ignored. The default is 8.
+@item -fworking-directory
+@opindex fworking-directory
+@opindex fno-working-directory
+Enable generation of linemarkers in the preprocessor output that will
+let the compiler know the current working directory at the time of
+preprocessing. When this option is enabled, the preprocessor will
+emit, after the initial linemarker, a second linemarker with the
+current working directory followed by two slashes. GCC will use this
+directory, when it's present in the preprocessed input, as the
+directory emitted as the current working directory in some debugging
+information formats. This option is implicitly enabled if debugging
+information is enabled, but this can be inhibited with the negated
+form @option{-fno-working-directory}. If the @option{-P} flag is
+present in the command line, this option has no effect, since no
+@code{#line} directives are emitted whatsoever.
+
@item -fno-show-column
@opindex fno-show-column
Do not print column numbers in diagnostics. This may be necessary if
--- gcc-3.3.4/gcc/doc/invoke.texi
+++ gcc-3.3.4/gcc/doc/invoke.texi
@@ -294,7 +294,8 @@
-include @var{file} -imacros @var{file} @gol
-iprefix @var{file} -iwithprefix @var{dir} @gol
-iwithprefixbefore @var{dir} -isystem @var{dir} @gol
--M -MM -MF -MG -MP -MQ -MT -nostdinc -P -remap @gol
+-M -MM -MF -MG -MP -MQ -MT -nostdinc @gol
+-P -fworking-directory -remap @gol
-trigraphs -undef -U@var{macro} -Wp,@var{option}}
@item Assembler Option
--- gcc-3.3.4/gcc/dwarf2out.c
+++ gcc-3.3.4/gcc/dwarf2out.c
@@ -11764,7 +11764,7 @@
{
dw_die_ref die;
char producer[250];
- const char *wd = getpwd ();
+ const char *wd = get_src_pwd ();
const char *language_string = lang_hooks.name;
int language;
@@ -13222,7 +13222,7 @@
if (get_AT (comp_unit_die, DW_AT_comp_dir) == NULL)
{
- char *wd = getpwd ();
+ char *wd = get_src_pwd ();
unsigned i;
if (wd != NULL)
--- gcc-3.3.4/gcc/dwarfout.c
+++ gcc-3.3.4/gcc/dwarfout.c
@@ -4147,7 +4147,7 @@
stmt_list_attribute (LINE_BEGIN_LABEL);
{
- const char *wd = getpwd ();
+ const char *wd = get_src_pwd ();
if (wd)
comp_dir_attribute (wd);
}
@@ -6272,7 +6272,7 @@
ASM_OUTPUT_PUSH_SECTION (asm_out_file, DEBUG_SFNAMES_SECTION);
ASM_OUTPUT_LABEL (asm_out_file, SFNAMES_BEGIN_LABEL);
{
- const char *pwd = getpwd ();
+ const char *pwd = get_src_pwd ();
char *dirname;
if (!pwd)
--- gcc-3.3.4/gcc/gcc.c
+++ gcc-3.3.4/gcc/gcc.c
@@ -725,7 +725,7 @@
in turn cause preprocessor symbols to be defined specially. */
static const char *cpp_options =
"%(cpp_unique_options) %1 %{m*} %{std*} %{ansi} %{W*&pedantic*} %{w} %{f*}\
- %{O*} %{undef}";
+ %{g*} %{O*} %{undef}";
/* This contains cpp options which are not passed when the preprocessor
output will be used by another program. */
--- gcc-3.3.4/gcc/toplev.c
+++ gcc-3.3.4/gcc/toplev.c
@@ -1711,6 +1711,46 @@
FILE *rtl_dump_file = NULL;
FILE *cgraph_dump_file = NULL;
+/* The current working directory of a translation. It's generally the
+ directory from which compilation was initiated, but a preprocessed
+ file may specify the original directory in which it was
+ created. */
+
+static const char *src_pwd;
+
+/* Initialize src_pwd with the given string, and return true. If it
+ was already initialized, return false. As a special case, it may
+ be called with a NULL argument to test whether src_pwd has NOT been
+ initialized yet. */
+
+bool
+set_src_pwd (const char *pwd)
+{
+ if (src_pwd)
+ {
+ if (strcmp (src_pwd, pwd) == 0)
+ return true;
+ else
+ return false;
+ }
+
+ src_pwd = xstrdup (pwd);
+ return true;
+}
+
+/* Return the directory from which the translation unit was initiated,
+ in case set_src_pwd() was not called before to assign it a
+ different value. */
+
+const char *
+get_src_pwd (void)
+{
+ if (! src_pwd)
+ src_pwd = getpwd ();
+
+ return src_pwd;
+}
+
/* Decode the string P as an integral parameter.
If the string is indeed an integer return its numeric value else
issue an Invalid Option error for the option PNAME and return DEFVAL.
--- gcc-3.3.4/gcc/toplev.h
+++ gcc-3.3.4/gcc/toplev.h
@@ -133,4 +133,10 @@
extern int exact_log2_wide PARAMS ((unsigned HOST_WIDE_INT));
extern int floor_log2_wide PARAMS ((unsigned HOST_WIDE_INT));
+/* Functions used to get and set GCC's notion of in what directory
+ compilation was started. */
+
+extern const char *get_src_pwd (void);
+extern bool set_src_pwd (const char *);
+
#endif /* ! GCC_TOPLEV_H */

View File

@ -1,22 +0,0 @@
--- gcc-3.3/libtool.m4.ppc64 2003-07-03 22:58:43.000000000 +0200
+++ gcc-3.3/libtool.m4 2003-07-03 22:59:06.000000000 +0200
@@ -202,6 +202,9 @@
ppc64-*linux*)
LD="${LD-ld} -m elf32ppclinux"
;;
+ powerpc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
s390x-*linux*)
LD="${LD-ld} -m elf_s390"
;;
@@ -218,6 +221,9 @@
ppc*-*linux*|powerpc*-*linux*)
LD="${LD-ld} -m elf64ppc"
;;
+ powerpc64-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
s390*-*linux*)
LD="${LD-ld} -m elf64_s390"
;;

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:220ba46c8020c6ea1013b2711b602df4a4b52028a0406d434c93ff8f8f922628
size 986481

View File

@ -1,41 +0,0 @@
Index: boehm-gc/finalize.c
===================================================================
RCS file: /cvs/gcc/gcc/boehm-gc/finalize.c,v
retrieving revision 1.11.28.1
diff -u -p -r1.11.28.1 finalize.c
--- boehm-gc/finalize.c 24 Jan 2004 11:05:54 -0000 1.11.28.1
+++ boehm-gc/finalize.c 9 Feb 2004 16:07:25 -0000
@@ -164,6 +164,7 @@ signed_word * log_size_ptr;
int index;
struct disappearing_link * new_dl;
DCL_LOCK_STATE;
+ struct disappearing_link *** dl_head_adr = &dl_head;
if ((word)link & (ALIGNMENT-1))
ABORT("Bad arg to GC_general_register_disappearing_link");
@@ -176,7 +177,7 @@ signed_word * log_size_ptr;
# ifndef THREADS
DISABLE_SIGNALS();
# endif
- GC_grow_table((struct hash_chain_entry ***)(&dl_head),
+ GC_grow_table((struct hash_chain_entry ***)dl_head_adr,
&log_dl_table_size);
# ifdef CONDPRINT
if (GC_print_stats) {
@@ -339,6 +340,7 @@ finalization_mark_proc * mp;
struct finalizable_object *new_fo;
hdr *hhdr;
DCL_LOCK_STATE;
+ struct finalizable_object *** fo_head_adr = &fo_head;
# ifdef THREADS
DISABLE_SIGNALS();
@@ -349,7 +351,7 @@ finalization_mark_proc * mp;
# ifndef THREADS
DISABLE_SIGNALS();
# endif
- GC_grow_table((struct hash_chain_entry ***)(&fo_head),
+ GC_grow_table((struct hash_chain_entry ***)fo_head_adr,
&log_fo_table_size);
# ifdef CONDPRINT
if (GC_print_stats) {

View File

@ -1,30 +0,0 @@
============================================================
Index: gcc/ada/adaint.c
--- gcc/ada/adaint.c 31 May 2002 18:08:22 -0000 1.10
+++ gcc/ada/adaint.c 22 Oct 2002 14:13:58 -0000
@@ -2244,17 +2244,6 @@ int _flush_cache()
}
#endif
-#if defined (CROSS_COMPILE) \
- || (! (defined (sparc) && defined (sun) && defined (__SVR4)) \
- && ! defined (linux) \
- && ! defined (hpux) \
- && ! (defined (__alpha__) && defined (__osf__)) \
- && ! defined (__MINGW32__))
-
-/* Dummy function to satisfy g-trasym.o. Currently Solaris sparc, HP/UX,
- GNU/Linux, Tru64 & Windows provide a non-dummy version of this procedure in
- libaddr2line.a. */
-
void
convert_addresses (addrs, n_addr, buf, len)
void *addrs ATTRIBUTE_UNUSED;
@@ -2264,7 +2253,6 @@ convert_addresses (addrs, n_addr, buf, l
{
*len = 0;
}
-#endif
#if defined (_WIN32)
int __gnat_argument_needs_quote = 1;

View File

@ -1,80 +0,0 @@
--- gcc/ada/link.c.jj Tue May 7 12:50:23 2002
+++ gcc/ada/link.c Wed Jun 5 14:45:32 2002
@@ -158,11 +158,11 @@ const char *object_library_extension = "
#elif defined (linux)
const char *object_file_option = "";
-const char *run_path_option = "-Wl,-rpath,";
-char shared_libgnat_default = STATIC;
+const char *run_path_option = "";
+char shared_libgnat_default = SHARED;
int link_max = 2147483647;
unsigned char objlist_file_supported = 0;
-unsigned char using_gnu_linker = 0;
+unsigned char using_gnu_linker = 1;
const char *object_library_extension = ".a";
#elif defined (__svr4__) && defined (i386)
--- gcc/ada/Makefile.in.jj Wed Jun 5 16:06:56 2002
+++ gcc/ada/Makefile.in Wed Jun 5 16:27:33 2002
@@ -1214,6 +1214,33 @@ ifeq ($(strip $(filter-out %86 linux%,$(
endif
endif
+ifeq ($(strip $(filter-out alpha% linux%,$(arch) $(osys))),)
+ MLIB_TGT=5lml-tgt
+ SYMLIB=
+ THREADSLIB=-lpthread
+ GNATLIB_SHARED=gnatlib-shared-dual
+ GMEM_LIB=gmemlib
+ LIBRARY_VERSION := $(strip $(shell grep Library_Version $(fsrcpfx)gnatvsn.ads | sed -e 's/.*GNAT Lib v\(.*\)[ "].*/\1/'))
+endif
+
+ifeq ($(strip $(filter-out sparc% linux%,$(arch) $(osys))),)
+ MLIB_TGT=5lml-tgt
+ SYMLIB=
+ THREADSLIB=-lpthread
+ GNATLIB_SHARED=gnatlib-shared-dual
+ GMEM_LIB=gmemlib
+ LIBRARY_VERSION := $(strip $(shell grep Library_Version $(fsrcpfx)gnatvsn.ads | sed -e 's/.*GNAT Lib v\(.*\)[ "].*/\1/'))
+endif
+
+ifeq ($(strip $(filter-out ia64 linux%,$(arch) $(osys))),)
+ MLIB_TGT=5lml-tgt
+ SYMLIB=
+ THREADSLIB=-lpthread
+ GNATLIB_SHARED=gnatlib-shared-dual
+ GMEM_LIB=gmemlib
+ LIBRARY_VERSION := $(strip $(shell grep Library_Version $(fsrcpfx)gnatvsn.ads | sed -e 's/.*GNAT Lib v\(.*\)[ "].*/\1/'))
+endif
+
ifeq ($(strip $(filter-out mips sgi irix%,$(targ))),)
ifeq ($(strip $(filter-out mips sgi irix6%,$(targ))),)
LIBGNAT_TARGET_PAIRS = \
--- gcc/ada/gnat_rm.texi.jj Tue Apr 23 20:27:39 2002
+++ gcc/ada/gnat_rm.texi Thu Jun 6 14:30:21 2002
@@ -31,6 +31,10 @@
@settitle GNAT Reference Manual
@setchapternewpage odd
@syncodeindex fn cp
+@dircategory Programming
+@direntry
+* gnat_rm: (gnat_rm). GNAT Reference Manual
+@end direntry
@titlepage
--- gcc/ada/gnat_ug.texi.jj Tue May 7 12:50:03 2002
+++ gcc/ada/gnat_ug.texi Thu Jun 6 14:30:33 2002
@@ -75,6 +75,11 @@
@syncodeindex fn cp
@c %**end of header
+@dircategory Programming
+@direntry
+* gnat_ug: (gnat_ug). GNAT User's Guide
+@end direntry
+
@titlepage
@ifset vms

View File

@ -1,62 +0,0 @@
Hello,
in the appended testcase (obtained from linux kernel), the following
bug occurred: load motion decides to optimize non-volatile instance
of src_pte, and not to take volatile instance into account. When
checking for availability, we however consider these instances to be equal,
which causes us to believe that the second load of pte is redundant.
The patch fixes it.
Zdenek
typedef struct { unsigned long pte_low; } pte_t;
static inline void clear_bit(int nr, volatile void * addr)
{
__asm__ __volatile__(
"btrl %1,%0"
:"=m" ((*(volatile long *) addr))
:"Ir" (nr));
}
static inline void ptep_set_wrprotect(pte_t *ptep) { clear_bit(1, ptep); }
int copy_page_range(void)
{
pte_t * src_pte;
pte_t pte = *src_pte;
if (pte.pte_low) {
ptep_set_wrprotect(src_pte);
pte = *src_pte;
}
foo (pte);
return 0;
}
Changelog:
* gcse.c (expr_equiv_p): Don't consider anything to be equal to
volatile mem.
Index: gcse.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gcse.c,v
retrieving revision 1.222.2.18
diff -c -3 -p -r1.222.2.18 gcse.c
*** gcc/gcse.c 15 Aug 2003 13:21:01 -0000 1.222.2.18
--- gcc/gcse.c 29 Aug 2003 22:33:15 -0000
*************** expr_equiv_p (x, y)
*** 1844,1849 ****
--- 1844,1853 ----
due to it being set with the different alias set. */
if (MEM_ALIAS_SET (x) != MEM_ALIAS_SET (y))
return 0;
+
+ /* A volatile mem should not be considered equivalent to any other. */
+ if (MEM_VOLATILE_P (x) || MEM_VOLATILE_P (y))
+ return 0;
break;
/* For commutative operations, check both orders. */

View File

@ -1,86 +0,0 @@
Index: gcc/configure.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/configure.in,v
retrieving revision 1.627.2.13
diff -u -p -a -u -p -a -r1.627.2.13 gcc/configure.in
--- gcc/configure.in 25 Jun 2003 23:14:55 -0000 1.627.2.13
+++ gcc/configure.in 22 Jul 2003 17:58:51 -0000
@@ -1613,7 +1613,7 @@ elif test x$gcc_cv_as != x; then
# GNU LD versions before 2.12.1 have buggy support for STV_HIDDEN.
# This is irritatingly difficult to feature test for. Look for
# the date string after the version number.
- ld_ver=`$gcc_cv_ld --version 2>/dev/null | head -1`
+ ld_ver=`$gcc_cv_ld --version 2>/dev/null | head -n 1`
if echo "$ld_ver" | grep GNU > /dev/null; then
changequote(,)dnl
ld_vers=`echo $ld_ver | sed -n 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\(\|\.[0-9][0-9]*\(\|\.[0-9][0-9]*\)\)\)\([ ].*\|\)$,\1,p'`
@@ -1688,7 +1688,7 @@ EOF
# ??? There exists an elf-specific test that will crash
# the assembler. Perhaps it's better to figure out whether
# arbitrary sections are supported and try the test.
- as_ver=`$gcc_cv_as --version 2>/dev/null | head -1`
+ as_ver=`$gcc_cv_as --version 2>/dev/null | head -n 1`
if echo "$as_ver" | grep GNU > /dev/null; then
changequote(,)dnl
as_ver=`echo $as_ver | sed -e 's/GNU assembler \([0-9.][0-9.]*\).*/\1/'`
@@ -1716,7 +1716,7 @@ if test x$gcc_cv_gas_major_version != x
fi
elif test x$gcc_cv_as != x; then
# Check if this is GAS.
- as_ver=`$gcc_cv_as --version < /dev/null 2> /dev/null | head -1`
+ as_ver=`$gcc_cv_as --version < /dev/null 2> /dev/null | head -n 1`
rm -f a.out 2> /dev/null
if echo "$as_ver" | grep GNU > /dev/null; then
# Versions up to and including 2.11.0 may mis-optimize
@@ -1769,7 +1769,7 @@ EOF
# and we got the correct data, then succeed.
if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1 \
&& $gcc_cv_objdump -s -j .eh_frame conftest.o 2>/dev/null \
- | tail -3 > conftest.got \
+ | tail -n 3 > conftest.got \
&& { cmp conftest.lit conftest.got > /dev/null 2>&1 \
|| cmp conftest.big conftest.got > /dev/null 2>&1; }
then
Index: gcc/configure
===================================================================
RCS file: /cvs/gcc/gcc/gcc/configure,v
retrieving revision 1.641.2.14
diff -u -p -a -u -p -a -r1.641.2.14 gcc/configure
--- gcc/configure 25 Jun 2003 23:14:53 -0000 1.641.2.14
+++ gcc/configure 22 Jul 2003 17:59:30 -0000
@@ -7130,7 +7130,7 @@ elif test x$gcc_cv_as != x; then
# GNU LD versions before 2.12.1 have buggy support for STV_HIDDEN.
# This is irritatingly difficult to feature test for. Look for
# the date string after the version number.
- ld_ver=`$gcc_cv_ld --version 2>/dev/null | head -1`
+ ld_ver=`$gcc_cv_ld --version 2>/dev/null | head -n 1`
if echo "$ld_ver" | grep GNU > /dev/null; then
ld_vers=`echo $ld_ver | sed -n 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\(\|\.[0-9][0-9]*\(\|\.[0-9][0-9]*\)\)\)\([ ].*\|\)$,\1,p'`
ld_date=`echo $ld_ver | sed -n 's,^.*\([2-9][0-9][0-9][0-9]\)[-]*\([01][0-9]\)[-]*\([0-3][0-9]\).*$,\1\2\3,p'`
@@ -7206,7 +7206,7 @@ EOF
# ??? There exists an elf-specific test that will crash
# the assembler. Perhaps it's better to figure out whether
# arbitrary sections are supported and try the test.
- as_ver=`$gcc_cv_as --version 2>/dev/null | head -1`
+ as_ver=`$gcc_cv_as --version 2>/dev/null | head -n 1`
if echo "$as_ver" | grep GNU > /dev/null; then
as_ver=`echo $as_ver | sed -e 's/GNU assembler \([0-9.][0-9.]*\).*/\1/'`
as_major=`echo $as_ver | sed 's/\..*//'`
@@ -7235,7 +7235,7 @@ if test x$gcc_cv_gas_major_version != x
fi
elif test x$gcc_cv_as != x; then
# Check if this is GAS.
- as_ver=`$gcc_cv_as --version < /dev/null 2> /dev/null | head -1`
+ as_ver=`$gcc_cv_as --version < /dev/null 2> /dev/null | head -n 1`
rm -f a.out 2> /dev/null
if echo "$as_ver" | grep GNU > /dev/null; then
# Versions up to and including 2.11.0 may mis-optimize
@@ -7288,7 +7288,7 @@ EOF
# and we got the correct data, then succeed.
if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1 \
&& $gcc_cv_objdump -s -j .eh_frame conftest.o 2>/dev/null \
- | tail -3 > conftest.got \
+ | tail -n 3 > conftest.got \
&& { cmp conftest.lit conftest.got > /dev/null 2>&1 \
|| cmp conftest.big conftest.got > /dev/null 2>&1; }
then

View File

@ -1,27 +0,0 @@
--- gcc/config/pa/pa.c 2004/07/12 14:49:07 1.1
+++ gcc/config/pa/pa.c 2004/07/12 14:53:02
@@ -8367,4 +8367,14 @@
fputs (",DATA\n", stream);
}
}
+
+void
+optimization_options (level, size)
+ int level;
+ int size ATTRIBUTE_UNUSED;
+{
+ if (level > 2)
+ flag_unroll_loops = 1;
+}
+
#include "gt-pa.h"
--- gcc/config/pa/pa.h 2004/07/12 14:49:04 1.1
+++ gcc/config/pa/pa.h 2004/07/12 14:56:58
@@ -2039,3 +2039,7 @@
/* We need a libcall to canonicalize function pointers on TARGET_ELF32. */
#define CANONICALIZE_FUNCPTR_FOR_COMPARE_LIBCALL \
"__canonicalize_funcptr_for_compare"
+
+/* Define this to change the optimizations performed by default. */
+#define OPTIMIZATION_OPTIONS(LEVEL, SIZE) \
+ optimization_options ((LEVEL), (SIZE))

View File

@ -1,149 +0,0 @@
--- gcc/config/ia64/ia64intrin.h 25 Apr 2003 14:26:35 +0200 1.4
+++ gcc/config/ia64/ia64intrin.h 16 Apr 2004 15:03:13 +0200
@@ -14,114 +14,114 @@ extern long __sync_val_compare_and_swap_
#define __sync_val_compare_and_swap(PTR, OLD, NEW) \
((sizeof (*(PTR)) == sizeof(int)) \
? (__typeof__(*(PTR))) \
- __sync_val_compare_and_swap_si((int *)(PTR),(int)(OLD),(int)(NEW)) \
+ __sync_val_compare_and_swap_si((int *)(void *)(PTR),(int)(OLD),(int)(NEW)) \
: (__typeof__(*(PTR))) \
- __sync_val_compare_and_swap_di((long *)(PTR),(long)(OLD),(long)(NEW)))
+ __sync_val_compare_and_swap_di((long *)(void *)(PTR),(long)(OLD),(long)(NEW)))
extern int __sync_bool_compare_and_swap_si (int *, int, int);
extern int __sync_bool_compare_and_swap_di (long *, long, long);
#define __sync_bool_compare_and_swap(PTR, OLD, NEW) \
((sizeof (*(PTR)) == sizeof(int)) \
- ? __sync_bool_compare_and_swap_si((int *)(PTR),(int)(OLD),(int)(NEW)) \
- : __sync_bool_compare_and_swap_di((long *)(PTR),(long)(OLD),(long)(NEW)))
+ ? __sync_bool_compare_and_swap_si((int *)(void *)(PTR),(int)(OLD),(int)(NEW)) \
+ : __sync_bool_compare_and_swap_di((long *)(void *)(PTR),(long)(OLD),(long)(NEW)))
extern void __sync_lock_release_si (int *);
extern void __sync_lock_release_di (long *);
#define __sync_lock_release(PTR) \
((sizeof (*(PTR)) == sizeof(int)) \
- ? __sync_lock_release_si((int *)(PTR)) \
- : __sync_lock_release_di((long *)(PTR)))
+ ? __sync_lock_release_si((int *)(void *)(PTR)) \
+ : __sync_lock_release_di((long *)(void *)(PTR)))
extern int __sync_lock_test_and_set_si (int *, int);
extern long __sync_lock_test_and_set_di (long *, long);
#define __sync_lock_test_and_set(PTR,VAL) \
((sizeof (*(PTR)) == sizeof(int)) \
- ? (__typeof__(*(PTR))) __sync_lock_test_and_set_si((int *)(PTR),(int)(VAL)) \
- : (__typeof__(*(PTR))) __sync_lock_test_and_set_di((long *)(PTR),(long)(VAL)))
+ ? (__typeof__(*(PTR))) __sync_lock_test_and_set_si((int *)(void *)(PTR),(int)(VAL)) \
+ : (__typeof__(*(PTR))) __sync_lock_test_and_set_di((long *)(void *)(PTR),(long)(VAL)))
extern int __sync_fetch_and_add_si (int *, int);
extern long __sync_fetch_and_add_di (long *, long);
#define __sync_fetch_and_add(PTR,VAL) \
((sizeof (*(PTR)) == sizeof(int)) \
- ? (__typeof__(*(PTR))) __sync_fetch_and_add_si((int *)(PTR),(int)(VAL)) \
- : (__typeof__(*(PTR))) __sync_fetch_and_add_di((long *)(PTR),(long)(VAL)))
+ ? (__typeof__(*(PTR))) __sync_fetch_and_add_si((int *)(void *)(PTR),(int)(VAL)) \
+ : (__typeof__(*(PTR))) __sync_fetch_and_add_di((long *)(void *)(PTR),(long)(VAL)))
extern int __sync_fetch_and_sub_si (int *, int);
extern long __sync_fetch_and_sub_di (long *, long);
#define __sync_fetch_and_sub(PTR,VAL) \
((sizeof (*(PTR)) == sizeof(int)) \
- ? (__typeof__(*(PTR))) __sync_fetch_and_sub_si((int *)(PTR),(int)(VAL)) \
- : (__typeof__(*(PTR))) __sync_fetch_and_sub_di((long *)(PTR),(long)(VAL)))
+ ? (__typeof__(*(PTR))) __sync_fetch_and_sub_si((int *)(void *)(PTR),(int)(VAL)) \
+ : (__typeof__(*(PTR))) __sync_fetch_and_sub_di((long *)(void *)(PTR),(long)(VAL)))
extern int __sync_fetch_and_and_si (int *, int);
extern long __sync_fetch_and_and_di (long *, long);
#define __sync_fetch_and_and(PTR,VAL) \
((sizeof (*(PTR)) == sizeof(int)) \
- ? (__typeof__(*(PTR))) __sync_fetch_and_and_si((int *)(PTR),(int)(VAL)) \
- : (__typeof__(*(PTR))) __sync_fetch_and_and_di((long *)(PTR),(long)(VAL)))
+ ? (__typeof__(*(PTR))) __sync_fetch_and_and_si((int *)(void *)(PTR),(int)(VAL)) \
+ : (__typeof__(*(PTR))) __sync_fetch_and_and_di((long *)(void *)(PTR),(long)(VAL)))
extern int __sync_fetch_and_or_si (int *, int);
extern long __sync_fetch_and_or_di (long *, long);
#define __sync_fetch_and_or(PTR,VAL) \
((sizeof (*(PTR)) == sizeof(int)) \
- ? (__typeof__(*(PTR))) __sync_fetch_and_or_si((int *)(PTR),(int)(VAL)) \
- : (__typeof__(*(PTR))) __sync_fetch_and_or_di((long *)(PTR),(long)(VAL)))
+ ? (__typeof__(*(PTR))) __sync_fetch_and_or_si((int *)(void *)(PTR),(int)(VAL)) \
+ : (__typeof__(*(PTR))) __sync_fetch_and_or_di((long *)(void *)(PTR),(long)(VAL)))
extern int __sync_fetch_and_xor_si (int *, int);
extern long __sync_fetch_and_xor_di (long *, long);
#define __sync_fetch_and_xor(PTR,VAL) \
((sizeof (*(PTR)) == sizeof(int)) \
- ? (__typeof__(*(PTR))) __sync_fetch_and_xor_si((int *)(PTR),(int)(VAL)) \
- : (__typeof__(*(PTR))) __sync_fetch_and_xor_di((long *)(PTR),(long)(VAL)))
+ ? (__typeof__(*(PTR))) __sync_fetch_and_xor_si((int *)(void *)(PTR),(int)(VAL)) \
+ : (__typeof__(*(PTR))) __sync_fetch_and_xor_di((long *)(void *)(PTR),(long)(VAL)))
extern int __sync_fetch_and_nand_si (int *, int);
extern long __sync_fetch_and_nand_di (long *, long);
#define __sync_fetch_and_nand(PTR,VAL) \
((sizeof (*(PTR)) == sizeof(int)) \
- ? (__typeof__(*(PTR))) __sync_fetch_and_nand_si((int *)(PTR),(int)(VAL)) \
- : (__typeof__(*(PTR))) __sync_fetch_and_nand_di((long *)(PTR),(long)(VAL)))
+ ? (__typeof__(*(PTR))) __sync_fetch_and_nand_si((int *)(void *)(PTR),(int)(VAL)) \
+ : (__typeof__(*(PTR))) __sync_fetch_and_nand_di((long *)(void *)(PTR),(long)(VAL)))
extern int __sync_add_and_fetch_si (int *, int);
extern long __sync_add_and_fetch_di (long *, long);
#define __sync_add_and_fetch(PTR,VAL) \
((sizeof (*(PTR)) == sizeof(int)) \
- ? (__typeof__(*(PTR))) __sync_add_and_fetch_si((int *)(PTR),(int)(VAL)) \
- : (__typeof__(*(PTR))) __sync_add_and_fetch_di((long *)(PTR),(long)(VAL)))
+ ? (__typeof__(*(PTR))) __sync_add_and_fetch_si((int *)(void *)(PTR),(int)(VAL)) \
+ : (__typeof__(*(PTR))) __sync_add_and_fetch_di((long *)(void *)(PTR),(long)(VAL)))
extern int __sync_sub_and_fetch_si (int *, int);
extern long __sync_sub_and_fetch_di (long *, long);
#define __sync_sub_and_fetch(PTR,VAL) \
((sizeof (*(PTR)) == sizeof(int)) \
- ? (__typeof__(*(PTR))) __sync_sub_and_fetch_si((int *)(PTR),(int)(VAL)) \
- : (__typeof__(*(PTR))) __sync_sub_and_fetch_di((long *)(PTR),(long)(VAL)))
+ ? (__typeof__(*(PTR))) __sync_sub_and_fetch_si((int *)(void *)(PTR),(int)(VAL)) \
+ : (__typeof__(*(PTR))) __sync_sub_and_fetch_di((long *)(void *)(PTR),(long)(VAL)))
extern int __sync_and_and_fetch_si (int *, int);
extern long __sync_and_and_fetch_di (long *, long);
#define __sync_and_and_fetch(PTR,VAL) \
((sizeof (*(PTR)) == sizeof(int)) \
- ? (__typeof__(*(PTR))) __sync_and_and_fetch_si((int *)(PTR),(int)(VAL)) \
- : (__typeof__(*(PTR))) __sync_and_and_fetch_di((long *)(PTR),(long)(VAL)))
+ ? (__typeof__(*(PTR))) __sync_and_and_fetch_si((int *)(void *)(PTR),(int)(VAL)) \
+ : (__typeof__(*(PTR))) __sync_and_and_fetch_di((long *)(void *)(PTR),(long)(VAL)))
extern int __sync_or_and_fetch_si (int *, int);
extern long __sync_or_and_fetch_di (long *, long);
#define __sync_or_and_fetch(PTR,VAL) \
((sizeof (*(PTR)) == sizeof(int)) \
- ? (__typeof__(*(PTR))) __sync_or_and_fetch_si((int *)(PTR),(int)(VAL)) \
- : (__typeof__(*(PTR))) __sync_or_and_fetch_di((long *)(PTR),(long)(VAL)))
+ ? (__typeof__(*(PTR))) __sync_or_and_fetch_si((int *)(void *)(PTR),(int)(VAL)) \
+ : (__typeof__(*(PTR))) __sync_or_and_fetch_di((long *)(void *)(PTR),(long)(VAL)))
extern int __sync_xor_and_fetch_si (int *, int);
extern long __sync_xor_and_fetch_di (long *, long);
#define __sync_xor_and_fetch(PTR,VAL) \
((sizeof (*(PTR)) == sizeof(int)) \
- ? (__typeof__(*(PTR))) __sync_xor_and_fetch_si((int *)(PTR),(int)(VAL)) \
- : (__typeof__(*(PTR))) __sync_xor_and_fetch_di((long *)(PTR),(long)(VAL)))
+ ? (__typeof__(*(PTR))) __sync_xor_and_fetch_si((int *)(void *)(PTR),(int)(VAL)) \
+ : (__typeof__(*(PTR))) __sync_xor_and_fetch_di((long *)(void *)(PTR),(long)(VAL)))
extern int __sync_nand_and_fetch_si (int *, int);
extern long __sync_nand_and_fetch_di (long *, long);
#define __sync_nand_and_fetch(PTR,VAL) \
((sizeof (*(PTR)) == sizeof(int)) \
- ? (__typeof__(*(PTR))) __sync_nand_and_fetch_si((int *)(PTR),(int)(VAL)) \
- : (__typeof__(*(PTR))) __sync_nand_and_fetch_di((long *)(PTR),(long)(VAL)))
+ ? (__typeof__(*(PTR))) __sync_nand_and_fetch_si((int *)(void *)(PTR),(int)(VAL)) \
+ : (__typeof__(*(PTR))) __sync_nand_and_fetch_di((long *)(void *)(PTR),(long)(VAL)))
#ifdef __cplusplus
}

View File

@ -1,547 +0,0 @@
Index: boehm-gc/Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/boehm-gc/Makefile.am,v
retrieving revision 1.36.2.2
diff -u -p -a -r1.36.2.2 Makefile.am
--- boehm-gc/Makefile.am 24 Jan 2004 11:05:53 -0000 1.36.2.2
+++ boehm-gc/Makefile.am 30 Mar 2004 11:17:02 -0000
@@ -16,6 +16,7 @@ MULTISUBDIR =
MULTIDO = true
MULTICLEAN = true
+toolexeclib_LTLIBRARIES = libgc.la
noinst_LTLIBRARIES = libgcjgc.la libgcjgc_convenience.la
if POWERPC_DARWIN
@@ -38,13 +39,18 @@ mips_sgi_mach_dep.s mips_ultrix_mach_dep
rs6000_mach_dep.s sparc_mach_dep.S sparc_netbsd_mach_dep.s \
sparc_sunos4_mach_dep.s ia64_save_regs_in_stack.s
+libgc_la_SOURCES = $(GC_SOURCES)
libgcjgc_la_SOURCES = $(GC_SOURCES)
libgcjgc_convenience_la_SOURCES = $(GC_SOURCES)
+EXTRA_libgc_la_SOURCES = $(GC_SOURCES)
EXTRA_libgcjgc_la_SOURCES = $(EXTRA_GC_SOURCES)
EXTRA_libgcjgc_convenience_la_SOURCES = $(EXTRA_GC_SOURCES)
# Include THREADLIBS here to ensure that the correct versions of
# linuxthread semaphore functions get linked:
+libgc_la_LIBADD = @addobjs@ $(THREADLIBS)
+libgc_la_DEPENDENCIES = @addobjs@
+libgc_la_LDFLAGS = -version-info 1:1:0 -rpath $(toolexeclibdir)
libgcjgc_la_LIBADD = @addobjs@ $(THREADLIBS)
libgcjgc_la_DEPENDENCIES = @addobjs@
libgcjgc_la_LDFLAGS = -version-info 1:1:0 -rpath $(toolexeclibdir)
@@ -137,12 +143,12 @@ CONFIG_STATUS_DEPENDENCIES = $(srcdir)/c
.PHONY: all-multi mostlyclean-multi clean-multi distclean-multi \
maintainer-clean-multi
-all-am: all-multi
-install-am: install-multi
-mostlyclean-am: mostlyclean-multi
-clean-am: clean-multi
-distclean-am: distclean-multi
-maintainer-clean-am: maintainer-clean-multi
+all-recursive: all-multi
+install-recursive: install-multi
+mostlyclean-recursive: mostlyclean-multi
+clean-recursive: clean-multi
+distclean-recursive: distclean-multi
+maintainer-clean-recursive: maintainer-clean-multi
all-multi:
: $(MAKE) ; exec $(MULTIDO) $(AM_MAKEFLAGS) DO=all multi-do
Index: boehm-gc/Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/boehm-gc/Makefile.in,v
retrieving revision 1.40.2.3
diff -u -p -a -r1.40.2.3 Makefile.in
--- boehm-gc/Makefile.in 24 Jan 2004 11:05:54 -0000 1.40.2.3
+++ boehm-gc/Makefile.in 30 Mar 2004 11:17:02 -0000
@@ -1,4 +1,4 @@
-# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
+# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
@@ -113,33 +113,29 @@ MULTISUBDIR =
MULTIDO = true
MULTICLEAN = true
+toolexeclib_LTLIBRARIES = libgc.la
noinst_LTLIBRARIES = libgcjgc.la libgcjgc_convenience.la
-@POWERPC_DARWIN_TRUE@asm_libgc_sources = @POWERPC_DARWIN_TRUE@powerpc_darwin_mach_dep.s
+@POWERPC_DARWIN_TRUE@asm_libgc_sources = powerpc_darwin_mach_dep.s
@POWERPC_DARWIN_FALSE@asm_libgc_sources =
-GC_SOURCES = allchblk.c alloc.c blacklst.c checksums.c dbg_mlc.c \
-dyn_load.c finalize.c gc_dlopen.c gcj_mlc.c headers.c aix_irix_threads.c \
-malloc.c mallocx.c mark.c mark_rts.c misc.c new_hblk.c \
-obj_map.c os_dep.c pcr_interface.c ptr_chck.c real_malloc.c reclaim.c \
-solaris_pthreads.c solaris_threads.c specific.c stubborn.c typd_mlc.c \
-backgraph.c win32_threads.c \
-pthread_support.c pthread_stop_world.c darwin_stop_world.c \
-$(asm_libgc_sources)
+GC_SOURCES = allchblk.c alloc.c blacklst.c checksums.c dbg_mlc.c dyn_load.c finalize.c gc_dlopen.c gcj_mlc.c headers.c aix_irix_threads.c malloc.c mallocx.c mark.c mark_rts.c misc.c new_hblk.c obj_map.c os_dep.c pcr_interface.c ptr_chck.c real_malloc.c reclaim.c solaris_pthreads.c solaris_threads.c specific.c stubborn.c typd_mlc.c backgraph.c win32_threads.c pthread_support.c pthread_stop_world.c darwin_stop_world.c $(asm_libgc_sources)
-EXTRA_GC_SOURCES = alpha_mach_dep.S \
-mips_sgi_mach_dep.s mips_ultrix_mach_dep.s powerpc_darwin_mach_dep.s \
-rs6000_mach_dep.s sparc_mach_dep.S sparc_netbsd_mach_dep.s \
-sparc_sunos4_mach_dep.s ia64_save_regs_in_stack.s
+EXTRA_GC_SOURCES = alpha_mach_dep.S mips_sgi_mach_dep.s mips_ultrix_mach_dep.s powerpc_darwin_mach_dep.s rs6000_mach_dep.s sparc_mach_dep.S sparc_netbsd_mach_dep.s sparc_sunos4_mach_dep.s ia64_save_regs_in_stack.s
+libgc_la_SOURCES = $(GC_SOURCES)
libgcjgc_la_SOURCES = $(GC_SOURCES)
libgcjgc_convenience_la_SOURCES = $(GC_SOURCES)
+EXTRA_libgc_la_SOURCES = $(GC_SOURCES)
EXTRA_libgcjgc_la_SOURCES = $(EXTRA_GC_SOURCES)
EXTRA_libgcjgc_convenience_la_SOURCES = $(EXTRA_GC_SOURCES)
# Include THREADLIBS here to ensure that the correct versions of
# linuxthread semaphore functions get linked:
+libgc_la_LIBADD = @addobjs@ $(THREADLIBS)
+libgc_la_DEPENDENCIES = @addobjs@
+libgc_la_LDFLAGS = -version-info 1:1:0 -rpath $(toolexeclibdir)
libgcjgc_la_LIBADD = @addobjs@ $(THREADLIBS)
libgcjgc_la_DEPENDENCIES = @addobjs@
libgcjgc_la_LDFLAGS = -version-info 1:1:0 -rpath $(toolexeclibdir)
@@ -162,52 +158,14 @@ TESTS = gctest
all_objs = @addobjs@ $(libgcjgc_la_OBJECTS)
-LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) \
- $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CFLAGS) $(MY_CFLAGS) $(GC_CFLAGS)
+LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(MY_CFLAGS) $(GC_CFLAGS)
LINK = $(LIBTOOL) --mode=link $(CC) $(AM_CFLAGS) $(MY_CFLAGS) $(LDFLAGS) -o $@
# Work around what appears to be a GNU make bug handling MAKEFLAGS
# values defined in terms of make variables, as is the case for CC and
# friends when we are called from the top level Makefile.
-AM_MAKEFLAGS = \
- "AR_FLAGS=$(AR_FLAGS)" \
- "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
- "CFLAGS=$(CFLAGS)" \
- "CXXFLAGS=$(CXXFLAGS)" \
- "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
- "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
- "INSTALL=$(INSTALL)" \
- "INSTALL_DATA=$(INSTALL_DATA)" \
- "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
- "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
- "LDFLAGS=$(LDFLAGS)" \
- "LIBCFLAGS=$(LIBCFLAGS)" \
- "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
- "MAKE=$(MAKE)" \
- "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
- "PICFLAG=$(PICFLAG)" \
- "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
- "SHELL=$(SHELL)" \
- "EXPECT=$(EXPECT)" \
- "RUNTEST=$(RUNTEST)" \
- "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
- "exec_prefix=$(exec_prefix)" \
- "infodir=$(infodir)" \
- "libdir=$(libdir)" \
- "prefix=$(prefix)" \
- "tooldir=$(tooldir)" \
- "AR=$(AR)" \
- "AS=$(AS)" \
- "CC=$(CC)" \
- "CXX=$(CXX)" \
- "LD=$(LD)" \
- "LIBCFLAGS=$(LIBCFLAGS)" \
- "NM=$(NM)" \
- "PICFLAG=$(PICFLAG)" \
- "RANLIB=$(RANLIB)" \
- "DESTDIR=$(DESTDIR)"
+AM_MAKEFLAGS = "AR_FLAGS=$(AR_FLAGS)" "CC_FOR_BUILD=$(CC_FOR_BUILD)" "CFLAGS=$(CFLAGS)" "CXXFLAGS=$(CXXFLAGS)" "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" "INSTALL=$(INSTALL)" "INSTALL_DATA=$(INSTALL_DATA)" "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" "LDFLAGS=$(LDFLAGS)" "LIBCFLAGS=$(LIBCFLAGS)" "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" "MAKE=$(MAKE)" "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" "PICFLAG=$(PICFLAG)" "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" "SHELL=$(SHELL)" "EXPECT=$(EXPECT)" "RUNTEST=$(RUNTEST)" "RUNTESTFLAGS=$(RUNTESTFLAGS)" "exec_prefix=$(exec_prefix)" "infodir=$(infodir)" "libdir=$(libdir)" "prefix=$(prefix)" "tooldir=$(tooldir)" "AR=$(AR)" "AS=$(AS)" "CC=$(CC)" "CXX=$(CXX)" "LD=$(LD)" "LIBCFLAGS=$(LIBCFLAGS)" "NM=$(NM)" "PICFLAG=$(PICFLAG)" "RANLIB=$(RANLIB)" "DESTDIR=$(DESTDIR)"
CONFIG_STATUS_DEPENDENCIES = $(srcdir)/configure.host
@@ -215,13 +173,24 @@ CONFIG_STATUS_DEPENDENCIES = $(srcdir)/c
MAKEOVERRIDES =
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
CONFIG_CLEAN_FILES =
-LTLIBRARIES = $(noinst_LTLIBRARIES)
+LTLIBRARIES = $(noinst_LTLIBRARIES) $(toolexeclib_LTLIBRARIES)
DEFS = @DEFS@ -I. -I$(srcdir)
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
+@POWERPC_DARWIN_TRUE@libgcjgc_la_OBJECTS = allchblk.lo alloc.lo \
+@POWERPC_DARWIN_TRUE@blacklst.lo checksums.lo dbg_mlc.lo dyn_load.lo \
+@POWERPC_DARWIN_TRUE@finalize.lo gc_dlopen.lo gcj_mlc.lo headers.lo \
+@POWERPC_DARWIN_TRUE@aix_irix_threads.lo malloc.lo mallocx.lo mark.lo \
+@POWERPC_DARWIN_TRUE@mark_rts.lo misc.lo new_hblk.lo obj_map.lo \
+@POWERPC_DARWIN_TRUE@os_dep.lo pcr_interface.lo ptr_chck.lo \
+@POWERPC_DARWIN_TRUE@real_malloc.lo reclaim.lo solaris_pthreads.lo \
+@POWERPC_DARWIN_TRUE@solaris_threads.lo specific.lo stubborn.lo \
+@POWERPC_DARWIN_TRUE@typd_mlc.lo backgraph.lo win32_threads.lo \
+@POWERPC_DARWIN_TRUE@pthread_support.lo pthread_stop_world.lo \
+@POWERPC_DARWIN_TRUE@darwin_stop_world.lo powerpc_darwin_mach_dep.lo
@POWERPC_DARWIN_FALSE@libgcjgc_la_OBJECTS = allchblk.lo alloc.lo \
@POWERPC_DARWIN_FALSE@blacklst.lo checksums.lo dbg_mlc.lo dyn_load.lo \
@POWERPC_DARWIN_FALSE@finalize.lo gc_dlopen.lo gcj_mlc.lo headers.lo \
@@ -233,18 +202,18 @@ LIBS = @LIBS@
@POWERPC_DARWIN_FALSE@typd_mlc.lo backgraph.lo win32_threads.lo \
@POWERPC_DARWIN_FALSE@pthread_support.lo pthread_stop_world.lo \
@POWERPC_DARWIN_FALSE@darwin_stop_world.lo
-@POWERPC_DARWIN_TRUE@libgcjgc_la_OBJECTS = allchblk.lo alloc.lo \
-@POWERPC_DARWIN_TRUE@blacklst.lo checksums.lo dbg_mlc.lo dyn_load.lo \
-@POWERPC_DARWIN_TRUE@finalize.lo gc_dlopen.lo gcj_mlc.lo headers.lo \
-@POWERPC_DARWIN_TRUE@aix_irix_threads.lo malloc.lo mallocx.lo mark.lo \
-@POWERPC_DARWIN_TRUE@mark_rts.lo misc.lo new_hblk.lo obj_map.lo \
-@POWERPC_DARWIN_TRUE@os_dep.lo pcr_interface.lo ptr_chck.lo \
+libgcjgc_convenience_la_LDFLAGS =
+@POWERPC_DARWIN_TRUE@libgcjgc_convenience_la_OBJECTS = allchblk.lo \
+@POWERPC_DARWIN_TRUE@alloc.lo blacklst.lo checksums.lo dbg_mlc.lo \
+@POWERPC_DARWIN_TRUE@dyn_load.lo finalize.lo gc_dlopen.lo gcj_mlc.lo \
+@POWERPC_DARWIN_TRUE@headers.lo aix_irix_threads.lo malloc.lo \
+@POWERPC_DARWIN_TRUE@mallocx.lo mark.lo mark_rts.lo misc.lo new_hblk.lo \
+@POWERPC_DARWIN_TRUE@obj_map.lo os_dep.lo pcr_interface.lo ptr_chck.lo \
@POWERPC_DARWIN_TRUE@real_malloc.lo reclaim.lo solaris_pthreads.lo \
@POWERPC_DARWIN_TRUE@solaris_threads.lo specific.lo stubborn.lo \
@POWERPC_DARWIN_TRUE@typd_mlc.lo backgraph.lo win32_threads.lo \
@POWERPC_DARWIN_TRUE@pthread_support.lo pthread_stop_world.lo \
@POWERPC_DARWIN_TRUE@darwin_stop_world.lo powerpc_darwin_mach_dep.lo
-libgcjgc_convenience_la_LDFLAGS =
@POWERPC_DARWIN_FALSE@libgcjgc_convenience_la_OBJECTS = allchblk.lo \
@POWERPC_DARWIN_FALSE@alloc.lo blacklst.lo checksums.lo dbg_mlc.lo \
@POWERPC_DARWIN_FALSE@dyn_load.lo finalize.lo gc_dlopen.lo gcj_mlc.lo \
@@ -256,32 +225,43 @@ libgcjgc_convenience_la_LDFLAGS =
@POWERPC_DARWIN_FALSE@specific.lo stubborn.lo typd_mlc.lo backgraph.lo \
@POWERPC_DARWIN_FALSE@win32_threads.lo pthread_support.lo \
@POWERPC_DARWIN_FALSE@pthread_stop_world.lo darwin_stop_world.lo
-@POWERPC_DARWIN_TRUE@libgcjgc_convenience_la_OBJECTS = allchblk.lo \
-@POWERPC_DARWIN_TRUE@alloc.lo blacklst.lo checksums.lo dbg_mlc.lo \
-@POWERPC_DARWIN_TRUE@dyn_load.lo finalize.lo gc_dlopen.lo gcj_mlc.lo \
-@POWERPC_DARWIN_TRUE@headers.lo aix_irix_threads.lo malloc.lo \
-@POWERPC_DARWIN_TRUE@mallocx.lo mark.lo mark_rts.lo misc.lo new_hblk.lo \
-@POWERPC_DARWIN_TRUE@obj_map.lo os_dep.lo pcr_interface.lo ptr_chck.lo \
+@POWERPC_DARWIN_TRUE@libgc_la_OBJECTS = allchblk.lo alloc.lo \
+@POWERPC_DARWIN_TRUE@blacklst.lo checksums.lo dbg_mlc.lo dyn_load.lo \
+@POWERPC_DARWIN_TRUE@finalize.lo gc_dlopen.lo gcj_mlc.lo headers.lo \
+@POWERPC_DARWIN_TRUE@aix_irix_threads.lo malloc.lo mallocx.lo mark.lo \
+@POWERPC_DARWIN_TRUE@mark_rts.lo misc.lo new_hblk.lo obj_map.lo \
+@POWERPC_DARWIN_TRUE@os_dep.lo pcr_interface.lo ptr_chck.lo \
@POWERPC_DARWIN_TRUE@real_malloc.lo reclaim.lo solaris_pthreads.lo \
@POWERPC_DARWIN_TRUE@solaris_threads.lo specific.lo stubborn.lo \
@POWERPC_DARWIN_TRUE@typd_mlc.lo backgraph.lo win32_threads.lo \
@POWERPC_DARWIN_TRUE@pthread_support.lo pthread_stop_world.lo \
@POWERPC_DARWIN_TRUE@darwin_stop_world.lo powerpc_darwin_mach_dep.lo
+@POWERPC_DARWIN_FALSE@libgc_la_OBJECTS = allchblk.lo alloc.lo \
+@POWERPC_DARWIN_FALSE@blacklst.lo checksums.lo dbg_mlc.lo dyn_load.lo \
+@POWERPC_DARWIN_FALSE@finalize.lo gc_dlopen.lo gcj_mlc.lo headers.lo \
+@POWERPC_DARWIN_FALSE@aix_irix_threads.lo malloc.lo mallocx.lo mark.lo \
+@POWERPC_DARWIN_FALSE@mark_rts.lo misc.lo new_hblk.lo obj_map.lo \
+@POWERPC_DARWIN_FALSE@os_dep.lo pcr_interface.lo ptr_chck.lo \
+@POWERPC_DARWIN_FALSE@real_malloc.lo reclaim.lo solaris_pthreads.lo \
+@POWERPC_DARWIN_FALSE@solaris_threads.lo specific.lo stubborn.lo \
+@POWERPC_DARWIN_FALSE@typd_mlc.lo backgraph.lo win32_threads.lo \
+@POWERPC_DARWIN_FALSE@pthread_support.lo pthread_stop_world.lo \
+@POWERPC_DARWIN_FALSE@darwin_stop_world.lo
check_PROGRAMS = gctest$(EXEEXT)
gctest_DEPENDENCIES = ./libgcjgc.la
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
DIST_COMMON = ChangeLog Makefile.am Makefile.in acinclude.m4 aclocal.m4 \
config.guess config.sub configure configure.in install-sh ltconfig \
-ltmain.sh mkinstalldirs
+ltmain.sh missing mkinstalldirs
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = gtar
+TAR = tar
GZIP_ENV = --best
-SOURCES = $(libgcjgc_la_SOURCES) $(EXTRA_libgcjgc_la_SOURCES) $(libgcjgc_convenience_la_SOURCES) $(EXTRA_libgcjgc_convenience_la_SOURCES)
-OBJECTS = $(libgcjgc_la_OBJECTS) $(libgcjgc_convenience_la_OBJECTS)
+SOURCES = $(libgcjgc_la_SOURCES) $(EXTRA_libgcjgc_la_SOURCES) $(libgcjgc_convenience_la_SOURCES) $(EXTRA_libgcjgc_convenience_la_SOURCES) $(libgc_la_SOURCES) $(EXTRA_libgc_la_SOURCES)
+OBJECTS = $(libgcjgc_la_OBJECTS) $(libgcjgc_convenience_la_OBJECTS) $(libgc_la_OBJECTS)
all: all-redirect
.SUFFIXES:
@@ -310,6 +290,31 @@ distclean-noinstLTLIBRARIES:
maintainer-clean-noinstLTLIBRARIES:
+mostlyclean-toolexeclibLTLIBRARIES:
+
+clean-toolexeclibLTLIBRARIES:
+ -test -z "$(toolexeclib_LTLIBRARIES)" || rm -f $(toolexeclib_LTLIBRARIES)
+
+distclean-toolexeclibLTLIBRARIES:
+
+maintainer-clean-toolexeclibLTLIBRARIES:
+
+install-toolexeclibLTLIBRARIES: $(toolexeclib_LTLIBRARIES)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(DESTDIR)$(toolexeclibdir)
+ @list='$(toolexeclib_LTLIBRARIES)'; for p in $$list; do \
+ if test -f $$p; then \
+ echo "$(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(toolexeclibdir)/$$p"; \
+ $(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(toolexeclibdir)/$$p; \
+ else :; fi; \
+ done
+
+uninstall-toolexeclibLTLIBRARIES:
+ @$(NORMAL_UNINSTALL)
+ list='$(toolexeclib_LTLIBRARIES)'; for p in $$list; do \
+ $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(toolexeclibdir)/$$p; \
+ done
+
.c.o:
$(COMPILE) -c $<
@@ -357,6 +362,9 @@ libgcjgc.la: $(libgcjgc_la_OBJECTS) $(li
libgcjgc_convenience.la: $(libgcjgc_convenience_la_OBJECTS) $(libgcjgc_convenience_la_DEPENDENCIES)
$(LINK) $(libgcjgc_convenience_la_LDFLAGS) $(libgcjgc_convenience_la_OBJECTS) $(libgcjgc_convenience_la_LIBADD) $(LIBS)
+libgc.la: $(libgc_la_OBJECTS) $(libgc_la_DEPENDENCIES)
+ $(LINK) -rpath $(toolexeclibdir) $(libgc_la_LDFLAGS) $(libgc_la_OBJECTS) $(libgc_la_LIBADD) $(LIBS)
+
mostlyclean-checkPROGRAMS:
clean-checkPROGRAMS:
@@ -553,7 +561,7 @@ installcheck-am:
installcheck: installcheck-recursive
install-info-am:
install-info: install-info-recursive
-install-exec-am:
+install-exec-am: install-toolexeclibLTLIBRARIES
install-exec: install-exec-recursive
install-data-am:
@@ -562,7 +570,7 @@ install-data: install-data-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
install: install-recursive
-uninstall-am:
+uninstall-am: uninstall-toolexeclibLTLIBRARIES
uninstall: uninstall-recursive
all-am: Makefile $(LTLIBRARIES)
all-redirect: all-recursive
@@ -570,6 +578,7 @@ install-strip:
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
installdirs: installdirs-recursive
installdirs-am:
+ $(mkinstalldirs) $(DESTDIR)$(toolexeclibdir)
mostlyclean-generic:
@@ -581,19 +590,21 @@ distclean-generic:
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
-mostlyclean-am: mostlyclean-noinstLTLIBRARIES mostlyclean-compile \
+mostlyclean-am: mostlyclean-noinstLTLIBRARIES \
+ mostlyclean-toolexeclibLTLIBRARIES mostlyclean-compile \
mostlyclean-libtool mostlyclean-checkPROGRAMS \
mostlyclean-tags mostlyclean-generic
mostlyclean: mostlyclean-recursive
-clean-am: clean-noinstLTLIBRARIES clean-compile clean-libtool \
- clean-checkPROGRAMS clean-tags clean-generic \
- mostlyclean-am
+clean-am: clean-noinstLTLIBRARIES clean-toolexeclibLTLIBRARIES \
+ clean-compile clean-libtool clean-checkPROGRAMS \
+ clean-tags clean-generic mostlyclean-am
clean: clean-recursive
-distclean-am: distclean-noinstLTLIBRARIES distclean-compile \
+distclean-am: distclean-noinstLTLIBRARIES \
+ distclean-toolexeclibLTLIBRARIES distclean-compile \
distclean-libtool distclean-checkPROGRAMS \
distclean-tags distclean-generic clean-am
-rm -f libtool
@@ -602,6 +613,7 @@ distclean: distclean-recursive
-rm -f config.status
maintainer-clean-am: maintainer-clean-noinstLTLIBRARIES \
+ maintainer-clean-toolexeclibLTLIBRARIES \
maintainer-clean-compile maintainer-clean-libtool \
maintainer-clean-checkPROGRAMS maintainer-clean-tags \
maintainer-clean-generic distclean-am
@@ -613,6 +625,9 @@ maintainer-clean: maintainer-clean-recur
.PHONY: mostlyclean-noinstLTLIBRARIES distclean-noinstLTLIBRARIES \
clean-noinstLTLIBRARIES maintainer-clean-noinstLTLIBRARIES \
+mostlyclean-toolexeclibLTLIBRARIES distclean-toolexeclibLTLIBRARIES \
+clean-toolexeclibLTLIBRARIES maintainer-clean-toolexeclibLTLIBRARIES \
+uninstall-toolexeclibLTLIBRARIES install-toolexeclibLTLIBRARIES \
mostlyclean-compile distclean-compile clean-compile \
maintainer-clean-compile mostlyclean-libtool distclean-libtool \
clean-libtool maintainer-clean-libtool mostlyclean-checkPROGRAMS \
@@ -647,12 +662,12 @@ include/gc_mark.h @addincludes@
.PHONY: all-multi mostlyclean-multi clean-multi distclean-multi \
maintainer-clean-multi
-all-am: all-multi
-install-am: install-multi
-mostlyclean-am: mostlyclean-multi
-clean-am: clean-multi
-distclean-am: distclean-multi
-maintainer-clean-am: maintainer-clean-multi
+all-recursive: all-multi
+install-recursive: install-multi
+mostlyclean-recursive: mostlyclean-multi
+clean-recursive: clean-multi
+distclean-recursive: distclean-multi
+maintainer-clean-recursive: maintainer-clean-multi
all-multi:
: $(MAKE) ; exec $(MULTIDO) $(AM_MAKEFLAGS) DO=all multi-do
Index: boehm-gc/include/Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/boehm-gc/include/Makefile.am,v
retrieving revision 1.1.40.1
diff -u -p -a -r1.1.40.1 Makefile.am
--- boehm-gc/include/Makefile.am 12 Jan 2003 14:24:07 -0000 1.1.40.1
+++ boehm-gc/include/Makefile.am 30 Mar 2004 11:17:02 -0000
@@ -1,6 +1,6 @@
AUTOMAKE_OPTIONS = foreign
-noinst_HEADERS = gc.h gc_backptr.h gc_local_alloc.h \
+include_HEADERS = gc.h gc_backptr.h gc_config_macros.h gc_local_alloc.h \
gc_pthread_redirects.h gc_cpp.h
Index: boehm-gc/include/Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/boehm-gc/include/Makefile.in,v
retrieving revision 1.3.30.2
diff -u -p -a -r1.3.30.2 Makefile.in
--- boehm-gc/include/Makefile.in 24 Jan 2004 11:05:56 -0000 1.3.30.2
+++ boehm-gc/include/Makefile.in 30 Mar 2004 11:17:02 -0000
@@ -1,4 +1,4 @@
-# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
+# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
@@ -103,29 +103,43 @@ toolexeclibdir = @toolexeclibdir@
AUTOMAKE_OPTIONS = foreign
-noinst_HEADERS = gc.h gc_backptr.h gc_local_alloc.h \
- gc_pthread_redirects.h gc_cpp.h
+include_HEADERS = gc.h gc_backptr.h gc_config_macros.h gc_local_alloc.h gc_pthread_redirects.h gc_cpp.h
CONFIG_CLEAN_FILES =
-HEADERS = $(noinst_HEADERS)
+HEADERS = $(include_HEADERS)
DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = gtar
+TAR = tar
GZIP_ENV = --best
all: all-redirect
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
- cd $(top_srcdir) && $(AUTOMAKE) --cygnus include/Makefile
+ cd $(top_srcdir) && $(AUTOMAKE) --foreign include/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+install-includeHEADERS: $(include_HEADERS)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(DESTDIR)$(includedir)
+ @list='$(include_HEADERS)'; for p in $$list; do \
+ if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \
+ echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(includedir)/$$p"; \
+ $(INSTALL_DATA) $$d$$p $(DESTDIR)$(includedir)/$$p; \
+ done
+
+uninstall-includeHEADERS:
+ @$(NORMAL_UNINSTALL)
+ list='$(include_HEADERS)'; for p in $$list; do \
+ rm -f $(DESTDIR)$(includedir)/$$p; \
+ done
+
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP)
@@ -160,8 +174,13 @@ distdir = $(top_builddir)/$(PACKAGE)-$(V
subdir = include
distdir: $(DISTFILES)
+ here=`cd $(top_builddir) && pwd`; \
+ top_distdir=`cd $(top_distdir) && pwd`; \
+ distdir=`cd $(distdir) && pwd`; \
+ cd $(top_srcdir) \
+ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --foreign include/Makefile
@for file in $(DISTFILES); do \
- if test -f $$file; then d=.; else d=$(srcdir); fi; \
+ d=$(srcdir); \
if test -d $$d/$$file; then \
cp -pr $$d/$$file $(distdir)/$$file; \
else \
@@ -174,28 +193,27 @@ info-am:
info: info-am
dvi-am:
dvi: dvi-am
-check-am:
+check-am: all-am
check: check-am
installcheck-am:
installcheck: installcheck-am
-install-info-am:
-install-info: install-info-am
install-exec-am:
install-exec: install-exec-am
-install-data-am:
+install-data-am: install-includeHEADERS
install-data: install-data-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
install: install-am
-uninstall-am:
+uninstall-am: uninstall-includeHEADERS
uninstall: uninstall-am
all-am: Makefile $(HEADERS)
all-redirect: all-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
installdirs:
+ $(mkinstalldirs) $(DESTDIR)$(includedir)
mostlyclean-generic:
@@ -227,12 +245,12 @@ maintainer-clean-am: maintainer-clean-t
maintainer-clean: maintainer-clean-am
-.PHONY: tags mostlyclean-tags distclean-tags clean-tags \
-maintainer-clean-tags distdir info-am info dvi-am dvi check check-am \
-installcheck-am installcheck install-info-am install-info \
-install-exec-am install-exec install-data-am install-data install-am \
-install uninstall-am uninstall all-redirect all-am all installdirs \
-mostlyclean-generic distclean-generic clean-generic \
+.PHONY: uninstall-includeHEADERS install-includeHEADERS tags \
+mostlyclean-tags distclean-tags clean-tags maintainer-clean-tags \
+distdir info-am info dvi-am dvi check check-am installcheck-am \
+installcheck install-exec-am install-exec install-data-am install-data \
+install-am install uninstall-am uninstall all-redirect all-am all \
+installdirs mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean

View File

@ -1,11 +0,0 @@
--- gcc/collect2.c
+++ gcc/collect2.c 2007/12/10 12:45:07
@@ -1572,7 +1572,7 @@
if (redir)
{
/* Open response file. */
- redir_handle = open (redir, O_WRONLY | O_TRUNC | O_CREAT);
+ redir_handle = open (redir, O_WRONLY | O_TRUNC | O_CREAT, 0644);
/* Duplicate the stdout and stderr file handles
so they can be restored later. */

View File

@ -1,44 +0,0 @@
diff -ru gcc-3.3.2/gcc/config/rs6000/t-linux64bi /gcc-3.3.2/gcc/config/rs6000/t-linux64bi
--- gcc-3.3.2/gcc/config/rs6000/t-linux64bi 2004-02-11 20:41:25.000000000 +0000
+++ gcc-3.3.2/gcc/config/rs6000/t-linux64bi 2004-02-11 17:33:38.000000000 +0000
@@ -9,13 +9,12 @@
SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-ppc64.ver
-MULTILIB_OPTIONS = m64/m32 msoft-float
-MULTILIB_DIRNAMES = 64 32 nof
+MULTILIB_OPTIONS = m64/m32
+MULTILIB_DIRNAMES = 64 32
MULTILIB_EXTRA_OPTS = fPIC mstrict-align
-MULTILIB_EXCEPTIONS = m64/msoft-float
-MULTILIB_EXCLUSIONS = m64/!m32/msoft-float
-MULTILIB_OSDIRNAMES = ../lib64 ../lib nof
-MULTILIB_MATCHES = $(MULTILIB_MATCHES_FLOAT)
+MULTILIB_EXCEPTIONS =
+MULTILIB_EXCLUSIONS =
+MULTILIB_OSDIRNAMES = ../lib64 ../lib
# We want fine grained libraries, so use the new code to build the
# floating point emulation libraries.
diff -ru gcc-3.3.2/gcc/config/rs6000/t-linuxbi /gcc-3.3.2/gcc/config/rs6000/t-linuxbi
--- gcc-3.3.2/gcc/config/rs6000/t-linuxbi 2004-02-11 20:41:25.000000000 +0000
+++ gcc-3.3.2/gcc/config/rs6000/t-linuxbi 2004-02-11 11:15:51.000000000 +0000
@@ -9,13 +9,12 @@
SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-ppc64.ver
-MULTILIB_OPTIONS = m64/m32 msoft-float
-MULTILIB_DIRNAMES = 64 32 nof
+MULTILIB_OPTIONS = m64/m32
+MULTILIB_DIRNAMES = 64 32
MULTILIB_EXTRA_OPTS = fPIC mstrict-align
-MULTILIB_EXCEPTIONS = m64/msoft-float
-MULTILIB_EXCLUSIONS = m64/!m32/msoft-float
-MULTILIB_OSDIRNAMES = ../lib64 ../lib nof
-MULTILIB_MATCHES = $(MULTILIB_MATCHES_FLOAT)
+MULTILIB_EXCEPTIONS =
+MULTILIB_EXCLUSIONS =
+MULTILIB_OSDIRNAMES = ../lib64 ../lib
# We want fine grained libraries, so use the new code to build the
# floating point emulation libraries.

View File

@ -1,20 +0,0 @@
diff -ur gcc-3.3.2/gcc/config/rs6000/linux64.h gcc-3.3.2/gcc/config/rs6000/linux64.h
--- gcc-3.3.2/gcc/config/rs6000/linux64.h 2003-11-28 09:14:56.000000000 +0000
+++ gcc-3.3.2/gcc/config/rs6000/linux64.h 2003-11-28 08:56:36.000000000 +0000
@@ -398,12 +398,12 @@
#if !defined (CROSS_COMPILE) || defined (NATIVE_CROSS)
#if DEFAULT_ARCH64_P
#define STARTFILE_PREFIX_SPEC "\
- %{!m32: " STANDARD_STARTFILE_PREFIX "../lib64/ /lib64/ /usr/lib64/} \
- %{m32: " STANDARD_STARTFILE_PREFIX " /lib/ /usr/lib/}"
+ %{!m32: /lib64/ /usr/lib64/} \
+ %{m32: /lib/ /usr/lib/}"
#else
#define STARTFILE_PREFIX_SPEC "\
- %{!m64: " STANDARD_STARTFILE_PREFIX " /lib/ /usr/lib/} \
- %{m64: " STANDARD_STARTFILE_PREFIX "../lib64/ /lib64/ /usr/lib64/}"
+ %{!m64: /lib/ /usr/lib/} \
+ %{m64: /lib64/ /usr/lib64/}"
#endif
#endif

View File

@ -1,20 +0,0 @@
--- libstdc++-v3/include/bits/stl_tree.h.orig 2005-01-20 11:11:09.000000000 +0000
+++ libstdc++-v3/include/bits/stl_tree.h 2005-01-20 11:05:06.000000000 +0000
@@ -302,7 +302,7 @@ namespace std
__x->_M_parent = __y;
}
- void
+ inline void
_Rb_tree_rebalance(_Rb_tree_node_base* __x, _Rb_tree_node_base*& __root)
{
__x->_M_color = _M_red;
@@ -357,7 +357,7 @@ namespace std
__root->_M_color = _M_black;
}
- _Rb_tree_node_base*
+ inline _Rb_tree_node_base*
_Rb_tree_rebalance_for_erase(_Rb_tree_node_base* __z,
_Rb_tree_node_base*& __root,
_Rb_tree_node_base*& __leftmost,

View File

@ -1,45 +0,0 @@
Index: semantics.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/semantics.c,v
retrieving revision 1.282.2.13
diff -u -p -r1.282.2.13 semantics.c
--- gcc/cp/semantics.c 5 May 2004 13:05:50 -0000 1.282.2.13
+++ gcc/cp/semantics.c 1 Oct 2004 13:21:06 -0000
@@ -2455,6 +2455,18 @@ expand_or_defer_fn (fn)
if (flag_unit_at_a_time && cgraph_global_info_ready)
abort ();
+ /* If this function is marked with the constructor attribute, add it
+ to the list of functions to be called along with constructors
+ from static duration objects. */
+ if (DECL_STATIC_CONSTRUCTOR (fn))
+ static_ctors = tree_cons (NULL_TREE, fn, static_ctors);
+
+ /* If this function is marked with the destructor attribute, add it
+ to the list of functions to be called along with destructors from
+ static duration objects. */
+ if (DECL_STATIC_DESTRUCTOR (fn))
+ static_dtors = tree_cons (NULL_TREE, fn, static_dtors);
+
if (flag_unit_at_a_time && !cgraph_global_info_ready)
{
if (at_eof)
@@ -2673,18 +2685,6 @@ genrtl_finish_function (fn)
if (ctype && TREE_ASM_WRITTEN (fn))
note_debug_info_needed (ctype);
#endif
-
- /* If this function is marked with the constructor attribute, add it
- to the list of functions to be called along with constructors
- from static duration objects. */
- if (DECL_STATIC_CONSTRUCTOR (fn))
- static_ctors = tree_cons (NULL_TREE, fn, static_ctors);
-
- /* If this function is marked with the destructor attribute, add it
- to the list of functions to be called along with destructors from
- static duration objects. */
- if (DECL_STATIC_DESTRUCTOR (fn))
- static_dtors = tree_cons (NULL_TREE, fn, static_dtors);
--function_depth;

View File

@ -1,31 +0,0 @@
* alias.c (init_alias_analysis): Don't check for
prologue_epilogue_contains.
Index: alias.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/alias.c,v
retrieving revision 1.180.2.5
diff -c -3 -p -r1.180.2.5 alias.c
*** gcc/alias.c 14 Aug 2003 13:20:09 -0000 1.180.2.5
--- gcc/alias.c 21 Aug 2003 23:17:21 -0000
*************** init_alias_analysis ()
*** 2810,2815 ****
--- 2810,2816 ----
{
rtx note, set;
+ #if 0
#if defined (HAVE_prologue) || defined (HAVE_epilogue)
/* The prologue/epilogue insns are not threaded onto the
insn chain until after reload has completed. Thus,
*************** init_alias_analysis ()
*** 2818,2823 ****
--- 2819,2825 ----
if (reload_completed
&& prologue_epilogue_contains (insn))
continue;
+ #endif
#endif
/* If this insn has a noalias note, process it, Otherwise,

View File

@ -1,41 +0,0 @@
From nobody Fri Jun 18 12:05:46 2004
From: Jakub Jelinek <jakub@redhat.com>
Subject: [PATCH] Fix ia64 _Unwind_Backtrace
To: Jim Wilson <wilson@specifixinc.com>
Cc: gcc-patches@gcc.gnu.org
Date: Tue, 8 Jun 2004 08:19:45 +0200
Hi!
_Unwind_Backtrace on ia64 happily goes through a frame with IP 0 and might
crash later.
.save rp, r0
in _start is used to terminate the chain, so we should stop right there.
Without this patch, GCC assumes there is a leaf function without unwind info
at address 0.
I looked at libunwind and it special cases RP == 0 as well.
Ok for 3.3/3.4/HEAD?
2004-06-08 Jakub Jelinek <jakub@redhat.com>
* config/ia64/unwind-ia64.c (uw_frame_state_for): Don't assume a
leaf function without unwind info at RP 0.
--- gcc/config/ia64/unwind-ia64.c.jj 2004-04-01 18:43:56.000000000 +0200
+++ gcc/config/ia64/unwind-ia64.c 2004-06-08 10:26:50.673203249 +0200
@@ -1783,8 +1783,10 @@ uw_frame_state_for (struct _Unwind_Conte
an unwind table entry.
This can only happen in the frame after unwinding through a signal
- handler. Avoid infinite looping by requiring that B0 != RP. */
- if (context->br_loc[0] && *context->br_loc[0] != context->rp)
+ handler. Avoid infinite looping by requiring that B0 != RP.
+ RP == 0 terminates the chain. */
+ if (context->br_loc[0] && *context->br_loc[0] != context->rp
+ && context->rp != 0)
{
fs->curr.reg[UNW_REG_RP].where = UNW_WHERE_BR;
fs->curr.reg[UNW_REG_RP].when = -1;
Jakub

View File

@ -1,276 +0,0 @@
--- i386.ld
+++ i386.ld
@@ -1,116 +1,164 @@
-/* ld script to make i386 Linux kernel
- * Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz>;
- */
-OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
+/* Default linker script, for normal executables */
+OUTPUT_FORMAT("elf32-i386", "elf32-i386",
+ "elf32-i386")
OUTPUT_ARCH(i386)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/alpha-unknown-linux-gnu/lib);
ENTRY(_start)
+SEARCH_DIR("/usr/i586-suse-linux/lib"); SEARCH_DIR("/usr/local/lib"); SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib");
SECTIONS
{
/* Read-only sections, merged into text segment: */
- . = 0x60000000 + SIZEOF_HEADERS;
- .interp : { *(.interp) }
- .hash : { *(.hash) }
- .dynsym : { *(.dynsym) }
- .dynstr : { *(.dynstr) }
- .gnu.version : { *(.gnu.version) }
- .gnu.version_d : { *(.gnu.version_d) }
- .gnu.version_r : { *(.gnu.version_r) }
- .rel.text :
- { *(.rel.text) *(.rel.gnu.linkonce.t*) }
- .rela.text :
- { *(.rela.text) *(.rela.gnu.linkonce.t*) }
- .rel.data :
- { *(.rel.data) *(.rel.gnu.linkonce.d*) }
- .rela.data :
- { *(.rela.data) *(.rela.gnu.linkonce.d*) }
- .rel.rodata :
- { *(.rel.rodata) *(.rel.gnu.linkonce.r*) }
- .rela.rodata :
- { *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
- .rel.got : { *(.rel.got) }
- .rela.got : { *(.rela.got) }
- .rel.ctors : { *(.rel.ctors) }
- .rela.ctors : { *(.rela.ctors) }
- .rel.dtors : { *(.rel.dtors) }
- .rela.dtors : { *(.rela.dtors) }
- .rel.init : { *(.rel.init) }
- .rela.init : { *(.rela.init) }
- .rel.fini : { *(.rel.fini) }
- .rela.fini : { *(.rela.fini) }
- .rel.bss : { *(.rel.bss) }
- .rela.bss : { *(.rela.bss) }
- .rel.plt : { *(.rel.plt) }
- .rela.plt : { *(.rela.plt) }
- .init : { *(.init) } =0x47ff041f
- .text :
+ PROVIDE (__executable_start = 0x60000000); . = 0x60000000 + SIZEOF_HEADERS;
+ .interp : { *(.interp) }
+ .hash : { *(.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.init : { *(.rel.init) }
+ .rela.init : { *(.rela.init) }
+ .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
+ .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
+ .rel.fini : { *(.rel.fini) }
+ .rela.fini : { *(.rela.fini) }
+ .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
+ .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
+ .rel.data.rel.ro : { *(.rel.data.rel.ro*) }
+ .rela.data.rel.ro : { *(.rel.data.rel.ro*) }
+ .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
+ .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
+ .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
+ .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
+ .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
+ .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
+ .rel.ctors : { *(.rel.ctors) }
+ .rela.ctors : { *(.rela.ctors) }
+ .rel.dtors : { *(.rel.dtors) }
+ .rela.dtors : { *(.rela.dtors) }
+ .rel.got : { *(.rel.got) }
+ .rela.got : { *(.rela.got) }
+ .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
+ .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
+ .rel.plt : { *(.rel.plt) }
+ .rela.plt : { *(.rela.plt) }
+ .init :
{
- *(.text)
+ KEEP (*(.init))
+ } =0x90909090
+ .plt : { *(.plt) }
+ .text :
+ {
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ KEEP (*(.text.*personality*))
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
- *(.gnu.linkonce.t*)
- } =0x47ff041f
- _etext = .;
+ } =0x90909090
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0x90909090
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
PROVIDE (etext = .);
- .fini : { *(.fini) } =0x47ff041f
- . = ALIGN(32 / 8);
- PROVIDE (__preinit_array_start = .);
- .preinit_array : { *(.preinit_array) }
- PROVIDE (__preinit_array_end = .);
- PROVIDE (__init_array_start = .);
- .init_array : { *(.init_array) }
- PROVIDE (__init_array_end = .);
- PROVIDE (__fini_array_start = .);
- .fini_array : { *(.fini_array) }
- PROVIDE (__fini_array_end = .);
- .rodata : { *(.rodata) *(.gnu.linkonce.r*) }
- .rodata1 : { *(.rodata1) }
- .reginfo : { *(.reginfo) }
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
/* Adjust the address for the data segment. We want to adjust up to
the same address within the page on the next page up. */
- . = ALIGN(0x100000) + (. & (0x100000 - 1));
- .data :
+ . = ALIGN (0x1000) - ((0x1000 - .) & (0x1000 - 1)); . = DATA_SEGMENT_ALIGN (0x1000, 0x1000);
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin*.o(.ctors))
+ /* We don't want to include the .ctor section from
+ from the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin*.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local) *(.data.rel.ro*) }
+ .dynamic : { *(.dynamic) }
+ .got : { *(.got) }
+ . = DATA_SEGMENT_RELRO_END (12, .);
+ .got.plt : { *(.got.plt) }
+ .data :
{
- *(.data)
- *(.gnu.linkonce.d*)
- CONSTRUCTORS
- }
- .data1 : { *(.data1) }
- .ctors :
- {
- *(.ctors)
- }
- .dtors :
- {
- *(.dtors)
- }
- .plt : { *(.plt) }
- .got : { *(.got.plt) *(.got) }
- .dynamic : { *(.dynamic) }
- /* We want the small data sections together, so single-instruction offsets
- can access them all, and initialized data all before uninitialized, so
- we can shorten the on-disk segment size. */
- .sdata : { *(.sdata) }
- _edata = .;
- PROVIDE (edata = .);
+ *(.data .data.* .gnu.linkonce.d.*)
+ KEEP (*(.gnu.linkonce.d.*personality*))
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ _edata = .; PROVIDE (edata = .);
__bss_start = .;
- .sbss : { *(.sbss) *(.scommon) }
- .bss :
+ .bss :
{
*(.dynbss)
- *(.bss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
*(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
}
- _end = . ;
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .;
PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
/* Stabs debugging sections. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
+ .comment 0 : { *(.comment) }
/* DWARF debug sections.
Symbols in the DWARF debugging sections are relative to the beginning
of the section so we begin them at 0. */
@@ -124,7 +172,7 @@
.debug_aranges 0 : { *(.debug_aranges) }
.debug_pubnames 0 : { *(.debug_pubnames) }
/* DWARF 2 */
- .debug_info 0 : { *(.debug_info) }
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) }
.debug_frame 0 : { *(.debug_frame) }
@@ -136,5 +184,5 @@
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
- /* These must appear regardless of . */
+ /DISCARD/ : { *(.note.GNU-stack) }
}

View File

@ -1,83 +0,0 @@
--- linux-user/main.c
+++ linux-user/main.c
@@ -377,19 +377,55 @@
{
TaskState *ts = env->opaque;
uint32_t opcode;
+ int rc;
/* we handle the FPU emulation here, as Linux */
/* we get the opcode */
/* FIXME - what to do if get_user() fails? */
get_user_u32(opcode, env->regs[15]);
- if (EmulateAll(opcode, &ts->fpa, env) == 0) {
+ if ((rc=EmulateAll(opcode, &ts->fpa, env)) == 0) {
info.si_signo = SIGILL;
info.si_errno = 0;
info.si_code = TARGET_ILL_ILLOPN;
info._sifields._sigfault._addr = env->regs[15];
queue_signal(info.si_signo, &info);
- } else {
+ } else if (rc < 0) { /* FP exception */
+ int arm_fpe=0;
+ /* translate softfloat flags to FPSR flags */
+ if(-rc & float_flag_invalid) arm_fpe |= BIT_IOC;
+ if(-rc & float_flag_divbyzero) arm_fpe |= BIT_DZC;
+ if(-rc & float_flag_overflow) arm_fpe |= BIT_OFC;
+ if(-rc & float_flag_underflow) arm_fpe |= BIT_UFC;
+ if(-rc & float_flag_inexact) arm_fpe |= BIT_IXC;
+
+ FPSR fpsr = ts->fpa.fpsr;
+ //printf("fpsr 0x%x, arm_fpe 0x%x\n",fpsr,arm_fpe);
+
+ if(fpsr & (arm_fpe << 16)) /* exception enabled? */
+ {
+ info.si_signo = SIGFPE;
+ info.si_errno = 0;
+ /* ordered by priority, least first */
+ if(arm_fpe & BIT_IXC) info.si_code = TARGET_FPE_FLTRES;
+ if(arm_fpe & BIT_UFC) info.si_code = TARGET_FPE_FLTUND;
+ if(arm_fpe & BIT_OFC) info.si_code = TARGET_FPE_FLTOVF;
+ if(arm_fpe & BIT_DZC) info.si_code = TARGET_FPE_FLTDIV;
+ if(arm_fpe & BIT_IOC) info.si_code = TARGET_FPE_FLTINV;
+ info._sifields._sigfault._addr = env->regs[15];
+ queue_signal(info.si_signo, &info);
+ }
+ else
+ env->regs[15] += 4;
+
+ /* accumulate unenabled exceptions */
+ if((!(fpsr & BIT_IXE)) && (arm_fpe & BIT_IXC)) fpsr |= BIT_IXC;
+ if((!(fpsr & BIT_UFE)) && (arm_fpe & BIT_UFC)) fpsr |= BIT_UFC;
+ if((!(fpsr & BIT_OFE)) && (arm_fpe & BIT_OFC)) fpsr |= BIT_OFC;
+ if((!(fpsr & BIT_DZE)) && (arm_fpe & BIT_DZC)) fpsr |= BIT_DZC;
+ if((!(fpsr & BIT_IOE)) && (arm_fpe & BIT_IOC)) fpsr |= BIT_IOC;
+ ts->fpa.fpsr=fpsr;
+ } else { /* everything OK */
/* increment PC */
env->regs[15] += 4;
}
--- target-arm/nwfpe/fpa11.c
+++ target-arm/nwfpe/fpa11.c
@@ -162,6 +162,8 @@
fpa11->initflag = 1;
}
+ set_float_exception_flags(0, &fpa11->fp_status);
+
if (TEST_OPCODE(opcode,MASK_CPRT))
{
//fprintf(stderr,"emulating CPRT\n");
@@ -191,6 +193,11 @@
}
// restore_flags(flags);
+ if(nRc == 1 && get_float_exception_flags(&fpa11->fp_status))
+ {
+ //printf("fef 0x%x\n",float_exception_flags);
+ nRc=-get_float_exception_flags(&fpa11->fp_status);
+ }
//printf("returning %d\n",nRc);
return(nRc);

View File

@ -1,904 +0,0 @@
2007-02-17 Gwenole Beauchesne <gbeauchesne@mandriva.com>
* target-i386/op.c (op_imull_EAX_T0, op_imulw_T0_T1,
op_imull_T0_T1): Add FORCE_RET() since CC_SRC involves a
compare-branch that may be optimized into a beqlr on ppc.
2005-06-02 Gwenole Beauchesne <gbeauchesne@mandriva.com>
* dyngen.c (trace_i386_insn): Fix push/imul case with 8-bit
immediate.
2005-05-11 Paul Brook <paul@codesourcery.com>
* gcc4 host support.
================================================================================
--- qemu/dyngen-exec.h
+++ qemu/dyngen-exec.h
@@ -194,7 +194,12 @@
#endif
/* force GCC to generate only one epilog at the end of the function */
+#if defined(__i386__) || defined(__x86_64__)
+/* Also add 4 bytes of padding so that we can replace the ret with a jmp. */
+#define FORCE_RET() __asm__ __volatile__("nop;nop;nop;nop" : : : "memory");
+#else
#define FORCE_RET() __asm__ __volatile__("" : : : "memory");
+#endif
#ifndef OPPROTO
#define OPPROTO
@@ -244,11 +249,18 @@
#endif
#if defined(__i386__)
-#define EXIT_TB() asm volatile ("ret")
-#define GOTO_LABEL_PARAM(n) asm volatile ("jmp " ASM_NAME(__op_gen_label) #n)
+/* Dyngen will replace hlt instructions with a ret instruction. Inserting a
+ ret directly would confuse dyngen. */
+#define EXIT_TB() asm volatile ("hlt")
+/* Dyngen will replace cli with 0x9e (jmp).
+ We generate the offset manually. */
+#define GOTO_LABEL_PARAM(n) \
+ asm volatile ("cli;.long " ASM_NAME(__op_gen_label) #n " - 1f;1:")
#elif defined(__x86_64__)
-#define EXIT_TB() asm volatile ("ret")
-#define GOTO_LABEL_PARAM(n) asm volatile ("jmp " ASM_NAME(__op_gen_label) #n)
+/* The same as i386. */
+#define EXIT_TB() asm volatile ("hlt")
+#define GOTO_LABEL_PARAM(n) \
+ asm volatile ("cli;.long " ASM_NAME(__op_gen_label) #n " - 1f;1:")
#elif defined(__powerpc__)
#define EXIT_TB() asm volatile ("blr")
#define GOTO_LABEL_PARAM(n) asm volatile ("b " ASM_NAME(__op_gen_label) #n)
--- qemu/dyngen.c
+++ qemu/dyngen.c
@@ -32,6 +32,8 @@
#include "config-host.h"
+//#define DEBUG_OP
+
/* NOTE: we test CONFIG_WIN32 instead of _WIN32 to enabled cross
compilation */
#if defined(CONFIG_WIN32)
@@ -1429,6 +1431,644 @@
#endif
+#if defined(HOST_I386) || defined(HOST_X86_64)
+
+/* This byte is the first byte of an instruction. */
+#define FLAG_INSN (1 << 0)
+/* This byte has been processed as part of an instruction. */
+#define FLAG_SCANNED (1 << 1)
+/* This instruction is a return instruction. Gcc cometimes generates prefix
+ bytes, so may be more than one byte long. */
+#define FLAG_RET (1 << 2)
+/* This is either the target of a jump, or the preceeding instruction uses
+ a pc-relative offset. */
+#define FLAG_TARGET (1 << 3)
+/* This is a magic instruction that needs fixing up. */
+#define FLAG_EXIT (1 << 4)
+#define MAX_EXITS 5
+
+static void
+bad_opcode(const char *name, uint32_t op)
+{
+ error("Unsupported opcode %0*x in %s", (op > 0xff) ? 4 : 2, op, name);
+}
+
+/* Mark len bytes as scanned, Returns insn_size + len. Reports an error
+ if these bytes have already been scanned. */
+static int
+eat_bytes(const char *name, char *flags, int insn, int insn_size, int len)
+{
+ while (len > 0) {
+ /* This should never occur in sane code. */
+ if (flags[insn + insn_size] & FLAG_SCANNED)
+ error ("Overlapping instructions in %s", name);
+ flags[insn + insn_size] |= FLAG_SCANNED;
+ insn_size++;
+ len--;
+ }
+ return insn_size;
+}
+
+static void
+trace_i386_insn (const char *name, uint8_t *start_p, char *flags, int insn,
+ int len)
+{
+ uint8_t *ptr;
+ uint8_t op;
+ int modrm;
+ int is_prefix;
+ int op_size;
+ int addr_size;
+ int insn_size;
+ int is_ret;
+ int is_condjmp;
+ int is_jmp;
+ int is_exit;
+ int is_pcrel;
+ int immed;
+ int seen_rexw;
+ int32_t disp;
+
+ ptr = start_p + insn;
+ /* nonzero if this insn has a ModR/M byte. */
+ modrm = 1;
+ /* The size of the immediate value in this instruction. */
+ immed = 0;
+ /* The operand size. */
+ op_size = 4;
+ /* The address size */
+ addr_size = 4;
+ /* The total length of this instruction. */
+ insn_size = 0;
+ is_prefix = 1;
+ is_ret = 0;
+ is_condjmp = 0;
+ is_jmp = 0;
+ is_exit = 0;
+ seen_rexw = 0;
+ is_pcrel = 0;
+
+ while (is_prefix) {
+ op = ptr[insn_size];
+ insn_size = eat_bytes(name, flags, insn, insn_size, 1);
+ is_prefix = 0;
+ switch (op >> 4) {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ if (op == 0x0f) {
+ /* two-byte opcode. */
+ op = ptr[insn_size];
+ insn_size = eat_bytes(name, flags, insn, insn_size, 1);
+ switch (op >> 4) {
+ case 0:
+ if ((op & 0xf) > 3)
+ modrm = 0;
+ break;
+ case 1: /* vector move or prefetch */
+ case 2: /* various moves and vector compares. */
+ case 4: /* cmov */
+ case 5: /* vector instructions */
+ case 6:
+ case 13:
+ case 14:
+ case 15:
+ break;
+ case 7: /* mmx */
+ if (op & 0x77) /* emms */
+ modrm = 0;
+ break;
+ case 3: /* wrmsr, rdtsc, rdmsr, rdpmc, sysenter, sysexit */
+ modrm = 0;
+ break;
+ case 8: /* long conditional jump */
+ is_condjmp = 1;
+ immed = op_size;
+ modrm = 0;
+ break;
+ case 9: /* setcc */
+ break;
+ case 10:
+ switch (op & 0x7) {
+ case 0: /* push fs/gs */
+ case 1: /* pop fs/gs */
+ case 2: /* cpuid/rsm */
+ modrm = 0;
+ break;
+ case 4: /* shld/shrd immediate */
+ immed = 1;
+ break;
+ default: /* Normal instructions with a ModR/M byte. */
+ break;
+ }
+ break;
+ case 11:
+ switch (op & 0xf) {
+ case 10: /* bt, bts, btr, btc */
+ immed = 1;
+ break;
+ default:
+ /* cmpxchg, lss, btr, lfs, lgs, movzx, btc, bsf, bsr
+ undefined, and movsx */
+ break;
+ }
+ break;
+ case 12:
+ if (op & 8) {
+ /* bswap */
+ modrm = 0;
+ } else {
+ switch (op & 0x7) {
+ case 2:
+ case 4:
+ case 5:
+ case 6:
+ immed = 1;
+ break;
+ default:
+ break;
+ }
+ }
+ break;
+ }
+ } else if ((op & 0x07) <= 0x3) {
+ /* General arithmentic ax. */
+ } else if ((op & 0x07) <= 0x5) {
+ /* General arithmetic ax, immediate. */
+ if (op & 0x01)
+ immed = op_size;
+ else
+ immed = 1;
+ modrm = 0;
+ } else if ((op & 0x23) == 0x22) {
+ /* Segment prefix. */
+ is_prefix = 1;
+ } else {
+ /* Segment register push/pop or DAA/AAA/DAS/AAS. */
+ modrm = 0;
+ }
+ break;
+
+#if defined(HOST_X86_64)
+ case 4: /* rex prefix. */
+ is_prefix = 1;
+ /* The address/operand size is actually 64-bit, but the immediate
+ values in the instruction are still 32-bit. */
+ op_size = 4;
+ addr_size = 4;
+ if (op & 8)
+ seen_rexw = 1;
+ break;
+#else
+ case 4: /* inc/dec register. */
+#endif
+ case 5: /* push/pop general register. */
+ modrm = 0;
+ break;
+
+ case 6:
+ switch (op & 0x0f) {
+ case 0: /* pusha */
+ case 1: /* popa */
+ modrm = 0;
+ break;
+ case 2: /* bound */
+ case 3: /* arpl */
+ break;
+ case 4: /* FS */
+ case 5: /* GS */
+ is_prefix = 1;
+ break;
+ case 6: /* opcode size prefix. */
+ op_size = 2;
+ is_prefix = 1;
+ break;
+ case 7: /* Address size prefix. */
+ addr_size = 2;
+ is_prefix = 1;
+ break;
+ case 8: /* push immediate */
+ immed = op_size;
+ modrm = 0;
+ break;
+ case 10: /* push 8-bit immediate */
+ immed = 1;
+ modrm = 0;
+ break;
+ case 9: /* imul immediate */
+ immed = op_size;
+ break;
+ case 11: /* imul 8-bit immediate */
+ immed = 1;
+ break;
+ case 12: /* insb */
+ case 13: /* insw */
+ case 14: /* outsb */
+ case 15: /* outsw */
+ modrm = 0;
+ break;
+ }
+ break;
+
+ case 7: /* Short conditional jump. */
+ is_condjmp = 1;
+ immed = 1;
+ modrm = 0;
+ break;
+
+ case 8:
+ if ((op & 0xf) <= 3) {
+ /* arithmetic immediate. */
+ if ((op & 3) == 1)
+ immed = op_size;
+ else
+ immed = 1;
+ }
+ /* else test, xchg, mov, lea or pop general. */
+ break;
+
+ case 9:
+ /* Various single-byte opcodes with no modrm byte. */
+ modrm = 0;
+ if (op == 10) {
+ /* Call */
+ immed = 4;
+ }
+ break;
+
+ case 10:
+ switch ((op & 0xe) >> 1) {
+ case 0: /* mov absoliute immediate. */
+ case 1:
+ if (seen_rexw)
+ immed = 8;
+ else
+ immed = addr_size;
+ break;
+ case 4: /* test immediate. */
+ if (op & 1)
+ immed = op_size;
+ else
+ immed = 1;
+ break;
+ default: /* Various string ops. */
+ break;
+ }
+ modrm = 0;
+ break;
+
+ case 11: /* move immediate to register */
+ if (op & 8) {
+ if (seen_rexw)
+ immed = 8;
+ else
+ immed = op_size;
+ } else {
+ immed = 1;
+ }
+ modrm = 0;
+ break;
+
+ case 12:
+ switch (op & 0xf) {
+ case 0: /* shift immediate */
+ case 1:
+ immed = 1;
+ break;
+ case 2: /* ret immediate */
+ immed = 2;
+ modrm = 0;
+ bad_opcode(name, op);
+ break;
+ case 3: /* ret */
+ modrm = 0;
+ is_ret = 1;
+ case 4: /* les */
+ case 5: /* lds */
+ break;
+ case 6: /* mov immediate byte */
+ immed = 1;
+ break;
+ case 7: /* mov immediate */
+ immed = op_size;
+ break;
+ case 8: /* enter */
+ /* TODO: Is this right? */
+ immed = 3;
+ modrm = 0;
+ break;
+ case 10: /* retf immediate */
+ immed = 2;
+ modrm = 0;
+ bad_opcode(name, op);
+ break;
+ case 13: /* int */
+ immed = 1;
+ modrm = 0;
+ break;
+ case 11: /* retf */
+ case 15: /* iret */
+ modrm = 0;
+ bad_opcode(name, op);
+ break;
+ default: /* leave, int3 or into */
+ modrm = 0;
+ break;
+ }
+ break;
+
+ case 13:
+ if ((op & 0xf) >= 8) {
+ /* Coprocessor escape. For our purposes this is just a normal
+ instruction with a ModR/M byte. */
+ } else if ((op & 0xf) >= 4) {
+ /* AAM, AAD or XLAT */
+ modrm = 0;
+ }
+ /* else shift instruction */
+ break;
+
+ case 14:
+ switch ((op & 0xc) >> 2) {
+ case 0: /* loop or jcxz */
+ is_condjmp = 1;
+ immed = 1;
+ break;
+ case 1: /* in/out immed */
+ immed = 1;
+ break;
+ case 2: /* call or jmp */
+ switch (op & 3) {
+ case 0: /* call */
+ immed = op_size;
+ break;
+ case 1: /* long jump */
+ immed = 4;
+ is_jmp = 1;
+ break;
+ case 2: /* far jmp */
+ bad_opcode(name, op);
+ break;
+ case 3: /* short jmp */
+ immed = 1;
+ is_jmp = 1;
+ break;
+ }
+ break;
+ case 3: /* in/out register */
+ break;
+ }
+ modrm = 0;
+ break;
+
+ case 15:
+ switch ((op & 0xe) >> 1) {
+ case 0:
+ case 1:
+ is_prefix = 1;
+ break;
+ case 2:
+ case 4:
+ case 5:
+ case 6:
+ modrm = 0;
+ /* Some privileged insns are used as markers. */
+ switch (op) {
+ case 0xf4: /* hlt: Exit translation block. */
+ is_exit = 1;
+ break;
+ case 0xfa: /* cli: Jump to label. */
+ is_exit = 1;
+ immed = 4;
+ break;
+ case 0xfb: /* sti: TB patch jump. */
+ /* Mark the insn for patching, but continue sscanning. */
+ flags[insn] |= FLAG_EXIT;
+ immed = 4;
+ break;
+ }
+ break;
+ case 3: /* unary grp3 */
+ if ((ptr[insn_size] & 0x38) == 0) {
+ if (op == 0xf7)
+ immed = op_size;
+ else
+ immed = 1; /* test immediate */
+ }
+ break;
+ case 7: /* inc/dec grp4/5 */
+ /* TODO: This includes indirect jumps. We should fail if we
+ encounter one of these. */
+ break;
+ }
+ break;
+ }
+ }
+
+ if (modrm) {
+ if (addr_size != 4)
+ error("16-bit addressing mode used in %s", name);
+
+ disp = 0;
+ modrm = ptr[insn_size];
+ insn_size = eat_bytes(name, flags, insn, insn_size, 1);
+ modrm &= 0xc7;
+ switch ((modrm & 0xc0) >> 6) {
+ case 0:
+ if (modrm == 5)
+ disp = 4;
+ break;
+ case 1:
+ disp = 1;
+ break;
+ case 2:
+ disp = 4;
+ break;
+ }
+ if ((modrm & 0xc0) != 0xc0 && (modrm & 0x7) == 4) {
+ /* SIB byte */
+ if (modrm == 4 && (ptr[insn_size] & 0x7) == 5) {
+ disp = 4;
+ is_pcrel = 1;
+ }
+ insn_size = eat_bytes(name, flags, insn, insn_size, 1);
+ }
+ insn_size = eat_bytes(name, flags, insn, insn_size, disp);
+ }
+ insn_size = eat_bytes(name, flags, insn, insn_size, immed);
+ if (is_condjmp || is_jmp) {
+ if (immed == 1) {
+ disp = (int8_t)*(ptr + insn_size - 1);
+ } else {
+ disp = (((int32_t)*(ptr + insn_size - 1)) << 24)
+ | (((int32_t)*(ptr + insn_size - 2)) << 16)
+ | (((int32_t)*(ptr + insn_size - 3)) << 8)
+ | *(ptr + insn_size - 4);
+ }
+ disp += insn_size;
+ /* Jumps to external symbols point to the address of the offset
+ before relocation. */
+ /* ??? These are probably a tailcall. We could fix them up by
+ replacing them with jmp to EOB + call, but it's easier to just
+ prevent the compiler generating them. */
+ if (disp == 1)
+ error("Unconditional jump (sibcall?) in %s", name);
+ disp += insn;
+ if (disp < 0 || disp > len)
+ error("Jump outside instruction in %s", name);
+
+ if ((flags[disp] & (FLAG_INSN | FLAG_SCANNED)) == FLAG_SCANNED)
+ error("Overlapping instructions in %s", name);
+
+ flags[disp] |= (FLAG_INSN | FLAG_TARGET);
+ is_pcrel = 1;
+ }
+ if (is_pcrel) {
+ /* Mark the following insn as a jump target. This will stop
+ this instruction being moved. */
+ flags[insn + insn_size] |= FLAG_TARGET;
+ }
+ if (is_ret)
+ flags[insn] |= FLAG_RET;
+
+ if (is_exit)
+ flags[insn] |= FLAG_EXIT;
+
+ if (!(is_jmp || is_ret || is_exit))
+ flags[insn + insn_size] |= FLAG_INSN;
+}
+
+/* Scan a function body. Returns the position of the return sequence.
+ Sets *patch_bytes to the number of bytes that need to be copied from that
+ location. If no patching is required (ie. the return is the last insn)
+ *patch_bytes will be set to -1. *plen is the number of code bytes to copy.
+ */
+static int trace_i386_op(const char * name, uint8_t *start_p, int *plen,
+ int *patch_bytes, int *exit_addrs)
+{
+ char *flags;
+ int more;
+ int insn;
+ int retpos;
+ int bytes;
+ int num_exits;
+ int len;
+ int last_insn;
+
+ len = *plen;
+ flags = malloc(len + 1);
+ memset(flags, 0, len + 1);
+ flags[0] |= FLAG_INSN;
+ more = 1;
+ while (more) {
+ more = 0;
+ for (insn = 0; insn < len; insn++) {
+ if ((flags[insn] & (FLAG_INSN | FLAG_SCANNED)) == FLAG_INSN) {
+ trace_i386_insn(name, start_p, flags, insn, len);
+ more = 1;
+ }
+ }
+ }
+
+ /* Strip any unused code at the end of the function. */
+ while (len > 0 && flags[len - 1] == 0)
+ len--;
+
+ retpos = -1;
+ num_exits = 0;
+ last_insn = 0;
+ for (insn = 0; insn < len; insn++) {
+ if (flags[insn] & FLAG_RET) {
+ /* ??? In theory it should be possible to handle multiple return
+ points. In practice it's not worth the effort. */
+ if (retpos != -1)
+ error("Multiple return instructions in %s", name);
+ retpos = insn;
+ }
+ if (flags[insn] & FLAG_EXIT) {
+ if (num_exits == MAX_EXITS)
+ error("Too many block exits in %s", name);
+ exit_addrs[num_exits] = insn;
+ num_exits++;
+ }
+ if (flags[insn] & FLAG_INSN)
+ last_insn = insn;
+ }
+
+ exit_addrs[num_exits] = -1;
+ if (retpos == -1) {
+ if (num_exits == 0) {
+ error ("No return instruction found in %s", name);
+ } else {
+ retpos = len;
+ last_insn = len;
+ }
+ }
+
+ /* If the return instruction is the last instruction we can just
+ remove it. */
+ if (retpos == last_insn)
+ *patch_bytes = -1;
+ else
+ *patch_bytes = 0;
+
+ /* Back up over any nop instructions. */
+ while (retpos > 0
+ && (flags[retpos] & FLAG_TARGET) == 0
+ && (flags[retpos - 1] & FLAG_INSN) != 0
+ && start_p[retpos - 1] == 0x90) {
+ retpos--;
+ }
+
+ if (*patch_bytes == -1) {
+ *plen = retpos;
+ free (flags);
+ return retpos;
+ }
+ *plen = len;
+
+ /* The ret is in the middle of the function. Find four more bytes that
+ so the ret can be replaced by a jmp. */
+ /* ??? Use a short jump where possible. */
+ bytes = 4;
+ insn = retpos + 1;
+ /* We can clobber everything up to the next jump target. */
+ while (insn < len && bytes > 0 && (flags[insn] & FLAG_TARGET) == 0) {
+ insn++;
+ bytes--;
+ }
+ if (bytes > 0) {
+ /* ???: Strip out nop blocks. */
+ /* We can't do the replacement without clobbering anything important.
+ Copy preceeding instructions(s) to give us some space. */
+ while (retpos > 0) {
+ /* If this byte is the target of a jmp we can't move it. */
+ if (flags[retpos] & FLAG_TARGET)
+ break;
+
+ (*patch_bytes)++;
+ bytes--;
+ retpos--;
+
+ /* Break out of the loop if we have enough space and this is either
+ the first byte of an instruction or a pad byte. */
+ if ((flags[retpos] & (FLAG_INSN | FLAG_SCANNED)) != FLAG_SCANNED
+ && bytes <= 0) {
+ break;
+ }
+ }
+ }
+
+ if (bytes > 0)
+ error("Unable to replace ret with jmp in %s\n", name);
+
+ free(flags);
+ return retpos;
+}
+
+#endif
+
#define MAX_ARGS 3
/* generate op code */
@@ -1442,6 +2082,11 @@
uint8_t args_present[MAX_ARGS];
const char *sym_name, *p;
EXE_RELOC *rel;
+#if defined(HOST_I386) || defined(HOST_X86_64)
+ int patch_bytes;
+ int retpos;
+ int exit_addrs[MAX_EXITS];
+#endif
/* Compute exact size excluding prologue and epilogue instructions.
* Increment start_offset to skip epilogue instructions, then compute
@@ -1452,33 +2097,12 @@
p_end = p_start + size;
start_offset = offset;
#if defined(HOST_I386) || defined(HOST_X86_64)
-#ifdef CONFIG_FORMAT_COFF
- {
- uint8_t *p;
- p = p_end - 1;
- if (p == p_start)
- error("empty code for %s", name);
- while (*p != 0xc3) {
- p--;
- if (p <= p_start)
- error("ret or jmp expected at the end of %s", name);
- }
- copy_size = p - p_start;
- }
-#else
{
int len;
len = p_end - p_start;
- if (len == 0)
- error("empty code for %s", name);
- if (p_end[-1] == 0xc3) {
- len--;
- } else {
- error("ret or jmp expected at the end of %s", name);
- }
+ retpos = trace_i386_op(name, p_start, &len, &patch_bytes, exit_addrs);
copy_size = len;
}
-#endif
#elif defined(HOST_PPC)
{
uint8_t *p;
@@ -1710,6 +2334,13 @@
}
if (gen_switch == 2) {
+#if defined(HOST_I386) || defined(HOST_X86_64)
+ if (patch_bytes != -1)
+ copy_size += patch_bytes;
+#ifdef DEBUG_OP
+ copy_size += 2;
+#endif
+#endif
fprintf(outfile, "DEF(%s, %d, %d)\n", name + 3, nb_args, copy_size);
} else if (gen_switch == 1) {
@@ -1915,7 +2546,43 @@
#error unsupport object format
#endif
}
+ }
+ /* Replace the marker instructions with the actual opcodes. */
+ for (i = 0; exit_addrs[i] != -1; i++) {
+ int op;
+ switch (p_start[exit_addrs[i]])
+ {
+ case 0xf4: op = 0xc3; break; /* hlt -> ret */
+ case 0xfa: op = 0xe9; break; /* cli -> jmp */
+ case 0xfb: op = 0xe9; break; /* sti -> jmp */
+ default: error("Internal error");
+ }
+ fprintf(outfile,
+ " *(uint8_t *)(gen_code_ptr + %d) = 0x%x;\n",
+ exit_addrs[i], op);
}
+ /* Fix up the return instruction. */
+ if (patch_bytes != -1) {
+ if (patch_bytes) {
+ fprintf(outfile, " memcpy(gen_code_ptr + %d,"
+ "gen_code_ptr + %d, %d);\n",
+ copy_size, retpos, patch_bytes);
+ }
+ fprintf(outfile,
+ " *(uint8_t *)(gen_code_ptr + %d) = 0xe9;\n",
+ retpos);
+ fprintf(outfile,
+ " *(uint32_t *)(gen_code_ptr + %d) = 0x%x;\n",
+ retpos + 1, copy_size - (retpos + 5));
+
+ copy_size += patch_bytes;
+ }
+#ifdef DEBUG_OP
+ fprintf(outfile,
+ " *(uint16_t *)(gen_code_ptr + %d) = 0x9090;\n",
+ copy_size);
+ copy_size += 2;
+#endif
}
#elif defined(HOST_X86_64)
{
@@ -1949,6 +2616,42 @@
}
}
}
+ /* Replace the marker instructions with the actual opcodes. */
+ for (i = 0; exit_addrs[i] != -1; i++) {
+ int op;
+ switch (p_start[exit_addrs[i]])
+ {
+ case 0xf4: op = 0xc3; break; /* hlt -> ret */
+ case 0xfa: op = 0xe9; break; /* cli -> jmp */
+ case 0xfb: op = 0xe9; break; /* sti -> jmp */
+ default: error("Internal error");
+ }
+ fprintf(outfile,
+ " *(uint8_t *)(gen_code_ptr + %d) = 0x%x;\n",
+ exit_addrs[i], op);
+ }
+ /* Fix up the return instruction. */
+ if (patch_bytes != -1) {
+ if (patch_bytes) {
+ fprintf(outfile, " memcpy(gen_code_ptr + %d,"
+ "gen_code_ptr + %d, %d);\n",
+ copy_size, retpos, patch_bytes);
+ }
+ fprintf(outfile,
+ " *(uint8_t *)(gen_code_ptr + %d) = 0xe9;\n",
+ retpos);
+ fprintf(outfile,
+ " *(uint32_t *)(gen_code_ptr + %d) = 0x%x;\n",
+ retpos + 1, copy_size - (retpos + 5));
+
+ copy_size += patch_bytes;
+ }
+#ifdef DEBUG_OP
+ fprintf(outfile,
+ " *(uint16_t *)(gen_code_ptr + %d) = 0x9090;\n",
+ copy_size);
+ copy_size += 2;
+#endif
}
#elif defined(HOST_PPC)
{
--- qemu/exec-all.h
+++ qemu/exec-all.h
@@ -339,14 +339,15 @@
#elif defined(__i386__) && defined(USE_DIRECT_JUMP)
-/* we patch the jump instruction directly */
+/* we patch the jump instruction directly. Use sti in place of the actual
+ jmp instruction so that dyngen can patch in the correct result. */
#define GOTO_TB(opname, tbparam, n)\
do {\
asm volatile (".section .data\n"\
ASM_OP_LABEL_NAME(n, opname) ":\n"\
".long 1f\n"\
ASM_PREVIOUS_SECTION \
- "jmp " ASM_NAME(__op_jmp) #n "\n"\
+ "sti;.long " ASM_NAME(__op_jmp) #n " - 1f\n"\
"1:\n");\
} while (0)
--- qemu/target-i386/op.c
+++ qemu/target-i386/op.c
@@ -290,6 +290,7 @@
EDX = (uint32_t)(res >> 32);
CC_DST = res;
CC_SRC = (res != (int32_t)res);
+ FORCE_RET();
}
void OPPROTO op_imulw_T0_T1(void)
@@ -299,6 +300,7 @@
T0 = res;
CC_DST = res;
CC_SRC = (res != (int16_t)res);
+ FORCE_RET();
}
void OPPROTO op_imull_T0_T1(void)
@@ -308,6 +310,7 @@
T0 = res;
CC_DST = res;
CC_SRC = (res != (int32_t)res);
+ FORCE_RET();
}
#ifdef TARGET_X86_64

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a68d110ac86247b385b677d02fff2315ba42418469ead2d4f7e8bb48cfa928ba
size 2370923

3
qemu-20080703.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:30948f2476c9b854f4888521cc9252558fc99688fbe89fca98c19e963a6fb195
size 2691429

View File

@ -1,126 +0,0 @@
Index: qemu.bkp/linux-user/syscall.c
================================================================================
--- qemu/linux-user/syscall.c
+++ qemu/linux-user/syscall.c
@@ -17,6 +17,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+
+#define __user
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
@@ -60,6 +62,7 @@
#define tchars host_tchars /* same as target */
#define ltchars host_ltchars /* same as target */
+#include <linux/futex.h>
#include <linux/termios.h>
#include <linux/unistd.h>
#include <linux/utsname.h>
@@ -2715,6 +2718,92 @@
unlock_user_struct(target_ts, target_addr, 1);
}
+#ifdef BSWAP_NEEDED
+static int futex_op(int oldval, int op, int oparg)
+{
+ int retval = oparg;
+ switch(op) {
+ case FUTEX_OP_SET: break;
+ case FUTEX_OP_ADD: retval += oparg; break;
+ case FUTEX_OP_OR: retval |= oparg; break;
+ case FUTEX_OP_ANDN: retval &= oparg; break;
+ case FUTEX_OP_XOR: retval ^= oparg; break;
+ }
+ return retval;
+}
+
+static int futex_cmp(int oldval, int cmp, int cmparg)
+{
+ switch(cmp) {
+ case FUTEX_OP_CMP_EQ: return oldval == cmparg;
+ case FUTEX_OP_CMP_NE: return oldval != cmparg;
+ case FUTEX_OP_CMP_LT: return oldval < cmparg;
+ case FUTEX_OP_CMP_LE: return oldval <= cmparg;
+ case FUTEX_OP_CMP_GT: return oldval > cmparg;
+ case FUTEX_OP_CMP_GE: return oldval >= cmparg;
+ }
+ return -1;
+}
+#endif
+
+static long do_futex(target_ulong uaddr, int op, uint32_t val,
+ target_ulong utime, target_ulong uaddr2,
+ uint32_t val3)
+{
+ struct timespec host_utime;
+ unsigned long val2 = utime;
+ long retval;
+
+ if (utime && (op == FUTEX_WAIT || op == FUTEX_LOCK_PI)) {
+ target_to_host_timespec(&host_utime, utime);
+ val2 = (unsigned long)&host_utime;
+ }
+
+#ifdef BSWAP_NEEDED
+ switch(op) {
+ case FUTEX_CMP_REQUEUE:
+ val3 = tswap32(val3);
+ case FUTEX_REQUEUE:
+ val2 = tswap32(val2);
+ case FUTEX_WAIT:
+ case FUTEX_WAKE:
+ case FUTEX_WAKE_OP:
+ val = tswap32(val);
+ case FUTEX_LOCK_PI: /* This one's icky, but comes out OK */
+ case FUTEX_UNLOCK_PI:
+ break;
+ default:
+ gemu_log("qemu: Unsupported futex op %d\n", op);
+ return -TARGET_ENOSYS;
+ }
+ if (op == FUTEX_WAKE_OP) {
+ /* Need to munge the secondary operation (val3) */
+ gemu_log("qemu: Tricky FUTEX_WAKE_OP - trying to emulate it\n");
+ val3 = tswap32(val3);
+ int op2 = (val3 >> 28) & 0xf;
+ int cmp = (val3 >> 24) & 0xf;
+ int oparg = (val3 >> 12) & 0xfff;
+ int cmparg = val3 & 0xfff;
+ int shift = val3 & (FUTEX_OP_OPARG_SHIFT << 28);
+ int oldval; if(get_user_u32(oldval, uaddr2))
+ return -TARGET_EFAULT;
+ if (shift)
+ oparg = 1 << oparg;
+
+ put_user_u32(uaddr2,futex_op(oldval, op2, oparg));
+ retval = syscall(__NR_futex, g2h(uaddr), FUTEX_WAKE, val, 0, 0, 0);
+ if(futex_cmp(oldval, cmp, cmparg)) {
+ retval = syscall(__NR_futex, g2h(uaddr2), FUTEX_WAKE, val2, 0, 0, 0);
+ }
+ } else {
+ retval = syscall(__NR_futex, g2h(uaddr), op, val, val2, g2h(uaddr2), val3);
+ }
+#else
+ retval = syscall(__NR_futex, g2h(uaddr), op, val, val2, g2h(uaddr2), val3);
+#endif
+ return retval;
+}
+
/* do_syscall() should always have a single exit point at the end so
that actions, such as logging of syscall results, can be performed.
All errnos that do_syscall() returns must be -TARGET_<errcode>. */
@@ -5116,6 +5205,11 @@
}
#endif
+#ifdef TARGET_NR_futex
+ case TARGET_NR_futex:
+ ret = get_errno(do_futex(arg1, arg2, arg3, arg4, arg5, arg6));
+ break;
+#endif
#if defined(TARGET_NR_set_tid_address) && defined(__NR_set_tid_address)
case TARGET_NR_set_tid_address:
ret = get_errno(set_tid_address((int *) arg1));

View File

@ -1,6 +1,6 @@
--- Makefile.target
+++ Makefile.target
@@ -111,6 +111,8 @@
@@ -84,6 +84,8 @@
OP_CFLAGS+=$(call cc-option, -fno-reorder-blocks, "")
OP_CFLAGS+=$(call cc-option, -fno-gcse, "")
OP_CFLAGS+=$(call cc-option, -fno-tree-ch, "")
@ -9,18 +9,18 @@
OP_CFLAGS+=$(call cc-option, -fno-optimize-sibling-calls, "")
OP_CFLAGS+=$(call cc-option, -fno-crossjumping, "")
OP_CFLAGS+=$(call cc-option, -fno-align-labels, "")
@@ -185,8 +187,9 @@
@@ -141,8 +143,9 @@
endif
ifeq ($(ARCH),ia64)
-BASE_CFLAGS+=-mno-sdata
-CFLAGS+=-mno-sdata
-OP_CFLAGS+=-mno-sdata
+OP_CFLAGS+=$(call cc-option, -mno-sched-ar-data-spec, "")
+BASE_CFLAGS+=-G0 -mno-sdata
+CFLAGS+=-G0 -mno-sdata
+OP_CFLAGS+=-G0 -mno-sdata
BASE_LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld
endif
ifeq ($(ARCH),arm)
--- target-alpha/op.c
+++ target-alpha/op.c
@@ -18,8 +18,6 @@

View File

@ -2,16 +2,16 @@ Index: qemu/linux-user/syscall.c
================================================================================
--- qemu/linux-user/syscall.c
+++ qemu/linux-user/syscall.c
@@ -29,7 +29,7 @@
#include <unistd.h>
@@ -30,7 +30,7 @@
#include <fcntl.h>
#include <time.h>
#include <limits.h>
-#include <sys/types.h>
+#include <linux/types.h>
#include <sys/ipc.h>
#include <sys/msg.h>
#include <sys/wait.h>
@@ -46,6 +46,9 @@
@@ -47,6 +47,9 @@
#include <sys/uio.h>
#include <sys/poll.h>
#include <sys/times.h>
@ -21,17 +21,17 @@ Index: qemu/linux-user/syscall.c
#include <sys/shm.h>
#include <sys/sem.h>
#include <sys/statfs.h>
@@ -164,6 +167,7 @@
#define __NR_sys_utimensat __NR_utimensat
#define __NR_sys_clone __NR_clone
@@ -153,6 +156,7 @@
#define __NR_sys_sched_getaffinity __NR_sched_getaffinity
+#define __NR_sys_ipc __NR_ipc
#if defined(__alpha__) || defined (__ia64__) || defined(__x86_64__)
#define __NR__llseek __NR_lseek
@@ -235,6 +239,10 @@
#ifdef __NR_sys_clone
_syscall5(int,sys_clone, int, flags, void *, child_stack, int *, parent_tidptr, void *, newtls, int *, child_tidptr)
#define __NR_sys_uname __NR_uname
#define __NR_sys_faccessat __NR_faccessat
#define __NR_sys_fchmodat __NR_fchmodat
@@ -243,6 +247,10 @@
#if defined(TARGET_NR_tkill) && defined(__NR_tkill)
_syscall2(int,sys_tkill,int,tid,int,sig)
#endif
+#ifdef __NR_ipc
+_syscall6(int,sys_ipc, long, call, long, first, long, second, long, third, void *, ptr, long, fifth)
@ -40,7 +40,7 @@ Index: qemu/linux-user/syscall.c
#ifdef __NR_sys_sched_getaffinity
_syscall3(int,sys_sched_getaffinity,pid_t,pid,unsigned int,cpusetsize,void*,mask)
#endif
@@ -1464,6 +1472,21 @@
@@ -1614,6 +1622,21 @@
abi_ulong __unused2;
};
@ -62,7 +62,7 @@ Index: qemu/linux-user/syscall.c
struct target_semid_ds
{
struct target_ipc_perm sem_perm;
@@ -1476,6 +1499,18 @@
@@ -1626,6 +1649,18 @@
abi_ulong __unused4;
};
@ -81,7 +81,7 @@ Index: qemu/linux-user/syscall.c
static inline abi_long target_to_host_ipc_perm(struct ipc_perm *host_ip,
abi_ulong target_addr)
{
@@ -1514,6 +1549,43 @@
@@ -1664,6 +1699,43 @@
return 0;
}
@ -125,7 +125,7 @@ Index: qemu/linux-user/syscall.c
static inline abi_long target_to_host_semid_ds(struct semid_ds *host_sd,
abi_ulong target_addr)
{
@@ -1544,6 +1616,32 @@
@@ -1694,6 +1766,32 @@
return 0;
}
@ -158,7 +158,7 @@ Index: qemu/linux-user/syscall.c
union semun {
int val;
struct semid_ds *buf;
@@ -1556,6 +1654,10 @@
@@ -1706,6 +1804,10 @@
unsigned short int *array;
};
@ -169,7 +169,7 @@ Index: qemu/linux-user/syscall.c
static inline abi_long target_to_host_semun(int cmd,
union semun *host_su,
abi_ulong target_addr,
@@ -1568,7 +1670,15 @@
@@ -1718,7 +1820,15 @@
case IPC_SET:
if (!lock_user_struct(VERIFY_READ, target_su, target_addr, 1))
return -TARGET_EFAULT;
@ -186,7 +186,7 @@ Index: qemu/linux-user/syscall.c
host_su->buf = ds;
unlock_user_struct(target_su, target_addr, 0);
break;
@@ -1604,7 +1714,14 @@
@@ -1754,7 +1864,14 @@
case IPC_SET:
if (lock_user_struct(VERIFY_WRITE, target_su, target_addr, 0))
return -TARGET_EFAULT;
@ -202,7 +202,7 @@ Index: qemu/linux-user/syscall.c
unlock_user_struct(target_su, target_addr, 1);
break;
case GETVAL:
@@ -1632,7 +1749,8 @@
@@ -1782,7 +1899,8 @@
{
union semun arg;
struct semid_ds dsarg;
@ -212,7 +212,7 @@ Index: qemu/linux-user/syscall.c
abi_long ret = 0;
switch( cmd ) {
@@ -1661,13 +1779,23 @@
@@ -1811,13 +1929,23 @@
ret = get_errno(semctl(first, second, cmd, arg));
host_to_target_semun(cmd,ptr,&arg,&dsarg);
break;
@ -237,7 +237,7 @@ Index: qemu/linux-user/syscall.c
}
return ret;
@@ -1691,6 +1819,41 @@
@@ -1841,6 +1969,41 @@
abi_ulong __unused5;
};
@ -279,7 +279,7 @@ Index: qemu/linux-user/syscall.c
static inline abi_long target_to_host_msqid_ds(struct msqid_ds *host_md,
abi_ulong target_addr)
{
@@ -1919,11 +2082,59 @@
@@ -2069,11 +2232,59 @@
case IPCOP_shmctl:
switch(second) {
case IPC_RMID:

View File

@ -1,7 +1,7 @@
Index: qemu/linux-user/mmap.c
================================================================================
--- qemu-0.9.1/linux-user/mmap.c
+++ qemu-0.9.1/linux-user/mmap.c
--- qemu/linux-user/mmap.c
+++ qemu/linux-user/mmap.c
@@ -27,6 +27,10 @@
#include "qemu.h"
@ -12,8 +12,8 @@ Index: qemu/linux-user/mmap.c
+
//#define DEBUG_MMAP
/* NOTE: all the constants are the HOST ones, but addresses are target. */
@@ -119,7 +123,7 @@
#if defined(USE_NPTL)
@@ -211,7 +215,7 @@
if (prot1 == 0) {
/* no page was there, so we allocate one */
void *p = mmap(host_start, qemu_host_page_size, prot,
@ -22,12 +22,12 @@ Index: qemu/linux-user/mmap.c
if (p == MAP_FAILED)
return -1;
prot1 = prot;
@@ -422,7 +426,7 @@
unsigned long host_addr;
@@ -551,7 +555,7 @@
mmap_lock();
/* XXX: use 5 args syscall */
- host_addr = (long)mremap(g2h(old_addr), old_size, new_size, flags);
+ host_addr = (long)mremap(g2h(old_addr), old_size, new_size, flags | MAP_32BIT);
if (host_addr == -1)
return -1;
new_addr = h2g(host_addr);
if (host_addr == -1) {
new_addr = -1;
} else {

View File

@ -1,17 +0,0 @@
Index: qemu/linux-user/mmap.c
================================================================================
--- qemu/linux-user/mmap.c
+++ qemu/linux-user/mmap.c
@@ -49,8 +49,10 @@
end = start + len;
if (end < start)
return -EINVAL;
- if (prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC))
- return -EINVAL;
+ if (prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC)) {
+ gemu_log("WARNING: dirty hack in mprotect: setting prot (%#x -> %#x)\n", prot, prot & (PROT_READ | PROT_WRITE | PROT_EXEC));
+ prot &= (PROT_READ | PROT_WRITE | PROT_EXEC);
+ }
if (len == 0)
return 0;

View File

@ -91,7 +91,7 @@ Index: qemu.bkp/linux-user/path.c
- return root;
-}
-
-/* This needs to be done after tree is stabalized (ie. no more reallocs!). */
-/* This needs to be done after tree is stabilized (ie. no more reallocs!). */
-static void set_parents(struct pathelem *child, struct pathelem *parent)
-{
- unsigned int i;

View File

@ -1,13 +0,0 @@
Index: qemu-0.9.0/configure
================================================================================
--- qemu-0.9.1/configure
+++ qemu-0.9.1/configure
@@ -526,7 +526,7 @@
if test -z "$target_list" ; then
# these targets are portable
if [ "$softmmu" = "yes" ] ; then
- target_list="i386-softmmu sparc-softmmu x86_64-softmmu mips-softmmu mipsel-softmmu mips64-softmmu mips64el-softmmu arm-softmmu ppc-softmmu ppcemb-softmmu ppc64-softmmu m68k-softmmu sh4-softmmu sh4eb-softmmu cris-softmmu"
+ target_list="i386-softmmu sparc-softmmu x86_64-softmmu mips-softmmu mipsel-softmmu mips64-softmmu mips64el-softmmu arm-softmmu ppc-softmmu ppcemb-softmmu ppc64-softmmu m68k-softmmu sh4-softmmu sh4eb-softmmu cris-softmmu z80-softmmu"
fi
# the following are Linux specific
if [ "$linux_user" = "yes" ] ; then

View File

@ -2,17 +2,17 @@ Index: qemu.bkp/linux-user/syscall.c
================================================================================
--- qemu/linux-user/syscall.c
+++ qemu/linux-user/syscall.c
@@ -163,6 +163,7 @@
#define __NR_sys_unlinkat __NR_unlinkat
#define __NR_sys_utimensat __NR_utimensat
#define __NR_sys_clone __NR_clone
+#define __NR_sys_sched_getaffinity __NR_sched_getaffinity
@@ -152,6 +152,7 @@
}
#if defined(__alpha__) || defined (__ia64__) || defined(__x86_64__)
#define __NR__llseek __NR_lseek
@@ -234,6 +235,9 @@
#ifdef __NR_sys_clone
_syscall5(int,sys_clone, int, flags, void *, child_stack, int *, parent_tidptr, void *, newtls, int *, child_tidptr)
+#define __NR_sys_sched_getaffinity __NR_sched_getaffinity
#define __NR_sys_uname __NR_uname
#define __NR_sys_faccessat __NR_faccessat
#define __NR_sys_fchmodat __NR_fchmodat
@@ -242,6 +243,9 @@
#if defined(TARGET_NR_tkill) && defined(__NR_tkill)
_syscall2(int,sys_tkill,int,tid,int,sig)
#endif
+#ifdef __NR_sys_sched_getaffinity
+_syscall3(int,sys_sched_getaffinity,pid_t,pid,unsigned int,cpusetsize,void*,mask)
@ -20,8 +20,8 @@ Index: qemu.bkp/linux-user/syscall.c
#ifdef __NR_exit_group
_syscall1(int,exit_group,int,error_code)
#endif
@@ -5254,6 +5258,17 @@
break;
@@ -5857,6 +5861,17 @@
break;
#endif
+#ifdef TARGET_NR_sched_getaffinity

View File

@ -1,141 +0,0 @@
Index: qemu.bkp/linux-user/main.c
================================================================================
--- qemu-0.9.1/linux-user/syscall.c
+++ qemu-0.9.1/linux-user/syscall.c
@@ -159,6 +159,7 @@
#define __NR_sys_tkill __NR_tkill
#define __NR_sys_unlinkat __NR_unlinkat
#define __NR_sys_utimensat __NR_utimensat
+#define __NR_sys_clone __NR_clone
#if defined(__alpha__) || defined (__ia64__) || defined(__x86_64__)
#define __NR__llseek __NR_lseek
@@ -227,6 +228,9 @@
#if defined(TARGET_NR_tkill) && defined(__NR_tkill)
_syscall2(int,sys_tkill,int,tid,int,sig)
#endif
+#ifdef __NR_sys_clone
+_syscall5(int,sys_clone, int, flags, void *, child_stack, int *, parent_tidptr, void *, newtls, int *, child_tidptr)
+#endif
#ifdef __NR_exit_group
_syscall1(int,exit_group,int,error_code)
#endif
@@ -2705,15 +2783,20 @@
/* do_fork() Must return host values and target errnos (unlike most
do_*() functions). */
-int do_fork(CPUState *env, unsigned int flags, abi_ulong newsp)
+int do_fork(CPUState *env, unsigned int flags, abi_ulong newsp, abi_ulong parent_tidptr, abi_ulong newtls, abi_ulong child_tidptr)
{
int ret;
+ unsigned long parent_tid = gettid();
TaskState *ts;
uint8_t *new_stack;
CPUState *new_env;
+#if defined(TARGET_I386)
+ uint64_t *new_gdt_table;
+#endif
if (flags & CLONE_VM) {
ts = malloc(sizeof(TaskState) + NEW_STACK_SIZE);
+ if (!ts) return -ENOMEM;
memset(ts, 0, sizeof(TaskState));
new_stack = ts->stack;
ts->used = 1;
@@ -2725,6 +2808,27 @@
#if defined(TARGET_I386)
if (!newsp)
newsp = env->regs[R_ESP];
+ new_gdt_table = malloc(9 * 8);
+ if (!new_gdt_table) {
+ free(new_env);
+ return -ENOMEM;
+ }
+ /* Copy main GDT table from parent, but clear TLS entries */
+ memcpy(new_gdt_table, g2h(env->gdt.base), 6 * 8);
+ memset(&new_gdt_table[6], 0, 3 * 8);
+ new_env->gdt.base = h2g(new_gdt_table);
+ if (flags & CLONE_SETTLS) {
+ ret = do_set_thread_area(new_env, newtls);
+ if (ret) {
+ free(new_gdt_table);
+ free(new_env);
+ return ret;
+ }
+ }
+
+ cpu_x86_load_seg(new_env, R_FS, new_env->segs[R_FS].selector);
+ cpu_x86_load_seg(new_env, R_GS, new_env->segs[R_GS].selector);
+
new_env->regs[R_ESP] = newsp;
new_env->regs[R_EAX] = 0;
#elif defined(TARGET_ARM)
@@ -2782,15 +2886,27 @@
#endif
new_env->opaque = ts;
#ifdef __ia64__
- ret = __clone2(clone_func, new_stack + NEW_STACK_SIZE, flags, new_env);
+ ret = __clone2(clone_func, new_stack + NEW_STACK_SIZE, flags & ~(CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID), new_env);
#else
- ret = clone(clone_func, new_stack + NEW_STACK_SIZE, flags, new_env);
+ ret = clone(clone_func, new_stack + NEW_STACK_SIZE, flags & ~(CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID), new_env);
#endif
} else {
/* if no CLONE_VM, we consider it is a fork */
- if ((flags & ~CSIGNAL) != 0)
- return -EINVAL;
- ret = fork();
+ ret = sys_clone(flags & ~(CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID), 0, g2h(parent_tidptr), NULL, g2h(child_tidptr));
+ }
+ /* Store child thread ID at location parent_tidptr in parent and child memory.
+ Currently this is only done in client memory */
+ if(flags & CLONE_PARENT_SETTID) {
+ put_user_u32(parent_tidptr, parent_tid);
+ }
+
+ /* Store child thread ID at location child_tidptr in child memory. */
+ if(flags & CLONE_CHILD_SETTID) {
+ if(ret==0) { /* only in client memory for fork() */
+ put_user_u32(child_tidptr, gettid());
+ } else if(flags & CLONE_VM) { /* real threads need it too */
+ put_user_u32(child_tidptr, ret);
+ }
}
return ret;
}
@@ -3073,7 +3189,7 @@
_mcleanup();
#endif
gdb_exit(cpu_env, arg1);
- /* XXX: should free thread stack and CPU env */
+ /* XXX: should free thread stack, GDT and CPU env */
_exit(arg1);
ret = 0; /* avoid warning */
break;
@@ -3115,7 +3231,7 @@
ret = do_brk(arg1);
break;
case TARGET_NR_fork:
- ret = get_errno(do_fork(cpu_env, SIGCHLD, 0));
+ ret = get_errno(do_fork(cpu_env, SIGCHLD, 0, 0,0,0));
break;
#ifdef TARGET_NR_waitpid
case TARGET_NR_waitpid:
@@ -4477,7 +4593,7 @@
ret = get_errno(fsync(arg1));
break;
case TARGET_NR_clone:
- ret = get_errno(do_fork(cpu_env, arg1, arg2));
+ ret = get_errno(do_fork(cpu_env, arg1, arg2,arg3,arg4,arg5));
break;
#ifdef __NR_exit_group
/* new thread calls */
@@ -4897,7 +5013,7 @@
#endif
#ifdef TARGET_NR_vfork
case TARGET_NR_vfork:
- ret = get_errno(do_fork(cpu_env, CLONE_VFORK | CLONE_VM | SIGCHLD, 0));
+ ret = get_errno(do_fork(cpu_env, CLONE_VFORK | CLONE_VM | SIGCHLD, 0, 0,0,0));
break;
#endif
#ifdef TARGET_NR_ugetrlimit

View File

@ -1,8 +1,8 @@
Index: qemu-0.9.1/block-vmdk.c
===================================================================
--- qemu-0.9.1.orig/block-vmdk.c
+++ qemu-0.9.1/block-vmdk.c
@@ -717,7 +717,7 @@ static int vmdk_create(const char *filen
================================================================================
--- qemu/block-vmdk.c
+++ qemu/block-vmdk.c
@@ -719,7 +719,7 @@
"ddb.geometry.cylinders = \"%lu\"\n"
"ddb.geometry.heads = \"16\"\n"
"ddb.geometry.sectors = \"63\"\n"
@ -11,7 +11,7 @@ Index: qemu-0.9.1/block-vmdk.c
char desc[1024];
const char *real_filename, *temp_str;
@@ -790,7 +790,9 @@ static int vmdk_create(const char *filen
@@ -792,7 +792,9 @@
if ((temp_str = strrchr(real_filename, ':')) != NULL)
real_filename = temp_str + 1;
sprintf(desc, desc_template, time(NULL), (unsigned long)total_size,
@ -22,10 +22,8 @@ Index: qemu-0.9.1/block-vmdk.c
/* write the descriptor */
lseek(fd, le64_to_cpu(header.desc_offset) << 9, SEEK_SET);
Index: qemu-0.9.1/block_int.h
===================================================================
--- qemu-0.9.1.orig/block_int.h
+++ qemu-0.9.1/block_int.h
--- qemu/block_int.h
+++ qemu/block_int.h
@@ -29,6 +29,7 @@
#define BLOCK_FLAG_ENCRYPT 1
#define BLOCK_FLAG_COMPRESS 2
@ -34,23 +32,21 @@ Index: qemu-0.9.1/block_int.h
struct BlockDriver {
const char *format_name;
Index: qemu-0.9.1/qemu-img.c
===================================================================
--- qemu-0.9.1.orig/qemu-img.c
+++ qemu-0.9.1/qemu-img.c
@@ -88,9 +88,9 @@ static void help(void)
--- qemu/qemu-img.c
+++ qemu/qemu-img.c
@@ -53,9 +53,9 @@
"QEMU disk image utility\n"
"\n"
"Command syntax:\n"
- " create [-e] [-6] [-b base_image] [-f fmt] filename [size]\n"
+ " create [-e] [-s] [-6] [-b base_image] [-f fmt] filename [size]\n"
" commit [-f fmt] filename\n"
- " convert [-c] [-e] [-6] [-f fmt] filename [filename2 [...]] [-O output_fmt] output_filename\n"
+ " convert [-c] [-e] [-s] [-6] [-f fmt] [-O output_fmt] filename [filename2 [...]] output_filename\n"
- " convert [-c] [-e] [-6] [-f fmt] [-O output_fmt] [-B output_base_image] filename [filename2 [...]] output_filename\n"
+ " convert [-c] [-e] [-s] [-6] [-f fmt] [-O output_fmt] [-B output_base_image] filename [filename2 [...]] output_filename\n"
" info [-f fmt] filename\n"
"\n"
"Command parameters:\n"
@@ -104,6 +104,7 @@ static void help(void)
@@ -73,6 +73,7 @@
" 'output_fmt' is the destination format\n"
" '-c' indicates that target image must be compressed (qcow format only)\n"
" '-e' indicates that the target image must be encrypted (qcow format only)\n"
@ -58,7 +54,7 @@ Index: qemu-0.9.1/qemu-img.c
" '-6' indicates that the target image must use compatibility level 6 (vmdk format only)\n"
);
printf("\nSupported format:");
@@ -242,7 +243,7 @@ static int img_create(int argc, char **a
@@ -211,7 +212,7 @@
flags = 0;
for(;;) {
@ -67,7 +63,7 @@ Index: qemu-0.9.1/qemu-img.c
if (c == -1)
break;
switch(c) {
@@ -258,6 +259,9 @@ static int img_create(int argc, char **a
@@ -227,6 +228,9 @@
case 'e':
flags |= BLOCK_FLAG_ENCRYPT;
break;
@ -77,7 +73,7 @@ Index: qemu-0.9.1/qemu-img.c
case '6':
flags |= BLOCK_FLAG_COMPAT6;
break;
@@ -293,6 +297,8 @@ static int img_create(int argc, char **a
@@ -262,6 +266,8 @@
error("Unknown file format '%s'", fmt);
printf("Formatting '%s', fmt=%s",
filename, fmt);
@ -86,16 +82,16 @@ Index: qemu-0.9.1/qemu-img.c
if (flags & BLOCK_FLAG_ENCRYPT)
printf(", encrypted");
if (flags & BLOCK_FLAG_COMPAT6)
@@ -421,7 +427,7 @@ static int img_convert(int argc, char **
out_fmt = "raw";
@@ -398,7 +404,7 @@
out_baseimg = NULL;
flags = 0;
for(;;) {
- c = getopt(argc, argv, "f:O:hce6");
+ c = getopt(argc, argv, "f:O:hces6");
- c = getopt(argc, argv, "f:O:B:hce6");
+ c = getopt(argc, argv, "f:O:B:hces6");
if (c == -1)
break;
switch(c) {
@@ -440,6 +446,9 @@ static int img_convert(int argc, char **
@@ -420,6 +426,9 @@
case 'e':
flags |= BLOCK_FLAG_ENCRYPT;
break;
@ -105,7 +101,7 @@ Index: qemu-0.9.1/qemu-img.c
case '6':
flags |= BLOCK_FLAG_COMPAT6;
break;
@@ -471,6 +480,8 @@ static int img_convert(int argc, char **
@@ -454,6 +463,8 @@
error("Compression not supported for this file format");
if (flags & BLOCK_FLAG_ENCRYPT && drv != &bdrv_qcow && drv != &bdrv_qcow2)
error("Encryption not supported for this file format");

File diff suppressed because it is too large Load Diff

View File

@ -1,48 +0,0 @@
--- qemu-0.9.1/Makefile.target
+++ qemu-0.9.1/Makefile.target
@@ -390,6 +390,9 @@
ifeq ($(findstring z80, $(TARGET_ARCH) $(ARCH)),z80)
LIBOBJS+=z80-dis.o
endif
+ifeq ($(findstring s390, $(TARGET_ARCH) $(ARCH)),s390)
+LIBOBJS+=s390-dis.o
+endif
ifdef CONFIG_GDBSTUB
OBJS+=gdbstub.o
--- qemu-0.9.1/dis-asm.h
+++ qemu-0.9.1/dis-asm.h
@@ -396,6 +396,7 @@
extern int print_insn_s390 PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_crisv32 PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_z80 PARAMS ((bfd_vma, disassemble_info*));
+extern int print_insn_s390 PARAMS ((bfd_vma, disassemble_info*));
#if 0
/* Fetch the disassembler for a given BFD, if that support is available. */
--- qemu-0.9.1/target-i386/translate.c
+++ qemu-0.9.1/target-i386/translate.c
@@ -1795,7 +1795,11 @@
case CC_OP_SUBW:
case CC_OP_SUBL:
case CC_OP_SUBQ:
+#ifdef __s390__
+ func = NULL; /* does not work on S/390 for unknown reasons */
+#else
func = gen_jcc_sub[s->cc_op - CC_OP_SUBB][jcc_op];
+#endif
break;
/* some jumps are easy to compute */
@@ -1843,7 +1847,11 @@
func = gen_jcc_sub[(s->cc_op - CC_OP_ADDB) % 4][jcc_op];
break;
case JCC_S:
+#ifdef __s390__
+ func = NULL;
+#else
func = gen_jcc_sub[(s->cc_op - CC_OP_ADDB) % 4][jcc_op];
+#endif
break;
default:
func = NULL;

View File

@ -1,74 +0,0 @@
--- ./s390-dis.c 2007-08-01 15:11:55.000000000 +0200
+++ ./s390-dis.c 2005-08-22 21:27:46.000000000 +0200
@@ -1,23 +1,23 @@
/* s390-dis.c -- Disassemble S390 instructions
- Copyright 2000, 2001, 2002, 2003, 2005, 2007 Free Software Foundation, Inc.
+ Copyright 2000, 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
- This file is part of the GNU opcodes library.
+ This file is part of GDB, GAS and the GNU binutils.
- This library is free software; you can redistribute it and/or modify
+ 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 3, or (at your option)
- any later version.
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
- It 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.
+ 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 file; see the file COPYING. If not, write to the
- Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston,
- MA 02110-1301, USA. */
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+ 02110-1301, USA. */
#include <stdio.h>
#include "ansidecl.h"
@@ -399,23 +399,23 @@
/* s390-opc.c -- S390 opcode list
- Copyright 2000, 2001, 2003, 2007 Free Software Foundation, Inc.
+ Copyright 2000, 2001, 2003 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
- This file is part of the GNU opcodes library.
+ This file is part of GDB, GAS, and the GNU binutils.
- This library is free software; you can redistribute it and/or modify
+ 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 3, or (at your option)
- any later version.
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
- It 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.
+ 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 file; see the file COPYING. If not, write to the
- Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston,
- MA 02110-1301, USA. */
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+ 02110-1301, USA. */
#include <stdio.h>
#include "ansidecl.h"

20
qemu-svn-ncurses.patch Normal file
View File

@ -0,0 +1,20 @@
--- configure
+++ configure
@@ -799,7 +799,7 @@
#include <curses.h>
int main(void) { return curses_version(); }
EOF
- if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lcurses 2> /dev/null ; then
+ if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lncurses 2> /dev/null ; then
curses=yes
fi
fi # test "$curses"
@@ -1102,7 +1102,7 @@
if test "$curses" = "yes" ; then
echo "#define CONFIG_CURSES 1" >> $config_h
echo "CONFIG_CURSES=yes" >> $config_mak
- echo "CURSES_LIBS=-lcurses" >> $config_mak
+ echo "CURSES_LIBS=-lncurses" >> $config_mak
fi
if test "$brlapi" = "yes" ; then
echo "CONFIG_BRLAPI=yes" >> $config_mak

26
qemu-svn-nodyngen.patch Normal file
View File

@ -0,0 +1,26 @@
--- configure
+++ configure
@@ -547,11 +547,6 @@
mipsel-softmmu \
mips64-softmmu \
mips64el-softmmu \
-ppc-softmmu \
-ppcemb-softmmu \
-ppc64-softmmu \
-sh4-softmmu \
-sh4eb-softmmu \
sparc-softmmu \
"
fi
@@ -567,11 +562,6 @@
m68k-linux-user \
mips-linux-user \
mipsel-linux-user \
-ppc-linux-user \
-ppc64-linux-user \
-ppc64abi32-linux-user \
-sh4-linux-user \
-sh4eb-linux-user \
sparc-linux-user \
sparc64-linux-user \
sparc32plus-linux-user \

189
qemu-svn-pcap.patch Normal file
View File

@ -0,0 +1,189 @@
Index: Makefile.target
================================================================================
--- Makefile.target
+++ Makefile.target
@@ -625,6 +625,9 @@
ifdef CONFIG_SLIRP
CPPFLAGS+=-I$(SRC_PATH)/slirp
endif
+ifdef CONFIG_PCAP
+LIBS+=-lpcap
+endif
LIBS+=$(AIOLIBS)
# specific flags are needed for non soft mmu emulator
--- configure
+++ configure
@@ -90,6 +90,7 @@
gdbstub="yes"
slirp="yes"
vde="no"
+pcap="yes"
fmod_lib=""
fmod_inc=""
vnc_tls="yes"
@@ -283,6 +284,8 @@
;;
--enable-vde) vde="yes"
;;
+ --disable-pcap) pcap="no"
+ ;;
--disable-kqemu) kqemu="no"
;;
--disable-brlapi) brlapi="no"
@@ -1066,6 +1069,10 @@
echo "#define CONFIG_VDE 1" >> $config_h
echo "VDE_LIBS=-lvdeplug" >> $config_mak
fi
+if test "$pcap" = "yes" ; then
+ echo "CONFIG_PCAP=yes" >> $config_mak
+ echo "#define CONFIG_PCAP 1" >> $config_h
+fi
for card in $audio_card_list; do
def=CONFIG_`echo $card | tr '[:lower:]' '[:upper:]'`
echo "$def=yes" >> $config_mak
--- vl.c
+++ vl.c
@@ -102,6 +102,10 @@
int inet_aton(const char *cp, struct in_addr *ia);
#endif
+#if defined(CONFIG_PCAP)
+#include <pcap.h>
+#endif
+
#if defined(CONFIG_SLIRP)
#include "libslirp.h"
#endif
@@ -4112,6 +4116,104 @@
#endif /* CONFIG_SLIRP */
+#if defined(CONFIG_PCAP)
+
+typedef struct PCAPState {
+ VLANClientState *vc;
+ pcap_t *handle;
+} PCAPState;
+
+static void pcap_receive(void *opaque, const uint8_t *buf, int size)
+{
+ PCAPState *s = (PCAPState *)opaque;
+
+ pcap_sendpacket(s->handle, (u_char*)buf, size);
+}
+
+static void pcap_callback(u_char *user, struct pcap_pkthdr *phdr, u_char *pdata)
+{
+ VLANClientState *vc = (VLANClientState *)user;
+
+ qemu_send_packet(vc, pdata, phdr->len);
+}
+
+static void pcap_send(void *opaque)
+{
+ PCAPState *s = (PCAPState *)opaque;
+
+ pcap_dispatch(s->handle, 1, (pcap_handler)&pcap_callback, (u_char *)s->vc);
+}
+
+static int net_pcap_init(VLANState *vlan, char *ifname)
+{
+ PCAPState *s;
+ char errbuf[PCAP_ERRBUF_SIZE];
+ int fd;
+
+ s = qemu_mallocz(sizeof(PCAPState));
+ if (!s)
+ return -1;
+
+ if (ifname == NULL && (ifname = pcap_lookupdev(errbuf)) == NULL) {
+ fprintf(stderr, "qemu: pcap_lookupdev: %s\n", errbuf);
+ goto fail;
+ }
+
+ /* Attempt to connect device. */
+ s->handle = (void*)pcap_open_live(ifname, 65535, 1, 0, errbuf);
+ if (!s->handle) {
+ fprintf(stderr, "qemu: pcap_open_live: %s\n", errbuf);
+ goto fail;
+ }
+
+ /* Check non-blocking mode. */
+ if (pcap_setnonblock(s->handle, 1, errbuf) < 0) {
+ fprintf(stderr, "qemu: pcap_setnonblock: %s\n", errbuf);
+ goto fail;
+ }
+
+#if defined(BIOCSHDRCMPLT)
+ /*
+ * Tell the kernel that the header is fully-formed when it gets it.
+ * This is required in order to fake the src address.
+ */
+ {
+ unsigned int one = 1;
+ ioctl(pcap_fileno(s->handle), BIOCSHDRCMPLT, &one);
+ }
+#endif /* BIOCSHDRCMPLT */
+
+#if defined(BIOCIMMEDIATE)
+ /*
+ * Tell the kernel that the packet has to be processed immediately.
+ */
+ {
+ unsigned int one = 1;
+ ioctl(pcap_fileno(s->handle), BIOCIMMEDIATE, &one);
+ }
+#endif /* BIOCIMMEDIATE */
+
+ s->vc = qemu_new_vlan_client(vlan, pcap_receive, NULL, s);
+ snprintf(s->vc->info_str, sizeof(s->vc->info_str), "pcap redirector");
+ if ((fd = pcap_get_selectable_fd(s->handle)) < 0) {
+ fprintf(stderr, "qemu: pcap_get_selectable_fd failed\n");
+ goto fail;
+ }
+ qemu_set_fd_handler(fd, pcap_send, NULL, s);
+
+ return 0;
+
+fail:
+ if (s) {
+ if (s->handle)
+ pcap_close(s->handle);
+ qemu_free(s);
+ }
+
+ return -1;
+}
+#endif /* CONFIG_PCAP */
+
#if !defined(_WIN32)
typedef struct TAPState {
@@ -5056,6 +5158,15 @@
ret = net_slirp_init(vlan);
} else
#endif
+#ifdef CONFIG_PCAP
+ if (!strcmp(device, "pcap")) {
+ char ifname[64];
+ if (get_param_value(ifname, sizeof(ifname), "ifname", p) <= 0)
+ ret = net_pcap_init(vlan, NULL);
+ else
+ ret = net_pcap_init(vlan, ifname);
+ } else
+#endif
#ifdef _WIN32
if (!strcmp(device, "tap")) {
char ifname[64];
@@ -7491,6 +7602,10 @@
" connect the user mode network stack to VLAN 'n' and send\n"
" hostname 'host' to DHCP clients\n"
#endif
+#ifdef CONFIG_PCAP
+ "-net pcap[,vlan=n][,ifname=name]\n"
+ " connect the host network interface using PCAP to VLAN 'n'\n"
+#endif
#ifdef _WIN32
"-net tap[,vlan=n],ifname=name\n"
" connect the host TAP network interface to VLAN 'n'\n"

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,17 @@
-------------------------------------------------------------------
Thu Jul 24 13:56:06 CEST 2008 - uli@suse.de
- update -> current SVN
- MIPS Magnum R4000 machine (Hervé Poussineau)
- Braille support (Samuel Thibault)
- Freecom MusicPal system emulation (Jan Kiszka)
- OMAP242x and Nokia N800, N810 machines (Andrzej Zaborowski)
- EsounD audio driver (Frederick Reeve)
- Gravis Ultrasound GF1 sound card (Tibor "TS" Schütz)
- added pcap networking
- ditched GCC3 thanks to TCG. Hooray!
(downside: no PPC and SH4 emulation, no S/390 host)
-------------------------------------------------------------------
Thu May 15 17:33:53 CEST 2008 - cthiel@suse.de

206
qemu.spec
View File

@ -1,5 +1,5 @@
#
# spec file for package qemu (Version 0.9.1)
# spec file for package qemu (Version 0.9.2svn20080703)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@ -12,34 +12,25 @@
Name: qemu
BuildRequires: SDL-devel bison e2fsprogs-devel
BuildRequires: SDL-devel bison e2fsprogs-devel libgnutls-devel libpcap-devel ncurses-devel
Url: http://fabrice.bellard.free.fr/qemu/
License: BSD 3-Clause; GPL v2 or later; LGPL v2.1 or later; X11/MIT
Group: System/Emulators/PC
Summary: Universal CPU emulator
Version: 0.9.1
Release: 46
Source: %name-%version.tar.bz2
#Patch400: qemu-0.7.0-gcc4-dot-syms.patch
#Patch401: qemu-0.8.0-gcc4-hacks.patch
#Patch402: qemu-0.8.3-gcc4.patch
Version: 0.9.2svn20080703
Release: 1
Source: %name-20080703.tar.bz2
Patch1: qemu-0.9.0.cvs-binfmt.patch
Patch6: qemu-0.7.0-amd64.patch
Patch8: qemu-cvs-pthread.patch
Patch10: linkerscripts.patch
Patch14: qemu-0.7.1-jobsignals.patch
Patch16: qemu-0.7.1-armfpaex.patch
Patch19: qemu-0.9.0-nousbdevfs.patch
Patch34: qemu-0.9.0-migration.patch
Patch37: qemu-0.9.0-kvm.patch
Patch38: qemu-0.9.0-kvm-bios.patch
Patch39: qemu-0.9.0-kvm-kqemu-window-caption.patch
Patch48: qemu-z80.diff
Patch50: qemu-cvs-newpath.patch
Patch51: qemu-cvs-tls.patch
Patch52: qemu-cvs-futex.patch
Patch53: qemu-cvs-sched_getaffinity.patch
Patch54: qemu-cvs-mplayer.patch
Patch56: qemu-cvs-ipc.patch
Patch57: qemu-cvs-ipc_semop.patch
Patch58: qemu-cvs-ioctl_debug.patch
@ -51,58 +42,15 @@ Patch63: qemu-cvs-gettimeofday.patch
Patch64: qemu-cvs-nofadvise64.patch
Patch65: qemu-cvs-flash.patch
Patch66: qemu-cvs-mmap-amd64.patch
Patch67: qemu-cvs-noppcemb.patch
Patch68: qemu-0.8.3-gcc4.patch
#Patch67: qemu-cvs-noppcemb.patch
Patch69: qemu-cvs-ia64.patch
Patch70: qemu-m68k.diff
Patch71: qemu-s390.patch
Patch82: qemu-cvs-svm2.patch
Patch83: qemu-cvs-ppcspe.patch
Patch84: qemu-s390dis-license.patch
Patch85: qemu-img-vmdk-scsi.patch
Patch86: bug-380828_qemu-block-format-arg.diff
Patch86: qemu-svn-ncurses.patch
Patch87: qemu-svn-nodyngen.patch
Patch88: qemu-svn-pcap.patch
Source200: kvm_bios.bin
Source201: zx-rom.bin
Source202: COPYING.zx-rom
# GCC 3 sources/patches
Source601: gcc-3.3.5.tar.bz2
Patch600: gcc-gcc-3.3.5-hammer.patch.bz2
Patch601: gcc-gcc-noalias-warn.diff
Patch602: gcc-configure.patch
Patch603: gcc-head-tail.patch
Patch604: gcc-bug-reporting.patch
Patch605: gcc-libgc.patch
Patch606: gcc-ia64intrin.patch
Patch607: gcc-ffi.patch
Patch608: gcc-fworking-directory.patch
Patch610: gcc-altivec.diff
Patch611: gcc-compact-dwarf2.patch
Patch616: gcc-c99-double-inline.diff
Patch617: gcc-c99numbers.diff
Patch621: gcc-gcse-volatile.patch
Patch622: gcc-swig-alias.patch
Patch632: gcc-aliasing.diff
Patch633: gcc-aliasing12.diff
Patch634: gcc-aliasing3.diff
Patch637: gcc-cse-mem-expr.patch
Patch642: gcc-emit-note.patch
Patch643: gcc-unwind-ia64.patch
Patch644: gcc-hppa.patch
Patch645: gcc-suse46595.diff
Patch646: gcc-stl-multiple-defs.diff
# Ada patches
Patch653: gcc-gcc32-ada-link.patch
Patch654: gcc-gcc32-ada-addr2line.patch
# c++ patches
# PPC specific
Patch661: gcc-gcc-3.3-ppc64.patch
# Do not merge this patch into the Alan M patch, it will just get lost later.
# If you think it is useless, try building "fam" and watch libtool break.
Patch663: gcc-ppc-nostartfileprefix.patch
Patch664: gcc-ppc-nof.patch
Patch700: gcc-abuildappease.patch
Patch701: gcc-3.3.5.dif
Patch702: gcc-o_creat.dif
# this is to make lint happy
Source300: rpmlintrc
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@ -122,27 +70,15 @@ Authors:
Fabrice Bellard <fabrice.bellard@free.fr>
%prep
%setup -q -a601
#%patch400 -p1
#%patch401 -p1
#%patch402 -p1
%setup -q -n %name
ln -s fpu/*.h .
%patch1 -p1
%patch6
%patch8 -p1
%patch10
%patch14
%patch16
%patch19
#%patch34 -p1
#%patch37 -p1
#%patch38 -p1
#%patch39 -p1
%patch48 -p1
%patch50 -p1
%patch51 -p1
%patch52 -p1
%patch53 -p1
%patch54 -p1
%patch56 -p1
%patch57 -p1
%patch58 -p1
@ -154,122 +90,33 @@ Authors:
%patch64 -p1
%patch65 -p1
%patch66 -p1
%patch67 -p1
#%patch67 -p1
%patch69
%patch70
%patch71 -p1
%ifarch ia64 ppc64
#this is the dyngen for gcc4 patch (does not work on x86)
%patch68 -p1
%endif
%patch83
%patch84
%patch85 -p1
%patch86 -p1
%if 1
cd gcc-3.3.5
%patch600
%patch601
%patch602
%patch603
%patch604
%patch605
%patch606
%patch607
%patch608 -p1
%patch610
%patch611
%patch616
%patch617
%patch621
%patch622
%patch632
%patch633
%patch634
%patch637
%patch642
%patch643
%patch644
%patch645
%patch646
%patch653
%patch654
#%ifarch ppc ppc64
%patch661 -p1
#%patch6063 -p1
#%endif
%patch700 -p1
%patch701
%patch702
cd ..
%endif
%patch86
%patch87
%patch88
%build
cp -p %SOURCE200 pc-bios/
cp -p %SOURCE202 .
%ifarch ia64 ppc64
%define qemucc gcc
%else
%define gcc33tmp /tmp/gcc33
%define qemucc %{gcc33tmp}/bin/gcc
QEMU_OPT_FLAGS="$RPM_OPT_FLAGS"
# fix opt flags for gcc3
%ifarch %ix86
QEMU_OPT_FLAGS="${RPM_OPT_FLAGS/-mtune=/-mcpu=}"
%endif
QEMU_OPT_FLAGS="${QEMU_OPT_FLAGS//-fstack-protector/}"
# build gcc 3.3
%define GCCDIST %{_target_cpu}-suse-linux
cd gcc-3.3.5
./configure --enable-threads=posix \
--prefix=%{gcc33tmp} --with-local-prefix=/usr/local \
--enable-languages=c \
--enable-shared --disable-biarch --disable-multilib \
%ifarch sparc
--with-cpu=v7 \
%endif
--host=%{GCCDIST}
make bootstrap-lean BOOT_CFLAGS="$QEMU_OPT_FLAGS" STAGE1_CFLAGS="$QEMU_OPT_FLAGS" CFLAGS="$QEMU_OPT_FLAGS" %{?jobs:-j%{jobs}}
make install
cd ..
QEMU_OPT_FLAGS="$QEMU_OPT_FLAGS -fno-strict-aliasing"
%endif
# build QEMU
mkdir -p dynamic
# build qemu-system without kqemu support
./configure --prefix=/usr \
--interp-prefix=/usr/share/qemu/qemu-i386 \
--cc=%qemucc --enable-adlib --disable-gcc-check \
--audio-card-list="ac97 adlib cs4231a gus" \
--audio-drv-list="alsa sdl" --enable-mixemu \
--disable-gcc-check \
--extra-cflags="$QEMU_OPT_FLAGS" --enable-system --disable-linux-user
make %{?jobs:-j%{jobs}}
mv */qemu */qemu-* dynamic || true
make clean
# build qemu-system with kqemu support
# kqemu target
%ifarch %ix86 x86_64
%ifarch x86_64
target_list_kqemu="x86_64-softmmu"
%else
target_list_kqemu="i386-softmmu"
%endif
./configure --prefix=/usr \
--interp-prefix=/usr/share/qemu/qemu-i386 \
--target-list="$target_list_kqemu" --cc=%qemucc \
--enable-adlib --extra-cflags="$QEMU_OPT_FLAGS"
echo '#define USE_KQEMU 1' >>config-host.h
make %{?jobs:-j%{jobs}}
mv */qemu */qemu-* dynamic || true
make clean
%endif
# build userland emus
./configure --prefix=/usr \
--interp-prefix=/usr/share/qemu/qemu-i386 \
%ifarch s390 # alpha-linux-user broken (ICE)
--target-list="i386-linux-user arm-linux-user armeb-linux-user sparc-linux-user sparc64-linux-user sparc32plus-linux-user mips-linux-user mipsel-linux-user m68k-linux-user sh4-linux-user ppc-linux-user ppc64-linux-user ppc64abi32-linux-user x86_64-linux-user cris-linux-user" \
%else
--enable-linux-user \
%endif
--disable-system --cc=%qemucc \
--disable-system \
--static --disable-gcc-check \
--extra-cflags="$QEMU_OPT_FLAGS"
make %{?jobs:-j%{jobs}}
@ -297,15 +144,13 @@ ln -sf ../../../emul/ia32-linux $RPM_BUILD_ROOT/usr/share/qemu/qemu-i386
%ifnarch ia64
mkdir -p $RPM_BUILD_ROOT/emul/ia32-linux
%endif
install -m 644 %SOURCE201 $RPM_BUILD_ROOT/usr/share/qemu/
%clean
rm -rf ${RPM_BUILD_ROOT}
rm -rf %{gcc33tmp}
%files
%defattr(-, root, root)
%doc COPYING COPYING.LIB Changelog README TODO VERSION qemu-doc.html COPYING.zx-rom
%doc COPYING COPYING.LIB Changelog README TODO VERSION qemu-doc.html
%ifnarch alpha
/usr/bin/qemu
%endif
@ -318,6 +163,17 @@ rm -rf %{gcc33tmp}
%endif
%changelog
* Thu Jul 24 2008 uli@suse.de
- update -> current SVN
- MIPS Magnum R4000 machine (Hervé Poussineau)
- Braille support (Samuel Thibault)
- Freecom MusicPal system emulation (Jan Kiszka)
- OMAP242x and Nokia N800, N810 machines (Andrzej Zaborowski)
- EsounD audio driver (Frederick Reeve)
- Gravis Ultrasound GF1 sound card (Tibor "TS" Schütz)
- added pcap networking
- ditched GCC3 thanks to TCG. Hooray!
(downside: no PPC and SH4 emulation, no S/390 host)
* Thu May 15 2008 cthiel@suse.de
- use lsilogic instead of buslogic for SCSI VMDK images
* Thu May 08 2008 uli@suse.de

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d55daa439b673b0e3f5897f99ac37ecb45f974d1862b4dadb85dec34af99cb42
size 16384