bazelbuild / bazelbuild/rules_rust

Rustc fails to load proc macros compiled with different libc

Open
#2,865 0 comments 0 reactions 0 assignees View on GitHub
needs-triage
Dominant language
Starlark
Stars
843
Forks
651
Avg merge
2d 18h
Merged PRs (30d)
15

Description

It's not unusual for custom cc_toolchains to use a custom c++ compiler sysroot with a libc.so.6.

Currently, proc-macro crates inherit CcLink args. This means that proc-macros might require a different GLIBC version, and fail during the dlsym call by rustc, since it tries to link in the system libc.so

One way to fix this is to recompile a custom toolchain so that proc-macros can be safely compiled and loaded against the custom sysroot libc, but a better solution IMO would be an experimental option to link proc-macros with the self-contained linker. Then rules_rust wouldn't have the requirement that rustc be compiled from source by the same c++ toolchain that links proc macro crates.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.