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

Upgrade Checked C clang sources to clang mainline 17.0 #1231

Open
dtarditi opened this issue Mar 24, 2024 · 2 comments
Open

Upgrade Checked C clang sources to clang mainline 17.0 #1231

dtarditi opened this issue Mar 24, 2024 · 2 comments

Comments

@dtarditi
Copy link
Member

dtarditi commented Mar 24, 2024

We need to upgrade the Checked C clang sources to a newer version of clang. The Checked C clang source are currently based on clang 12.0.2, from Jan. 2021.

I updated the Wiki page on upgrading the compiler sources to point the most recent documentation on this.

I looked at clang 16.0 from July 2022 and clang 17.0 from Jan. 2023. In both cases, I merged the Checked clang sources into a baseline branch that matches upstream. I then committed the changes with the merge markers and diff'ed the two versions with merge conflicts. It does not look like much more work to jump to clang 17.0 instead of clang 16.0. There were only 95 merge chunks that differed between the two (and these could be because upstream changed relative to itself).

We will aim from clang 17.0. I've pushed two branches: 17-init-baseline, which just mirrors upstream at the point where the branch for 17.0 was a taken and 17-init-main, which has the Checked C clang sources merged into. We always smaller changes (the Checked C changes) into the clang sources (which have much more changes).

If you look at dates, we will be updating to 2 years of changes. This is about 2/3 of the time delta. This seems look a reasonable mid-point to aim for.

I am tracking progress on resolving the merge conflicts with the following files:

The current work is to resolve merge conflicts and get clang to compile again. The approach is to:

  1. Try to build clang
  2. See what files fail to compile.
  3. Fix the merge conflicts or compile files in a few files.
  4. Once those files succeed, check-in the changes and repeat the whole process.
@dtarditi
Copy link
Member Author

BTW, C doesn't evolve that fast and the C front-end does not have that many bugs. The upgrade overhead here is mostly due to working in a shared C/C++/Objective C front-end code base.

@dtarditi
Copy link
Member Author

dtarditi commented Jun 4, 2024

We are closing in on the upgrade. I've fixed a number of merge issues that result in failing clang tests. Here is the summary of my latest run on a Windows x64 system using the 17-init-main branch:

Testing Time: 5371.27s
  Skipped          :    30
  Unsupported      :   237
  Passed           : 32974
  Expectedly Failed:    39
  Failed           :   458

357 of the failing tests are for the 3C tool, which leaves 101 other failing clang tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant