Conversation
91d18b9 to
2042a86
Compare
2042a86 to
1cfad87
Compare
1cfad87 to
d643cb8
Compare
|
Nice work! If you'd like to send PRs for any abstraction work, that could be good. Just be sure to tell me which bit of abstraction you want do so that we avoid duplication. I guess one logical one to start with might be |
There are a couple things i think it would be good to have some input in before submitting a pr.
Any feedback on these which be very welcome. also would it be fine to have a pr say adding windows args + windows compilation that just panics if you target windows/pe? |
I assume having
Having a flag in addition to the LLVM approach of switching based on
I haven't yet looking into what you're doing there enough yet to have thoughts on alternatives.
Yeah, I'm not entirely happy with the Platform / ObjectFile relationship at the moment. I'm not sure what best way to structure it is though. My main annoyance at the moment is the invariant lifetimes that arise from it.
Yeah, naming is hard. I'm not sure about the naming of
The idea as it current stands is that it's file-format + CPU architecture. So
Yeah. My rough plan was make it less ELF-specific as we go. For the trait to be shared between the different file formats, it to some extent needs to be a superset of what those file formats need. There might be scope to have an elf-specific trait provided it's only needs to be used from elf-specific code (e.g. in
I've only looked at bits of the PR so far. One thing I did notice was that it doesn't seem to use the layout phase. I haven't found what it's doing instead. My intention is for the layout phase to become generic enough that it can be used for other platforms. A lot of the things the linker needs to do are in layout. e.g. garbage collection, figuring out how bit each section needs to be, assigning addresses. So I expect that eventually we'd want to use it for windows too.
There's a PR in progress for making wild compile for windows - #1629. So I wouldn't want to take that work away for that contributor while they're still working on it. As for adding parsing of windows args without the rest of the required support for windows, I'd be fine with that. Ideally if code needs to be moved and edited, it'd be good if those operations can be done in separate PRs, or at least separate commits in one PR (although we now always squash on merge), since that makes the diffs easier to review. I guess something else that needs to be figured out is module structure. I've thus far avoided having submodules, but I accept that at some point it might be necessary to put some code in a subdirectory of |
|
yes it would be good to sort out how you think modules should be handled. i dont really see anyway around having them and personally i like them. what is needed though is how the structuring should be done. |
|
I'm inclined to go with If we have elf-specific layout code as a submodule of layout, how would we reference that code? At the moment, I've got most of the elf-specific layout code in elf.rs, which means the relevant types can be referenced from the |
|
sounds good. i think for the second part the best way is just build it out and see what happens and refactor later. i feel like hindsight will probably play a big role |
|
LLD allows changing the target via combination of First is the distinction whether to use GNU ld or link.exe style args, aka flavor (there are also mac and wasm flavors but not relavant here). This is based on Windows targets can use either style, MinGW driver handles GNU style args and converts them into link style args: https://github.com/llvm/llvm-project/blob/4d08284157d09ce6104f0753f1dbf5adc43c113d/lld/MinGW/Driver.cpp#L620 There is also an elephant in this room: quoting and escaping command line args. Because of Windows stupid decision to use escape character as path separator, for example Personally I don't care about MSVC toolchains, but I can help with MinGW part if we decide on whether and how to support it. Ability to build Windows binaries on Linux could also help when developing Windows specific parts. |
|
As per https://github.com/wild-linker/wild/blob/b95e0f8461e1b8fa2cc07467f49e83cd0ca978a2/CONTRIBUTING.md#llm--ai-use-policy could you disclose whether (and how if the previous answer was positive) you used AI for this PR? |
|
Note that the policy currently doesn't require disclosure of AI use, except for written communication, or if there are bits of code / changes to code that the submitter doesn't fully understand themselves. |
|
My point is generating code via LLMs usually means the author at least partially doesn't understand proposed changes. If AI was used, then I'd ask for explicit statement that author reviewed and understands the changes, before taking deeper look into the code. |
my personal goal would be to support target triple as a set all flag to specify the target info then also support the more standard -m -flavor flags etc that will overide the target triple if used. this gives the best of both world IMO.
i like i currently have we should just support on windows targets at the same time in the parser. the logic is basiclly start with "-" or "/" and flag name.lower_case() == flag name. which means you can write the parser builder logic onces and have it work on both flag types.
I haven't run into this being an issue yet but haven't tested a heap.
building to target MSVC isnt too bad on linux for rust u can just use https://github.com/rust-cross/cargo-xwin |
Sure i use LLM's (Claude code mainly) for various parts. I normally use it to do research and find links for reading reading material on whatever im working on. Also use it to write parts of the code base i think it can do a good job of. i.e. i want to move fields from say linux/elf struct onto common/shared struct. In general i wouldn't put a pr up for review unless i had read every line written and decided it wasn't slop. unless its simple changes that would be enforced by a some form a automated checking like rustc compile time checks. |
If you want to do this. Which in general i would agree with as there is too much slop code these days. You should probably come up with a well worded question that makes more sense for the various ways that "AI" is used. Like using a AI autocomplete like is completely different from used in Agent mode which is completely different from AI used to research or ask questions. I mean you could even argue that any search engine request in google.com etc is AI and has been for years. Anyways my point being you should come up with a template or better worded question that covers the use case better. |
33bb73f to
ddc0103
Compare
A very much WIP windows support.
Currently you can link a very simple windows program with
just test-pe