`-static-libstdc++` breaks build
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Domain
- build-system
Research direction
Inspect lib/LcovUtil/Makefile.PL around the cxx_runtime_flags logic and the -static-libstdc++ check. Reproduce the NetBSD shared-object build, compare the linker command with and without that flag, and consider the issue complete when the LcovUtil.so build succeeds without the incompatible relocation error.
Written by the indexing model from the issue text.
Description
Updating lcov in pkgsrc from 2.5 to 2.6 I see new build breakage on NetBSD 11.99.9/x86_64:
c++ -shared -Wl,-zrelro -Wl,-znow -L/usr/lib -Wl,-R/usr/lib -Wl,-R/usr/pkg/lib -L/usr/pkg/lib -static-libstdc++ LcovUtil.o -o blib/arch/auto/LcovUtil/LcovUtil.so \
"-L/usr/pkg/lib/perl5/5.44.0/x86_64-netbsd-thread-multi/CORE" "-Wl,-R/usr/pkg/lib/perl5/5.44.0/x86_64-netbsd-thread-multi/CORE" "-Wl,-R/usr/pkg/lib/perl5/5.44.0/x86_64-netbsd-thread-multi/CORE" -lperl \
ld: /usr/lib/libstdc++.a(eh_globals.o): relocation R_X86_64_TPOFF32 against `_ZZN12_GLOBAL__N_110get_globalEvE6global' can not be used when making a shared object; local-exec is incompatible with -shared
ld: failed to set dynamic section sizes: bad value
gmake[1]: *** [Makefile:490: blib/arch/auto/LcovUtil/LcovUtil.so] Error 1
I hacked around this with:
--- lib/LcovUtil/Makefile.PL.orig 2026-10-04 08:54:16.488088210 +0000
+++ lib/LcovUtil/Makefile.PL
@@ -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 {
and the build succeeded:
c++ -shared -Wl,-zrelro -Wl,-znow -L/usr/lib -Wl,-R/usr/lib -Wl,-R/usr/pkg/lib -L/usr/pkg/lib LcovUtil.o -o blib/arch/auto/LcovUtil/LcovUtil.so \
"-L/usr/pkg/lib/perl5/5.44.0/x86_64-netbsd-thread-multi/CORE" "-Wl,-R/usr/pkg/lib/perl5/5.44.0/x86_64-netbsd-thread-multi/CORE" "-Wl,-R/usr/pkg/lib/perl5/5.44.0/x86_64-netbsd-thread-multi/CORE" -lperl \
chmod 755 blib/arch/auto/LcovUtil/LcovUtil.so
- Dominant language
- Perl
- Stars
- 1.1k
- Forks
- 271
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 9
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from linux-test-project/lcov
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
linux-test-project/lcov#546 · 4 comments ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
linux-test-project/lcov#557 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 57/100
linux-test-project/lcov#555 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
linux-test-project/lcov#554 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 63/100
linux-test-project/lcov#536 · 4 comments ·
Maintainers usually reply within 1 day
All issues in linux-test-project/lcov
Similar issues
-
✏️ Editing - Tags
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
openfoodfacts/openfoodfacts-server#15127 ·
Maintainers usually reply within 1 day
-
FIDO2 (ecdsa-sk / ed25519-sk) ingress keys rejected: missing in get_supported_ssh_algorithms_listOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ovh/the-bastion#695 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
observablt-ci
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
elastic/golang-crossbuild#840 ·
Maintainers usually reply within 1 day
-
Sync playback crashes repeatedly in a sync group (v9.1.1)Possibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
LMS-Community/slimserver#1701 · 6 comments ·
Maintainers usually reply within 1 day