Skip to content

Tests: define the static data members the test headers declare - #56

Merged
adalisk-emikhaylov merged 2 commits into
masterfrom
test-static-members
Oct 15, 2026
Merged

adalisk-emikhaylov merged 2 commits into
masterfrom
test-static-members

Conversation

@Fedr

@Fedr Fedr commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

The test headers declare MR::MemberVars::A::z and w and MR::MatchingLayout::A::x without defining them, so the test library has undefined data symbols. That doesn't bother the C# tests, since DllImport binds functions lazily, but it makes libbleh.so fail to load eagerly: dlopen with RTLD_NOW, or the loaders of languages that bind the whole library at once (data symbols are always resolved at load time). Found while loading it from Rust and Java in #54 / #55.

They're now static inline with an initializer, so no extra source file is needed.

🤖 Generated with Claude Code

@adalisk-emikhaylov adalisk-emikhaylov left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make them inline instead to avoid an extra file.

@Fedr
Fedr force-pushed the test-static-members branch from 8e90310 to abff24c Compare October 14, 2026 20:00
Without definitions libbleh.so has undefined data symbols, so it can't be loaded eagerly (dlopen with RTLD_NOW, and the loaders of the languages that bind the whole library at once). Functions resolve lazily, data doesn't, which is why the C# tests never noticed. They're inline, so no extra file is needed.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@Fedr
Fedr force-pushed the test-static-members branch from abff24c to 8fb58bd Compare October 14, 2026 20:45
@adalisk-emikhaylov
adalisk-emikhaylov merged commit 75dc2a1 into master Oct 15, 2026
@adalisk-emikhaylov
adalisk-emikhaylov deleted the test-static-members branch October 15, 2026 12:09
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