[libunwind] Don't include <sys/syscall.h> from assembly on Linux (#235756)
Commit fd4113508a64 ("[libunwind] Support extended amd64 segment
registers", #229176) made libunwind/src/assembly.h include
<sys/syscall.h> on x86_64 Linux to get SYS_arch_prctl. On Android
(Bionic, NDK r29), that header includes <sys/cdefs.h> ->
<android/api-level.h> -> <bits/get_device_api_level_inlines.h>, which
contain C declarations guarded only by __ASSEMBLY__ (not defined for .S
files). As a result, UnwindRegistersSave.S and UnwindRegistersRestore.S
fail to assemble for x86_64 Android.
On Linux, use the assembler-safe kernel UAPI header <asm/unistd.h> and
__NR_arch_prctl alongside the existing <asm/prctl.h>. FreeBSD continues
to use <sys/syscall.h>.
Fixes fd4113508a64.
Assisted-by: Gemini
GitOrigin-RevId: 65527a00703b9f286dd60d80539d06aa48ced2fa
1 file changed