Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rust_bindgen_library breaks in rust_shared_library #2533

Open
neilisaac opened this issue Feb 29, 2024 · 0 comments
Open

rust_bindgen_library breaks in rust_shared_library #2533

neilisaac opened this issue Feb 29, 2024 · 0 comments

Comments

@neilisaac
Copy link
Contributor

When linking a rust_shared_library that depends on a bindgen_rust_library, I get errors such as:

/usr/bin/ld.gold: error: /.../some_rust_binding.rlib(some_c_lib.o): requires dynamic R_X86_64_PC32 reloc against '_ZNSs4_Rep20_S_empty_rep_storageE' which may overflow at runtime; recompile with -fPIC

It looks to me like the rust_library target is including the cc_lib in its rlib output. This PR changes it to depend on the cc_library target instead, where the cc toolchain will provide both PIC and non-PIC objects to select as appropriate at link time.

I'm using v0.39.0 with experimental_use_cc_common_link enabled.

I worked around this issue as follows: #2517

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

No branches or pull requests

1 participant