This allows using #pragma comment(lib, "foo") in MinGW built code for system libraries, if built with -fms-extensions.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
As long as this is mostly intended for system libraries, we can skip the .dll.a part, and don't need to think about any static flag.
Simplified it to only care about the case of system libraries for now. As this feature isn't available in ld.bfd and therefore not in use in the general mingw ecosystem, it might be ok to limit it to this case for now, for use with sanitizers?
COFF/Driver.cpp | ||
---|---|---|
377 ↗ | (On Diff #168757) | I guess this could be has_extension, probably with Style::windows, as well. |
383–385 ↗ | (On Diff #168757) | How about llvm::sys::path::replace_extension? |
386 ↗ | (On Diff #168757) | Eh, saving a library name for every -defaultlib: we find in an object file is kind of a waste of memory. They're everywhere. But, this is a pre-existing problem that needs fixing, so I won't push to fix it now. |
COFF/Driver.cpp | ||
---|---|---|
383–385 ↗ | (On Diff #168757) | I actually just changed it to use that, in the version I updated a few minutes earlier. |
COFF/Driver.cpp | ||
---|---|---|
380 ↗ | (On Diff #168872) | Please add a comment to explain this mingw-specific behavior. It might be a good thing to separate this code as a new function. |
COFF/Driver.cpp | ||
---|---|---|
380 ↗ | (On Diff #168872) | Ok, I added more comments and split this to a separate function, before pushing. |