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

Weak linkage support #60

Closed
bjorn3 opened this issue Jan 30, 2019 · 2 comments
Closed

Weak linkage support #60

bjorn3 opened this issue Jan 30, 2019 · 2 comments

Comments

@bjorn3
Copy link
Contributor

bjorn3 commented Jan 30, 2019

This is needed for libstd:

https://github.com/rust-lang/rust/blob/1a51bb8174e97251a37fcd83ff8750b7773e762a/src/libstd/sys/unix/fast_thread_local.rs#L22

@bjorn3
Copy link
Contributor Author

bjorn3 commented Jan 30, 2019

cc bjorn3/rustc_codegen_cranelift#146

@pchickey
Copy link
Collaborator

My plan is to change the global :bool field in the relevant artifact::Decl variants to instead be scope: Scope where pub enum Scope { Local, Global, Weak }. I don't want to re-use the ELF term "binding" for this in the public API because its confusing, and there is already a concept of artifact::Binding in the library.

Based on my reading of goblin's mach code, it appears there is a flag to mark exports as weak definitions, so this scheme should be supportable with mach (https://github.com/m4b/goblin/blob/master/src/mach/exports.rs#L25). I'd love if someone could point me to reference materials on the mach file format. Unfortunately, I don't have access to a machine running Mac OS to test this, but I could probably convince my employer to send me a retired macbook.

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

2 participants