I noticed some programs failing on my Raspi 4 on FreeBSD 13, and tracked the issue down to setjmp behaviour.
Apparently setjmp returns 0 when it should return 1.
The FreeBSD man page for setjmp / longjmp does _not_ state that setjmp should return 1 on a longjmp with argument 0. But it states that the functions are conforming to the ISO C90 standard. All C standards, including ISO C90 mandate that setjmp should return 1 on a longjmp with argument 0.
I don't know if this is an issue specific to aarch64, or just some generic FreeBSD issue, as the Raspi is my only FreeBSD system.
I created a small test program to reproduce the issue; it fails on the Raspi, but passes on Debian GNU/Linux on amd64:
I compile using cc test.c, execute via ./a.out.
// When called with an argument of 0, longjmp() should make setjmp() return 1 instead.
static int i;
i = 0;
j = setjmp(buf);
assert(i == j);