Add frust-extern option#2134
Conversation
CohenArthur
left a comment
There was a problem hiding this comment.
I think this is a good start, but it does not yet cover the entirety of what we want from the option (which is fine). we'll also need to add tests later
| if (std::string::npos == pos) | ||
| { | ||
| return false; | ||
| } |
There was a problem hiding this comment.
| if (std::string::npos == pos) | |
| { | |
| return false; | |
| } | |
| if (std::string::npos == pos) | |
| return false; |
nit, also shouldn't we error out here? not sure why rustc accepts rustc --extern <something_without_an_equal_sign> and I haven't looked into it, so maybe we should not error out here
There was a problem hiding this comment.
No we shouldn't. At least rustc does not, it simply ignores the dependency.
There was a problem hiding this comment.
I think this is due to the unstable feature with options here. But still, no option and no path seems to raise no error.
There was a problem hiding this comment.
I have no idea how the argument parsing and logic in rustc works, so I can't really help here. I just know that last time I looked, rustc uses https://docs.rs/getargs/latest/getargs/ to parse arguments.
Add a new option to gather extern crates location. gcc/rust/ChangeLog: * lang.opt: Add frust-extern option. * rust-session-manager.cc (Session::handle_extern_option): Add frust-extern option handler. * rust-session-manager.h (struct Session): Add an unordered map to store library name and locations. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Add a new option to gather extern crates location.
gcc/rust/ChangeLog: