Skip to contentSkip to conversation

sparc-user build error

Qemu-devel Magnus Damm 3 participants 4 messages Oct 10, 2004

lore
Share & tools
lore
#0 lore raw

Hello,

I'm unable to build sparc-user on my powerpc box. I use gcc-3.4.1 from Gentoo stable ppc, and I'm building the CVS version of QEMU.

make[1]: Entering directory `/home/damm/build/qemu/cvs/src/qemu/sparc-user'
gcc -Wall -O2 -g -fno-strict-aliasing -D__powerpc__ -I. -I/home/damm/build/qemu/cvs/src/qemu/target-sparc -I/home/damm/build/qemu/cvs/src/qemu -I/home/damm/build/qemu/cvs/src/qemu/linux-user -I/home/damm/build/qemu/cvs/src/qemu/linux-user/sparc -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I/home/damm/build/qemu/cvs/src/qemu/slirp -c -o exec.o /home/damm/build/qemu/cvs/src/qemu/exec.c
gcc -Wall -O2 -g -fno-strict-aliasing -D__powerpc__ -I. -I/home/damm/build/qemu/cvs/src/qemu/target-sparc -I/home/damm/build/qemu/cvs/src/qemu -I/home/damm/build/qemu/cvs/src/qemu/linux-user -I/home/damm/build/qemu/cvs/src/qemu/linux-user/sparc -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I/home/damm/build/qemu/cvs/src/qemu/slirp -c -o translate-all.o /home/damm/build/qemu/cvs/src/qemu/translate-all.c
In file included from /home/damm/build/qemu/cvs/src/qemu/translate-all.c:41:
./op.h: In function `dyngen_code':
./op.h:4783: error: parse error before ')' token ./op.h:4784: error: parse error before ')' token ./op.h:4799: error: parse error before ')' token ./op.h:4800: error: parse error before ')' token make[1]: *** [translate-all.o] Error 1

It seems to me that "op_fitos" and "op_fitod" in "target-sparc/op.c" gets converted to wierd code in "sparc-user/op.h" by dyngen:

op.c:

void OPPROTO op_fitos(void)

{
    FT0 = (float) *((int32_t *)&FT1);
}

op.h:

case INDEX_op_fitos: {
    extern void op_fitos();
    memcpy(gen_code_ptr, (void *)((char *)&op_fitos+0), 56);
    *(uint16_t *)(gen_code_ptr + 18) = ((long)(&) + 0 + 0x8000) >> 16;
    *(uint16_t *)(gen_code_ptr + 26) = ((long)(&) + 0);
    gen_code_ptr += 56;
}

break;

The same goes for "op_fitod". Look at the "(long)(&)", any ideas?

/ magnus

#1 lore raw

It should work now.

Fabrice.

Quoted 65 lines · Magnus Damm

Hello,

I'm unable to build sparc-user on my powerpc box. I use gcc-3.4.1 from Gentoo stable ppc, and I'm building the CVS version of QEMU.

make[1]: Entering directory `/home/damm/build/qemu/cvs/src/qemu/sparc-user' gcc -Wall -O2 -g -fno-strict-aliasing -D__powerpc__ -I.

(quoted diff) +0 -6
-I/home/damm/build/qemu/cvs/src/qemu/target-sparc
-I/home/damm/build/qemu/cvs/src/qemu
-I/home/damm/build/qemu/cvs/src/qemu/linux-user
-I/home/damm/build/qemu/cvs/src/qemu/linux-user/sparc -D_GNU_SOURCE
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-I/home/damm/build/qemu/cvs/src/qemu/slirp -c -o exec.o

/home/damm/build/qemu/cvs/src/qemu/exec.c
gcc -Wall -O2 -g -fno-strict-aliasing -D__powerpc__ -I.

(quoted diff) +0 -6
-I/home/damm/build/qemu/cvs/src/qemu/target-sparc
-I/home/damm/build/qemu/cvs/src/qemu
-I/home/damm/build/qemu/cvs/src/qemu/linux-user
-I/home/damm/build/qemu/cvs/src/qemu/linux-user/sparc -D_GNU_SOURCE
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-I/home/damm/build/qemu/cvs/src/qemu/slirp -c -o translate-all.o

/home/damm/build/qemu/cvs/src/qemu/translate-all.c In file included from /home/damm/build/qemu/cvs/src/qemu/translate-all.c:41:
./op.h: In function `dyngen_code':
./op.h:4783: error: parse error before ')' token ./op.h:4784: error: parse error before ')' token ./op.h:4799: error: parse error before ')' token ./op.h:4800: error: parse error before ')' token make[1]: *** [translate-all.o] Error 1

It seems to me that "op_fitos" and "op_fitod" in "target-sparc/op.c" gets converted to wierd code in "sparc-user/op.h" by dyngen:

op.c:

void OPPROTO op_fitos(void)

{
    FT0 = (float) *((int32_t *)&FT1);
}

op.h:

case INDEX_op_fitos: {
    extern void op_fitos();
    memcpy(gen_code_ptr, (void *)((char *)&op_fitos+0), 56);
    *(uint16_t *)(gen_code_ptr + 18) = ((long)(&) + 0 + 0x8000) >> 16;
    *(uint16_t *)(gen_code_ptr + 26) = ((long)(&) + 0);
    gen_code_ptr += 56;
}

break;

The same goes for "op_fitod". Look at the "(long)(&)", any ideas?

/ magnus

_______________________________________________
Qemu-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/qemu-devel

#3 lore raw
In reply to Magnus Damm

Hi,

Quoted 14 lines · Magnus Damm

I'm unable to build sparc-user on my powerpc box. I use gcc-3.4.1 from Gentoo stable ppc, and I'm building the CVS version of QEMU.

[...]

op.h:

case INDEX_op_fitos: {
    extern void op_fitos();
    memcpy(gen_code_ptr, (void *)((char *)&op_fitos+0), 56);
    *(uint16_t *)(gen_code_ptr + 18) = ((long)(&) + 0 + 0x8000) >> 16;
    *(uint16_t *)(gen_code_ptr + 26) = ((long)(&) + 0);
    gen_code_ptr += 56;
}
Quoted 3 lines

break;

The same goes for "op_fitod". Look at the "(long)(&)", any ideas?

It's a similar problem to

http://lists.gnu.org/archive/html/qemu-devel/2004-10/msg00092.html

You are building on i386, right? Then try to add the lines

                    if (strstart(sym_name, "__op_param", &p)) {
                        snprintf(name, sizeof(name), "param%s", p);
+                   } else if(sym_name[0]==0) {
+                       continue;
                    } else {
                        snprintf(name, sizeof(name), "(long)(&%s)",
sym_name);
                    }

in dyngen.c at line 1643 (the two lines to be added are the ones with a '+' at the left).

A bone for general discussion: How many reasons can you think of to patch relocations other than "__op_param*" and "__op_jump*"?

Ciao,
Dscho

#2 lore raw
In reply to Fabrice Bellard

Much better, thanks!

/ magnus

Quoted 78 lines · Fabrice Bellard

It should work now.

Fabrice.

Quoted 55 lines · Magnus Damm

Hello,

I'm unable to build sparc-user on my powerpc box. I use gcc-3.4.1 from Gentoo stable ppc, and I'm building the CVS version of QEMU.

make[1]: Entering directory `/home/damm/build/qemu/cvs/src/qemu/sparc-user' gcc -Wall -O2 -g -fno-strict-aliasing -D__powerpc__ -I.

(quoted diff) +0 -6
-I/home/damm/build/qemu/cvs/src/qemu/target-sparc
-I/home/damm/build/qemu/cvs/src/qemu
-I/home/damm/build/qemu/cvs/src/qemu/linux-user
-I/home/damm/build/qemu/cvs/src/qemu/linux-user/sparc -D_GNU_SOURCE
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-I/home/damm/build/qemu/cvs/src/qemu/slirp -c -o exec.o

/home/damm/build/qemu/cvs/src/qemu/exec.c
gcc -Wall -O2 -g -fno-strict-aliasing -D__powerpc__ -I.

(quoted diff) +0 -6
-I/home/damm/build/qemu/cvs/src/qemu/target-sparc
-I/home/damm/build/qemu/cvs/src/qemu
-I/home/damm/build/qemu/cvs/src/qemu/linux-user
-I/home/damm/build/qemu/cvs/src/qemu/linux-user/sparc -D_GNU_SOURCE
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-I/home/damm/build/qemu/cvs/src/qemu/slirp -c -o translate-all.o

/home/damm/build/qemu/cvs/src/qemu/translate-all.c In file included from /home/damm/build/qemu/cvs/src/qemu/translate-all.c:41:
./op.h: In function `dyngen_code':
./op.h:4783: error: parse error before ')' token ./op.h:4784: error: parse error before ')' token ./op.h:4799: error: parse error before ')' token ./op.h:4800: error: parse error before ')' token make[1]: *** [translate-all.o] Error 1

It seems to me that "op_fitos" and "op_fitod" in "target-sparc/op.c" gets converted to wierd code in "sparc-user/op.h" by dyngen:

op.c:

void OPPROTO op_fitos(void)

{
    FT0 = (float) *((int32_t *)&FT1);
}

op.h:

case INDEX_op_fitos: {
    extern void op_fitos();
    memcpy(gen_code_ptr, (void *)((char *)&op_fitos+0), 56);
    *(uint16_t *)(gen_code_ptr + 18) = ((long)(&) + 0 + 0x8000) >> 16;
    *(uint16_t *)(gen_code_ptr + 26) = ((long)(&) + 0);
    gen_code_ptr += 56;
}

break;

The same goes for "op_fitod". Look at the "(long)(&)", any ideas?

Quoted 10 lines

/ magnus

_______________________________________________
Qemu-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/qemu-devel

_______________________________________________
Qemu-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/qemu-devel