Fixes PR43744
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
- Build Status
Buildable 40649 Build 40774: arc lint + arc unit
Event Timeline
This looks like the right approach, but I have a concern or two about the ramifications as noted inline. Let me know if my concerns are unwarranted.
lld/COFF/Driver.cpp | ||
---|---|---|
1168 | I don't entirely understand the meaning of noEntry here, but your change affects whether this happens or not. Is that important? I don't know. See my comment on your new test. | |
1730 | This seems like a possible problem. Before, you couldn't get here without OPT_INPUTs--you either had some, or you had a DEF file which would provide the output file name. Now we can get here with just an archive, so we might be dereferencing an iterator at the beginning of an empty list. | |
lld/test/COFF/wholearchive.s | ||
18 | I think the -out flag is preventing the potential crasher I mentioned above. Can you try it without the -out? Maybe we need one with a DEF file as well. |
Somewhat related to the comments, I believe lld-link's ability to generate an import library from a def file directly is non-standard. MSVC's toolchain requires you to go through lib for that.
lld/COFF/Driver.cpp | ||
---|---|---|
1683 | This also ended up being a bug caught by the entry inference test. | |
1730 | Thanks, that's a real bug. I checked the Visual C++ linker's behavior, and they name the output after the first wholearchive argument. I did this: link -wholearchive:foo.lib and it produced foo.exe. | |
lld/test/COFF/wholearchive.s | ||
18 | I updated two existing tests that deal with infering things from inputs:
I don't think the case of -def: -wholearchive: is interesting, the def file is going to control the name of the DLL in that case. |
I don't entirely understand the meaning of noEntry here, but your change affects whether this happens or not. Is that important? I don't know. See my comment on your new test.