[Bug testsuite/42854] [4.4/4.5 Regression] FAIL: gcc.dg/darwin-weakimport-[13].c scan-assembler-not *
--- Comment #12 from howarth at nitro dot med dot uc dot edu 2010-02-14 23:34 --- Posted revised patch at http://gcc.gnu.org/ml/gcc-patches/2010-02/msg00549.html with regression test results at http://gcc.gnu.org/ml/gcc-testresults/2010-02/msg01339.html. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42854
[Bug testsuite/42854] [4.4/4.5 Regression] FAIL: gcc.dg/darwin-weakimport-[13].c scan-assembler-not *
--- Comment #11 from howarth at nitro dot med dot uc dot edu 2010-02-14 02:12 --- Proposed patch at http://gcc.gnu.org/ml/gcc-patches/2010-02/msg00532.html and testsuite resuilts for proposed patch at http://gcc.gnu.org/ml/gcc-testresults/2010-02/msg01258.html. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42854
[Bug testsuite/42854] [4.4/4.5 Regression] FAIL: gcc.dg/darwin-weakimport-[13].c scan-assembler-not *
--- Comment #10 from howarth at nitro dot med dot uc dot edu 2010-02-13 16:04 --- This alternative fix works as well... --- /Users/howarth/gcc-4.5-20100211/gcc/varasm.c2010-01-20 18:46:25.0 -0500 +++ gcc/varasm.c2010-02-13 10:58:45.0 -0500 @@ -2345,7 +2345,8 @@ for declarations that can be weak, it happens to be match. */ && !TREE_STATIC (decl) - && lookup_attribute ("weak", DECL_ATTRIBUTES (decl)) + && ( lookup_attribute ("weak", DECL_ATTRIBUTES (decl)) || + lookup_attribute ("weak_import", DECL_ATTRIBUTES (decl))) && value_member (decl, weak_decls) == NULL_TREE) weak_decls = tree_cons (NULL, decl, weak_decls); @@ -5290,9 +5291,11 @@ warning (0, "weak declaration of %q+D not supported", decl); mark_weak (decl); +#ifndef ASM_WEAKEN_DECL if (!lookup_attribute ("weak", DECL_ATTRIBUTES (decl))) DECL_ATTRIBUTES (decl) = tree_cons (get_identifier ("weak"), NULL, DECL_ATTRIBUTES (decl)); +#endif } static void -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42854
[Bug testsuite/42854] [4.4/4.5 Regression] FAIL: gcc.dg/darwin-weakimport-[13].c scan-assembler-not *
--- Comment #9 from howarth at nitro dot med dot uc dot edu 2010-02-13 15:41 --- This should probably be a P2 since it causes a regression on darwin which breaks their weak linking. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42854
[Bug testsuite/42854] [4.4/4.5 Regression] FAIL: gcc.dg/darwin-weakimport-[13].c scan-assembler-not *
--- 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.c2010-01-20 18:46:25.0 -0500 +++ gcc/varasm.c2010-02-13 00:23:56.0 -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
[Bug testsuite/42854] [4.4/4.5 Regression] FAIL: gcc.dg/darwin-weakimport-[13].c scan-assembler-not *
--- Comment #7 from howarth at nitro dot med dot uc dot edu 2010-02-13 05:09 --- The weak_import attribute is described fairly well in this technote http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION2 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42854
[Bug testsuite/42854] [4.4/4.5 Regression] FAIL: gcc.dg/darwin-weakimport-[13].c scan-assembler-not *
--- Comment #6 from howarth at nitro dot med dot uc dot edu 2010-02-11 02:04 --- This section in darwin.c seems a bit strange... if (!DECL_EXTERNAL (decl) && (!TREE_PUBLIC (decl) || !DECL_WEAK (decl)) && ! lookup_attribute ("weakref", DECL_ATTRIBUTES (decl)) && ((TREE_STATIC (decl) && (!DECL_COMMON (decl) || !TREE_PUBLIC (decl))) || (!DECL_COMMON (decl) && DECL_INITIAL (decl) && DECL_INITIAL (decl) != error_mark_node))) SYMBOL_REF_FLAGS (sym_ref) |= MACHO_SYMBOL_FLAG_DEFINED; Since they already test against... !DECL_WEAK (decl)) , I wonder if it might also need to test against... ! lookup_attribute ("weak", DECL_ATTRIBUTES (decl)) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42854
[Bug testsuite/42854] [4.4/4.5 Regression] FAIL: gcc.dg/darwin-weakimport-[13].c scan-assembler-not *
-- rguenth at gcc dot gnu dot org changed: What|Removed |Added Priority|P3 |P4 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42854
[Bug testsuite/42854] [4.4/4.5 Regression] FAIL: gcc.dg/darwin-weakimport-[13].c scan-assembler-not *
--- Comment #5 from dominiq at lps dot ens dot fr 2010-01-25 21:59 --- > Mike Stump's comment on Geoff's implementation of the attribute weak_import in > FSF gcc is... Could you give a pointer? The first test was introduced by this patch http://gcc.gnu.org/ml/gcc-patches/2004-10/msg02441.html and updated by this one http://gcc.gnu.org/ml/gcc-patches/2005-01/msg00146.html The second test was introduce by this patch http://gcc.gnu.org/ml/gcc-patches/2005-12/msg00378.html Note the introduction: > weak_import is more-or-less deprecated on Darwin, by which I mean that > it has a bunch of known bugs but we aren't trying very hard to convince > people to stop using it. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42854
[Bug testsuite/42854] [4.4/4.5 Regression] FAIL: gcc.dg/darwin-weakimport-[13].c scan-assembler-not *
--- Comment #4 from howarth at nitro dot med dot uc dot edu 2010-01-25 20:20 --- Mike Stump's comment on Geoff's implementation of the attribute weak_import in FSF gcc is... > Not earth shattering, it just sets .weak_definition or .weak_reference for > the assembler. google can find tidbits about the programming model, how > they are used and the assembler manual and so on... if your curious. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42854
[Bug testsuite/42854] [4.4/4.5 Regression] FAIL: gcc.dg/darwin-weakimport-[13].c scan-assembler-not *
--- Comment #3 from jakub at gcc dot gnu dot org 2010-01-25 12:59 --- I mean that grep weak_import doc/* yields nothing at all (and google for weak_import doesn't show up any useful documentation either). It seems that Geoff Keating's implementation of the attribute (how could it be committed without documentation nor at least some words on what it is meant to do?) basically ignored it if weak attribute was also specified. Just removing those lookup_attribute (, "weak") tests would cure this. That really depends on what __attribute__((weak, weak_import)) is supposed to mean (if anything). Or what means combination of #pragma weak and weak_import attribute for the same decl name. Also, what matters is if undefined weak_import symbols are supposed to generate weak directives or not. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42854
[Bug testsuite/42854] [4.4/4.5 Regression] FAIL: gcc.dg/darwin-weakimport-[13].c scan-assembler-not *
--- Comment #2 from dominiq at lps dot ens dot fr 2010-01-25 12:53 --- > This is completely undocumented attribute ... What is the "undocumented attribute"? If you mean "-fno-asynchronous-unwind-tables", you don't need it for the tests to fail. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42854
[Bug testsuite/42854] [4.4/4.5 Regression] FAIL: gcc.dg/darwin-weakimport-[13].c scan-assembler-not *
--- Comment #1 from jakub at gcc dot gnu dot org 2010-01-25 12:03 --- This is completely undocumented attribute, so you first need to get Apple to actually document what it does and get the documentation into doc/extend.texi. Especially nothing explains the relationship between weak attribute, weak_import attribute and #pragma weak. Unless this is clarified, there is nothing that can be done about this, complain to Apple. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42854
[Bug testsuite/42854] [4.4/4.5 Regression] FAIL: gcc.dg/darwin-weakimport-[13].c scan-assembler-not *
-- rguenth at gcc dot gnu dot org changed: What|Removed |Added Target Milestone|--- |4.4.4 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42854