tally/build/audit_android_fixture.zig
Emil Lerch f12eb4e063
All checks were successful
Build / Android (push) Successful in 2m48s
Build / Engine, CLI and TUI (push) Successful in 7m18s
Build / Sign (push) Successful in 6m39s
Build / Publish (push) Successful in 17s
Build / F-Droid repo (push) Successful in 50s
integrate android audit into build flow
2026-10-13 08:57:33 -07:00

18 lines
788 B
Zig

//! A library that breaks every rule `audit_android.zig` checks, so `zig build test` can
//! hold the auditor to failing on it. An audit that passes everything would be
//! indistinguishable from a working one by looking at the real libraries.
//!
//! It references a symbol it does not define, has a thread-local (a TLS segment, and a
//! reference to `__tls_get_addr`), is linked at the default 4 KiB page alignment,
//! needs another library (`build.zig` links it against one), and exports no JNI entry
//! points.
extern fn puts(s: [*:0]const u8) c_int;
extern fn tally_audit_dependency() c_int;
threadlocal var calls: u32 = 0;
export fn tally_audit_fixture() c_int {
calls += 1;
return puts("never called: this library exists to be refused") + tally_audit_dependency();
}