From: Nathan Chancellor <[email protected]> Date: Thu, 07 Aug 2025 14:36:28 -0700
> After an innocuous change in -next that modified a structure that > contains __counted_by, clang-19 start crashing when building certain > files in drivers/gpu/drm/xe. When assertions are enabled, the more > descriptive failure is: > > clang: clang/lib/AST/RecordLayoutBuilder.cpp:3335: const ASTRecordLayout > &clang::ASTContext::getASTRecordLayout(const RecordDecl *) const: Assertion > `D && "Cannot get layout of forward declarations!"' failed. > > According to a reverse bisect, a tangential change to the LLVM IR > generation phase of clang during the LLVM 20 development cycle [1] > resolves this problem. Bump the version of clang that enables > CONFIG_CC_HAS_COUNTED_BY to 20.1.0 to ensure that this issue cannot be > hit. Any chance for this to go to the next 19.x (if it's planned at all)? I always use the latest HEAD from llvm-project, but 19 is still widely used across distros etc =\ > > Link: > https://github.com/llvm/llvm-project/commit/160fb1121cdf703c3ef5e61fb26c5659eb581489 > [1] > Signed-off-by: Nathan Chancellor <[email protected]> > --- > Should this be marked for stable? If this makes 6.17 final, I think we > are fine for mainline and newer but I wonder if a patch that adds > __counted_by to a structure would ever be backported and expose this > problem there. Thanks, Olek
