[lld] [LLD][MINGW] Add `--undefined-glob` flag support (PR #109866)

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 24 14:22:37 PDT 2024


https://github.com/mstorsjo commented:

The changes look reasonable, thanks!

The surrounding context raises a question regarding the actual COFF implementation though: On the COFF level we have two options, `-include:` and `-includeoptional:`, and on the MinGW level we have two corresponding options, `--require-defined` and `--undefined`. GNU ld does support both `--require-defined` and `--undefined`, while LLD/ELF only supports `--undefined`.

How does the ELF flag `--undefined-glob` behave (either GNU ld or LLD/ELF), if the requested symbols don't exist (i.e. the glob doesn't match anything)? If this is consistent with `--undefined`, I guess it means that it's not an error if the requested symbols don't exist at all. I.e. on the COFF level, it's more consistent with `-includeoptional:` than with `-include:`. Looking at the code, it does look like it's not an error.

It would be good to have a testcase on the COFF level, to validate this - I should have thought of this during the review of #109721, but I missed to request this.

This change looks fine, but I'd like to have the semantics of these options clarified (i.e. the questions above answered) before I merge this one.

https://github.com/llvm/llvm-project/pull/109866


More information about the llvm-commits mailing list