The gcc.dg/profile-generate-3.c test case no longer compiles on *-apple-darwin*. On x86_64-apple-darwin10 the test case produces the error... Executing on host: /sw/src/fink.build/gcc45-4.4.999-20100205/darwin_objdir/gcc/xgcc -B/sw/src/fink.build/gcc45-4.4.999-20100205/darwin_objdir/gcc/ /sw/src/fink.build/gcc45-4.4.999-20100205/gcc-4.5-20100205/gcc/testsuite/gcc.dg/profile-generate-3.c -fprofile-generate=. -lm -o profile-generate-3.exe (timeout = 300) Undefined symbols: "___gcov_merge_add", referenced from: __data@0 in cc6Pfi4X.o "___gcov_indirect_call_profiler", referenced from: _main in cc6Pfi4X.o global constructors keyed to 65535_0_profile_generate_3.c in cc6Pfi4X.o "___gcov_init", referenced from: global constructors keyed to 65535_0_profile_generate_3.c in cc6Pfi4X.o ld: symbol(s) not found collect2: ld returned 1 exit status compiler exited with status 1 output is: Undefined symbols: "___gcov_merge_add", referenced from: __data@0 in cc6Pfi4X.o "___gcov_indirect_call_profiler", referenced from: _main in cc6Pfi4X.o global constructors keyed to 65535_0_profile_generate_3.c in cc6Pfi4X.o "___gcov_init", referenced from: global constructors keyed to 65535_0_profile_generate_3.c in cc6Pfi4X.o ld: symbol(s) not found collect2: ld returned 1 exit status FAIL: gcc.dg/profile-generate-3.c (test for excess errors) Excess errors: Undefined symbols: "___gcov_merge_add", referenced from: __data@0 in cc6Pfi4X.o "___gcov_indirect_call_profiler", referenced from: _main in cc6Pfi4X.o global constructors keyed to 65535_0_profile_generate_3.c in cc6Pfi4X.o "___gcov_init", referenced from: global constructors keyed to 65535_0_profile_generate_3.c in cc6Pfi4X.o ld: symbol(s) not found Last reported revision that worked was r155525 and first reported revision that failed was r155604.
Could this be a side-effect of r155534... 2009-12-31 Iain Sandoe <iain.sandoe@sandoe-acoustics.co.uk> PR target/41605 * config/darwin.h (LINK_COMMAND_SPEC): Resolve fopenmp specifically for target. (LINK_SPEC): Replace dynamic libraries by static equivalents where necessary. * config/darwin9.h (LINK_COMMAND_SPEC): Resolve fopenmp specifically for target. I find that if I explicitly add -lgcov to the linkage then gcc.dg/profile-generate-3.c links fine.
Is this a typo in the committed patch? - %(link_libgcc) %o %{fprofile-arcs|fprofile-generate*|coverage:-lgcov} \ to + %{L*} %(link_libgcc) %o %{fprofile-arcs|fprofile-generate|coverage:-lgcov} \ Notice that the * after fprofile-generate has been dropped after the patch.
Index: gcc/config/darwin.h =================================================================== --- gcc/config/darwin.h (revision 156530) +++ gcc/config/darwin.h (working copy) @@ -272,7 +272,7 @@ %{A} %{e*} %{m} %{r} %{x} \ %{o*}%{!o:-o a.out} \ %{!A:%{!nostdlib:%{!nostartfiles:%S}}} \ - %{L*} %(link_libgcc) %o %{fprofile-arcs|fprofile-generate|coverage:-lgcov} \ + %{L*} %(link_libgcc) %o %{fprofile-arcs|fprofile-generate*|coverage:-lgcov} \ %{fopenmp|ftree-parallelize-loops=*: \ %{static|static-libgcc|static-libstdc++|static-libgfortran: libgomp.a%s; : -lgomp } } \ %{!nostdlib:%{!nodefaultlibs: %(link_ssp) %G %L }} \ Index: gcc/config/darwin9.h =================================================================== --- gcc/config/darwin9.h (revision 156530) +++ gcc/config/darwin9.h (working copy) @@ -31,7 +31,7 @@ %{A} %{e*} %{m} %{r} %{x} \ %{o*}%{!o:-o a.out} \ %{!A:%{!nostdlib:%{!nostartfiles:%S}}} \ - %{L*} %(link_libgcc) %o %{fprofile-arcs|fprofile-generate|coverage:-lgcov} \ + %{L*} %(link_libgcc) %o %{fprofile-arcs|fprofile-generate*|coverage:-lgcov} \ %{fopenmp|ftree-parallelize-loops=*: \ %{static|static-libgcc|static-libstdc++|static-libgfortran: libgomp.a%s; : -lgomp } } \ %{!nostdlib:%{!nodefaultlibs: %(link_ssp) %G %L }} \ eliminates the failure of gcc.dg/profile-generate-3.c as expected on x86_64-apple-darwin10.
Subject: Bug 42982 Author: davek Date: Fri Feb 12 17:35:18 2010 New Revision: 156736 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=156736 Log: 2010-02-12 Dave Korn <dave.korn.cygwin@gmail.com> Jack Howarth <howarth@bromo.med.uc.edu> Iain Sandoe <iain.sandoe@sandoe-acoustics.co.uk> PR target/42982 Partial revert of unintended change in fix for PR41605. * gcc/config/darwin.h: Fix typo. * gcc/config/darwin9.h: Same. Modified: trunk/gcc/ChangeLog trunk/gcc/config/darwin.h trunk/gcc/config/darwin9.h
Fixed with r156736.