ext: hide statically-linked symbols to prevent llhttp collision#1000
ext: hide statically-linked symbols to prevent llhttp collision#1000stanhu wants to merge 1 commit intolibgit2:masterfrom
Conversation
libgit2 >= 1.8 bundles llhttp as its default HTTP parser. Without visibility controls, all 119 llhttp_* symbols are exported from rugged.so and collide with the llhttp-ffi gem (used by the http gem) when both are loaded in the same process. Fix by: - Passing -DCMAKE_C_VISIBILITY_PRESET=hidden to cmake so libgit2 and its bundled deps (including llhttp) are compiled with -fvisibility=hidden on all platforms. - Appending -Wl,--exclude-libs,ALL to $LDFLAGS on Linux as a belt-and-suspenders linker-level guard (macOS ld does not support this flag, but the cmake flag covers it there). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
BeforeAfter: |
|
@carlosmn Could you look at this? |
|
@ethomson We ran into a significant regression after updating to Rugged v1.9 when the
|
|
That sounds like a problem, indeed. Sounds like something that libgit2 should be addressing. I won't be able to take a look for a few days, unfortunately. |
libgit2 >= 1.8 bundles llhttp as its default HTTP parser. Without visibility controls, all 119 llhttp_* symbols are exported from rugged.so and collide with the llhttp-ffi gem (used by the http gem) when both are loaded in the same process.
Fix by: