]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
bsd-user/syscall_defs.h: define STAT_TIME_T_EXT only for 32 bits
authorPierrick Bouvier <pierrick.bouvier@linaro.org>
Mon, 19 Jan 2026 07:57:38 +0000 (23:57 -0800)
committerMichael Tokarev <mjt@tls.msk.ru>
Tue, 20 Jan 2026 12:28:21 +0000 (15:28 +0300)
Commit 369c1ba2b changed the wrong conditional "#if defined(__i386__)" to
"#if defined(TARGET_I386)".
However, TARGET_I386 is defined for target x86_64 also.

This commit fixes it by identifying correctly 32 bits target.

Found with:
$ ./build/qemu-x86_64 \
  -plugin ./build/contrib/plugins/libstoptrigger,icount=1000000 \
  -plugin ./build/tests/tcg/plugins/libinsn \
  -d plugin \
  ./build/qemu-system-x86_64 --version
ld-elf.so.1: /lib/libz.so.6: invalid file format
cpu 0 insns: 59746
total insns: 59746

Fixes: 369c1ba2b ("Fix __i386__ test for TARGET_HAS_STAT_TIME_T_EXT")
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
bsd-user/syscall_defs.h

index c49be32bdc0fb4e91d2e7080404da33bf96ab669..cc4b484f3ab1e570c09bdcd4adfb505c4e30f7d8 100644 (file)
@@ -247,7 +247,7 @@ struct target_freebsd11_stat {
     unsigned int:(8 / 2) * (16 - (int)sizeof(struct target_freebsd_timespec));
 } __packed;
 
-#if defined(TARGET_I386)
+#if defined(TARGET_I386) && !defined(TARGET_X86_64)
 #define TARGET_HAS_STAT_TIME_T_EXT       1
 #endif