Use different sizes for usize and pointers in vtables' debuginfo #45
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The current code generating debuginfo for vtables assumes that
sizeof(usize) == pointer_size && alignof(usize) == pointer_align. Of course, this does not work for CHERIoT, and this patch tries to rewrite the generation of this data to be compatible with CHERIoT (and other platforms with non-integral pointers).Without this patch, the debuginfo generated for vtables on CHERIoT looks like this:
The generated data change with this patch (only when targeting CHERIoT, it stays the same for "usual" targets) in:
Of course, the new way to generate the data should produce exactly the same output it produced for every other target in
rustc, that is, exactly the same code should be generated ifsizeof(usize) == pointer_size && alignof(usize) == pointer_alignis true. This is, of course, a strict requirement to merge this PR.Marking this as a draft because I have to figure out how to test this code that looks plausible but could break catastrophically, and having CI is useful.