Commit f2bf094ee7d5ca77fe6ed0b8d6599a945d97664d

Authored by aurel32
1 parent b6cd0ea1

Qemu 32-bit i386, gcc >= 3.4 spill error fix

(Ben Taylor)


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4337 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 2 changed files with 15 additions and 2 deletions
Makefile.target
@@ -96,6 +96,12 @@ HELPER_CFLAGS= @@ -96,6 +96,12 @@ HELPER_CFLAGS=
96 ifeq ($(ARCH),i386) 96 ifeq ($(ARCH),i386)
97 HELPER_CFLAGS+=-fomit-frame-pointer 97 HELPER_CFLAGS+=-fomit-frame-pointer
98 OP_CFLAGS+=-mpreferred-stack-boundary=2 -fomit-frame-pointer 98 OP_CFLAGS+=-mpreferred-stack-boundary=2 -fomit-frame-pointer
  99 +# op.c and helper.c need this on 32-bit x86 system to avoid
  100 +# a compiler spill error. This can probably go away
  101 +# once the SSE ops have been converted to TCG
  102 +ifeq ($(HAVE_GT_GCC_3_3), true)
  103 +I386_CFLAGS=-march=i586 -mtune=i686
  104 +endif
99 endif 105 endif
100 106
101 ifeq ($(ARCH),ppc) 107 ifeq ($(ARCH),ppc)
@@ -309,7 +315,7 @@ gen-op.h: op.o $(DYNGEN) @@ -309,7 +315,7 @@ gen-op.h: op.o $(DYNGEN)
309 $(DYNGEN) -g -o $@ $< 315 $(DYNGEN) -g -o $@ $<
310 316
311 op.o: op.c 317 op.o: op.c
312 - $(CC) $(OP_CFLAGS) $(CPPFLAGS) -c -o $@ $< 318 + $(CC) $(OP_CFLAGS) $(CPPFLAGS) $(I386_CFLAGS) -c -o $@ $<
313 319
314 machine.o: machine.c 320 machine.o: machine.c
315 $(CC) $(OP_CFLAGS) $(CPPFLAGS) -c -o $@ $< 321 $(CC) $(OP_CFLAGS) $(CPPFLAGS) -c -o $@ $<
@@ -319,7 +325,7 @@ machine.o: machine.c @@ -319,7 +325,7 @@ machine.o: machine.c
319 ifeq ($(TARGET_BASE_ARCH), i386) 325 ifeq ($(TARGET_BASE_ARCH), i386)
320 # XXX: rename helper.c to op_helper.c 326 # XXX: rename helper.c to op_helper.c
321 helper.o: helper.c 327 helper.o: helper.c
322 - $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< 328 + $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(CFLAGS) $(I386_CFLAGS) -c -o $@ $<
323 else 329 else
324 op_helper.o: op_helper.c 330 op_helper.o: op_helper.c
325 $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< 331 $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
configure
@@ -1199,6 +1199,13 @@ case &quot;$target_cpu&quot; in @@ -1199,6 +1199,13 @@ case &quot;$target_cpu&quot; in
1199 then 1199 then
1200 echo "#define USE_KQEMU 1" >> $config_h 1200 echo "#define USE_KQEMU 1" >> $config_h
1201 fi 1201 fi
  1202 + gcc3minver=`$cc --version 2> /dev/null| fgrep "(GCC) 3." | awk '{ print $3 }' | cut -f2 -d.`
  1203 + if test -n "$gcc3minver" -a $gcc3minver -gt 3
  1204 + then
  1205 + echo "HAVE_GT_GCC_3_3=true" >> $config_mak
  1206 + else
  1207 + echo "HAVE_GT_GCC_3_3=false" >> $config_mak
  1208 + fi
1202 ;; 1209 ;;
1203 x86_64) 1210 x86_64)
1204 echo "TARGET_ARCH=x86_64" >> $config_mak 1211 echo "TARGET_ARCH=x86_64" >> $config_mak