Library from swift (CInterop) doesn't compile with Xcode 13

Although all my cinteropXYZ gradle tasks failed with a less meaningful error message, I can confirm, that the cinterop tasks break with the update to xcode13. After ~2 days of debugging and ruling out other possibilities (I work on a m1 mac), I found myself installing Xcode 12.5 from the apple developer page.
As soon as Xcode 12.5 and 13 are both installed, you can choose the used xcode command line tools in the xcode preferences (under “Locations”). With “Xcode 12.5.1” selected, all my cinterop tasks run flawlessly again. As the Update to Xcode13 also updated the bundled Apple Clang Compiler, my guess is, that a change in clang is the root of the cinterop issue.