Skip to content

Commit

Permalink
Workaround parsing GNU system headers with GCC 11.0 version. (mono#1737)
Browse files Browse the repository at this point in the history
  • Loading branch information
tritao committed May 30, 2023
1 parent dc743a2 commit 0272532
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Parser/ParserOptions.cs
Expand Up @@ -240,9 +240,11 @@ public void SetupLinux(string headersPath = "")
GetUnixCompilerInfo(headersPath, out var compiler, out var longVersion, out var shortVersion);

AddSystemIncludeDirs(BuiltinsDir);
AddArguments($"-fgnuc-version={longVersion}");

var majorVersion = shortVersion.Split('.')[0];
// Workaround https://github.com/llvm/llvm-project/issues/53152, remove once bug is fixed.
AddArguments(int.Parse(majorVersion) >= 11 ? $"-fgnuc-version=10.1" : $"-fgnuc-version={longVersion}");

string[] versions = { longVersion, shortVersion, majorVersion };
string[] triples = { "x86_64-linux-gnu", "x86_64-pc-linux-gnu" };
if (compiler == "gcc")
Expand Down

0 comments on commit 0272532

Please sign in to comment.