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

Rustbuild compiles proc macros with -Ztls-model=inital-exec when cross-compiling #92976

Open
bjorn3 opened this issue Jan 16, 2022 · 1 comment
Labels
A-linkage Area: linking into static, shared libraries and binaries A-thread-locals Area: Thread local storage (TLS) C-bug Category: This is a bug. E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@bjorn3
Copy link
Member

bjorn3 commented Jan 16, 2022

Proc macros are dlopen'ed. -Ztls-model=initial-exec is not allowed for dlopen'ed dynamic libraries. Only for dynamic libraries declared directly or indirectly as DT_NEEDED of the main executable. While at least glibc reserves a bit of space just in case someone tries to dlopen a dynamic library compiled with the initial-exec tls model, this space is limited and running out of it will cause a failure to load.

cc https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/bypassing.20llvm-libunwind.20build.20on.20musl/near/268196922

@bjorn3 bjorn3 added A-linkage Area: linking into static, shared libraries and binaries T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) A-thread-locals Area: Thread local storage (TLS) C-bug Category: This is a bug. labels Jan 16, 2022
@Mark-Simulacrum
Copy link
Member

#100536 makes progress here for a subset of proc-macro dependencies; it's not an exhaustive list though and we don't have tests verifying we're doing the right thing here for now. It would be good to add those in the future.

@Mark-Simulacrum Mark-Simulacrum added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Aug 20, 2022
@JohnTitor JohnTitor added the E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example label Dec 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linkage Area: linking into static, shared libraries and binaries A-thread-locals Area: Thread local storage (TLS) C-bug Category: This is a bug. E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

No branches or pull requests

3 participants