From b8f2fec0f2d66427c8f947979fee8173099c690c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Mon, 22 Sep 2025 18:36:47 +0200 Subject: [PATCH] std.pie: fix register constraint in getDynamicSymbol() for s390x (#25327) If the compiler happens to pick `ret = r0`, then this will assemble to `ag r0, 0` which is obviously not what we want. Using `a` instead of `r` will ensure that we get an appropriate address register, i.e. `r1` through `r15`. Re-enable pie_linux for s390x-linux which was disabled in ed7ff0b693037078f451a7c6c1124611060f4892. --- lib/std/pie.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/std/pie.zig b/lib/std/pie.zig index 09b875ca15..403c1e8f1a 100644 --- a/lib/std/pie.zig +++ b/lib/std/pie.zig @@ -177,7 +177,7 @@ inline fn getDynamicSymbol() [*]const elf.Dyn { \\ jg 2f \\ 1: .quad _DYNAMIC - . \\ 2: - : [ret] "=r" (-> [*]const elf.Dyn), + : [ret] "=a" (-> [*]const elf.Dyn), ), // The compiler does not necessarily have any obligation to load the `l7` register (pointing // to the GOT), so do it ourselves just in case.