[PATCH] D102873: [clang] [MinGW] Fix gcc version detection/picking

Martin Storsjö via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 28 01:17:23 PDT 2021


mstorsjo added a comment.

Also @mati865 FYI, phabricator has this odd behaviour, that if you press "accept" but don't write a textual message, the notification mail only gets sent to the person receivers but not to the mailing list - so readers of the list will only see the original messages and then e.g. when the patch is pushed with no messages inbetween, it can seem a bit puzzling. So it's usually good to fill it out with a plain "LGTM" message or something if accepting a review.



================
Comment at: clang/test/Driver/mingw-sysroot.cpp:21
 // RUN: env "PATH=%T/testroot-gcc/bin:%PATH%" %clang -target x86_64-w64-mingw32 -rtlib=platform -stdlib=libstdc++ --sysroot="" -c -### %s 2>&1 | FileCheck -check-prefix=CHECK_TESTROOT_GCC %s
-// CHECK_TESTROOT_GCC: "{{.*}}/testroot-gcc{{/|\\\\}}lib{{/|\\\\}}gcc{{/|\\\\}}x86_64-w64-mingw32{{/|\\\\}}5.3-posix{{/|\\\\}}include{{/|\\\\}}c++"
-// CHECK_TESTROOT_GCC: "{{.*}}/testroot-gcc{{/|\\\\}}lib{{/|\\\\}}gcc{{/|\\\\}}x86_64-w64-mingw32{{/|\\\\}}5.3-posix{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}x86_64-w64-mingw32"
-// CHECK_TESTROOT_GCC: "{{.*}}/testroot-gcc{{/|\\\\}}lib{{/|\\\\}}gcc{{/|\\\\}}x86_64-w64-mingw32{{/|\\\\}}5.3-posix{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}backward"
+// CHECK_TESTROOT_GCC: "{{.*}}/testroot-gcc{{/|\\\\}}lib{{/|\\\\}}gcc{{/|\\\\}}x86_64-w64-mingw32{{/|\\\\}}10.2-posix{{/|\\\\}}include{{/|\\\\}}c++"
+// CHECK_TESTROOT_GCC: "{{.*}}/testroot-gcc{{/|\\\\}}lib{{/|\\\\}}gcc{{/|\\\\}}x86_64-w64-mingw32{{/|\\\\}}10.2-posix{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}x86_64-w64-mingw32"
----------------
MaskRay wrote:
> You may want to the adopt the `-SAME: {{^}} ` scheme I used in linux-cross.cpp
> 
> It can make sure the include paths are consecutive.
Thanks! Note for reference - I had to change the pattern `{{.*}}` into `{{[^"]*}}` (or better, `[[SYSROOT:[^"]+]]` as in linux-cross.cpp) for this to work properly, otherwise that wildcard can end up capturing the `"-internal-isystem"` which we want to spell out, if we want to force them to be consecutive. And not all of these are entirely consecutive, so the last one ends up without `-SAME`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102873/new/

https://reviews.llvm.org/D102873



More information about the cfe-commits mailing list