Greetings, attached patch, adds a ./configure option for setting the C compiler that will be used to build op.c for each of the targets; letting the user compile everything else with gcc 4.x if configured as the default C compiler while isolating the opcode generation which currently relies in gcc 3.x for dyngen to be able to make sense of it.
tested it in a gentoo 2006.0 system (amd64) using gcc-4.1.1 to compile qemu-0.8.1 and the CVS HEAD, by instructing qemu to use gcc-3.4.5 for op.c, configuring it with : ./configure --op-cc=gcc-3.4.5 --disable-gcc-check didn't modify the gcc-check function in ./configure to test $op_cc instead to minimize the changes proposed, and because I wasn't sure that doing so was beneficial to the end user without a description of the options that can be used to select a different compiler for different parts of the code. FYI gcc-4.1.1 is not able to compile qemu-0.8.1 or the CVS HEAD because it confuses dyngen and makes it generate invalid code as can be seen in gentoo's bug 132667. https://bugs.gentoo.org/show_bug.cgi?id=132667 and which includes a hacky fix (by using a helper function), but i consider wasn't worth fixing as the resulting binary won't work at all (as expected). Carlo
Index: Makefile.target =================================================================== RCS file: /sources/qemu/qemu/Makefile.target,v retrieving revision 1.113 diff -u -p -r1.113 Makefile.target --- Makefile.target 30 May 2006 01:48:12 -0000 1.113 +++ Makefile.target 4 Jun 2006 07:53:52 -0000 @@ -445,7 +445,7 @@ gen-op.h: op.o $(DYNGEN) $(DYNGEN) -g -o $@ $< op.o: op.c - $(CC) $(OP_CFLAGS) $(DEFINES) -c -o $@ $< + $(OP_CC) $(OP_CFLAGS) $(DEFINES) -c -o $@ $< helper.o: helper.c $(CC) $(HELPER_CFLAGS) $(DEFINES) -c -o $@ $< Index: configure =================================================================== RCS file: /sources/qemu/qemu/configure,v retrieving revision 1.102 diff -u -p -r1.102 configure --- configure 14 May 2006 11:30:38 -0000 1.102 +++ configure 4 Jun 2006 07:53:53 -0000 @@ -23,6 +23,7 @@ static="no" cross_prefix="" cc="gcc" host_cc="gcc" +op_cc="gcc" ar="ar" make="make" install="install" @@ -182,6 +183,8 @@ for opt do ;; --host-cc=*) host_cc="$optarg" ;; + --op-cc=*) op_cc="$optarg" + ;; --make=*) make="$optarg" ;; --install=*) install="$optarg" @@ -271,6 +274,7 @@ echo " --source-path=PATH path of echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]" echo " --cc=CC use C compiler CC [$cc]" echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc." +echo " --op-cc=CC use C compiler CC [$op_cc] for op.c" echo " --make=MAKE use specified make [$make]" echo " --install=INSTALL use specified install [$install]" echo " --static enable static build [$static]" @@ -417,7 +421,7 @@ int main(void) { EOF have_gcc3_options="no" -if $cc -fno-reorder-blocks -fno-optimize-sibling-calls -o $TMPO $TMPC 2> /dev/null ; then +if $op_cc -fno-reorder-blocks -fno-optimize-sibling-calls -o $TMPO $TMPC 2> /dev/null ; then have_gcc3_options="yes" fi @@ -522,6 +526,7 @@ fi echo "Source path $source_path" echo "C compiler $cc" echo "Host C compiler $host_cc" +echo "OP C compiler $op_cc" echo "make $make" echo "install $install" echo "host CPU $cpu" @@ -588,6 +593,7 @@ if test "$have_gcc3_options" = "yes" ; t echo "HAVE_GCC3_OPTIONS=yes" >> $config_mak fi echo "HOST_CC=$host_cc" >> $config_mak +echo "OP_CC=$op_cc" >> $config_mak echo "AR=$ar" >> $config_mak echo "STRIP=$strip -s -R .comment -R .note" >> $config_mak echo "CFLAGS=$CFLAGS" >> $config_mak
_______________________________________________ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel