Add the /v option which prints out the LLD version string.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Would it be easy to print the version number as part of /? instead? Maybe that's safer.
It's a little bit confusing that for gcc/clang, -v means verbose, for ld it means version, we can't use /version for lld-link because for link.exe that means something else..
Thanks!
Nico, this addresses your needs, right?
lld/test/COFF/help.test | ||
---|---|---|
3 ↗ | (On Diff #119207) | Maybe add a regex to check that it prints something that looks like a version? |
FWIW, I've got code elsewhere that detects lld-link, that looks like this:
elif $_cc -? 2>/dev/null | grep -q 'LLVM.*Linker'; then
and then for getting the actual version from that linker:
_ident=$($_cc -flavor gnu --version 2>/dev/null)
Once this goes in, at least the first test needs to be adjusted, in case I want the code to work both with LLD <= 5.0 and >= 6.0.
This would work for me, but it sounds like it'd break mstorsjo :-( Maybe lld-link and clang-cl should both just have a --version. That won't clash, does what it says, and won't break existing code.
Are you suggesting we implement the Unix-style, double-hyphen --version to lld-link? It would work, but it seem a bit strange to me, as all the other options starts with "/".
Yes, that's what I meant. clang-cl also has a bunch of Unix style flags. I agree it's a bit strange, but it'd be llvm-consistent.
Instead of including version information to the --help message, add the --version option.