Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround parsing GNU system headers with GCC 11.0 version. #1737

Merged
merged 1 commit into from
May 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/Parser/ParserOptions.cs
Original file line number Diff line number Diff line change
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