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

Rust support #1

Open
jrmuizel opened this issue Jun 19, 2020 · 5 comments
Open

Rust support #1

jrmuizel opened this issue Jun 19, 2020 · 5 comments
Labels
enhancement New feature or request

Comments

@jrmuizel
Copy link

This would be really nice to have.

@sebastianpoeplau
Copy link
Collaborator

We think so too :) There's someone currently looking into it - we'll keep you posted.

@sebastianpoeplau sebastianpoeplau added the enhancement New feature or request label Jun 19, 2020
@sebastianpoeplau
Copy link
Collaborator

Thanks for sharing @unseddd! In our initial work, we went for the first approach. While getting SymCC added to upstream LLVM would allow a cleaner solution and make it easier for people to use SymCC in general, a lot of continued effort would be required to keep up with LLVM's pace of development and to provide high-quality support for all its targets.

I'm trying to find the time to finish the work on Rust support from where the student left off... He was able to include the SymCC pass into the LLVM version that rustc uses, and we determined that we'd need the stage-0 compiler and the stage-1 libraries, as you said. Finally, we'd have to make sure that the new compiler links or compiles SymCC's libSymRuntime into binaries.

@sebastianpoeplau
Copy link
Collaborator

I can't guarantee how long-term I can provide development and support (future being uncertain), but I want to get more involved with LLVM development. Willing to experiment with adding a symbolize pass in-tree. llvm/lib/Transforms/Instrumentation seems like a good place for smth like a SymbolizePass.cpp to live, what do you think?

Yes, I agree. And for the custom build of rustc and its LLVM I think it's easiest to compile SymCC in-tree anyway, so that we avoid the challenges around locating and loading libSymbolize.so. We're building a custom version of the compiler already, so we can as well patch the SymCC pass in.

I had some success with building SymCC in Rust's LLVM tree as well, but haven't figured out how to get the codegen backend to load the libSymbolize.so library (rustc_codegen_llvm looks for static .a libs). Still working on it, though.

Maybe it's easiest to move SymCC's compiler directory into the LLVM tree. The LLVM docs suggest that the changes needed in the build system should be relatively minor.

I have some spare cycles to throw at the problem, so I'm willing to help out. Will look into how to link libSymRuntime once I get a working symbolized rustc build. Does libSymRuntime need to be linked in the rustc build, or only for binaries being tested?

That's great! As for libSymRuntime, it's only needed to execute instrumented code, not to build it. So while rustc needs to build the runtime into the executables that it creates, I don't think it will itself need to be built against it.

@sebastianpoeplau
Copy link
Collaborator

Wow, that's really nice! Great progress :)

@unseddd
Copy link

unseddd commented Nov 16, 2020

Tried moving SymCC in-tree in LLVM, and using the new pass manager. Running into a linking issue, but will keep experimenting.

(Apologies for deleting previous comments, went overzealous with housekeeping)

tuong referenced this issue in unseddd/rust Jan 22, 2022
tuong pushed a commit to sfu-rsl/symcc that referenced this issue May 11, 2022
Add support to LLVM12 ( SIMPLE + QSYM ) and LLVM13 ( only SIMPLE )
tuong pushed a commit to sfu-rsl/symcc that referenced this issue Jul 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants