Skip to content

Unconditionally set static_library even when use_pic is True - #4176

Closed
jakos-sec wants to merge 1 commit into
bazelbuild:mainfrom
jakos-sec:fix-static-library-pic
Closed

Unconditionally set static_library even when use_pic is True#4176
jakos-sec wants to merge 1 commit into
bazelbuild:mainfrom
jakos-sec:fix-static-library-pic

Conversation

@jakos-sec

Copy link
Copy Markdown
Contributor

rules_go and some other C++ interoperability layers expect static_library to unconditionally be present. When they attempt to link the binary, the Rust archives (libcxx.a, libtokenizers_cpp.a, etc.) were missing from the linker command line, triggering the ld.lld: error: undefined symbol build failure, we therefore set those unconditionally.

@krasimirgg
krasimirgg self-requested a review July 28, 2026 08:52
`rules_go` and some other C++ interoperability layers expect static_library to unconditionally be present. When they attempt to link the binary, the Rust archives (libcxx.a, libtokenizers_cpp.a, etc.) were missing from the linker command line, triggering the `ld.lld: error: undefined symbol` build failure, we therefore set those unconditionally.
@jakos-sec
jakos-sec force-pushed the fix-static-library-pic branch from db27e28 to 5a16448 Compare July 28, 2026 09:27

@krasimirgg krasimirgg 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.

Thank you! Chatted offline, and let's see if we can set up an integration test for this using rules_go (seems we need to bump the version of rules_go used by tests first; we can do that independently).

@jakos-sec

Copy link
Copy Markdown
Contributor Author

I can currently no longer reproduce the issues that require static_library to be always set. Let's close this PR and create a new one if the issue is reproducable.

@jakos-sec jakos-sec closed this Jul 28, 2026
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