Skip to content

sys: rework ffi layout#13

Merged
dvdhrm merged 10 commits intobus1:mainfrom
dvdhrm:wip/sys
Apr 29, 2026
Merged

sys: rework ffi layout#13
dvdhrm merged 10 commits intobus1:mainfrom
dvdhrm:wip/sys

Conversation

@dvdhrm
Copy link
Copy Markdown
Member

@dvdhrm dvdhrm commented Apr 29, 2026

Rework the ffi layout of sys::ffi, and add an elf module to show how this is supposed to work.

dvdhrm added 10 commits April 27, 2026 13:33
Allow external access to `abi::shared`, but mark it as hidden. This
allows `sys` to meddle with the native abi but re-use `abi::shared`.

Signed-off-by: David Rheinsberg <david@readahead.eu>
Add the Sys-V ABI of Aarch64.

Signed-off-by: David Rheinsberg <david@readahead.eu>
Use the canonical name `target` rather than the otherwise unused term
`auto` to refer to the compilation target platform.

Signed-off-by: David Rheinsberg <david@readahead.eu>
Extend the wishlist with a new item for documentation of re-exports of
other modules. So far, rustdoc does not allow documenting them, yet the
way our platform aliases work would really benefit from documentation on
re-exports.

Signed-off-by: David Rheinsberg <david@readahead.eu>
Rework the sys::ffi file-system layout and platform generation. This
makes it a lot easier to add new platforms, and no longer requires
patching multiple places.

This also adds aarch64 support, showing how new platforms can be easily
added.

Signed-off-by: David Rheinsberg <david@readahead.eu>
Fix a couple of rustdoc references, which are either redundant,
unresolved, or not available in no_std.

Signed-off-by: David Rheinsberg <david@readahead.eu>
Use a proper module doc header.

Signed-off-by: David Rheinsberg <david@readahead.eu>
Add sys::ffi::elf with common definitions of the executable and linkable
format.

Signed-off-by: David Rheinsberg <david@readahead.eu>
Avoid comparing alignments of foreign types against libc. The types in
`libc` are not correctly aligned, unless they a native to the target
platform. Hence, only compare alignment for native types.

Signed-off-by: David Rheinsberg <david@readahead.eu>
Fix the alignment of i128 and u128 to 16 for i686. This was already
fixed for x86-64, but not for x86 proper.

This changed semi-recently in rustc and now matches the respective ABI.
Unfortunately, x86 does not define 128-bit integers in its ABI and
likely never will. But all compilers now agree to use 16-byte alignment
for them, given that 128-bit floating points do so on x86.

Signed-off-by: David Rheinsberg <david@readahead.eu>
@dvdhrm dvdhrm merged commit 59b2bfa into bus1:main Apr 29, 2026
10 checks passed
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

Successfully merging this pull request may close these issues.

1 participant