Skip to contentSkip to conversation

qemu-armeb linux stat64 syscall fix

PATCH New Claudio Scordino 1 participant 1 message Sep 12, 2006 3 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

PATCH 1/1 qemu-armeb linux stat64 syscall fix

Hi all,

    we had a problem compiling the linux kernel using for an arm big endian target in the qemu-armeb environment.

The compilation stopped when executing the split-include utility during the kernel compilation phase: split-include exited with an error of the stat64 syscall, executed in the environment emulated by qemu.

Qemu seemed to ignore the fact that in big endian systems the fields st_blocks and its padding are swapped (to allow future expansion of the field,) so the fix consisted only in swapping the two fields (only in big endian systems, of course.)

The attached patch should fix the problem.

Regards,

Michael, Fabio and Claudio

linux-user/syscall_defs.h +5 -0
diff -ur qemu-0.8.1.orig/linux-user/syscall_defs.h qemu-0.8.1/linux-user/syscall_defs.h
@@ -914,8 +914,13 @@
 	long long	st_size;
 	target_ulong	st_blksize;
 
+#ifndef TARGET_WORDS_BIGENDIAN
 	target_ulong	st_blocks;	/* Number 512-byte blocks allocated. */
 	target_ulong	__pad4;		/* future possible st_blocks high bits */
+#else
+	target_ulong	__pad4;		/* future possible st_blocks high bits */
+	target_ulong	st_blocks;	/* Number 512-byte blocks allocated. */
+#endif
 
 	target_ulong	target_st_atime;
 	target_ulong	__pad5;