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

feature gate FFI imports of LLVM intrinsics #20313

Closed
huonw opened this issue Dec 29, 2014 · 1 comment · Fixed by #20334
Closed

feature gate FFI imports of LLVM intrinsics #20313

huonw opened this issue Dec 29, 2014 · 1 comment · Fixed by #20334
Labels
A-FFI Area: Foreign function interface (FFI) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.

Comments

@huonw
Copy link
Member

huonw commented Dec 29, 2014

E.g. one can import an intrinsic via

extern {
    #[link_name = "llvm.sqrt.f32"]
    fn sqrt(x: f32) -> f32;
}

AFAIK, LLVM doesn't have guarantees about the stability of intrinsics, so a library usable with Rust 1.0 that does the above may become unusable with Rust 1.x if LLVM is upgraded. Being chaine to a specific LLVM version would be really bad, so we should feature gate link_names that start with llvm..

(Tagging as E-mentor, since I'm happy to help. The relevant code is in syntax::feature_gate.)

@huonw huonw added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. I-nominated A-FFI Area: Foreign function interface (FFI) E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. labels Dec 29, 2014
@nagisa
Copy link
Member

nagisa commented Dec 30, 2014

I’ll take this.

nagisa added a commit to nagisa/rust that referenced this issue Dec 31, 2014
alexcrichton added a commit to alexcrichton/rust that referenced this issue Jan 2, 2015
dlrobertson pushed a commit to dlrobertson/rust that referenced this issue Nov 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-FFI Area: Foreign function interface (FFI) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants