From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16595 invoked by alias); 19 Nov 2012 17:01:03 -0000 Received: (qmail 15746 invoked by uid 48); 19 Nov 2012 17:00:27 -0000 From: "howarth at nitro dot med.uc.edu" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/54083] FAIL: gcc.dg/torture/pr53922.c on *-apple-darwin* Date: Mon, 19 Nov 2012 17:01:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: howarth at nitro dot med.uc.edu X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: CC Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-11/txt/msg01790.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54083 Jack Howarth changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |howarth at nitro dot | |med.uc.edu --- Comment #12 from Jack Howarth 2012-11-19 17:00:21 UTC --- (In reply to comment #11) > Author: hjl > Date: Mon Nov 5 21:59:49 2012 UTC (13 days, 18 hours ago) > New Revision: 193193 > > URL: http://gcc.gnu.org/viewcvs?view=revision&sortby=date&revision=193193 > Log: > * gcc.dg/torture/pr53922.c: Use -Wl,-undefined,dynamic_lookup on > darwin. > > Modified: > trunk/gcc/testsuite/ChangeLog > trunk/gcc/testsuite/gcc.dg/torture/pr53922.c > > This does not fix the failures for powerpc-apple-darwin9. This is will never be fixable for darwin9 short of using a newer linker as the test case for radr://10466868, "-undefined dynamic_lookup linker bug" fails under Xcode 3.1.4. 17-Nov-2011 08:22 PM Jack Howarth: Summary: The following weak.c test case reveals a linker bug in -undefined dynamic_lookup in Xcode 4.2/4.2.1 under both darwin10 and darwin11. --------------- weak.c --------------------- #include char *myweakfunc(void) __attribute__((weak)) ; int main(int argc, char **argv) { if (myweakfunc) printf ("found myweakfunc %s\n", myweakfunc()); else printf("Weak func not found\n"); return 0; } ------------------------------------------- Steps to Reproduce: 1) Install Xcode 4.2 on darwin10 or darwin11. 2) Compile the weak.c test case with... /usr/bin/llvm-gcc weak.c -o wk -undefined dynamic_lookup 3) Execute the resulting "wk" executable Expected Results: I expected the same results as is seen when the weak.c test case is compiled with llvm-gcc from Xcode 3.2.6... howarth% /Developer-3.2.6/usr/bin/llvm-gcc weak.c -o wk -undefined dynamic_lookup howarth% ./wk Weak func not found Actual Results: The resulting binary fails to execute with the runtime error... dyld: Symbol not found: _myweakfunc Referenced from: /Users/howarth/./wk Expected in: flat namespace in /Users/howarth/./wk Trace/BPT trap This behavior was works in Xcode 3.2.6 up to Xcode 4.2 where it was broken again. It was fixed again after Xcode 4.4.1 and we should be careful to test for this linker behavior in the FSF gcc testsuite to insure that Apple doesn't break it again. Note that MacPorts provides an ld64 package on powerpc darwin9 which is based on the linker from Xcode 3.2.6 which should work.