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

Check different rustc codegen backends against each other #4

Closed
bjorn3 opened this issue Jun 27, 2022 · 5 comments · Fixed by #5
Closed

Check different rustc codegen backends against each other #4

bjorn3 opened this issue Jun 27, 2022 · 5 comments · Fixed by #5

Comments

@bjorn3
Copy link
Contributor

bjorn3 commented Jun 27, 2022

This would allow verifying that libraries compiled against one codegen backend (eg llvm) could be linked against those compiled with another codegen backend (eg cranelift). I got a quick implementation over at https://github.com/bjorn3/rustc_codegen_cranelift/issues/1234#issuecomment-1167723143.

@Gankra
Copy link
Owner

Gankra commented Jun 27, 2022

Your patch looks decent, the only ??? part is the string you're passing in for the cranelift backend. Is there a more "correct" way to do this? Point to a repo/sha? path? rustup? ..?

@bjorn3
Copy link
Contributor Author

bjorn3 commented Jun 27, 2022

I would like it to be configurable. So for example you could say --codegen-backend-a=llvm --codegen-backend-b=/path/to/librustc_codegen_cranelift.so to compare the builtin llvm backend against an external cranelift backend. Not sure what the best commandline interface would be though.

@Gankra
Copy link
Owner

Gankra commented Jun 27, 2022

Hmm I think the best way would be to add a --add-rustc-codegen-backend=my-rustc:path/to/backend flag which can basically copy the logic for pairs:

https://github.com/Gankra/abi-checker/blob/ec12649b6ba0bb73a47d1a91929120d4eedef3d6/src/main.rs#L153-L158

and injects your custom ABI here

https://github.com/Gankra/abi-checker/blob/ec12649b6ba0bb73a47d1a91929120d4eedef3d6/src/main.rs#L234

Then if there aren't any weird assumptions this breaks, my-rustc_calls_rustc will suddenly automagically work.

@Gankra
Copy link
Owner

Gankra commented Jun 27, 2022

lmk if you want to tackle this or would prefer me to

@bjorn3
Copy link
Contributor Author

bjorn3 commented Jun 28, 2022

Opened #5.

@Gankra Gankra closed this as completed in #5 Jun 28, 2022
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