You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently discovered that Apple Clang version 14.0.3 (clang-1403.0.22.14.1), which is shipped with recent versions of Xcode, uses a somewhat non-standard LLVM bitcode format when compared to the upstream Clang. This is because this pointer-authentication–related commit (which is exclusive to Apple LLVM) introduces a new record type into METADATA_DERIVED_TYPE, meaning that there are now 15 records instead of 14.
In order to handle this robustly, it would be helpful to know precisely which versions of Apple Clang diverge from the upstream LLVM bitcode format so that we can handle things accordingly in our library. Here is what I know:
This commit, which introduces the 15th record type in METADATA_DERIVED_TYPE, is present in Apple Clang 14.
However, it's not clear to me if this is the only major Apple Clang release in which the two bitcode formats diverge. There are several git tags of the form swift-DEVELOPMENT-SNAPSHOT-yyyy-mm-dd-a associated with that commit, but that doesn't make it clear if they correspond to particular Clang releases.
Moreover, the pointer authentication–related record type was actually introduced in an earlier commit here, which uses 14 records instead of 15 records for METADATA_DERIVED_TYPE. I am guessing that this commit predates the upstream LLVM 14 release, which added another record type to bring the upstream total to 14. However, it's not clear to me if this commit ever made it into a released version of Apple Clang. If it did, this would mean that the metadata record associated with pointer authentication would be different depending on which Apple Clang version was used!
Going forward, will Apple Clang guarantee that METADATA_DERIVED_TYPE's record for pointer authentication will always be in the same record type, or could this change?
The text was updated successfully, but these errors were encountered:
I recently discovered that Apple Clang version 14.0.3 (clang-1403.0.22.14.1), which is shipped with recent versions of Xcode, uses a somewhat non-standard LLVM bitcode format when compared to the upstream Clang. This is because this pointer-authentication–related commit (which is exclusive to Apple LLVM) introduces a new record type into
METADATA_DERIVED_TYPE
, meaning that there are now 15 records instead of 14.I maintain a library for parsing LLVM bitcode files, and this poses something of a challenge for us. By default, we try to match the conventions of the upstream LLVM, and upstream LLVM says that
METADATA_DERIVED_TYPE
shall have no more than 14 records. This assumption breaks when our library tries to load recent Apple Clang–compiled bitcode files that use pointer authentication, however. See this issue.In order to handle this robustly, it would be helpful to know precisely which versions of Apple Clang diverge from the upstream LLVM bitcode format so that we can handle things accordingly in our library. Here is what I know:
METADATA_DERIVED_TYPE
, is present in Apple Clang 14.git
tags of the formswift-DEVELOPMENT-SNAPSHOT-yyyy-mm-dd-a
associated with that commit, but that doesn't make it clear if they correspond to particular Clang releases.METADATA_DERIVED_TYPE
. I am guessing that this commit predates the upstream LLVM 14 release, which added another record type to bring the upstream total to 14. However, it's not clear to me if this commit ever made it into a released version of Apple Clang. If it did, this would mean that the metadata record associated with pointer authentication would be different depending on which Apple Clang version was used!METADATA_DERIVED_TYPE
's record for pointer authentication will always be in the same record type, or could this change?The text was updated successfully, but these errors were encountered: