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

Cross compilation + #[phase(syntax)] = sadness #12102

Closed
alexcrichton opened this issue Feb 8, 2014 · 3 comments
Closed

Cross compilation + #[phase(syntax)] = sadness #12102

alexcrichton opened this issue Feb 8, 2014 · 3 comments
Labels
A-syntaxext Area: Syntax extensions

Comments

@alexcrichton
Copy link
Member

I believe that when you specify a crate with #[phase(syntax)], that should resolve a crate for the host architecture, not the target architecture. This means that if I'm doing a cross-compile, I'm going to attempt to dlopen libraries for the target architecture, which will probably fail if I'm cross compiling.

cc @sfackler

alexcrichton added a commit to alexcrichton/rust that referenced this issue Feb 11, 2014
Loadable syntax extensions don't work when cross compiling (see rust-lang#12102), so the
fourcc tests all need to be ignored. They're valuable tests, so they shouldn't
be outright ignored, so they're now flagged with ignore-cross-compile
bors added a commit that referenced this issue Feb 12, 2014
Loadable syntax extensions don't work when cross compiling (see #12102), so the
fourcc tests all need to be ignored. They're valuable tests, so they shouldn't
be outright ignored, so they're now flagged with ignore-cross-compile
alexcrichton added a commit to alexcrichton/rust that referenced this issue Mar 2, 2014
These tests are failing on the snap builders, and are now tagged with a FIXME.

cc rust-lang#12102
@alexcrichton
Copy link
Member Author

Another problem I just uncovered:

Let's say that I have my own syntax extension inside of directory foo. To use this syntax, extension I will pass -L foo to the compiler. The compiler will then open up foo/libmymacro-ffffff-1.0.dylib in an attempt to read the metadata and find the macro registrar. By default, crate loading will load dependencies as well. This means that when libmymacro is built for the host architecture, it will load the target architecture's libstd metadata (!!!).

The new SVH infrastructure has detected this bug because the SVH is different between target/host crates. This could be fixed with a combination of #10814 and perhaps some more clever infrastructure for loading syntax extensions with a different target architecture.

bors added a commit that referenced this issue Mar 3, 2014
These tests are failing on the snap builders, and are now tagged with a FIXME.

cc #12102
bors added a commit that referenced this issue Apr 23, 2014
This allows the use of syntax extensions when cross-compiling (fixing #12102). It does this by encoding the target triple in the crate metadata and checking it when searching for files. Currently the crate triple must match the host triple when there is a macro_registrar_fn, it must match the target triple when linking, and can match either when only macro_rules! macros are used.

due to carelessness, this is pretty much a duplicate of #13450.
@sfackler
Copy link
Member

sfackler commented Jun 5, 2014

This was fixed, right?

@alexcrichton
Copy link
Member Author

This was indeed, #13584 fixed it.

bors added a commit to rust-lang-ci/rust that referenced this issue Jul 25, 2022
style: rename crates to kebab-case

Ref: rust-lang#12102
I updated all the folders names as well as the crates names in each `Cargo.toml` to use kebab-case.

This is my first ra PR. In case I missed something, I am ready/available to fix it until it is ready to merge.

Thank you.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-syntaxext Area: Syntax extensions
Projects
None yet
Development

No branches or pull requests

2 participants