Skip to content

peering: localize only hidden non-weak symbols in the moq-fabric bundle - #1014

Open
gmarzot wants to merge 1 commit into
openmoq:peering/moq-peeringfrom
gmarzot:peering/bundle-localize-global-hidden
Open

gmarzot wants to merge 1 commit into
openmoq:peering/moq-peeringfrom
gmarzot:peering/bundle-localize-global-hidden

Conversation

@gmarzot

@gmarzot gmarzot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

docker/Dockerfile on peering/moq-peering (1aae13b, 8c3a9e6) fails at the final moqx link on its own bookworm image (GCC 12.2, binutils 2.40), with 1,410 errors like:

`_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_replaceEmmPKcm' referenced in section `.text' of
libmoqx_peering.a(moqx_peering_bundle.o): defined in discarded section `.text._ZNSt7__cxx1112basic_string...'
of libmoqx_peering.a(moqx_peering_bundle.o)

objcopy --localize-hidden in cmake/bundle-peering.cmake also localizes hidden weak symbols. Those are COMDAT group members: inline libstdc++ and spdlog code, hidden by VISIBILITY_INLINES_HIDDEN. The final link keeps an earlier object's copy of each group and discards the bundle's, so the bundle's now-local references point into discarded sections.

This change localizes only hidden GLOBAL definitions, listed from readelf -sW. Hidden weak symbols stay weak and merge by name, as they would without the bundle. picoquic stays isolated: no picoquic_ or ptls_ symbol is global in the bundle (1,872 symbols localized, 1,216 weak hidden left).

Tested: docker/Dockerfile at 8c3a9e6 with this change builds and links, and a moqx / LAPS / moqx fabric on moq-fabric f10e8bc5 using that image peers and delivers (steady streams, datagrams, path changes, relay restarts).


This change is Reviewable

objcopy --localize-hidden also localizes hidden weak (COMDAT) symbols. The
final link keeps another object's copy of each group and discards the
bundle's, so the bundle's now-local references point into discarded
sections and the link fails. Localize only hidden GLOBAL definitions,
listed with readelf -sW; hidden weak symbols stay weak and merge by name.
@gmarzot gmarzot self-assigned this Nov 20, 2026
@gmarzot
gmarzot requested review from TimEvens and afrind November 20, 2026 17:15
@gmarzot gmarzot added the gemini-review Ask Gemini to review this PR label Nov 20, 2026

This branch has not been deployed

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

Labels

gemini-review Ask Gemini to review this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant