From cc0bd4bed23a697be5d35aee8d4ae4340e7a0226 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Wed, 31 Mar 2010 10:32:08 +0100 Subject: gcc: Drop 3.4.4/3.4.6 and gcc-native as all are now unused Signed-off-by: Richard Purdie --- meta/packages/gcc/gcc-3.4.4.inc | 26 - meta/packages/gcc/gcc-3.4.4/15342.patch | 22 - .../gcc/gcc-3.4.4/GCC3.4.0VisibilityPatch.diff | 1100 ------- .../GCOV_PREFIX_STRIP-cross-profile_3.4.patch | 389 --- .../packages/gcc/gcc-3.4.4/always-fixincperm.patch | 32 - .../gcc-3.4.4/gcc-3.4.0-arm-bigendian-uclibc.patch | 30 - .../gcc/gcc-3.4.4/gcc-3.4.0-arm-bigendian.patch | 70 - .../gcc/gcc-3.4.4/gcc-3.4.0-arm-lib1asm.patch | 24 - .../gcc/gcc-3.4.4/gcc-3.4.0-arm-nolibfloat.patch | 24 - .../gcc/gcc-3.4.4/gcc-3.4.0-arm-softfloat.patch | 256 -- .../gcc/gcc-3.4.4/gcc-3.4.1-uclibc-100-conf.patch | 442 --- .../gcc-3.4.4/gcc-3.4.1-uclibc-200-locale.patch | 3246 -------------------- .../gcc/gcc-3.4.4/gcc-libgcc2-inhibit-libc.patch | 21 - .../gcc-3.4.4/gcc-uclibc-3.4.0-120-softfloat.patch | 14 - .../gcc/gcc-3.4.4/gcc34-arm-ldm-peephole.patch | 79 - meta/packages/gcc/gcc-3.4.4/gcc34-arm-ldm.patch | 119 - meta/packages/gcc/gcc-3.4.4/gcc34-arm-tune.patch | 9 - .../gcc/gcc-3.4.4/gcc34-configure.in.patch | 22 - .../gcc/gcc-3.4.4/gcc34-reverse-compare.patch | 32 - .../gcc/gcc-3.4.4/gcc34-thumb-support.patch | 156 - .../packages/gcc/gcc-3.4.4/gcc4-mtune-compat.patch | 14 - .../gcc/gcc-3.4.4/hrw-open-needs-3-args.patch | 13 - meta/packages/gcc/gcc-3.4.4/jarfix.patch | 30 - .../gcc/gcc-3.4.4/sdk-libstdc++-includes.patch | 22 - .../gcc/gcc-3.4.4/zecke-no-host-includes.patch | 32 - meta/packages/gcc/gcc-3.4.4/zecke-xgcc-cpp.patch | 13 - meta/packages/gcc/gcc-3.4.6.inc | 23 - .../gcc/gcc-3.4.6/GCC3.4.0VisibilityPatch.diff | 1100 ------- .../GCOV_PREFIX_STRIP-cross-profile_3.4.patch | 389 --- .../packages/gcc/gcc-3.4.6/always-fixincperm.patch | 32 - .../gcc-3.4.6/gcc-3.4.0-arm-bigendian-uclibc.patch | 30 - .../gcc/gcc-3.4.6/gcc-3.4.0-arm-bigendian.patch | 70 - .../gcc/gcc-3.4.6/gcc-3.4.0-arm-lib1asm.patch | 24 - .../gcc/gcc-3.4.6/gcc-3.4.0-arm-nolibfloat.patch | 24 - .../gcc/gcc-3.4.6/gcc-3.4.0-arm-softfloat.patch | 256 -- .../gcc/gcc-3.4.6/gcc-3.4.1-uclibc-100-conf.patch | 442 --- .../gcc-3.4.6/gcc-3.4.1-uclibc-200-locale.patch | 3246 -------------------- .../gcc-3.4.6/gcc-uclibc-3.4.0-120-softfloat.patch | 14 - .../gcc/gcc-3.4.6/gcc34-arm-ldm-peephole.patch | 79 - meta/packages/gcc/gcc-3.4.6/gcc34-arm-ldm.patch | 119 - meta/packages/gcc/gcc-3.4.6/gcc34-arm-tune.patch | 9 - .../gcc/gcc-3.4.6/gcc34-configure.in.patch | 22 - .../gcc/gcc-3.4.6/gcc34-reverse-compare.patch | 32 - .../gcc/gcc-3.4.6/gcc34-thumb-support.patch | 156 - .../packages/gcc/gcc-3.4.6/gcc4-mtune-compat.patch | 14 - meta/packages/gcc/gcc-3.4.6/jarfix.patch | 30 - .../gcc/gcc-3.4.6/sdk-libstdc++-includes.patch | 22 - .../gcc/gcc-3.4.6/zecke-no-host-includes.patch | 32 - meta/packages/gcc/gcc-3.4.6/zecke-xgcc-cpp.patch | 13 - meta/packages/gcc/gcc-cross-initial_3.4.4.bb | 2 - meta/packages/gcc/gcc-cross-intermediate_3.4.4.bb | 2 - meta/packages/gcc/gcc-cross_3.4.4.bb | 6 - meta/packages/gcc/gcc-native.inc | 24 - meta/packages/gcc/gcc-native_3.4.6.bb | 6 - meta/packages/gcc/gcc_3.4.4.bb | 5 - 55 files changed, 12460 deletions(-) delete mode 100644 meta/packages/gcc/gcc-3.4.4.inc delete mode 100644 meta/packages/gcc/gcc-3.4.4/15342.patch delete mode 100644 meta/packages/gcc/gcc-3.4.4/GCC3.4.0VisibilityPatch.diff delete mode 100644 meta/packages/gcc/gcc-3.4.4/GCOV_PREFIX_STRIP-cross-profile_3.4.patch delete mode 100644 meta/packages/gcc/gcc-3.4.4/always-fixincperm.patch delete mode 100644 meta/packages/gcc/gcc-3.4.4/gcc-3.4.0-arm-bigendian-uclibc.patch delete mode 100644 meta/packages/gcc/gcc-3.4.4/gcc-3.4.0-arm-bigendian.patch delete mode 100644 meta/packages/gcc/gcc-3.4.4/gcc-3.4.0-arm-lib1asm.patch delete mode 100644 meta/packages/gcc/gcc-3.4.4/gcc-3.4.0-arm-nolibfloat.patch delete mode 100644 meta/packages/gcc/gcc-3.4.4/gcc-3.4.0-arm-softfloat.patch delete mode 100644 meta/packages/gcc/gcc-3.4.4/gcc-3.4.1-uclibc-100-conf.patch delete mode 100644 meta/packages/gcc/gcc-3.4.4/gcc-3.4.1-uclibc-200-locale.patch delete mode 100644 meta/packages/gcc/gcc-3.4.4/gcc-libgcc2-inhibit-libc.patch delete mode 100644 meta/packages/gcc/gcc-3.4.4/gcc-uclibc-3.4.0-120-softfloat.patch delete mode 100644 meta/packages/gcc/gcc-3.4.4/gcc34-arm-ldm-peephole.patch delete mode 100644 meta/packages/gcc/gcc-3.4.4/gcc34-arm-ldm.patch delete mode 100644 meta/packages/gcc/gcc-3.4.4/gcc34-arm-tune.patch delete mode 100644 meta/packages/gcc/gcc-3.4.4/gcc34-configure.in.patch delete mode 100644 meta/packages/gcc/gcc-3.4.4/gcc34-reverse-compare.patch delete mode 100644 meta/packages/gcc/gcc-3.4.4/gcc34-thumb-support.patch delete mode 100644 meta/packages/gcc/gcc-3.4.4/gcc4-mtune-compat.patch delete mode 100644 meta/packages/gcc/gcc-3.4.4/hrw-open-needs-3-args.patch delete mode 100644 meta/packages/gcc/gcc-3.4.4/jarfix.patch delete mode 100644 meta/packages/gcc/gcc-3.4.4/sdk-libstdc++-includes.patch delete mode 100644 meta/packages/gcc/gcc-3.4.4/zecke-no-host-includes.patch delete mode 100644 meta/packages/gcc/gcc-3.4.4/zecke-xgcc-cpp.patch delete mode 100644 meta/packages/gcc/gcc-3.4.6.inc delete mode 100644 meta/packages/gcc/gcc-3.4.6/GCC3.4.0VisibilityPatch.diff delete mode 100644 meta/packages/gcc/gcc-3.4.6/GCOV_PREFIX_STRIP-cross-profile_3.4.patch delete mode 100644 meta/packages/gcc/gcc-3.4.6/always-fixincperm.patch delete mode 100644 meta/packages/gcc/gcc-3.4.6/gcc-3.4.0-arm-bigendian-uclibc.patch delete mode 100644 meta/packages/gcc/gcc-3.4.6/gcc-3.4.0-arm-bigendian.patch delete mode 100644 meta/packages/gcc/gcc-3.4.6/gcc-3.4.0-arm-lib1asm.patch delete mode 100644 meta/packages/gcc/gcc-3.4.6/gcc-3.4.0-arm-nolibfloat.patch delete mode 100644 meta/packages/gcc/gcc-3.4.6/gcc-3.4.0-arm-softfloat.patch delete mode 100644 meta/packages/gcc/gcc-3.4.6/gcc-3.4.1-uclibc-100-conf.patch delete mode 100644 meta/packages/gcc/gcc-3.4.6/gcc-3.4.1-uclibc-200-locale.patch delete mode 100644 meta/packages/gcc/gcc-3.4.6/gcc-uclibc-3.4.0-120-softfloat.patch delete mode 100644 meta/packages/gcc/gcc-3.4.6/gcc34-arm-ldm-peephole.patch delete mode 100644 meta/packages/gcc/gcc-3.4.6/gcc34-arm-ldm.patch delete mode 100644 meta/packages/gcc/gcc-3.4.6/gcc34-arm-tune.patch delete mode 100644 meta/packages/gcc/gcc-3.4.6/gcc34-configure.in.patch delete mode 100644 meta/packages/gcc/gcc-3.4.6/gcc34-reverse-compare.patch delete mode 100644 meta/packages/gcc/gcc-3.4.6/gcc34-thumb-support.patch delete mode 100644 meta/packages/gcc/gcc-3.4.6/gcc4-mtune-compat.patch delete mode 100644 meta/packages/gcc/gcc-3.4.6/jarfix.patch delete mode 100644 meta/packages/gcc/gcc-3.4.6/sdk-libstdc++-includes.patch delete mode 100644 meta/packages/gcc/gcc-3.4.6/zecke-no-host-includes.patch delete mode 100644 meta/packages/gcc/gcc-3.4.6/zecke-xgcc-cpp.patch delete mode 100644 meta/packages/gcc/gcc-cross-initial_3.4.4.bb delete mode 100644 meta/packages/gcc/gcc-cross-intermediate_3.4.4.bb delete mode 100644 meta/packages/gcc/gcc-cross_3.4.4.bb delete mode 100644 meta/packages/gcc/gcc-native.inc delete mode 100644 meta/packages/gcc/gcc-native_3.4.6.bb delete mode 100644 meta/packages/gcc/gcc_3.4.4.bb diff --git a/meta/packages/gcc/gcc-3.4.4.inc b/meta/packages/gcc/gcc-3.4.4.inc deleted file mode 100644 index df99c3b4c7..0000000000 --- a/meta/packages/gcc/gcc-3.4.4.inc +++ /dev/null @@ -1,26 +0,0 @@ -require gcc-common.inc - -SRC_URI = "${GNU_MIRROR}/gcc/gcc-${PV}/gcc-${PV}.tar.bz2 \ - file://gcc34-reverse-compare.patch;patch=1 \ - file://gcc34-arm-ldm.patch;patch=1 \ - file://gcc34-arm-ldm-peephole.patch;patch=1 \ - file://gcc34-arm-tune.patch;patch=1 \ - file://gcc-3.4.1-uclibc-100-conf.patch;patch=1 \ - file://gcc-3.4.1-uclibc-200-locale.patch;patch=1 \ - file://gcc-3.4.0-arm-lib1asm.patch;patch=1 \ - file://gcc-3.4.0-arm-nolibfloat.patch;patch=1 \ - file://gcc-3.4.0-arm-bigendian.patch;patch=1 \ - file://gcc-3.4.0-arm-bigendian-uclibc.patch;patch=1 \ - file://GCC3.4.0VisibilityPatch.diff;patch=1 \ - file://15342.patch;patch=1 \ - file://jarfix.patch;patch=1 \ - file://always-fixincperm.patch;patch=1 \ - file://GCOV_PREFIX_STRIP-cross-profile_3.4.patch;patch=1 \ - file://zecke-xgcc-cpp.patch;patch=1 \ - file://gcc-libgcc2-inhibit-libc.patch;patch=1 \ - file://gcc4-mtune-compat.patch;patch=1 \ - file://hrw-open-needs-3-args.patch" - -SRC_URI += "file://gcc34-configure.in.patch;patch=1" -SRC_URI += "file://gcc34-thumb-support.patch;patch=1" -SRC_URI_append_fail-fast = " file://zecke-no-host-includes.patch;patch=1 " diff --git a/meta/packages/gcc/gcc-3.4.4/15342.patch b/meta/packages/gcc/gcc-3.4.4/15342.patch deleted file mode 100644 index d0f3e72d47..0000000000 --- a/meta/packages/gcc/gcc-3.4.4/15342.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- gcc/gcc/regrename.c~ 2004-01-14 17:55:20.000000000 +0000 -+++ gcc/gcc/regrename.c 2005-02-28 07:24:25.893015200 +0000 -@@ -671,7 +671,8 @@ - - case SET: - scan_rtx (insn, &SET_SRC (x), class, action, OP_IN, 0); -- scan_rtx (insn, &SET_DEST (x), class, action, OP_OUT, 0); -+ scan_rtx (insn, &SET_DEST (x), class, action, -+ GET_CODE (PATTERN (insn)) == COND_EXEC ? OP_INOUT : OP_OUT, 0); - return; - - case STRICT_LOW_PART: -@@ -696,7 +697,8 @@ - abort (); - - case CLOBBER: -- scan_rtx (insn, &SET_DEST (x), class, action, OP_OUT, 1); -+ scan_rtx (insn, &SET_DEST (x), class, action, -+ GET_CODE (PATTERN (insn)) == COND_EXEC ? OP_INOUT : OP_OUT, 0); - return; - - case EXPR_LIST: diff --git a/meta/packages/gcc/gcc-3.4.4/GCC3.4.0VisibilityPatch.diff b/meta/packages/gcc/gcc-3.4.4/GCC3.4.0VisibilityPatch.diff deleted file mode 100644 index d51da7157d..0000000000 --- a/meta/packages/gcc/gcc-3.4.4/GCC3.4.0VisibilityPatch.diff +++ /dev/null @@ -1,1100 +0,0 @@ - -diff -aur gcc-3.4.0orig/gcc/c-common.c gcc-3.4.0/gcc/c-common.c ---- gcc-3.4.0orig/gcc/c-common.c 2004-03-19 01:32:59.000000000 +0000 -+++ gcc-3.4.0/gcc/c-common.c 2004-05-10 21:05:33.000000000 +0100 -@@ -833,7 +833,7 @@ - handle_deprecated_attribute }, - { "vector_size", 1, 1, false, true, false, - handle_vector_size_attribute }, -- { "visibility", 1, 1, true, false, false, -+ { "visibility", 1, 1, false, false, false, - handle_visibility_attribute }, - { "tls_model", 1, 1, true, false, false, - handle_tls_model_attribute }, -@@ -4886,7 +4886,16 @@ - - *no_add_attrs = true; - -- if (decl_function_context (decl) != 0 || ! TREE_PUBLIC (decl)) -+ if (TYPE_P (*node)) -+ { -+ if (TREE_CODE (*node) != RECORD_TYPE && TREE_CODE (*node) != UNION_TYPE) -+ { -+ warning ("`%s' attribute ignored on non-class types", -+ IDENTIFIER_POINTER (name)); -+ return NULL_TREE; -+ } -+ } -+ else if (decl_function_context (decl) != 0 || ! TREE_PUBLIC (decl)) - { - warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); - return NULL_TREE; -@@ -4897,6 +4906,14 @@ - error ("visibility arg not a string"); - return NULL_TREE; - } -+ -+ /* If this is a type, set the visibility on the type decl. */ -+ if (TYPE_P (decl)) -+ { -+ decl = TYPE_NAME (decl); -+ if (! decl) -+ return NULL_TREE; -+ } - - if (strcmp (TREE_STRING_POINTER (id), "default") == 0) - DECL_VISIBILITY (decl) = VISIBILITY_DEFAULT; -@@ -4908,6 +4925,14 @@ - DECL_VISIBILITY (decl) = VISIBILITY_PROTECTED; - else - error ("visibility arg must be one of \"default\", \"hidden\", \"protected\" or \"internal\""); -+ DECL_VISIBILITYSPECIFIED (decl) = 1; -+ -+ /* For decls only, go ahead and attach the attribute to the node as well. -+ This is needed so we can determine whether we have VISIBILITY_DEFAULT -+ because the visibility was not specified, or because it was explicitly -+ overridden from the class visibility. */ -+ if (DECL_P (*node)) -+ *no_add_attrs = false; - - return NULL_TREE; - } - -diff -aur gcc-3.4.0orig/gcc/c-decl.c gcc-3.4.0/gcc/c-decl.c ---- gcc-3.4.0orig/gcc/c-decl.c 2004-03-22 17:58:18.000000000 +0000 -+++ gcc-3.4.0/gcc/c-decl.c 2004-05-10 15:16:27.000000000 +0100 -@@ -1164,9 +1164,8 @@ - } - - /* warnings */ -- /* All decls must agree on a non-default visibility. */ -- if (DECL_VISIBILITY (newdecl) != VISIBILITY_DEFAULT -- && DECL_VISIBILITY (olddecl) != VISIBILITY_DEFAULT -+ /* All decls must agree on a visibility. */ -+ if (DECL_VISIBILITYSPECIFIED (newdecl) && DECL_VISIBILITYSPECIFIED (olddecl) - && DECL_VISIBILITY (newdecl) != DECL_VISIBILITY (olddecl)) - { - warning ("%Jredeclaration of '%D' with different visibility " -@@ -1361,9 +1360,12 @@ - Currently, it can only be defined in the prototype. */ - COPY_DECL_ASSEMBLER_NAME (olddecl, newdecl); - -- /* If either declaration has a nondefault visibility, use it. */ -- if (DECL_VISIBILITY (olddecl) != VISIBILITY_DEFAULT) -- DECL_VISIBILITY (newdecl) = DECL_VISIBILITY (olddecl); -+ /* Use visibility of whichever declaration had it specified */ -+ if (DECL_VISIBILITYSPECIFIED (olddecl)) -+ { -+ DECL_VISIBILITY (newdecl) = DECL_VISIBILITY (olddecl); -+ DECL_VISIBILITYSPECIFIED (newdecl) = 1; -+ } - - if (TREE_CODE (newdecl) == FUNCTION_DECL) - { - -diff -aur gcc-3.4.0orig/gcc/common.opt gcc-3.4.0/gcc/common.opt ---- gcc-3.4.0orig/gcc/common.opt 2004-02-18 00:09:04.000000000 +0000 -+++ gcc-3.4.0/gcc/common.opt 2004-05-09 08:10:50.000000000 +0100 -@@ -718,6 +718,11 @@ - Common - Add extra commentary to assembler output - -+fvisibility= -+Common Joined RejectNegative -+-fvisibility=[default|internal|hidden|protected] Set the default symbol visibility -+ -+ - fvpt - Common - Use expression value profiles in optimizations - -diff -aur gcc-3.4.0orig/gcc/c.opt gcc-3.4.0/gcc/c.opt ---- gcc-3.4.0orig/gcc/c.opt 2004-02-18 00:09:03.000000000 +0000 -+++ gcc-3.4.0/gcc/c.opt 2004-05-09 08:10:50.000000000 +0100 -@@ -656,6 +656,10 @@ - C++ ObjC++ - Use __cxa_atexit to register destructors - -+fvisibility-inlines-hidden -+C++ -+Marks all inlined methods as having hidden visibility -+ - fvtable-gc - C++ ObjC++ - Discard unused virtual functions -diff -aur gcc-3.4.0orig/gcc/c-opts.c gcc-3.4.0/gcc/c-opts.c ---- gcc-3.4.0orig/gcc/c-opts.c 2004-02-18 00:09:03.000000000 +0000 -+++ gcc-3.4.0/gcc/c-opts.c 2004-05-09 08:10:50.000000000 +0100 -@@ -912,6 +912,10 @@ - case OPT_fuse_cxa_atexit: - flag_use_cxa_atexit = value; - break; -+ -+ case OPT_fvisibility_inlines_hidden: -+ visibility_options.inlineshidden = value; -+ break; - - case OPT_fweak: - flag_weak = value; - -diff -aur gcc-3.4.0orig/gcc/cp/class.c gcc-3.4.0/gcc/cp/class.c ---- gcc-3.4.0orig/gcc/cp/class.c 2004-03-09 07:27:23.000000000 +0000 -+++ gcc-3.4.0/gcc/cp/class.c 2004-05-10 21:06:50.000000000 +0100 -@@ -524,6 +524,10 @@ - DECL_ALIGN (decl) = MAX (TYPE_ALIGN (double_type_node), - DECL_ALIGN (decl)); - -+ /* The vtable's visibility is the class visibility. There is no way -+ to override the visibility for just the vtable. */ -+ DECL_VISIBILITY (decl) = CLASSTYPE_VISIBILITY (class_type); -+ DECL_VISIBILITYSPECIFIED (decl) = CLASSTYPE_VISIBILITYSPECIFIED (class_type); - import_export_vtable (decl, class_type, 0); - - return decl; -@@ -2971,7 +2975,25 @@ - continue; - - if (TREE_CODE (x) == CONST_DECL || TREE_CODE (x) == VAR_DECL) -- continue; -+ { -+ /* Apply the class's visibility attribute to static members -+ which do not have a visibility attribute. */ -+ if (! lookup_attribute ("visibility", DECL_ATTRIBUTES (x))) -+ { -+ if (visibility_options.inlineshidden && DECL_INLINE (x)) -+ { -+ DECL_VISIBILITY (x) = VISIBILITY_HIDDEN; -+ DECL_VISIBILITYSPECIFIED (x) = 1; -+ } -+ else -+ { -+ DECL_VISIBILITY (x) = CLASSTYPE_VISIBILITY (current_class_type); -+ DECL_VISIBILITYSPECIFIED (x) = CLASSTYPE_VISIBILITYSPECIFIED (current_class_type); -+ } -+ } -+ -+ continue; -+ } - - /* Now it can only be a FIELD_DECL. */ - -@@ -3708,6 +3730,22 @@ - check_for_override (x, t); - if (DECL_PURE_VIRTUAL_P (x) && ! DECL_VINDEX (x)) - cp_error_at ("initializer specified for non-virtual method `%D'", x); -+ -+ /* Apply the class's visibility attribute to methods which do -+ not have a visibility attribute. */ -+ if (! lookup_attribute ("visibility", DECL_ATTRIBUTES (x))) -+ { -+ if (visibility_options.inlineshidden && DECL_INLINE (x)) -+ { -+ DECL_VISIBILITY (x) = VISIBILITY_HIDDEN; -+ DECL_VISIBILITYSPECIFIED (x) = 1; -+ } -+ else -+ { -+ DECL_VISIBILITY (x) = CLASSTYPE_VISIBILITY (current_class_type); -+ DECL_VISIBILITYSPECIFIED (x) = CLASSTYPE_VISIBILITYSPECIFIED (current_class_type); -+ } -+ } - - /* The name of the field is the original field name - Save this in auxiliary field for later overloading. */ -@@ -7830,3 +7868,4 @@ - *vid->last_init = build_tree_list (NULL_TREE, init); - vid->last_init = &TREE_CHAIN (*vid->last_init); - } -+ - -diff -aur gcc-3.4.0orig/gcc/cp/cp-tree.h gcc-3.4.0/gcc/cp/cp-tree.h ---- gcc-3.4.0orig/gcc/cp/cp-tree.h 2004-03-20 00:13:08.000000000 +0000 -+++ gcc-3.4.0/gcc/cp/cp-tree.h 2004-05-10 20:56:56.000000000 +0100 -@@ -1008,7 +1008,12 @@ - #define PUBLICLY_UNIQUELY_DERIVED_P(PARENT, TYPE) \ - (lookup_base ((TYPE), (PARENT), ba_not_special | ba_quiet, NULL) \ - != NULL_TREE) -- -+ -+/* Gives the visibility specification for a class type. */ -+#define CLASSTYPE_VISIBILITY(TYPE) DECL_VISIBILITY (TYPE_NAME (TYPE)) -+#define CLASSTYPE_VISIBILITYSPECIFIED(TYPE) DECL_VISIBILITYSPECIFIED (TYPE_NAME (TYPE)) -+ -+ - /* This is a few header flags for 'struct lang_type'. Actually, - all but the first are used only for lang_type_class; they - are put in this structure to save space. */ - -diff -aur gcc-3.4.0orig/gcc/cp/decl.c gcc-3.4.0/gcc/cp/decl.c ---- gcc-3.4.0orig/gcc/cp/decl.c 2004-04-01 21:47:21.000000000 +0100 -+++ gcc-3.4.0/gcc/cp/decl.c 2004-05-28 21:16:11.000000000 +0100 -@@ -1869,17 +1869,34 @@ - DECL_COMMON (newdecl) = DECL_COMMON (olddecl); - COPY_DECL_ASSEMBLER_NAME (olddecl, newdecl); - -- /* If either declaration has a nondefault visibility, use it. */ -- if (DECL_VISIBILITY (olddecl) != VISIBILITY_DEFAULT) -+ /* Warn about conflicting visibility specifications. */ -+ if (DECL_VISIBILITYSPECIFIED (olddecl) && DECL_VISIBILITYSPECIFIED (newdecl) -+ && DECL_VISIBILITY (newdecl) != DECL_VISIBILITY (olddecl)) -+ { -+ warning ("%J'%D': visibility attribute ignored because it", -+ newdecl, newdecl); -+ warning ("%Jconflicts with previous declaration here", olddecl); -+ } -+ /* Choose the declaration which specified visibility. */ -+ if (DECL_VISIBILITYSPECIFIED (olddecl)) - { -- if (DECL_VISIBILITY (newdecl) != VISIBILITY_DEFAULT -- && DECL_VISIBILITY (newdecl) != DECL_VISIBILITY (olddecl)) -- { -- warning ("%J'%D': visibility attribute ignored because it", -- newdecl, newdecl); -- warning ("%Jconflicts with previous declaration here", olddecl); -- } - DECL_VISIBILITY (newdecl) = DECL_VISIBILITY (olddecl); -+ DECL_VISIBILITYSPECIFIED (newdecl) = 1; -+ } -+ /* If it's a definition of a global operator new or operator -+ delete, it must be default visibility. */ -+ if (NEW_DELETE_OPNAME_P (DECL_NAME (newdecl)) && DECL_INITIAL (newdecl) != NULL_TREE) -+ { -+ if (!DECL_FUNCTION_MEMBER_P (newdecl) && VISIBILITY_DEFAULT != DECL_VISIBILITY (newdecl)) -+ { -+ warning ("%J`%D': ignoring non-default symbol", -+ newdecl, newdecl); -+ warning ("%Jvisibility on global operator new or delete", newdecl); -+ DECL_VISIBILITY (olddecl) = VISIBILITY_DEFAULT; -+ DECL_VISIBILITYSPECIFIED (olddecl) = 1; -+ DECL_VISIBILITY (newdecl) = VISIBILITY_DEFAULT; -+ DECL_VISIBILITYSPECIFIED (newdecl) = 1; -+ } - } - - if (TREE_CODE (newdecl) == FUNCTION_DECL) - -diff -aur gcc-3.4.0orig/gcc/cp/method.c gcc-3.4.0/gcc/cp/method.c ---- gcc-3.4.0orig/gcc/cp/method.c 2004-04-08 23:15:58.000000000 +0100 -+++ gcc-3.4.0/gcc/cp/method.c 2004-05-09 08:10:52.000000000 +0100 -@@ -394,6 +394,7 @@ - rewrite. */ - TREE_PUBLIC (thunk_fndecl) = TREE_PUBLIC (function); - DECL_VISIBILITY (thunk_fndecl) = DECL_VISIBILITY (function); -+ DECL_VISIBILITYSPECIFIED (thunk_fndecl) = DECL_VISIBILITYSPECIFIED (function); - - if (flag_syntax_only) - { - -diff -aur gcc-3.4.0orig/gcc/cp/optimize.c gcc-3.4.0/gcc/cp/optimize.c ---- gcc-3.4.0orig/gcc/cp/optimize.c 2004-02-08 01:52:50.000000000 +0000 -+++ gcc-3.4.0/gcc/cp/optimize.c 2004-05-09 08:10:52.000000000 +0100 -@@ -155,6 +155,7 @@ - DECL_NOT_REALLY_EXTERN (clone) = DECL_NOT_REALLY_EXTERN (fn); - TREE_PUBLIC (clone) = TREE_PUBLIC (fn); - DECL_VISIBILITY (clone) = DECL_VISIBILITY (fn); -+ DECL_VISIBILITYSPECIFIED (clone) = DECL_VISIBILITYSPECIFIED (fn); - - /* Adjust the parameter names and locations. */ - parm = DECL_ARGUMENTS (fn); - -diff -aur gcc-3.4.0orig/gcc/cp/rtti.c gcc-3.4.0/gcc/cp/rtti.c ---- gcc-3.4.0orig/gcc/cp/rtti.c 2004-03-08 23:00:26.000000000 +0000 -+++ gcc-3.4.0/gcc/cp/rtti.c 2004-05-10 21:09:21.000000000 +0100 -@@ -361,7 +361,11 @@ - pushdecl_top_level_and_finish (d, NULL_TREE); - - if (CLASS_TYPE_P (type)) -- CLASSTYPE_TYPEINFO_VAR (TYPE_MAIN_VARIANT (type)) = d; -+ { -+ CLASSTYPE_TYPEINFO_VAR (TYPE_MAIN_VARIANT (type)) = d; -+ DECL_VISIBILITY (d) = CLASSTYPE_VISIBILITY (type); -+ DECL_VISIBILITYSPECIFIED (d) = CLASSTYPE_VISIBILITYSPECIFIED (type); -+ } - - /* Remember the type it is for. */ - TREE_TYPE (name) = type; -@@ -759,6 +763,11 @@ - TREE_STATIC (name_decl) = 1; - DECL_EXTERNAL (name_decl) = 0; - TREE_PUBLIC (name_decl) = 1; -+ if (CLASS_TYPE_P (target)) -+ { -+ DECL_VISIBILITY (name_decl) = CLASSTYPE_VISIBILITY (target); -+ DECL_VISIBILITYSPECIFIED (name_decl) = CLASSTYPE_VISIBILITYSPECIFIED (target); -+ } - import_export_tinfo (name_decl, target, typeinfo_in_lib_p (target)); - /* External name of the string containing the type's name has a - special name. */ - -diff -aur gcc-3.4.0orig/gcc/c-pragma.c gcc-3.4.0/gcc/c-pragma.c ---- gcc-3.4.0orig/gcc/c-pragma.c 2004-01-23 23:35:53.000000000 +0000 -+++ gcc-3.4.0/gcc/c-pragma.c 2004-05-09 08:10:52.000000000 +0100 -@@ -480,6 +480,86 @@ - return asmname; - } - -+ -+#ifdef HANDLE_PRAGMA_VISIBILITY -+static void handle_pragma_visibility (cpp_reader *); -+ -+/* Sets the default visibility for symbols to something other than that -+ specified on the command line. */ -+static void -+handle_pragma_visibility (cpp_reader *dummy ATTRIBUTE_UNUSED) -+{ /* Form is #pragma GCC visibility push(hidden)|pop */ -+ static int visstack [16], visidx; -+ tree x; -+ enum cpp_ttype token; -+ enum { bad, push, pop } action = bad; -+ -+ token = c_lex (&x); -+ if (token == CPP_NAME) -+ { -+ const char *op = IDENTIFIER_POINTER (x); -+ if (!strcmp (op, "push")) -+ action = push; -+ else if (!strcmp (op, "pop")) -+ action = pop; -+ } -+ if (bad == action) -+ GCC_BAD ("#pragma GCC visibility must be followed by push or pop"); -+ else -+ { -+ if (pop == action) -+ { -+ if (!visidx) -+ { -+ GCC_BAD ("No matching push for '#pragma GCC visibility pop'"); -+ } -+ else -+ { -+ default_visibility = visstack[--visidx]; -+ visibility_options.inpragma = (visidx>0); -+ } -+ } -+ else -+ { -+ if (c_lex (&x) != CPP_OPEN_PAREN) -+ GCC_BAD ("missing '(' after '#pragma GCC visibility push' - ignored"); -+ token = c_lex (&x); -+ if (token != CPP_NAME) -+ { -+ GCC_BAD ("malformed #pragma GCC visibility push"); -+ } -+ else if (visidx >= 16) -+ { -+ GCC_BAD ("No more than sixteen #pragma GCC visibility pushes allowed at once"); -+ } -+ else -+ { -+ const char *str = IDENTIFIER_POINTER (x); -+ visstack[visidx++] = default_visibility; -+ if (!strcmp (str, "default")) -+ default_visibility = VISIBILITY_DEFAULT; -+ else if (!strcmp (str, "internal")) -+ default_visibility = VISIBILITY_INTERNAL; -+ else if (!strcmp (str, "hidden")) -+ default_visibility = VISIBILITY_HIDDEN; -+ else if (!strcmp (str, "protected")) -+ default_visibility = VISIBILITY_PROTECTED; -+ else -+ { -+ GCC_BAD ("#pragma GCC visibility push() must specify default, internal, hidden or protected"); -+ } -+ visibility_options.inpragma = 1; -+ } -+ if (c_lex (&x) != CPP_CLOSE_PAREN) -+ GCC_BAD ("missing '(' after '#pragma GCC visibility push' - ignored"); -+ } -+ } -+ if (c_lex (&x) != CPP_EOF) -+ warning ("junk at end of '#pragma GCC visibility'"); -+} -+ -+#endif -+ - /* Front-end wrapper for pragma registration to avoid dragging - cpplib.h in almost everywhere. */ - void -@@ -505,6 +585,9 @@ - #ifdef HANDLE_PRAGMA_EXTERN_PREFIX - c_register_pragma (0, "extern_prefix", handle_pragma_extern_prefix); - #endif -+#ifdef HANDLE_PRAGMA_VISIBILITY -+ c_register_pragma ("GCC", "visibility", handle_pragma_visibility); -+#endif - - #ifdef REGISTER_TARGET_PRAGMAS - REGISTER_TARGET_PRAGMAS (); -diff -aur gcc-3.4.0orig/gcc/c-pragma.h gcc-3.4.0/gcc/c-pragma.h ---- gcc-3.4.0orig/gcc/c-pragma.h 2004-01-31 06:18:05.000000000 +0000 -+++ gcc-3.4.0/gcc/c-pragma.h 2004-05-09 08:10:53.000000000 +0100 -@@ -44,6 +44,11 @@ - #define HANDLE_PRAGMA_PACK 1 - #endif /* HANDLE_PRAGMA_PACK_PUSH_POP */ - -+/* It's safe to always leave visibility pragma enabled as if -+ visibility is not supported on the host OS platform the -+ statements are ignored. */ -+#define HANDLE_PRAGMA_VISIBILITY 1 -+ - extern void init_pragma (void); - - /* Front-end wrapper for pragma registration to avoid dragging - - -diff -aur gcc-3.4.0orig/gcc/doc/invoke.texi gcc-3.4.0/gcc/doc/invoke.texi ---- gcc-3.4.0orig/gcc/doc/invoke.texi 2004-04-19 00:05:36.000000000 +0100 -+++ gcc-3.4.0/gcc/doc/invoke.texi 2004-05-28 21:29:36.000000000 +0100 -@@ -183,7 +183,8 @@ - -fno-optional-diags -fpermissive @gol - -frepo -fno-rtti -fstats -ftemplate-depth-@var{n} @gol - -fuse-cxa-atexit -fno-weak -nostdinc++ @gol ---fno-default-inline -Wabi -Wctor-dtor-privacy @gol -+-fno-default-inline -fvisibility-inlines-hidden @gol -+-Wabi -Wctor-dtor-privacy @gol - -Wnon-virtual-dtor -Wreorder @gol - -Weffc++ -Wno-deprecated @gol - -Wno-non-template-friend -Wold-style-cast @gol -@@ -674,7 +675,8 @@ - -fargument-alias -fargument-noalias @gol - -fargument-noalias-global -fleading-underscore @gol - -ftls-model=@var{model} @gol ---ftrapv -fwrapv -fbounds-check} -+-ftrapv -fwrapv -fbounds-check @gol -+-fvisibility} - @end table - - @menu -@@ -1433,6 +1435,20 @@ - destructors, but will only work if your C library supports - @code{__cxa_atexit}. - -+@item -fvisibility-inlines-hidden -+@opindex fvisibility-inlines-hidden -+Causes all inlined methods to be marked with -+@code{__attribute__ ((visibility ("hidden")))} so that they do not -+appear in the export table of a DSO and do not require a PLT indirection -+when used within the DSO. Enabling this option can have a dramatic effect -+on load and link times of a DSO as it massively reduces the size of the -+dynamic export table when the library makes heavy use of templates. While -+it can cause bloating through duplication of code within each DSO where -+it is used, often the wastage is less than the considerable space occupied -+by a long symbol name in the export table which is typical when using -+templates and namespaces. For even more savings, combine with the -+@code{-fvisibility=hidden} switch. -+ - @item -fno-weak - @opindex fno-weak - Do not use weak symbol support, even if it is provided by the linker. -@@ -11198,6 +11214,54 @@ - - The default without @option{-fpic} is @code{initial-exec}; with - @option{-fpic} the default is @code{global-dynamic}. -+ -+@item -fvisibility=@var{default|internal|hidden|protected} -+@opindex fvisibility -+Set the default ELF image symbol visibility to the specified option - all -+symbols will be marked with this unless overrided within the code. -+Using this feature can very substantially improve linking and -+load times of shared object libraries, produce more optimised -+code, provide near-perfect API export and prevent symbol clashes. -+It is @strong{strongly} recommended that you use this in any shared objects -+you distribute. -+ -+Despite the nomenclature, @code{default} always means public ie; -+available to be linked against from outside the shared object. -+@code{protected} and @code{internal} are pretty useless in real-world -+usage so the only other commonly used option will be @code{hidden}. -+The default if -fvisibility isn't specified is @code{default} ie; make every -+symbol public - this causes the same behaviour as previous versions of -+GCC. -+ -+A good explanation of the benefits offered by ensuring ELF -+symbols have the correct visibility is given by ``How To Write -+Shared Libraries'' by Ulrich Drepper (which can be found at -+@w{@uref{http://people.redhat.com/~drepper/}}) - however a superior -+solution made possible by this option to marking things hidden when -+the default is public is to make the default hidden and mark things -+public. This is the norm with DLL's on Windows and with @option{-fvisibility=hidden} -+and @code{__attribute__ ((visibility("default")))} instead of -+@code{__declspec(dllexport)} you get almost identical semantics with -+identical syntax. This is a great boon to those working with -+cross-platform projects. -+ -+For those adding visibility support to existing code, you may find -+@samp{#pragma GCC visibility} of use. This works by you enclosing -+the declarations you wish to set visibility for with (for example) -+@samp{#pragma GCC visibility push(hidden)} and -+@samp{#pragma GCC visibility pop}. These can be nested up to sixteen -+times. Bear in mind that symbol visibility should be viewed @strong{as -+part of the API interface contract} and thus all new code should -+always specify visibility when it is not the default ie; declarations -+only for use within the local DSO should @strong{always} be marked explicitly -+as hidden as so to avoid PLT indirection overheads - making this -+abundantly clear also aids readability and self-documentation of the code. -+Note that due to ISO C++ specification requirements, operator new and -+operator delete must always be of default visibility. -+ -+An overview of these techniques, their benefits and how to use them -+is at @w{@uref{http://www.nedprod.com/programs/gccvisibility.html}}. -+ - @end table - - @c man end - -diff -aur gcc-3.4.0orig/gcc/flags.h gcc-3.4.0/gcc/flags.h ---- gcc-3.4.0orig/gcc/flags.h 2004-02-18 00:09:04.000000000 +0000 -+++ gcc-3.4.0/gcc/flags.h 2004-05-09 08:10:53.000000000 +0100 -@@ -60,6 +60,30 @@ - /* Nonzero means emit debugging information only for symbols which are used. */ - extern int flag_debug_only_used_symbols; - -+/* Enumerate visibility settings. */ -+#ifndef SYMBOL_VISIBILITY_DEFINED -+#define SYMBOL_VISIBILITY_DEFINED -+enum symbol_visibility -+{ -+ VISIBILITY_DEFAULT, -+ VISIBILITY_INTERNAL, -+ VISIBILITY_HIDDEN, -+ VISIBILITY_PROTECTED -+}; -+#endif -+ -+/* The default visibility for all symbols (unless overridden). */ -+extern enum symbol_visibility default_visibility; -+ -+struct visibility_flags -+{ -+ unsigned inpragma : 1; /* True when in #pragma GCC visibility. */ -+ unsigned inlineshidden : 1; /* True when -finlineshidden in effect. */ -+}; -+ -+/* Global visibility options. */ -+extern struct visibility_flags visibility_options; -+ - /* Nonzero means do optimizations. -opt. */ - - extern int optimize; - -diff -aur gcc-3.4.0orig/gcc/opts.c gcc-3.4.0/gcc/opts.c ---- gcc-3.4.0orig/gcc/opts.c 2004-02-18 00:09:04.000000000 +0000 -+++ gcc-3.4.0/gcc/opts.c 2004-05-09 08:10:53.000000000 +0100 -@@ -142,6 +142,12 @@ - write_symbols is set to DBX_DEBUG, XCOFF_DEBUG, or DWARF_DEBUG. */ - bool use_gnu_debug_info_extensions; - -+/* The default visibility for all symbols (unless overridden) */ -+enum symbol_visibility default_visibility = VISIBILITY_DEFAULT; -+ -+/* Global visibility options. */ -+struct visibility_flags visibility_options; -+ - /* Columns of --help display. */ - static unsigned int columns = 80; - -@@ -1440,6 +1446,21 @@ - flag_verbose_asm = value; - break; - -+ case OPT_fvisibility_: -+ { -+ if(!strcmp(arg, "default")) -+ default_visibility=VISIBILITY_DEFAULT; -+ else if(!strcmp(arg, "internal")) -+ default_visibility=VISIBILITY_INTERNAL; -+ else if(!strcmp(arg, "hidden")) -+ default_visibility=VISIBILITY_HIDDEN; -+ else if(!strcmp(arg, "protected")) -+ default_visibility=VISIBILITY_PROTECTED; -+ else -+ error("unrecognised visibility value \"%s\"", arg); -+ } -+ break; -+ - case OPT_fweb: - flag_web = value; - break; - -diff -aur gcc-3.4.0orig/gcc/tree.c gcc-3.4.0/gcc/tree.c ---- gcc-3.4.0orig/gcc/tree.c 2004-02-05 22:01:35.000000000 +0000 -+++ gcc-3.4.0/gcc/tree.c 2004-05-10 15:22:52.000000000 +0100 -@@ -2563,6 +2563,11 @@ - layout_decl (t, 0); - else if (code == FUNCTION_DECL) - DECL_MODE (t) = FUNCTION_MODE; -+ -+ /* Set default visibility to whatever the user supplied with -+ visibility_specified depending on #pragma GCC visibility. */ -+ DECL_VISIBILITY (t) = default_visibility; -+ DECL_VISIBILITYSPECIFIED (t) = visibility_options.inpragma; - - return t; - } - -diff -aur gcc-3.4.0orig/gcc/tree.h gcc-3.4.0/gcc/tree.h ---- gcc-3.4.0orig/gcc/tree.h 2004-02-08 01:52:43.000000000 +0000 -+++ gcc-3.4.0/gcc/tree.h 2004-05-09 08:10:54.000000000 +0100 -@@ -1499,6 +1499,10 @@ - /* Value of the decls's visibility attribute */ - #define DECL_VISIBILITY(NODE) (DECL_CHECK (NODE)->decl.visibility) - -+/* Nonzero means that the decl had its visibility specified rather than -+ being inferred. */ -+#define DECL_VISIBILITYSPECIFIED(NODE) (DECL_CHECK (NODE)->decl.visibility_specified) -+ - /* In a FUNCTION_DECL, nonzero if the function cannot be inlined. */ - #define DECL_UNINLINABLE(NODE) (FUNCTION_DECL_CHECK (NODE)->decl.uninlinable) - -@@ -1633,7 +1637,8 @@ - || TREE_CODE (DECL_CONTEXT (EXP)) == TRANSLATION_UNIT_DECL) - - /* Enumerate visibility settings. */ -- -+#ifndef SYMBOL_VISIBILITY_DEFINED -+#define SYMBOL_VISIBILITY_DEFINED - enum symbol_visibility - { - VISIBILITY_DEFAULT, -@@ -1641,6 +1646,7 @@ - VISIBILITY_HIDDEN, - VISIBILITY_PROTECTED - }; -+#endif - - struct function; - -@@ -1684,8 +1690,7 @@ - unsigned thread_local_flag : 1; - unsigned declared_inline_flag : 1; - ENUM_BITFIELD(symbol_visibility) visibility : 2; -- unsigned unused : 1; -- /* one unused bit. */ -+ unsigned visibility_specified : 1; - - unsigned lang_flag_0 : 1; - unsigned lang_flag_1 : 1; - -diff -aur gcc-3.4.0orig/gcc/varasm.c gcc-3.4.0/gcc/varasm.c ---- gcc-3.4.0orig/gcc/varasm.c 2004-04-14 22:14:08.000000000 +0100 -+++ gcc-3.4.0/gcc/varasm.c 2004-05-09 08:10:54.000000000 +0100 -@@ -5150,8 +5150,8 @@ - /* Static variables are always local. */ - else if (! TREE_PUBLIC (exp)) - local_p = true; -- /* A variable is local if the user tells us so. */ -- else if (DECL_VISIBILITY (exp) != VISIBILITY_DEFAULT) -+ /* A variable is local if the user explicitly tells us so. */ -+ else if (DECL_VISIBILITYSPECIFIED (exp) && DECL_VISIBILITY (exp) != VISIBILITY_DEFAULT) - local_p = true; - /* Otherwise, variables defined outside this object may not be local. */ - else if (DECL_EXTERNAL (exp)) -@@ -5159,6 +5159,9 @@ - /* Linkonce and weak data are never local. */ - else if (DECL_ONE_ONLY (exp) || DECL_WEAK (exp)) - local_p = false; -+ /* If none of the above and visibility is not default, make local. */ -+ else if (DECL_VISIBILITY (exp) != VISIBILITY_DEFAULT) -+ local_p = true; - /* If PIC, then assume that any global name can be overridden by - symbols resolved from other modules. */ - else if (shlib) - -diff -Naur gcc-3.4.0orig/gcc/testsuite/gcc.dg/visibility-9.c gcc-3.4.0/gcc/testsuite/gcc.dg/visibility-9.c ---- gcc-3.4.0orig/gcc/testsuite/gcc.dg/visibility-9.c 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-3.4.0/gcc/testsuite/gcc.dg/visibility-9.c 2004-05-09 12:40:39.000000000 +0100 -@@ -0,0 +1,9 @@ -+/* Test that -fvisibility works. */ -+/* { dg-do compile } */ -+/* { dg-require-visibility "" } */ -+/* { dg-options "-fvisibility=hidden" } */ -+/* { dg-final { scan-assembler "\\.hidden.*foo" } } */ -+ -+void foo(); -+ -+void foo() { } -diff -Naur gcc-3.4.0orig/gcc/testsuite/gcc.dg/visibility-a.c gcc-3.4.0/gcc/testsuite/gcc.dg/visibility-a.c ---- gcc-3.4.0orig/gcc/testsuite/gcc.dg/visibility-a.c 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-3.4.0/gcc/testsuite/gcc.dg/visibility-a.c 2004-05-09 12:55:04.000000000 +0100 -@@ -0,0 +1,10 @@ -+/* Test that #pragma GCC visibility works. */ -+/* { dg-do compile } */ -+/* { dg-require-visibility "" } */ -+/* { dg-final { scan-assembler "\\.hidden.*foo" } } */ -+ -+#pragma GCC visibility push(hidden) -+void foo(); -+#pragma GCC visibility pop -+ -+void foo() { } -diff -Naur gcc-3.4.0orig/gcc/testsuite/g++.dg/ext/visibility/fvisibility.C gcc-3.4.0/gcc/testsuite/g++.dg/ext/visibility/fvisibility.C ---- gcc-3.4.0orig/gcc/testsuite/g++.dg/ext/visibility/fvisibility.C 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-3.4.0/gcc/testsuite/g++.dg/ext/visibility/fvisibility.C 2004-05-09 19:17:13.000000000 +0100 -@@ -0,0 +1,12 @@ -+/* Test that -fvisibility affects class members. */ -+/* { dg-do compile } */ -+/* { dg-require-visibility "" } */ -+/* { dg-options "-fvisibility=hidden" } */ -+/* { dg-final { scan-assembler "\\.hidden.*Foo.methodEv" } } */ -+ -+class Foo -+{ -+ void method(); -+}; -+ -+void Foo::method() { } -diff -Naur gcc-3.4.0orig/gcc/testsuite/g++.dg/ext/visibility/fvisibility-inlines-hidden.C gcc-3.4.0/gcc/testsuite/g++.dg/ext/visibility/fvisibility-inlines-hidden.C ---- gcc-3.4.0orig/gcc/testsuite/g++.dg/ext/visibility/fvisibility-inlines-hidden.C 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-3.4.0/gcc/testsuite/g++.dg/ext/visibility/fvisibility-inlines-hidden.C 2004-05-09 19:17:59.000000000 +0100 -@@ -0,0 +1,18 @@ -+/* Test that -fvisibility-inlines-hidden affects class members. */ -+/* { dg-do compile } */ -+/* { dg-require-visibility "" } */ -+/* { dg-options "-fvisibility-inlines-hidden" } */ -+/* { dg-final { scan-assembler "\\.hidden.*Foo.methodEv" } } */ -+ -+class Foo -+{ -+public: -+ void method() { } -+}; -+ -+int main(void) -+{ -+ Foo f; -+ f.method(); -+ return 0; -+} -diff -Naur gcc-3.4.0orig/gcc/testsuite/g++.dg/ext/visibility/fvisibility-override1.C gcc-3.4.0/gcc/testsuite/g++.dg/ext/visibility/fvisibility-override1.C ---- gcc-3.4.0orig/gcc/testsuite/g++.dg/ext/visibility/fvisibility-override1.C 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-3.4.0/gcc/testsuite/g++.dg/ext/visibility/fvisibility-override1.C 2004-05-09 19:18:06.000000000 +0100 -@@ -0,0 +1,12 @@ -+/* Test that -fvisibility does not override class member specific settings. */ -+/* { dg-do compile } */ -+/* { dg-require-visibility "" } */ -+/* { dg-options "-fvisibility=hidden" } */ -+/* { dg-final { scan-assembler "\\.internal.*Foo.methodEv" } } */ -+ -+class __attribute__ ((visibility ("internal"))) Foo -+{ -+ void method(); -+}; -+ -+void Foo::method() { } -diff -Naur gcc-3.4.0orig/gcc/testsuite/g++.dg/ext/visibility/fvisibility-override2.C gcc-3.4.0/gcc/testsuite/g++.dg/ext/visibility/fvisibility-override2.C ---- gcc-3.4.0orig/gcc/testsuite/g++.dg/ext/visibility/fvisibility-override2.C 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-3.4.0/gcc/testsuite/g++.dg/ext/visibility/fvisibility-override2.C 2004-05-09 19:18:12.000000000 +0100 -@@ -0,0 +1,12 @@ -+/* Test that -fvisibility does not override class member specific settings. */ -+/* { dg-do compile } */ -+/* { dg-require-visibility "" } */ -+/* { dg-options "-fvisibility=hidden" } */ -+/* { dg-final { scan-assembler "\\.internal.*Foo.methodEv" } } */ -+ -+class Foo -+{ -+ __attribute__ ((visibility ("internal"))) void method(); -+}; -+ -+void Foo::method() { } -diff -Naur gcc-3.4.0orig/gcc/testsuite/g++.dg/ext/visibility/memfuncts.C gcc-3.4.0/gcc/testsuite/g++.dg/ext/visibility/memfuncts.C ---- gcc-3.4.0orig/gcc/testsuite/g++.dg/ext/visibility/memfuncts.C 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-3.4.0/gcc/testsuite/g++.dg/ext/visibility/memfuncts.C 2004-05-09 19:18:19.000000000 +0100 -@@ -0,0 +1,11 @@ -+/* Test that setting visibility for class member functions works. */ -+/* { dg-do compile } */ -+/* { dg-require-visibility "" } */ -+/* { dg-final { scan-assembler "\\.hidden.*Foo.methodEv" } } */ -+ -+class __attribute__ ((visibility ("hidden"))) Foo -+{ -+ void method(); -+}; -+ -+void Foo::method() { } -diff -Naur gcc-3.4.0orig/gcc/testsuite/g++.dg/ext/visibility/noPLT.C gcc-3.4.0/gcc/testsuite/g++.dg/ext/visibility/noPLT.C ---- gcc-3.4.0orig/gcc/testsuite/g++.dg/ext/visibility/noPLT.C 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-3.4.0/gcc/testsuite/g++.dg/ext/visibility/noPLT.C 2004-05-09 19:21:49.000000000 +0100 -@@ -0,0 +1,20 @@ -+/* Test that -fvisibility=hidden prevents PLT. */ -+/* { dg-do compile } */ -+/* { dg-require-visibility "" } */ -+/* { dg-options "-fPIC -fvisibility=hidden" } */ -+/* { dg-final { scan-assembler-not "methodEv@PLT" } } */ -+ -+class Foo -+{ -+public: -+ void method(); -+}; -+ -+void Foo::method() { } -+ -+int main(void) -+{ -+ Foo f; -+ f.method(); -+ return 0; -+} -diff -Naur gcc-3.4.0orig/gcc/testsuite/g++.dg/ext/visibility/pragma.C gcc-3.4.0/gcc/testsuite/g++.dg/ext/visibility/pragma.C ---- gcc-3.4.0orig/gcc/testsuite/g++.dg/ext/visibility/pragma.C 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-3.4.0/gcc/testsuite/g++.dg/ext/visibility/pragma.C 2004-05-09 19:18:30.000000000 +0100 -@@ -0,0 +1,13 @@ -+/* Test that #pragma GCC visibility affects class members. */ -+/* { dg-do compile } */ -+/* { dg-require-visibility "" } */ -+/* { dg-final { scan-assembler "\\.hidden.*Foo.methodEv" } } */ -+ -+#pragma GCC visibility push(hidden) -+class Foo -+{ -+ void method(); -+}; -+#pragma GCC visibility pop -+ -+void Foo::method() { } -diff -Naur gcc-3.4.0orig/gcc/testsuite/g++.dg/ext/visibility/pragma-override1.C gcc-3.4.0/gcc/testsuite/g++.dg/ext/visibility/pragma-override1.C ---- gcc-3.4.0orig/gcc/testsuite/g++.dg/ext/visibility/pragma-override1.C 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-3.4.0/gcc/testsuite/g++.dg/ext/visibility/pragma-override1.C 2004-05-09 19:18:36.000000000 +0100 -@@ -0,0 +1,13 @@ -+/* Test that #pragma GCC visibility does not override class member specific settings. */ -+/* { dg-do compile } */ -+/* { dg-require-visibility "" } */ -+/* { dg-final { scan-assembler "\\.internal.*Foo.methodEv" } } */ -+ -+#pragma GCC visibility push(hidden) -+class __attribute__ ((visibility ("internal"))) Foo -+{ -+ void method(); -+}; -+#pragma GCC visibility pop -+ -+void Foo::method() { } -diff -Naur gcc-3.4.0orig/gcc/testsuite/g++.dg/ext/visibility/pragma-override2.C gcc-3.4.0/gcc/testsuite/g++.dg/ext/visibility/pragma-override2.C ---- gcc-3.4.0orig/gcc/testsuite/g++.dg/ext/visibility/pragma-override2.C 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-3.4.0/gcc/testsuite/g++.dg/ext/visibility/pragma-override2.C 2004-05-09 19:18:44.000000000 +0100 -@@ -0,0 +1,13 @@ -+/* Test that #pragma GCC visibility does not override class member specific settings. */ -+/* { dg-do compile } */ -+/* { dg-require-visibility "" } */ -+/* { dg-final { scan-assembler "\\.internal.*Foo.methodEv" } } */ -+ -+#pragma GCC visibility push(hidden) -+class Foo -+{ -+ __attribute__ ((visibility ("internal"))) void method(); -+}; -+#pragma GCC visibility pop -+ -+void Foo::method() { } -diff -Naur gcc-3.4.0orig/gcc/testsuite/g++.dg/ext/visibility/staticmemfuncts.C gcc-3.4.0/gcc/testsuite/g++.dg/ext/visibility/staticmemfuncts.C ---- gcc-3.4.0orig/gcc/testsuite/g++.dg/ext/visibility/staticmemfuncts.C 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-3.4.0/gcc/testsuite/g++.dg/ext/visibility/staticmemfuncts.C 2004-05-09 19:18:50.000000000 +0100 -@@ -0,0 +1,11 @@ -+/* Test that setting visibility for static class member functions works. */ -+/* { dg-do compile } */ -+/* { dg-require-visibility "" } */ -+/* { dg-final { scan-assembler "\\.hidden.*Foo.methodEv" } } */ -+ -+class __attribute__ ((visibility ("hidden"))) Foo -+{ -+ static void method(); -+}; -+ -+void Foo::method() { } -diff -Naur gcc-3.4.0orig/gcc/testsuite/g++.dg/ext/visibility/virtual.C gcc-3.4.0/gcc/testsuite/g++.dg/ext/visibility/virtual.C ---- gcc-3.4.0orig/gcc/testsuite/g++.dg/ext/visibility/virtual.C 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-3.4.0/gcc/testsuite/g++.dg/ext/visibility/virtual.C 2004-05-09 13:24:06.000000000 +0100 -@@ -0,0 +1,11 @@ -+/* Test that setting visibility for class affects virtual table. */ -+/* { dg-do compile } */ -+/* { dg-require-visibility "" } */ -+/* { dg-final { scan-assembler "\\.hidden.*ZTV3Foo" } } */ -+ -+class __attribute__ ((visibility ("hidden"))) Foo -+{ -+ virtual void method(); -+}; -+ -+void Foo::method() { } -diff -Naur gcc-3.4.0orig/gcc/testsuite/g++.dg/ext/visibility/visibility-1.C gcc-3.4.0/gcc/testsuite/g++.dg/ext/visibility/visibility-1.C ---- gcc-3.4.0orig/gcc/testsuite/g++.dg/ext/visibility/visibility-1.C 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-3.4.0/gcc/testsuite/g++.dg/ext/visibility/visibility-1.C 2003-12-10 06:34:44.000000000 +0000 -@@ -0,0 +1,8 @@ -+/* Test visibility attribute on function definition. */ -+/* { dg-do compile { target *86-*-linux* } } */ -+/* { dg-final { scan-assembler "\\.hidden.*_Z3foov" } } */ -+ -+void -+__attribute__((visibility ("hidden"))) -+foo() -+{ } -diff -Naur gcc-3.4.0orig/gcc/testsuite/g++.dg/ext/visibility/visibility-2.C gcc-3.4.0/gcc/testsuite/g++.dg/ext/visibility/visibility-2.C ---- gcc-3.4.0orig/gcc/testsuite/g++.dg/ext/visibility/visibility-2.C 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-3.4.0/gcc/testsuite/g++.dg/ext/visibility/visibility-2.C 2003-12-10 06:34:44.000000000 +0000 -@@ -0,0 +1,7 @@ -+/* Test that visibility attribute on declaration extends to definition. */ -+/* { dg-do compile { target *86-*-linux* } } */ -+/* { dg-final { scan-assembler "\\.hidden.*_Z3foov" } } */ -+ -+void __attribute__((visibility ("hidden"))) foo(); -+ -+void foo() { } -diff -Naur gcc-3.4.0orig/gcc/testsuite/g++.dg/ext/visibility/visibility-3.C gcc-3.4.0/gcc/testsuite/g++.dg/ext/visibility/visibility-3.C ---- gcc-3.4.0orig/gcc/testsuite/g++.dg/ext/visibility/visibility-3.C 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-3.4.0/gcc/testsuite/g++.dg/ext/visibility/visibility-3.C 2003-12-10 06:34:45.000000000 +0000 -@@ -0,0 +1,7 @@ -+/* Test visibility attribute on forward declaration of global variable */ -+/* { dg-do compile { target *86-*-linux* } } */ -+/* { dg-final { scan-assembler "\\.hidden.*xyzzy" } } */ -+ -+int -+__attribute__((visibility ("hidden"))) -+xyzzy = 5; -diff -Naur gcc-3.4.0orig/gcc/testsuite/g++.dg/ext/visibility/visibility-4.C gcc-3.4.0/gcc/testsuite/g++.dg/ext/visibility/visibility-4.C ---- gcc-3.4.0orig/gcc/testsuite/g++.dg/ext/visibility/visibility-4.C 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-3.4.0/gcc/testsuite/g++.dg/ext/visibility/visibility-4.C 2003-12-10 06:34:45.000000000 +0000 -@@ -0,0 +1,8 @@ -+/* Test visibility attribute on forward declaration of global variable */ -+/* { dg-do compile { target *86-*-linux* } } */ -+/* { dg-final { scan-assembler "\\.hidden.*xyzzy" } } */ -+ -+extern int __attribute__ ((visibility ("hidden"))) -+xyzzy; -+ -+int xyzzy = 5; -diff -Naur gcc-3.4.0orig/gcc/testsuite/g++.dg/ext/visibility/visibility-5.C gcc-3.4.0/gcc/testsuite/g++.dg/ext/visibility/visibility-5.C ---- gcc-3.4.0orig/gcc/testsuite/g++.dg/ext/visibility/visibility-5.C 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-3.4.0/gcc/testsuite/g++.dg/ext/visibility/visibility-5.C 2003-12-10 06:34:45.000000000 +0000 -@@ -0,0 +1,11 @@ -+/* Test visibility attribute on definition of a function that has -+ already had a forward declaration. */ -+/* { dg-do compile { target *86-*-linux* } } */ -+/* { dg-final { scan-assembler "\\.hidden.*_Z3foov" } } */ -+ -+void foo(); -+ -+void -+ __attribute__((visibility ("hidden"))) -+foo() -+{ } -diff -Naur gcc-3.4.0orig/gcc/testsuite/g++.dg/ext/visibility/visibility-6.C gcc-3.4.0/gcc/testsuite/g++.dg/ext/visibility/visibility-6.C ---- gcc-3.4.0orig/gcc/testsuite/g++.dg/ext/visibility/visibility-6.C 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-3.4.0/gcc/testsuite/g++.dg/ext/visibility/visibility-6.C 2003-12-10 06:34:45.000000000 +0000 -@@ -0,0 +1,10 @@ -+/* Test visibility attribute on definition of global variable that has -+ already had a forward declaration. */ -+/* { dg-do compile { target *86-*-linux* } } */ -+/* { dg-final { scan-assembler "\\.hidden.*xyzzy" } } */ -+ -+extern int xyzzy; -+ -+int -+__attribute__((visibility ("hidden"))) -+xyzzy = 5; -diff -Naur gcc-3.4.0orig/gcc/testsuite/g++.dg/ext/visibility/visibility-7.C gcc-3.4.0/gcc/testsuite/g++.dg/ext/visibility/visibility-7.C ---- gcc-3.4.0orig/gcc/testsuite/g++.dg/ext/visibility/visibility-7.C 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-3.4.0/gcc/testsuite/g++.dg/ext/visibility/visibility-7.C 2003-12-10 06:34:45.000000000 +0000 -@@ -0,0 +1,11 @@ -+/* Test warning from conflicting visibility specifications. */ -+/* { dg-do compile { target *86-*-linux* } } */ -+/* { dg-final { scan-assembler "\\.hidden.*xyzzy" } } */ -+ -+extern int -+__attribute__((visibility ("hidden"))) -+xyzzy; /* { dg-warning "previous declaration here" "" } */ -+ -+int -+__attribute__((visibility ("protected"))) -+xyzzy = 5; /* { dg-warning "visibility attribute ignored" "" } */ -diff -Naur gcc-3.4.0orig/gcc/testsuite/g++.dg/ext/visibility-1.C gcc-3.4.0/gcc/testsuite/g++.dg/ext/visibility-1.C ---- gcc-3.4.0orig/gcc/testsuite/g++.dg/ext/visibility-1.C 2003-12-10 06:34:44.000000000 +0000 -+++ gcc-3.4.0/gcc/testsuite/g++.dg/ext/visibility-1.C 1970-01-01 01:00:00.000000000 +0100 -@@ -1,8 +0,0 @@ --/* Test visibility attribute on function definition. */ --/* { dg-do compile { target *86-*-linux* } } */ --/* { dg-final { scan-assembler "\\.hidden.*_Z3foov" } } */ -- --void --__attribute__((visibility ("hidden"))) --foo() --{ } -diff -Naur gcc-3.4.0orig/gcc/testsuite/g++.dg/ext/visibility-2.C gcc-3.4.0/gcc/testsuite/g++.dg/ext/visibility-2.C ---- gcc-3.4.0orig/gcc/testsuite/g++.dg/ext/visibility-2.C 2003-12-10 06:34:44.000000000 +0000 -+++ gcc-3.4.0/gcc/testsuite/g++.dg/ext/visibility-2.C 1970-01-01 01:00:00.000000000 +0100 -@@ -1,7 +0,0 @@ --/* Test that visibility attribute on declaration extends to definition. */ --/* { dg-do compile { target *86-*-linux* } } */ --/* { dg-final { scan-assembler "\\.hidden.*_Z3foov" } } */ -- --void __attribute__((visibility ("hidden"))) foo(); -- --void foo() { } -diff -Naur gcc-3.4.0orig/gcc/testsuite/g++.dg/ext/visibility-3.C gcc-3.4.0/gcc/testsuite/g++.dg/ext/visibility-3.C ---- gcc-3.4.0orig/gcc/testsuite/g++.dg/ext/visibility-3.C 2003-12-10 06:34:45.000000000 +0000 -+++ gcc-3.4.0/gcc/testsuite/g++.dg/ext/visibility-3.C 1970-01-01 01:00:00.000000000 +0100 -@@ -1,7 +0,0 @@ --/* Test visibility attribute on forward declaration of global variable */ --/* { dg-do compile { target *86-*-linux* } } */ --/* { dg-final { scan-assembler "\\.hidden.*xyzzy" } } */ -- --int --__attribute__((visibility ("hidden"))) --xyzzy = 5; -diff -Naur gcc-3.4.0orig/gcc/testsuite/g++.dg/ext/visibility-4.C gcc-3.4.0/gcc/testsuite/g++.dg/ext/visibility-4.C ---- gcc-3.4.0orig/gcc/testsuite/g++.dg/ext/visibility-4.C 2003-12-10 06:34:45.000000000 +0000 -+++ gcc-3.4.0/gcc/testsuite/g++.dg/ext/visibility-4.C 1970-01-01 01:00:00.000000000 +0100 -@@ -1,8 +0,0 @@ --/* Test visibility attribute on forward declaration of global variable */ --/* { dg-do compile { target *86-*-linux* } } */ --/* { dg-final { scan-assembler "\\.hidden.*xyzzy" } } */ -- --extern int __attribute__ ((visibility ("hidden"))) --xyzzy; -- --int xyzzy = 5; -diff -Naur gcc-3.4.0orig/gcc/testsuite/g++.dg/ext/visibility-5.C gcc-3.4.0/gcc/testsuite/g++.dg/ext/visibility-5.C ---- gcc-3.4.0orig/gcc/testsuite/g++.dg/ext/visibility-5.C 2003-12-10 06:34:45.000000000 +0000 -+++ gcc-3.4.0/gcc/testsuite/g++.dg/ext/visibility-5.C 1970-01-01 01:00:00.000000000 +0100 -@@ -1,11 +0,0 @@ --/* Test visibility attribute on definition of a function that has -- already had a forward declaration. */ --/* { dg-do compile { target *86-*-linux* } } */ --/* { dg-final { scan-assembler "\\.hidden.*_Z3foov" } } */ -- --void foo(); -- --void -- __attribute__((visibility ("hidden"))) --foo() --{ } -diff -Naur gcc-3.4.0orig/gcc/testsuite/g++.dg/ext/visibility-6.C gcc-3.4.0/gcc/testsuite/g++.dg/ext/visibility-6.C ---- gcc-3.4.0orig/gcc/testsuite/g++.dg/ext/visibility-6.C 2003-12-10 06:34:45.000000000 +0000 -+++ gcc-3.4.0/gcc/testsuite/g++.dg/ext/visibility-6.C 1970-01-01 01:00:00.000000000 +0100 -@@ -1,10 +0,0 @@ --/* Test visibility attribute on definition of global variable that has -- already had a forward declaration. */ --/* { dg-do compile { target *86-*-linux* } } */ --/* { dg-final { scan-assembler "\\.hidden.*xyzzy" } } */ -- --extern int xyzzy; -- --int --__attribute__((visibility ("hidden"))) --xyzzy = 5; -diff -Naur gcc-3.4.0orig/gcc/testsuite/g++.dg/ext/visibility-7.C gcc-3.4.0/gcc/testsuite/g++.dg/ext/visibility-7.C ---- gcc-3.4.0orig/gcc/testsuite/g++.dg/ext/visibility-7.C 2003-12-10 06:34:45.000000000 +0000 -+++ gcc-3.4.0/gcc/testsuite/g++.dg/ext/visibility-7.C 1970-01-01 01:00:00.000000000 +0100 -@@ -1,11 +0,0 @@ --/* Test warning from conflicting visibility specifications. */ --/* { dg-do compile { target *86-*-linux* } } */ --/* { dg-final { scan-assembler "\\.hidden.*xyzzy" } } */ -- --extern int --__attribute__((visibility ("hidden"))) --xyzzy; /* { dg-warning "previous declaration here" "" } */ -- --int --__attribute__((visibility ("protected"))) --xyzzy = 5; /* { dg-warning "visibility attribute ignored" "" } */ diff --git a/meta/packages/gcc/gcc-3.4.4/GCOV_PREFIX_STRIP-cross-profile_3.4.patch b/meta/packages/gcc/gcc-3.4.4/GCOV_PREFIX_STRIP-cross-profile_3.4.patch deleted file mode 100644 index 701a687e05..0000000000 --- a/meta/packages/gcc/gcc-3.4.4/GCOV_PREFIX_STRIP-cross-profile_3.4.patch +++ /dev/null @@ -1,389 +0,0 @@ -2005-05-04 Grigory Zagorodnev - H.J. Lu - - - Cross-profiling support: relocate .gcda files when - running at system other than executable been built on. - - - * gcov-io.c (gcov_open): When in libgcov library - use given data file relocation prefix to build file name. - * gcov-io.h (gcov_open): Updated proto to accept - data file relocation prefix. - * libgcov.c (create_file_directory): New function. - (gcov_prefix): New static variable to hold data file - relocation prefix. - (gcov_version): Use relocation prefix. - (gcov_exit): Always try to create directory for output - file. Relocate filename at each use. - (__gcov_init): Initialize directory relocation prefix - if required. Strip off leading directories from - the initial filename. - * tsystem.h: include filenames.h - (DIR_SEPARATOR): Macro copied from system.h. - (DIR_SEPARATOR_2): Likewise. - * doc/gcov.texi (Cross-profiling): New node documenting - cross-profiling management. - * doc/invoke.texi (-fprofile-arcs): xref to cross-profiling. - -Grigory Zagorodnev -Intel Corporation - ---- gcc-3.4/gcc/gcov-io.c.prefix 2004-02-26 13:54:47.000000000 -0800 -+++ gcc-3.4/gcc/gcov-io.c 2005-05-04 11:46:01.000000000 -0700 -@@ -55,13 +55,14 @@ static inline gcov_unsigned_t from_file - - GCOV_LINKAGE int - #if IN_LIBGCOV --gcov_open (const char *name) -+gcov_open (const char *prefix, const char *name) - #else - gcov_open (const char *name, int mode) - #endif - { - #if IN_LIBGCOV - const int mode = 0; -+ char *tmp; - #endif - #if GCOV_LOCKED - struct flock s_flock; -@@ -83,6 +84,14 @@ gcov_open (const char *name, int mode) - #if !IN_LIBGCOV - gcov_var.endian = 0; - #endif -+ -+#if IN_LIBGCOV -+ /* Build complete filename with prefix */ -+ tmp = alloca( strlen(prefix) + strlen(name) + 1); -+ *tmp = '\0'; -+ name = strcat( strcat(tmp, prefix), name); -+#endif -+ - #if GCOV_LOCKED - if (mode > 0) - fd = open (name, O_RDWR); ---- gcc-3.4/gcc/gcov-io.h.prefix 2005-05-02 15:37:58.000000000 -0700 -+++ gcc-3.4/gcc/gcov-io.h 2005-05-04 11:46:01.000000000 -0700 -@@ -502,7 +502,7 @@ GCOV_LINKAGE struct gcov_var - functions for writing. Your file may become corrupted if you break - these invariants. */ - #if IN_LIBGCOV --GCOV_LINKAGE int gcov_open (const char */*name*/) ATTRIBUTE_HIDDEN; -+GCOV_LINKAGE int gcov_open (const char */*prefix*/, const char */*name*/) ATTRIBUTE_HIDDEN; - #else - GCOV_LINKAGE int gcov_open (const char */*name*/, int /*direction*/); - GCOV_LINKAGE int gcov_magic (gcov_unsigned_t, gcov_unsigned_t); ---- gcc-3.4/gcc/libgcov.c.prefix 2004-02-26 13:54:47.000000000 -0800 -+++ gcc-3.4/gcc/libgcov.c 2005-05-04 12:01:58.000000000 -0700 -@@ -92,6 +92,70 @@ static struct gcov_info *gcov_list; - object file included in multiple programs. */ - static gcov_unsigned_t gcov_crc32; - -+/* Directory prefix to relocate coverage data file names */ -+static char *gcov_prefix = 0; -+ -+/* Level of dirs to strip off the initial filename to relocate */ -+static int gcov_prefix_strip = 0; -+ -+static int -+create_file_directory (const char *prefix, const char *filename) -+{ -+ char *dname; -+ char sep, *r, *s; -+ size_t plen, flen; -+ -+ /* Detect directory separator */ -+ s = strrchr (prefix, DIR_SEPARATOR); -+#ifdef DIR_SEPARATOR_2 -+ if (! s) -+ s = strrchr (prefix, DIR_SEPARATOR_2); -+#endif -+ if (s) -+ sep = *s; -+ else -+ sep = DIR_SEPARATOR; -+ -+ /* join prefix and filename, split path */ -+ plen = strlen(prefix); -+ flen = strlen(filename); -+ r = alloca(plen + flen + 1); -+ strncpy(r, prefix, plen); -+ strncpy(r + plen, filename, flen); -+ r[plen + flen] = '\0'; -+ s = strrchr(r, sep); -+ if (s) -+ *(s + 1) = '\0'; -+ -+ if (access (r, F_OK) == 0) -+ return 0; -+ -+ /* Skip consecutive separators. */ -+ for (dname = r; *dname && *dname == sep; ++dname); -+ while (1) -+ { -+ char *s = strchr (dname, sep); -+ if (s == 0) -+ break; -+ *s = '\0'; -+ /* Try to make directory if it doesn't already exist. */ -+ if (access (r, F_OK) == -1 -+ && mkdir (r, 0755) == -1 -+ /* The directory might have been made by another process. */ -+ && errno != EEXIST) -+ { -+ *s = sep; -+ fprintf (stderr, "profiling:%s:Cannot create directory\n", r); -+ return -1; -+ }; -+ *s = sep; -+ /* Skip consecutive separators. */ -+ for (dname = s + 1; *dname && *dname == sep; ++dname) -+ ; -+ } -+ return 0; -+} -+ - static int - gcov_version (struct gcov_info *ptr, gcov_unsigned_t version) - { -@@ -103,8 +167,8 @@ gcov_version (struct gcov_info *ptr, gco - GCOV_UNSIGNED2STRING (e, GCOV_VERSION); - - fprintf (stderr, -- "profiling:%s:Version mismatch - expected %.4s got %.4s\n", -- ptr->filename, e, v); -+ "profiling:%s%s:Version mismatch - expected %.4s got %.4s\n", -+ gcov_prefix, ptr->filename, e, v); - return 0; - } - return 1; -@@ -204,9 +268,14 @@ gcov_exit (void) - fi_stride &= ~(__alignof__ (struct gcov_fn_info) - 1); - } - -- if (!gcov_open (gi_ptr->filename)) -+ if (create_file_directory (gcov_prefix, gi_ptr->filename)) - { -- fprintf (stderr, "profiling:%s:Cannot open\n", gi_ptr->filename); -+ fprintf (stderr, "profiling:%s%s:Skip\n", gcov_prefix, gi_ptr->filename); -+ continue; -+ } -+ else if (!gcov_open (gcov_prefix, gi_ptr->filename)) -+ { -+ fprintf (stderr, "profiling:%s%s:Cannot open\n", gcov_prefix, gi_ptr->filename); - continue; - } - -@@ -216,8 +285,8 @@ gcov_exit (void) - /* Merge data from file. */ - if (tag != GCOV_DATA_MAGIC) - { -- fprintf (stderr, "profiling:%s:Not a gcov data file\n", -- gi_ptr->filename); -+ fprintf (stderr, "profiling:%s%s:Not a gcov data file\n", -+ gcov_prefix, gi_ptr->filename); - read_fatal:; - gcov_close (); - continue; -@@ -250,8 +319,8 @@ gcov_exit (void) - || gcov_read_unsigned () != fi_ptr->checksum) - { - read_mismatch:; -- fprintf (stderr, "profiling:%s:Merge mismatch for %s\n", -- gi_ptr->filename, -+ fprintf (stderr, "profiling:%s%s:Merge mismatch for %s\n", -+ gcov_prefix, gi_ptr->filename, - f_ix + 1 ? "function" : "summaries"); - goto read_fatal; - } -@@ -309,8 +378,8 @@ gcov_exit (void) - if (!gcov_is_eof ()) - { - read_error:; -- fprintf (stderr, error < 0 ? "profiling:%s:Overflow merging\n" -- : "profiling:%s:Error merging\n", gi_ptr->filename); -+ fprintf (stderr, error < 0 ? "profiling:%s%s:Overflow merging\n" -+ : "profiling:%s%s:Error merging\n", gcov_prefix, gi_ptr->filename); - goto read_fatal; - } - rewrite:; -@@ -357,8 +426,8 @@ gcov_exit (void) - && (!GCOV_LOCKED || cs_all->runs == cs_prg->runs) - && memcmp (cs_all, cs_prg, sizeof (*cs_all))) - { -- fprintf (stderr, "profiling:%s:Invocation mismatch - some data files may have been removed%s", -- gi_ptr->filename, GCOV_LOCKED -+ fprintf (stderr, "profiling:%s%s:Invocation mismatch - some data files may have been removed%s", -+ gcov_prefix, gi_ptr->filename, GCOV_LOCKED - ? "" : " or concurrent update without locking support"); - all.checksum = ~0u; - } -@@ -418,9 +487,9 @@ gcov_exit (void) - gcov_write_summary (GCOV_TAG_PROGRAM_SUMMARY, &program); - if ((error = gcov_close ())) - fprintf (stderr, error < 0 ? -- "profiling:%s:Overflow writing\n" : -- "profiling:%s:Error writing\n", -- gi_ptr->filename); -+ "profiling:%s%s:Overflow writing\n" : -+ "profiling:%s%s:Error writing\n", -+ gcov_prefix, gi_ptr->filename); - } - } - -@@ -430,11 +499,69 @@ gcov_exit (void) - void - __gcov_init (struct gcov_info *info) - { -+ /* Save initial filename pointer to calculate CRC. */ -+ const char *ptr = info->filename; -+ - if (!info->version) - return; -+ -+ /* Initialize directory prefix if requred */ -+ if (gcov_prefix == 0) -+ { -+ if ((gcov_prefix = getenv("GCOV_PREFIX"))) -+ { -+ char *tmp; -+ -+ /* Normalize prefix: take off trailing separator. */ -+ tmp = gcov_prefix + strlen(gcov_prefix) - 1; -+ if (IS_DIR_SEPARATOR(*tmp)) -+ *tmp = '\0'; -+ -+ /* Check if the level of dirs to strip off specified */ -+ if ((tmp = getenv("GCOV_PREFIX_STRIP"))) -+ { -+ gcov_prefix_strip = atoi (tmp); -+ /* Do not consider negative values. */ -+ if (gcov_prefix_strip < 0) -+ gcov_prefix_strip = 0; -+ }; -+ } -+ else -+ gcov_prefix = (char *) ""; -+ }; -+ -+ /* Strip off leading directories from the initial filename */ -+ if (gcov_prefix_strip > 0) -+ { -+ char sep, *s; -+ int level; -+ const char *fname = info->filename; -+ -+ /* Detect directory separator */ -+ s = strrchr (fname, DIR_SEPARATOR); -+#ifdef DIR_SEPARATOR_2 -+ if (! s) -+ s = strrchr (fname, DIR_SEPARATOR_2); -+#endif -+ if (s) -+ sep = *s; -+ else -+ sep = DIR_SEPARATOR; -+ -+ /* Skip selected directory levels */ -+ for ( level = gcov_prefix_strip; level > 0; level--) -+ if ((s = strchr(fname + 1, sep))) -+ fname = s; -+ else -+ break; -+