https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114034
Bug ID: 114034 Summary: Failure of tests gcov-dump-{1,2}.C Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: fxcoudert at gcc dot gnu.org Target Milestone: --- We have the following failures on x86_64-apple-darwin23: FAIL: g++.dg/gcov/gcov-dump-1.C -std=gnu++98 (test for excess errors) FAIL: g++.dg/gcov/gcov-dump-1.C -std=gnu++14 (test for excess errors) FAIL: g++.dg/gcov/gcov-dump-1.C -std=gnu++17 (test for excess errors) FAIL: g++.dg/gcov/gcov-dump-1.C -std=gnu++20 (test for excess errors) FAIL: g++.dg/gcov/gcov-dump-2.C -std=gnu++98 (test for excess errors) FAIL: g++.dg/gcov/gcov-dump-2.C -std=gnu++14 (test for excess errors) FAIL: g++.dg/gcov/gcov-dump-2.C -std=gnu++17 (test for excess errors) FAIL: g++.dg/gcov/gcov-dump-2.C -std=gnu++20 (test for excess errors) Excess errors: ld: warning: ignoring duplicate libraries: '-lgcov' The compilation line only includes one -lgcov: /Users/fx/ibin-20240219/gcc/testsuite/g++1/../../xg++ -B/Users/fx/ibin-20240219/gcc/testsuite/g++1/../../ /Users/fx/gcc-upstream/gcc/testsuite/g++.dg/gcov/gcov-dump-1.C -fdiagnostics-plain-output -nostdinc++ -I/Users/fx/ibin-20240219/x86_64-apple-darwin23/libstdc++-v3/include/x86_64-apple-darwin23 -I/Users/fx/ibin-20240219/x86_64-apple-darwin23/libstdc++-v3/include -I/Users/fx/gcc-upstream/libstdc++-v3/libsupc++ -I/Users/fx/gcc-upstream/libstdc++-v3/include/backward -I/Users/fx/gcc-upstream/libstdc++-v3/testsuite/util -fmessage-length=0 -std=gnu++98 -fprofile-generate -ftest-coverage -lgcov -L/Users/fx/ibin-20240219/x86_64-apple-darwin23/./libstdc++-v3/src/.libs -B/Users/fx/ibin-20240219/x86_64-apple-darwin23/./libstdc++-v3/src/.libs -L/Users/fx/ibin-20240219/x86_64-apple-darwin23/./libstdc++-v3/src/.libs -L/Users/fx/ibin-20240219/x86_64-apple-darwin23/./libstdc++-v3/src/experimental/.libs -B/Users/fx/ibin-20240219/x86_64-apple-darwin23/./libitm/ -L/Users/fx/ibin-20240219/x86_64-apple-darwin23/./libitm/.libs -lm -o ./gcov-dump-1.exe but the driver somehow includes another one when calling collect2: /Users/fx/ibin-20240219/gcc/testsuite/g++1/../../collect2 -demangle -syslibroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/ -dynamic -arch x86_64 -platform_version macos 14.0.0 0.0 -o ./gcov-dump-1.exe -L/Users/fx/ibin-20240219/x86_64-apple-darwin23/./libstdc++-v3/src/.libs -L/Users/fx/ibin-20240219/x86_64-apple-darwin23/./libstdc++-v3/src/.libs -L/Users/fx/ibin-20240219/x86_64-apple-darwin23/./libstdc++-v3/src/experimental/.libs -L/Users/fx/ibin-20240219/x86_64-apple-darwin23/./libitm/.libs -L/Users/fx/ibin-20240219/gcc/testsuite/g++1/../.. -L/Users/fx/ibin-20240219/x86_64-apple-darwin23/./libstdc++-v3/src/.libs -L/Users/fx/ibin-20240219/x86_64-apple-darwin23/./libitm -lemutls_w -lheapt_w /var/folders/_8/7ft0tbns6_l87s21n4s_1sc80000gn/T//ccyOpfRM.o -lgcov -lstdc++ -lgcov -lgcc_s.1.1 -lgcc -lSystem -no_compact_unwind -rpath @loader_path -rpath /Users/fx/ibin-20240219/gcc -rpath /Users/fx/ibin-20240219/x86_64-apple-darwin23/libstdc++-v3/src/.libs -rpath /Users/fx/ibin-20240219/x86_64-apple-darwin23/libitm I'm wondering if it's a good idea to simply ignore the warning in the two test cases. It's not such a frequent use case, and darwin linker to being a pain here.