qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Don't require GCC3 unless necessary (v2)
@ 2008-05-21 21:21 Anthony Liguori
  2008-05-22 13:20 ` Paul Brook
  0 siblings, 1 reply; 4+ messages in thread
From: Anthony Liguori @ 2008-05-21 21:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: Anthony Liguori, Paul Brook

Now that i386, x86_64, and arm are converted to TCG, we should not insist on
requiring GCC3 unless we're building a target that still requires dyngen.

If we're using some targets that do require GCC3 and some that don't, always
use GCC3 to ensure a consistent build.

Since v1, there was a small typo in the gcc3minver fix.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

diff --git a/Makefile b/Makefile
index 5bf9bbd..6505f0e 100644
--- a/Makefile
+++ b/Makefile
@@ -26,7 +26,11 @@ LIBS+=$(AIOLIBS)
 
 all: $(TOOLS) $(DOCS) recurse-all 
 
-subdir-%: dyngen$(EXESUF) libqemu_common.a
+ifeq ($(CONFIG_DYNGEN), yes)
+SUBDIR_DEP=dyngen$(EXESUF)
+endif
+
+subdir-%: $(SUBDIR_DEP) libqemu_common.a
 	$(MAKE) -C $(subst subdir-,,$@) all
 
 recurse-all: $(patsubst %,subdir-%, $(TARGET_DIRS))
diff --git a/configure b/configure
index 6b84f20..3fa2316 100755
--- a/configure
+++ b/configure
@@ -461,6 +461,37 @@ if test "$mingw32" = "yes" ; then
     oss="no"
 fi
 
+# If --target-list isn't specified, we need dyngen
+if [ "$target_list" == "" ]; then
+    dyngen="yes"
+else
+    dyngen="no"
+fi
+
+# Check if any targets require dyngen
+for target in $target_list; do
+    target_cpu=`echo $target | cut -d '-' -f 1`
+    [ "$target_cpu" = "alpha" ] && dyngen="yes"
+    [ "$target_cpu" = "m68k" ] && dyngen="yes"
+    [ "$target_cpu" = "mips" ] && dyngen="yes"
+    [ "$target_cpu" = "mipsel" ] && dyngen="yes"
+    [ "$target_cpu" = "mipsn32" ] && dyngen="yes"
+    [ "$target_cpu" = "mipsn32el" ] && dyngen="yes"
+    [ "$target_cpu" = "mips64" ] && dyngen="yes"
+    [ "$target_cpu" = "mips64el" ] && dyngen="yes"
+    [ "$target_cpu" = "ppc" ] && dyngen="yes"
+    [ "$target_cpu" = "ppcemb" ] && dyngen="yes"
+    [ "$target_cpu" = "ppc64" ] && dyngen="yes"
+    [ "$target_cpu" = "ppc64abi32" ] && dyngen="yes"
+    [ "$target_cpu" = "sh4" ] && dyngen="yes"
+    [ "$target_cpu" = "she4eb" ] && dyngen="yes"
+done
+
+# If no targets require dyngen, use default CC instead of gcc3
+if [ "$dyngen" = "no" ]; then
+    check_gcc="no"
+fi
+
 # Check for gcc4, error if pre-gcc4
 if test "$check_gcc" = "yes" ; then
     cat > $TMPC <<EOF
@@ -885,6 +916,7 @@ echo "CFLAGS=$CFLAGS" >> $config_mak
 echo "LDFLAGS=$LDFLAGS" >> $config_mak
 echo "EXESUF=$EXESUF" >> $config_mak
 echo "AIOLIBS=$AIOLIBS" >> $config_mak
+echo "CONFIG_DYNGEN=$dyngen" >> $config_mak
 case "$cpu" in
   i386)
     echo "ARCH=i386" >> $config_mak
@@ -1200,11 +1232,12 @@ case "$target_cpu" in
       echo "#define USE_KQEMU 1" >> $config_h
     fi
     gcc3minver=`$cc --version 2> /dev/null| fgrep "(GCC) 3." | awk '{ print $3 }' | cut -f2 -d.`
-    if test -n "$gcc3minver" -a $gcc3minver -gt 3
-    then
-      echo "HAVE_GT_GCC_3_3=true" >> $config_mak
-    else
-      echo "HAVE_GT_GCC_3_3=false" >> $config_mak
+    if test -n "$gcc3minver" ; then
+	if test "$gcc3minver" -gt 3 ; then
+	    echo "HAVE_GT_GCC_3_3=true" >> $config_mak
+	else
+	    echo "HAVE_GT_GCC_3_3=false" >> $config_mak
+	fi
     fi
   ;;
   x86_64)

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] Don't require GCC3 unless necessary (v2)
  2008-05-21 21:21 [Qemu-devel] [PATCH] Don't require GCC3 unless necessary (v2) Anthony Liguori
@ 2008-05-22 13:20 ` Paul Brook
  2008-05-22 16:22   ` Anthony Liguori
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Brook @ 2008-05-22 13:20 UTC (permalink / raw)
  To: qemu-devel; +Cc: Anthony Liguori

> +# Check if any targets require dyngen
> +for target in $target_list; do

You've just duplicated this logic. Please don't.

Paul

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] Don't require GCC3 unless necessary (v2)
  2008-05-22 13:20 ` Paul Brook
@ 2008-05-22 16:22   ` Anthony Liguori
  2008-05-22 16:31     ` Paul Brook
  0 siblings, 1 reply; 4+ messages in thread
From: Anthony Liguori @ 2008-05-22 16:22 UTC (permalink / raw)
  To: Paul Brook; +Cc: qemu-devel

Paul Brook wrote:
>> +# Check if any targets require dyngen
>> +for target in $target_list; do
>>     
>
> You've just duplicated this logic. Please don't.
>   

The problem is the dyngen checks have to be done before the use of $cc 
which is long before the target_list loop.  In the absence of 
introducing functions in the configure script (which aren't there right 
now), I don't see a good way to avoid the duplication.

The duplication is small and it's temporary until all targets convert to 
TCG.

Regards,

Anthony Liguori

> Paul
>   

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] Don't require GCC3 unless necessary (v2)
  2008-05-22 16:22   ` Anthony Liguori
@ 2008-05-22 16:31     ` Paul Brook
  0 siblings, 0 replies; 4+ messages in thread
From: Paul Brook @ 2008-05-22 16:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Anthony Liguori

On Thursday 22 May 2008, Anthony Liguori wrote:
> Paul Brook wrote:
> >> +# Check if any targets require dyngen
> >> +for target in $target_list; do
> >
> > You've just duplicated this logic. Please don't.
>
> The problem is the dyngen checks have to be done before the use of $cc
> which is long before the target_list loop.  In the absence of
> introducing functions in the configure script (which aren't there right
> now), I don't see a good way to avoid the duplication.
>
> The duplication is small and it's temporary until all targets convert to
> TCG

TBH I'd rather just finish the TCG conversion and rip out dyngen altogether.

Paul

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-05-22 16:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-21 21:21 [Qemu-devel] [PATCH] Don't require GCC3 unless necessary (v2) Anthony Liguori
2008-05-22 13:20 ` Paul Brook
2008-05-22 16:22   ` Anthony Liguori
2008-05-22 16:31     ` Paul Brook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).