head 1.2; access; symbols; locks; strict; comment @# @; 1.2 date 2026.10.19.14.12.16; author wiz; state Exp; branches; next 1.1; commitid lBmpEHu5nnLBT50H; 1.1 date 2026.10.04.10.06.14; author wiz; state Exp; branches; next ; commitid UJaDIN2oI2n719YG; desc @@ 1.2 log @lcov: use upstream version of build fix @ text @$NetBSD$ Makefile.PL: make the -static-libstdc++ probe use the C++ runtime https://github.com/linux-test-project/lcov/pull/560 --- lib/LcovUtil/Makefile.PL.orig 2026-09-29 23:30:59.000000000 +0000 +++ lib/LcovUtil/Makefile.PL @@@@ -162,7 +162,21 @@@@ my $cxx_runtime_flags = ''; my $out = File::Spec->catfile($tmpdir, 'probe.so'); open(my $probe, '>', $src) or die "Makefile.PL: cannot write $src: $!\n"; - print($probe "extern \"C\" int lcov_probe() { return 0; }\n"); + # Use exceptions, as the extension does: an empty probe pulls nothing out + # of a static libstdc++.a, so it links even where the real extension cannot + # (e.g. a libstdc++.a which is not position-independent - see #552). + print($probe <<'END_PROBE'); +#include +#include +extern "C" int lcov_probe(const char *s) +{ + try { + throw std::runtime_error(std::string(s)); + } catch (const std::exception &e) { + return static_cast(std::string(e.what()).size()); + } +} +END_PROBE close($probe); # True when $cxx can build a shared object with these extra flags. @@@@ -206,7 +220,7 @@@@ my $cxx_runtime_flags = ''; if (defined($rpath) && $can_link->($rpath)) { $cxx_runtime_flags = " $rpath"; print <<"END_MSG"; -Makefile.PL: no static C++ library for '$cxx'; using an rpath instead. +Makefile.PL: no usable static C++ library for '$cxx'; using an rpath instead. The extension will look for its C++ runtime in $dir before anything named by LD_LIBRARY_PATH. Moving or removing that directory @ 1.1 log @lcov: update to 2.6. Changes from v2.5 release: new html2lcov tool Capture source diff and 'baseline' coverage from lcov HTML report - suitable as input to generate differential coverage report versus 'now'. See the html2lcov documentation for details. new jacoco2lcov tool Translate JaCoCo java coverage data to lcov format - e.g., for multi-language coverage reporting or to take advantage of lcov features. See the jacoco2lcov documentation for details. new XS back end (on plaforms which support it). C++ implementation of some key types and operations - to improve execution time and memory footprint compared to pure Perl. various bug fixes and test coverage improvements. @ text @d3 2 a4 2 Fix build on NetBSD. https://github.com/linux-test-project/lcov/issues/552 d6 1 a6 1 --- lib/LcovUtil/Makefile.PL.orig 2026-10-04 08:54:16.488088210 +0000 d8 32 a39 9 @@@@ -191,7 +191,7 @@@@ my $cxx_runtime_flags = ''; # Look for libc++ as well as libstdc++: clang spells the option the same # way but may be using libc++ instead, in which case that is the library to # ask about. - if ($find_lib->('libstdc++.a', 'libc++.a') && + if (0 && $find_lib->('libstdc++.a', 'libc++.a') && $can_link->('-static-libstdc++')) { $cxx_runtime_flags = ' -static-libstdc++'; } else { @