Our build server is failing on xen-unstable.hg c/s 11822 in tools/firmware/vmxassist/traps.S. hg annotate shows that the code hasn''t changed for quite a while. This is 64bit and 32bit builds, trying 32bit pae now. If I change the failing line in traps.S from: movl $DATA_SELECTOR, %eax /* make sure these are sane */ To: movl DATA_SELECTOR, %eax /* make sure these are sane */ Build picks up the #define of DATA_SELECTOR in machine.h, and builds successfully. The failure is with gcc 3.3.5, I just tried a local SLES10 gcc 4.0.2 version and it seems to work fine with either of the above asm lines, and generates same opcodes. Should the "$" be removed? Thanks, --Tom Here is the failure: with: xec] [exec] gcc -m32 -march=i686 -DNDEBUG -std=gnu99 -Wall -Wstrict-prototypes -Wno-unused-value -DDEBUG -DTEXTADDR=0x000D0000 -I. -I../../../tools/libxc -fno-builtin -O2 -msoft-float -D__ASSEMBLY__ -DDEBUG -DTEXTADDR=0x000D0000 -c trap.S [sshexec] [exec] gcc -m32 -march=i686 -DNDEBUG -std=gnu99 -Wall -Wstrict-prototypes -Wno-unused-value -DDEBUG -DTEXTADDR=0x000D0000 -I. -I../../../tools/libxc -fno-builtin -O2 -msoft-float -c vm86.c [sshexec] [exec] gcc -m32 -march=i686 -DNDEBUG -std=gnu99 -Wall -Wstrict-prototypes -Wno-unused-value -DDEBUG -DTEXTADDR=0x000D0000 -I. -I../../../tools/libxc -fno-builtin -O2 -msoft-float -c setup.c [sshexec] [exec] gcc -m32 -march=i686 -DNDEBUG -std=gnu99 -Wall -Wstrict-prototypes -Wno-unused-value -DDEBUG -DTEXTADDR=0x000D0000 -I. -I../../../tools/libxc -fno-builtin -O2 -msoft-float -c util.c [sshexec] [exec] cpp -P -DDEBUG -DTEXTADDR=0x000D0000 vmxassist.ld > vmxassist.tmp [sshexec] [exec] ld -o vmxassist -melf_i386 -nostdlib --fatal-warnings -N -T vmxassist.tmp head.o trap.o vm86.o setup.o util.o [sshexec] [exec] trap.o(.text+0x308): In function `common_trap'': [sshexec] [exec] trap.S: undefined reference to `DATA_SELECTOR'' _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On 19/10/06 5:39 pm, "Woller, Thomas" <thomas.woller@amd.com> wrote:> The failure is with gcc 3.3.5, I just tried a local SLES10 gcc 4.0.2 > version and it seems to work fine with either of the above asm lines, > and generates same opcodes.I expect placing $DATA_SELECTOR in brackets $(DATA_SELECTOR) will work. I expect the version of cpp is not able to pick out a macro usage when it runs into adjacent punctuation.> Should the "$" be removed?That would change the meaning of the instruction! It would be move from memory instead of move from immediate. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On 19/10/06 7:47 pm, "Keir Fraser" <Keir.Fraser@cl.cam.ac.uk> wrote:>> The failure is with gcc 3.3.5, I just tried a local SLES10 gcc 4.0.2 >> version and it seems to work fine with either of the above asm lines, >> and generates same opcodes. > > I expect placing $DATA_SELECTOR in brackets $(DATA_SELECTOR) will work. I > expect the version of cpp is not able to pick out a macro usage when it runs > into adjacent punctuation.Well, it''ll be interesting to know if this fixes the problem but actually it would make little sense now I think about it. We have lots of examples in Xen .S files where we mov $<macro name>,... And they aren''t causing problems. So this is rather weird. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
> I expect placing $DATA_SELECTOR in brackets $(DATA_SELECTOR) > will work. I expect the version of cpp is not able to pick > out a macro usage when it runs into adjacent punctuation. >Yes. () works. Here is patch.. Thanks for the help Tom Signed-off-by: Tom Woller <thomas.woller@amd.com> diff -r 20522afb2615 tools/firmware/vmxassist/trap.S --- a/tools/firmware/vmxassist/trap.S Wed Oct 18 18:23:32 2006 +++ b/tools/firmware/vmxassist/trap.S Thu Oct 19 13:50:53 2006 @@ -106,7 +106,7 @@ pushl %es pushal - movl $DATA_SELECTOR, %eax /* make sure these are sane */ + movl $(DATA_SELECTOR), %eax /* make sure these are sane */ movl %eax, %ds movl %eax, %es movl %eax, %fs _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On 19/10/06 8:06 pm, "Woller, Thomas" <thomas.woller@amd.com> wrote:>> I expect placing $DATA_SELECTOR in brackets $(DATA_SELECTOR) >> will work. I expect the version of cpp is not able to pick >> out a macro usage when it runs into adjacent punctuation. >> > Yes. () works. Here is patch.. > Thanks for the help > Tom > > Signed-off-by: Tom Woller <thomas.woller@amd.com>Oh, the penny drops. It''s because we now have -std=gnu99. I deliberately strip that out of CFLAGS when building asm files in Xen itself, as it makes gcc really unhappy (doesn''t like #-prefixed end-of-line comments). Clearly it''s not partial to $-prefixed macro names either, with older gcc versions. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel