Skip to content

Link against libstdc++ - #23

Merged
fwsGonzo merged 1 commit into
varnish:mainfrom
pbowyer:fix/link-libstdcxx
Sep 6, 2026
Merged

fwsGonzo merged 1 commit into
varnish:mainfrom
pbowyer:fix/link-libstdcxx

Conversation

@pbowyer

@pbowyer pbowyer commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

The kvm and tinykvm VMOD targets declare only C source files, so libtool links their shared objects using the C compiler. However, both targets also include the C++ libkvm.a and libtinykvm.a static archives.

Without an explicit C++ runtime dependency, loading either VMOD can fail when libstdc++ has not already been loaded into the Varnish process:

undefined symbol: _ZTVN10__cxxabiv117__class_type_infoE

I found this in EL10, where jemalloc does not pull in libstdc++. Debian and Ubuntu hid the missing dependency because libstdc++ is already present from their jemalloc packaging.

Adding -lstdc++ after the static archives gives both shared objects the dependency they require, independently of the host distribution's transitive dependencies.

@fwsGonzo
fwsGonzo merged commit 585c57d into varnish:main Sep 6, 2026
4 checks passed
@fwsGonzo

fwsGonzo commented Sep 6, 2026

Copy link
Copy Markdown
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants