-
Notifications
You must be signed in to change notification settings - Fork 1
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
Experiment: add Rust static lib linked into krabcake tool #1
Conversation
…enable krabcake tool in Rust itself.
(This currently avoids use of |
(one thing that is currently broken, or at least non-optimal: the Rust static lib is being built in the It is also generating a |
… not the correct long-term solution to git complaining about the target subdir.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess once you add the code to show the Rust code was successfully called, we can merge :)
@@ -13,18 +33,25 @@ endif | |||
|
|||
KRABCAKE_SOURCES_COMMON = kc_main.c | |||
|
|||
# RUST_EXTRA_LD_FLAGS = -ldl -lrt -lpthread -lgcc_s -lc -lm -lrt -lutil | |||
# RUST_EXTRA_LD_FLAGS = -ldl -lrt -lpthread -lc -lm -lrt -lutil | |||
RUST_EXTRA_LD_FLAGS = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this + its usage below is currently a no-op right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's right; this is a relic from when I was trying to figure out some linker stuff. (I never really resolved it to my satisfaction, though at least now I have some theories as to what's going on...)
Agreed |
…t side and C side of the krabcake tool.
update: I think the aforementioned linkage issues are due to unresolved symbols that are injected when you have potential panicking paths in the code of the static library. In particular, I observed really wonky behavior where, depending on how complex my code was, changes to arithmetic operations would cause linker errors, and I eventually realized it was due to array access This is not at all my long- or even medium-term intent here. My intent is that the Rust code here should be allowed to panic, and panics should map into Valgrind's internal abort machinery that already exists. But for the short-term, I'm working around the panicking by ensuring my static lib never actually panics (in a manner that LLVM can prove at compile time, sufficiently so to eliminate those otherwise unresolved symbols). |
Experiment: add Rust static lib that is linked into krabcake tool to enable krabcake tool in Rust itself.