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
{{ message }}
Repository navigation
Commit 9b04071
Browse filesBrowse the repository at this point in the historyBrowse files
authored
compat.libffi: build the aarch64 backend, so aarch64 links (#920)
The descriptor listed only src/x86/*, whose files guard themselves out on
aarch64; the resulting libffi.so.8 had no ffi_prep_cif_machdep, and every
libwayland consumer died at the first closure dispatch.
- compile src/aarch64/ffi.c and sysv.S under
target_cfg['cfg(arch = "aarch64")']. ffi.c guards its whole body, but
sysv.S has an ELF GNU property note after `#endif /* __arm64__ */` that
GNU as on x86 cannot drop -- it reports `invalid operands (*UND* and
*UND*) for '|'` -- so both units are selected by target, not listed in
the common set. No per-file flags or defines are needed.
- switch c_standard to gnu11: libffi is GNU C, and clang rejects `asm`
under strict -std=c11. GCC accepts it, which is why the x86 path never
showed this.
- install() no longer bakes x86_64 into the shared install tree: ffi.h's
@target@ block becomes a per-arch dispatch (X86 on 32-bit x86, as
configure writes, because src/x86/ffitarget.h reads it), and both
ffitarget.h files are installed under arch names behind a generated
selector. Unsupported architectures get an explicit #error instead of a
silently wrong x86 header.
- extend the example test with a variadic ffi_call, the path aarch64
reaches through ffi_cif.is_variadic.
Verified: tests/examples/libffi green on x86_64 with gcc 16.1.0 and
llvm 22.1.8, and on aarch64 with llvm 23.1.3; an aarch64 compositor built
against this descriptor then serves a headless Wayland socket and its
globals enumerate with wayland-info.
Co-authored-by: aimol <aimol@qq.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
0 commit comments