Source: yuzu
Version: 0-1734+ds-10.1
Severity: important
Tags: patch ftbfs
User: [email protected]
Usertags: origin-ubuntu tenacious ubuntu-patch
Dear Maintainer,
yuzu fails to build on arm64 with the Linux 7.3 kernel headers
(linux-libc-dev 7.3.0-9.9 in Ubuntu, 7.3~rc7-1~exp1 in experimental). It
still builds in unstable because linux-libc-dev 7.2.12-1 has the old
headers, so it will start failing there once 7.3 reaches unstable.
The error:
In file included from src/./core/arm/nce/arm_nce_asm_definitions.h:8,
from src/./core/arm/nce/guest_context.h:11,
from src/./core/arm/nce/arm_nce.h:9,
from src/core/hle/kernel/k_process.cpp:21:
/usr/include/asm-generic/signal.h:63:3: error: conflicting declaration
'typedef struct sigset_t sigset_t'
/usr/include/aarch64-linux-gnu/bits/types/sigset_t.h:7:20: note: previous
declaration as 'typedef struct __sigset_t sigset_t'
src/core/arm/nce/arm_nce_asm_definitions.h defines __ASSEMBLY__ before it
includes <asm-generic/signal.h> and <asm-generic/unistd.h>, so that it gets
only the constants and not the C declarations. In 7.3, the uapi headers
check __ASSEMBLER__ instead:
7.2.12-1: #ifndef __ASSEMBLY__
7.3: #ifndef __ASSEMBLER__
With 7.3, the kernel's sigset_t typedef is no longer hidden and clashes with
glibc's. Only arm64 is affected, because only arm64 builds the NCE code.
The attached patch also defines __ASSEMBLER__, but only around the two
includes: glibc headers (errno.h, endian.h, features.h, bits/floatn.h) check
it too, and the header is included from C++ files. When the compiler has
already defined it (arm_nce.s, built with -x assembler-with-cpp), it is left
alone. That works with both old and new headers. We applied it in Ubuntu as
0-1734+ds-10.1ubuntu2.
Thanks for considering the patch.
--
Sebastien Bacher
Description: also define __ASSEMBLER__ around the kernel uapi includes
Linux 7.3 uapi headers guard their C declarations with __ASSEMBLER__
instead of __ASSEMBLY__, so defining only __ASSEMBLY__ no longer hides
them and asm-generic/signal.h's sigset_t conflicts with glibc's on arm64:
error: conflicting declaration 'typedef struct sigset_t sigset_t'
.
glibc headers also check __ASSEMBLER__, so only define it around the two
includes, and leave it alone when the compiler set it for arm_nce.s.
Author: Sebastien Bacher <[email protected]>
Forwarded: no
Last-Update: 2026-10-26
---
--- a/src/core/arm/nce/arm_nce_asm_definitions.h
+++ b/src/core/arm/nce/arm_nce_asm_definitions.h
@@ -5,9 +5,19 @@
#define __ASSEMBLY__
+#ifndef __ASSEMBLER__
+#define __ASSEMBLER__
+#define YUZU_UNDEF_ASSEMBLER
+#endif
+
#include <asm-generic/signal.h>
#include <asm-generic/unistd.h>
+#ifdef YUZU_UNDEF_ASSEMBLER
+#undef __ASSEMBLER__
+#undef YUZU_UNDEF_ASSEMBLER
+#endif
+
#define ReturnToRunCodeByExceptionLevelChangeSignal SIGUSR2
#define BreakFromRunCodeSignal SIGURG
#define GuestAccessFaultSignal SIGSEGV