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

VxWorks wr-cc is detected as MSVC compiler, cc adds flags "no-logo", "W4" and "--" which causes compilation issues. #1197

Closed
biabbas opened this issue Sep 4, 2024 · 6 comments · Fixed by #1198

Comments

@biabbas
Copy link
Contributor

biabbas commented Sep 4, 2024

More discussion at Zulip: https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/Optimizing.20Compiler.20builtins.20causes.20build.20failure.20on.20VxWorks

Follow up of issue: rust-lang/compiler-builtins#679

@NobodyXu
Copy link
Collaborator

NobodyXu commented Sep 4, 2024

Does VxWorks wr-cc define any macro?

If it does, then we could use it to detect VxWorks wr-cc compiler.

@biabbas
Copy link
Contributor Author

biabbas commented Sep 4, 2024

Does VxWorks wr-cc define any macro?

If it does, then we could use it to detect VxWorks wr-cc compiler.

Yes. It does have __VXWORKS__ macro. I'll try using this. Additionally, whenever compiling a program, cc-crate would add target=some_target. For VxWorks this behavior causes issues as each wr-cc is configured for one target.

@biabbas
Copy link
Contributor Author

biabbas commented Sep 4, 2024

How does it distinguish clang from msvc on linux. On linux GNUC and clang both would be defined.

@NobodyXu
Copy link
Collaborator

NobodyXu commented Sep 4, 2024

You could put it in detect_compiler_family.c then modify tool.rs to support VxWorks wr-cc

@NobodyXu
Copy link
Collaborator

NobodyXu commented Sep 4, 2024

How does it distinguish clang from msvc on linux. On linux GNUC and clang both would be defined.

We pass -? to the compiler to detect msvc.

@biabbas
Copy link
Contributor Author

biabbas commented Sep 4, 2024

Oh

How does it distinguish clang from msvc on linux. On linux GNUC and clang both would be defined.

We pass -? to the compiler to detect msvc.

Yeah. For some reason wr-cc -? returns 0.

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

Successfully merging a pull request may close this issue.

2 participants