------- Comment #8 from howarth at nitro dot med dot uc dot edu 2010-02-13 06:09 ------- On darwin, it would appear that the change in r155919 is unnecessary. Using...
--- /Users/howarth/gcc-4.5-20100211/gcc/varasm.c 2010-01-20 18:46:25.000000000 -0500 +++ gcc/varasm.c 2010-02-13 00:23:56.000000000 -0500 @@ -2345,7 +2345,9 @@ for declarations that can be weak, it happens to be match. */ && !TREE_STATIC (decl) +#ifndef __APPLE__ && lookup_attribute ("weak", DECL_ATTRIBUTES (decl)) +#endif && value_member (decl, weak_decls) == NULL_TREE) weak_decls = tree_cons (NULL, decl, weak_decls); @@ -5290,9 +5292,11 @@ warning (0, "weak declaration of %q+D not supported", decl); mark_weak (decl); +#ifndef __APPLE__ if (!lookup_attribute ("weak", DECL_ATTRIBUTES (decl))) DECL_ATTRIBUTES (decl) = tree_cons (get_identifier ("weak"), NULL, DECL_ATTRIBUTES (decl)); +#endif } I find that g++.dg/template/instantiate11.C doesn't produce weak symbols in instantiate11.s. The problem with r155919 on darwin is that it forces the weak_import attribute to become weak in declare_weak and drops the decls for weak_imports in assemble_external since it looks only for the weak attribute and not weak_import (which is set in darwin.c). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42854