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

Import Cargo, first steps towards porting to Rust 🦀 #343

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

katef
Copy link
Owner

@katef katef commented Apr 20, 2021

Here I'm introducing Cargo to the build. It's driven from the existing makefiles. This marks the start of porting to Rust by a piecemeal approach, so we'll have a hybrid codebase until that's completed.

I've added an fsm_noop function written in Rust (called from fsm_new), just to prove the linking here works.

Currently the makefiles build libfsm.a from a single partially-linked libfsm.o. That single .o file is made by ld -r -o libfsm.o *.o, effectively bundling together all the various .o files.

In this PR I'm adding the Cargo-generated .a file to that list of sources for ld -r. I think this depends on ld being able to see inside a .a file when invoked with -r for partial linking. This seems to work okay, at least on the ELF and Mach-O systems available in CI. Those are all I'm interested in for the moment.

@data-man
Copy link
Contributor

Really porting to Rust?
Bad news.

@katef
Copy link
Owner Author

katef commented Sep 18, 2021

Really porting to Rust?
Bad news.

I'm unsure. at least for the moment, it's more work than I can take on, regardless of whether it's a good idea or not. So this PR isn't going anywhere for a while yet.

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 this pull request may close these issues.

None yet

3 participants