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

Q: Is the platform target really correct? #1

Open
cuviper opened this issue Mar 9, 2018 · 1 comment
Open

Q: Is the platform target really correct? #1

cuviper opened this issue Mar 9, 2018 · 1 comment

Comments

@cuviper
Copy link

cuviper commented Mar 9, 2018

In mod platform, this is using #[cfg(target_os = "...)] to select the appropriate probe implementation.

However, AIUI compiler plugins are compiled for the host platform, since they have to be loaded in rustc, so this code will see target_os of the host. But this may be different than the target platform that you're generating code for, set by cargo build --target ....

So I suspect this is incorrect for cross-compilation. It probably should use some runtime condition to detect the target and select the probe implementation.

@Fiedzia
Copy link
Owner

Fiedzia commented Mar 12, 2018

You might be right, I have no idea how cross-compilation works. So the plugin should detect compilation target and insert appropriate call.

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