Skip to contentSkip to conversation

Fail to compile

Qemu-devel Anne et Bertrand 2 participants 4 messages Feb 21, 2004 – Feb 23, 2004

lore
Share & tools
lore
#0 lore raw

System : Mandrake9.1PPC, kernel-2.4.23.
Wgereas qemu-0.5.0 compile and run on my system, I can't compile anymore qemu-0.5.2 and also the latest CVS :

gcc -Wall -O2 -g -I. -I/home/bertrand/Desktop/qemu/target-i386 -I/home/bertrand/Desktop/qemu -D_GNU_SOURCE -c -o main.o /home/bertrand/Desktop/qemu/main.c gcc -Wall -O2 -g -I. -I/home/bertrand/Desktop/qemu/target-i386 -I/home/bertrand/Desktop/qemu -D_GNU_SOURCE -c -o syscall.o /home/bertrand/Desktop/qemu/syscall.c /home/bertrand/Desktop/qemu/syscall.c:1147: `O_DIRECT' undeclared here (not in a function)
/home/bertrand/Desktop/qemu/syscall.c:1147: initializer element is not constant
/home/bertrand/Desktop/qemu/syscall.c:1147: (near initialization for fcntl_flags_tbl[13].alpha_mask') /home/bertrand/Desktop/qemu/syscall.c:1147: O_DIRECT' undeclared here (not in a function)
/home/bertrand/Desktop/qemu/syscall.c:1147: initializer element is not constant
/home/bertrand/Desktop/qemu/syscall.c:1147: (near initialization for `fcntl_flags_tbl[13].alpha_bits') /home/bertrand/Desktop/qemu/syscall.c:1147: initializer element is not constant
/home/bertrand/Desktop/qemu/syscall.c:1147: (near initialization for `fcntl_flags_tbl[13]') /home/bertrand/Desktop/qemu/syscall.c:1148: initializer element is not constant
/home/bertrand/Desktop/qemu/syscall.c:1148: (near initialization for `fcntl_flags_tbl[14]')
make[1]: *** [syscall.o] Erreur 1
make[1]: Leaving directory `/home/bertrand/Desktop/qemu/i386-user'
make: *** [all] Erreur 1

Any idea ?

Thanks
Bertrand Dekoninck

PC : please cc me, I'm off the list.

#1 lore raw
Quoted 4 lines · Anne et Bertrand

System : Mandrake9.1PPC, kernel-2.4.23.
Wgereas qemu-0.5.0 compile and run on my system, I can't compile anymore qemu-0.5.2 and also the latest CVS :

Quoted 8 lines

gcc -Wall -O2 -g -I. -I/home/bertrand/Desktop/qemu/target-i386 -I/home/bertrand/Desktop/qemu -D_GNU_SOURCE -c -o main.o /home/bertrand/Desktop/qemu/main.c
gcc -Wall -O2 -g -I. -I/home/bertrand/Desktop/qemu/target-i386 -I/home/bertrand/Desktop/qemu -D_GNU_SOURCE -c -o syscall.o /home/bertrand/Desktop/qemu/syscall.c /home/bertrand/Desktop/qemu/syscall.c:1147: `O_DIRECT' undeclared here (not in a function)

...

What is your glibc version ?
Whatever, try to apply this patch:

Index: syscall.c
===================================================================
RCS file: /cvsroot/qemu/qemu/syscall.c,v
retrieving revision 1.42

syscall.c 22 Feb 2004 00:23:50 -0000 renamed from syscall.c 4 Jan 2004 23:57:22 -0000 1.42 +2 -0
diff -u -d -w -B -b -d -p -r1.42 syscall.c
@@ -1144,7 +1144,9 @@ static bitmask_transtbl fcntl_flags_tbl[
        { TARGET_O_DIRECTORY, TARGET_O_DIRECTORY, O_DIRECTORY, O_DIRECTORY, },
        { TARGET_O_NOFOLLOW,  TARGET_O_NOFOLLOW,  O_NOFOLLOW,  O_NOFOLLOW,  },
        { TARGET_O_LARGEFILE, TARGET_O_LARGEFILE, O_LARGEFILE, O_LARGEFILE, },
+#if defined (O_DIRECT)
        { TARGET_O_DIRECT,    TARGET_O_DIRECT,    O_DIRECT,    O_DIRECT,    },
+#endif
        { 0, 0, 0, 0 }
 };
 
Signature · 2 lines
J. Mayer <[email protected]>
Never organized
#2 lore raw

[Qemu-devel] [BUG] signed 16 bits word load for bigendian targets.

If the LSB is negative, the result is false.
Here's the patch:

Index: cpu-all.h
===================================================================
RCS file: /cvsroot/qemu/qemu/cpu-all.h,v
retrieving revision 1.20

cpu-all.h 22 Feb 2004 00:53:28 -0000 renamed from cpu-all.h 16 Feb 2004 21:57:02 -0000 1.20 +1 -2
diff -u -d -w -B -b -d -p -r1.20 cpu-all.h
@@ -202,7 +202,7 @@ static inline int lduw_raw(void *ptr)
 static inline int ldsw_raw(void *ptr)
 {
     int8_t *b = (int8_t *) ptr;
-    return (b[0]<<8|b[1]);
+    return (b[0]<<8 | (uint8_t)b[1]);
 }
 
-- 

J. Mayer <[email protected]>
Never organized

#3 lore raw
In reply to Anne et Bertrand
Quoted 2 lines

What is your glibc version ?
Whatever, try to apply this patch:

rpm -q gli[bertrand@localhost bertrand]$ rpm -q glibc glibc-2.3.1-10.1.91mdk

I've applied this patches to 0.5.2 : compiled with success (although a little trouble on install : it failed on some directorie in the source tree so I had to cd to each one and type make to finish the install). Runs well : for the first time I could launch ReactoS and even a kind of Knoppix disk image. Thanks !

The patche applied to the cvs tree let syscall.c compile too, but I've got an assembly error later in i386-softmmu :
gcc -I. -I/home/bertrand/Desktop/qemu/target-i386 -I/home/bertrand/Desktop/qemu -D_GNU_SOURCE -c -o linux_boot.o /home/bertrand/Desktop/qemu/linux_boot.S /home/bertrand/Desktop/qemu/linux_boot.S: Assembler messages:
/home/bertrand/Desktop/qemu/linux_boot.S:8: Error: unknown pseudo-op: `.code16'
/home/bertrand/Desktop/qemu/linux_boot.S:14: Error: Unrecognized opcode: `cli'
/home/bertrand/Desktop/qemu/linux_boot.S:15: Error: Unrecognized opcode: `cld'
/home/bertrand/Desktop/qemu/linux_boot.S:16: Error: Unrecognized opcode: `mov'
/home/bertrand/Desktop/qemu/linux_boot.S:17: Error: Unrecognized opcode: `mov'
/home/bertrand/Desktop/qemu/linux_boot.S:18: Error: Unrecognized opcode: `mov'
/home/bertrand/Desktop/qemu/linux_boot.S:19: Error: Unrecognized opcode: `mov'
/home/bertrand/Desktop/qemu/linux_boot.S:20: Error: Unrecognized opcode: `mov'
/home/bertrand/Desktop/qemu/linux_boot.S:21: Error: Unrecognized opcode: `mov'
/home/bertrand/Desktop/qemu/linux_boot.S:22: Error: Unrecognized opcode: `mov'
/home/bertrand/Desktop/qemu/linux_boot.S:23: Error: Unrecognized opcode: `ljmp'
make[1]: *** [linux_boot.o] Erreur 1
make[1]: Leaving directory `/home/bertrand/Desktop/qemu/i386-softmmu'
make: *** [all] Erreur 1

Bertrand Dekoninck