In earlier GCC versions, the Debian/Ubuntu provided mingw toolchains
were packaged in /usr/lib/gcc/<triple> with version strings such as
"5.3-win32", which were matched and found since
6afcd64eb6. However in recent versions,
they have stopped including the minor version number and only have
version strings such as "10-win32" and "10-posix".
Generalize the parsing code to tolerate the patch suffix to be present
on a version number with only a major number.
Refactor the string parsing code to highlight the overall structure of
the parsing. This implementation should yield the same result as before,
except for when there's only one segment and it has trailing, non-number
contents.
This allows Clang to find the GCC libraries and headers in Debian/Ubuntu
provided MinGW cross compilers.
1.8 KiB
1.8 KiB