Skip to content

Commit 3af974e

Browse files
committed
[LLVM][TargetParser] Handle -msys targets the same as -cygwin.
MSYS2 uses i686-pc-msys and x86_64-pc-msys as target, and is a fork of Cygwin. There's an effort underway to try to switch as much as possible to use -pc-cygwin targets, but the -msys target will be hanging around for the forseeable future.
1 parent 2667845 commit 3af974e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/TargetParser/Triple.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,7 +1150,8 @@ std::string Triple::normalize(StringRef Str, CanonicalForm Form) {
11501150
OSType OS = UnknownOS;
11511151
if (Components.size() > 2) {
11521152
OS = parseOS(Components[2]);
1153-
IsCygwin = Components[2].starts_with("cygwin");
1153+
IsCygwin = Components[2].starts_with("cygwin") ||
1154+
Components[2].starts_with("msys");
11541155
IsMinGW32 = Components[2].starts_with("mingw");
11551156
}
11561157
EnvironmentType Environment = UnknownEnvironment;
@@ -1195,7 +1196,7 @@ std::string Triple::normalize(StringRef Str, CanonicalForm Form) {
11951196
break;
11961197
case 2:
11971198
OS = parseOS(Comp);
1198-
IsCygwin = Comp.starts_with("cygwin");
1199+
IsCygwin = Comp.starts_with("cygwin") || Comp.starts_with("msys");
11991200
IsMinGW32 = Comp.starts_with("mingw");
12001201
Valid = OS != UnknownOS || IsCygwin || IsMinGW32;
12011202
break;

0 commit comments

Comments
 (0)