Skip to contentSkip to conversation

Add cross compile to top level configuration file

PATCH Superseded Jerone Young 3 participants 14 messages Oct 15, 2007 – Oct 16, 2007 4 messages not in the archive KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add cross compile to top level configuration file

This patch is an improved version of patches sent last week to enable the top level configuration file for cross compile. This currently allows x86 & x86-64 to cross compile. But will soon be sending patches for powerpc embedded once this is accepted. This patches to latest git and is in git format ;-)

configure +64 -28
@@ -3,32 +3,30 @@ prefix=/usr/local
 prefix=/usr/local
 kerneldir=/lib/modules/$(uname -r)/build
 want_module=1
-qemu_cc=$(ls /usr/bin/gcc3* /usr/bin/gcc-3* 2>/dev/null | tail -n1)
+cc=gcc
+qemu_cc=
 disable_gcc_check=
+cross_prefix=
+arch=`uname -m`
+target_exec=
 
 usage() {
     cat <<-EOF
 	Usage: $0 [options]
 
 	Options include:
-
+	    --arch=ARCH            architecture to compile for ($arch)
+	    --cross-prefix=PREFIX  prefix for cross compiler
 	    --prefix=PREFIX        where to install things ($prefix)
 	    --with-patched-kernel  don't use external module
 	    --kerneldir=DIR        kernel build directory ($kerneldir)
-	    --qemu-cc="$qemu_cc"   compiler for qemu (needs gcc3.x) ($qemu_cc)
+	    --qemu-cc=CC           compiler for qemu (needs to be gcc 3.x)
+	                           Not valid if used with --cross-prefix	
 	    --disable-gcc-check    don't insist on gcc-3.x
-                                   - this will break running without kvm
+	                           CAUTION: using this option may break build
 EOF
     exit 1
 }
-
-
-# prefer gcc if its version is 3.* ( over a compat-gcc )
-# do it before parsing command line arguments to enable the user
-#    to specify a specific gcc he/she likes.
-if gcc -v 2>&1 | grep -q 'gcc *version *3\.[2-4]\.[0-9]'; then
-	qemu_cc=gcc
-fi
 
 while [[ "$1" = -* ]]; do
     opt="$1"; shift
@@ -53,6 +51,12 @@ while [[ "$1" = -* ]]; do
 	--disable-gcc-check)
 	    disable_gcc_check=1
 	    ;;
+	--arch)
+	    arch="$arg"
+	    ;;
+	--cross-prefix)
+	    cross_prefix="$arg"
+            ;;
 	--help)
 	    usage
 	    ;;
@@ -62,39 +66,71 @@ while [[ "$1" = -* ]]; do
     esac
 done
 
-if [[ -z "$qemu_cc" ]]; then
-    echo "$0: cannot locate gcc 3.x. please install it or specify with --qemu-cc"
-    exit 1
+
+# if cc is not specified on the command line
+# look for gcc version 3.x 
+if [[ -z "$qemu_cc" ]] && [[ -z "$cross_prefix" ]]; then
+    #check for a gcc 3.x version on the system
+    cc_check=$(ls /usr/bin/gcc3* /usr/bin/gcc-3* 2>/dev/null | tail -n1)
+    #prefer gcc if its version is 3.* ( over a compat-gcc )
+    gcc_check=$(gcc -v 2>&1 | grep -q 'gcc *version *3\.[2-4]\.[0-9]')
+    if [[ -n "$cc_check" ]] && [[ -z "$gcc_check" ]] ; then
+        cc=$cc_check
+    fi
 fi
 
+#if qemu_cc is specfied on the command line, set cc=$qemu_cc
+if [[ -n "$qemu_cc" ]] && [[ -z "$cross_prefix" ]]; then 
+   cc=$qemu_cc
+fi 
+
+#set kenel directory
 libkvm_kerneldir="$kerneldir"
 if (( want_module )); then
     libkvm_kerneldir=$(readlink -f kernel)
 fi
 
-target_cpu() {
-    if [[ $(uname -m) = i?86 ]]; then
-	echo x86_64
-    else
-	uname -m
-    fi
-}
+#if arch is an x86 arch set to i386
+if [[ $arch = i?86 ]]; then
+  arch="i386"
+fi
 
-(cd user; ./configure --prefix="$prefix" --kerneldir="$libkvm_kerneldir")
-(cd qemu; ./configure --target-list=$(target_cpu)-softmmu --cc="$qemu_cc" \
+#see if using a cross compiler or not
+qemu_opts=
+user_opts=
+if [[ -z $cross_prefix ]]; then
+    qemu_opts+=" --cc=$cc"
+    user_opts+=" --cc=$cc"
+else
+    qemu_opts+=" --cross-prefix=$cross_prefix"
+    user_opts+=" --cross-prefix=$cross_prefix"
+fi
+
+#set parameters compiling
+if [ "$arch" = "i386" -o "$arch" = "x86_64" ]; then
+    target_exec="x86_64-softmmu"
+    qemu_opts+=" --enable-alsa"
+fi
+
+qemudir=`pwd`/qemu
+
+#configure user dir
+(cd user; ./configure --prefix="$prefix" --kerneldir="$libkvm_kerneldir" \
+          $user_opts --arch="$arch")
+(cd qemu; ./configure --target-list=$target_exec \
     --disable-kqemu --extra-cflags="-I $PWD/../user" \
     --extra-ldflags="-L $PWD/../user" \
     --enable-kvm --kernel-path="$libkvm_kerneldir" \
-    --enable-alsa \
     ${disable_gcc_check:+"--disable-gcc-check"} \
-    --prefix="$prefix"
+    --prefix="$prefix" \
+    $qemu_opts --cpu="$arch"
 )
 
 
-
 cat <<EOF > config.mak
+ARCH=$arch
 PREFIX=$prefix
 KERNELDIR=$kerneldir
 WANT_MODULE=$want_module
+CC=$cross_prefix$cc
 EOF
-

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/

_______________________________________________
kvm-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel

#1 lore raw
Quoted 80 lines · Jerone Young

This patch is an improved version of patches sent last week to enable the top level configuration file for cross compile. This currently allows x86 & x86-64 to cross compile. But will soon be sending patches for powerpc embedded once this is accepted. This patches to latest git and is in git format ;-)

------------------------------------------------------------------------

configure +20 -15
@@ -3,32 +3,30 @@ prefix=/usr/local
 prefix=/usr/local
 kerneldir=/lib/modules/$(uname -r)/build
 want_module=1
-qemu_cc=$(ls /usr/bin/gcc3* /usr/bin/gcc-3* 2>/dev/null | tail -n1)
+cc=gcc
+qemu_cc=
 disable_gcc_check=
+cross_prefix=
+arch=`uname -m`
+target_exec=
 
 usage() {
     cat <<-EOF
 	Usage: $0 [options]
 
 	Options include:
-
+	    --arch=ARCH            architecture to compile for ($arch)
+	    --cross-prefix=PREFIX  prefix for cross compiler
 	    --prefix=PREFIX        where to install things ($prefix)
 	    --with-patched-kernel  don't use external module
 	    --kerneldir=DIR        kernel build directory ($kerneldir)
-	    --qemu-cc="$qemu_cc"   compiler for qemu (needs gcc3.x) ($qemu_cc)
+	    --qemu-cc=CC           compiler for qemu (needs to be gcc 3.x)
+	                           Not valid if used with --cross-prefix	
 	    --disable-gcc-check    don't insist on gcc-3.x
-                                   - this will break running without kvm
+	                           CAUTION: using this option may break build
 EOF
     exit 1
 }
-
-
-# prefer gcc if its version is 3.* ( over a compat-gcc )
-# do it before parsing command line arguments to enable the user
-#    to specify a specific gcc he/she likes.
-if gcc -v 2>&1 | grep -q 'gcc *version *3\.[2-4]\.[0-9]'; then
-	qemu_cc=gcc
-fi
 
 while [[ "$1" = -* ]]; do
     opt="$1"; shift
@@ -53,6 +51,12 @@ while [[ "$1" = -* ]]; do
 	--disable-gcc-check)
 	    disable_gcc_check=1
 	    ;;
+	--arch)
+	    arch="$arg"
+	    ;;
+	--cross-prefix)
+	    cross_prefix="$arg"
+            ;;
 	--help)
 	    usage
 	    ;;
@@ -62,39 +66,71 @@ while [[ "$1" = -* ]]; do
     esac
 done
 
-if [[ -z "$qemu_cc" ]]; then
-    echo "$0: cannot locate gcc 3.x. please install it or specify with --qemu-cc"
-    exit 1
+
+# if cc is not specified on the command line
+# look for gcc version 3.x 
+if [[ -z "$qemu_cc" ]] && [[ -z "$cross_prefix" ]]; then

configure while [[ "$1" = -* ]]; do · line 82

Quoted 10 lines
configure +7 -0
+    #check for a gcc 3.x version on the system
+    cc_check=$(ls /usr/bin/gcc3* /usr/bin/gcc-3* 2>/dev/null | tail -n1)
+    #prefer gcc if its version is 3.* ( over a compat-gcc )
+    gcc_check=$(gcc -v 2>&1 | grep -q 'gcc *version *3\.[2-4]\.[0-9]')
+    if [[ -n "$cc_check" ]] && [[ -z "$gcc_check" ]] ; then
+        cc=$cc_check
+    fi
 fi
 
 

The QEMU that's in git automatically finds the right GCC version so this whole check isn't necessary anymore.

Regards,

Anthony Liguori

Quoted 31 lines
configure +16 -9
+#if qemu_cc is specfied on the command line, set cc=$qemu_cc
+if [[ -n "$qemu_cc" ]] && [[ -z "$cross_prefix" ]]; then 
+   cc=$qemu_cc
+fi 
+
+#set kenel directory
 libkvm_kerneldir="$kerneldir"
 if (( want_module )); then
     libkvm_kerneldir=$(readlink -f kernel)
 fi
 
-target_cpu() {
-    if [[ $(uname -m) = i?86 ]]; then
-	echo x86_64
-    else
-	uname -m
-    fi
-}
+#if arch is an x86 arch set to i386
+if [[ $arch = i?86 ]]; then
+  arch="i386"
+fi
 
-(cd user; ./configure --prefix="$prefix" --kerneldir="$libkvm_kerneldir")
-(cd qemu; ./configure --target-list=$(target_cpu)-softmmu --cc="$qemu_cc" \
+#see if using a cross compiler or not
+qemu_opts=
+user_opts=
+if [[ -z $cross_prefix ]]; then
+    qemu_opts+=" --cc=$cc"
+    user_opts+=" --cc=$cc"

configure while [[ "$1" = -* ]]; do · line 128

Quoted 10 lines
configure +9 -0
+else
+    qemu_opts+=" --cross-prefix=$cross_prefix"
+    user_opts+=" --cross-prefix=$cross_prefix"
+fi
+
+#set parameters compiling
+if [ "$arch" = "i386" -o "$arch" = "x86_64" ]; then
+    target_exec="x86_64-softmmu"
+    qemu_opts+=" --enable-alsa"
 

Why are you only passing --enable-alsa only x86?

Quoted 7 lines
configure +7 -0
+fi
+
+qemudir=`pwd`/qemu
+
+#configure user dir
+(cd user; ./configure --prefix="$prefix" --kerneldir="$libkvm_kerneldir" \
+          $user_opts --arch="$arch")

configure while [[ "$1" = -* ]]; do · line 128

Quoted 10 lines
configure +3 -2
+(cd qemu; ./configure --target-list=$target_exec \
     --disable-kqemu --extra-cflags="-I $PWD/../user" \
     --extra-ldflags="-L $PWD/../user" \
     --enable-kvm --kernel-path="$libkvm_kerneldir" \
-    --enable-alsa \
     ${disable_gcc_check:+"--disable-gcc-check"} \
-    --prefix="$prefix"
+    --prefix="$prefix" \
+    $qemu_opts --cpu="$arch"
 

I don't think this is right. You're using two different --cpu options for i386 and x86_64. There really shouldn't be a --cpu option at all for x86.

Regards,

Anthony Liguori

Quoted 21 lines
configure +1 -1
 )
 
 
-
 cat <<EOF > config.mak
+ARCH=$arch
 PREFIX=$prefix
 KERNELDIR=$kerneldir

WANT_MODULE=$want_module

configure +1 -2
+CC=$cross_prefix$cc
 EOF
-
 
 
-------------------------------------------------------------------------

This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
------------------------------------------------------------------------

Quoted 4 lines

_______________________________________________
kvm-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw
Quoted 86 lines · Anthony Liguori
Quoted 85 lines · Jerone Young

This patch is an improved version of patches sent last week to enable the top level configuration file for cross compile. This currently allows x86 & x86-64 to cross compile. But will soon be sending patches for powerpc embedded once this is accepted. This patches to latest git and is in git format ;-)

------------------------------------------------------------------------

configure +25 -15
@@ -3,32 +3,30 @@ prefix=/usr/local
 prefix=/usr/local
 kerneldir=/lib/modules/$(uname -r)/build
 want_module=1
-qemu_cc=$(ls /usr/bin/gcc3* /usr/bin/gcc-3* 2>/dev/null | tail -n1)
+cc=gcc
+qemu_cc=
 disable_gcc_check=
+cross_prefix=
+arch=`uname -m`
+target_exec=
 
 usage() {
     cat <<-EOF
 	Usage: $0 [options]
 
 	Options include:
-
+	    --arch=ARCH            architecture to compile for ($arch)
+	    --cross-prefix=PREFIX  prefix for cross compiler
 	    --prefix=PREFIX        where to install things ($prefix)
 	    --with-patched-kernel  don't use external module
 	    --kerneldir=DIR        kernel build directory ($kerneldir)
-	    --qemu-cc="$qemu_cc"   compiler for qemu (needs gcc3.x) ($qemu_cc)
+	    --qemu-cc=CC           compiler for qemu (needs to be gcc 3.x)
+	                           Not valid if used with --cross-prefix	
 	    --disable-gcc-check    don't insist on gcc-3.x
-                                   - this will break running without kvm
+	                           CAUTION: using this option may break build
 EOF
     exit 1
 }
-
-
-# prefer gcc if its version is 3.* ( over a compat-gcc )
-# do it before parsing command line arguments to enable the user
-#    to specify a specific gcc he/she likes.
-if gcc -v 2>&1 | grep -q 'gcc *version *3\.[2-4]\.[0-9]'; then
-	qemu_cc=gcc
-fi
 
 while [[ "$1" = -* ]]; do
     opt="$1"; shift
@@ -53,6 +51,12 @@ while [[ "$1" = -* ]]; do
 	--disable-gcc-check)
 	    disable_gcc_check=1
 	    ;;
+	--arch)
+	    arch="$arg"
+	    ;;
+	--cross-prefix)
+	    cross_prefix="$arg"
+            ;;
 	--help)
 	    usage
 	    ;;
@@ -62,39 +66,71 @@ while [[ "$1" = -* ]]; do
     esac
 done
 
-if [[ -z "$qemu_cc" ]]; then
-    echo "$0: cannot locate gcc 3.x. please install it or specify with --qemu-cc"
-    exit 1
+
+# if cc is not specified on the command line
+# look for gcc version 3.x 
+if [[ -z "$qemu_cc" ]] && [[ -z "$cross_prefix" ]]; then
+    #check for a gcc 3.x version on the system
+    cc_check=$(ls /usr/bin/gcc3* /usr/bin/gcc-3* 2>/dev/null | tail -n1)
+    #prefer gcc if its version is 3.* ( over a compat-gcc )
+    gcc_check=$(gcc -v 2>&1 | grep -q 'gcc *version *3\.[2-4]\.[0-9]')
+    if [[ -n "$cc_check" ]] && [[ -z "$gcc_check" ]] ; then
Quoted 8 lines

configure while [[ "$1" = -* ]]; do · line 92

Quoted 5 lines
configure +2 -0
+        cc=$cc_check
+    fi
 fi
 
 

The QEMU that's in git automatically finds the right GCC version so this whole check isn't necessary anymore.

This is true. Figured that this was still there for a particular reason. If this is the case then this can be removed.

Quoted 40 lines

Regards,

Anthony Liguori

Quoted 35 lines
configure +20 -9
+#if qemu_cc is specfied on the command line, set cc=$qemu_cc
+if [[ -n "$qemu_cc" ]] && [[ -z "$cross_prefix" ]]; then 
+   cc=$qemu_cc
+fi 
+
+#set kenel directory
 libkvm_kerneldir="$kerneldir"
 if (( want_module )); then
     libkvm_kerneldir=$(readlink -f kernel)
 fi
 
-target_cpu() {
-    if [[ $(uname -m) = i?86 ]]; then
-	echo x86_64
-    else
-	uname -m
-    fi
-}
+#if arch is an x86 arch set to i386
+if [[ $arch = i?86 ]]; then
+  arch="i386"
+fi
 
-(cd user; ./configure --prefix="$prefix" --kerneldir="$libkvm_kerneldir")
-(cd qemu; ./configure --target-list=$(target_cpu)-softmmu --cc="$qemu_cc" \
+#see if using a cross compiler or not
+qemu_opts=
+user_opts=
+if [[ -z $cross_prefix ]]; then
+    qemu_opts+=" --cc=$cc"
+    user_opts+=" --cc=$cc"
+else
+    qemu_opts+=" --cross-prefix=$cross_prefix"
+    user_opts+=" --cross-prefix=$cross_prefix"
+fi
Quoted 8 lines

configure while [[ "$1" = -* ]]; do · line 128

Quoted 6 lines
configure +5 -0
+
+#set parameters compiling
+if [ "$arch" = "i386" -o "$arch" = "x86_64" ]; then
+    target_exec="x86_64-softmmu"
+    qemu_opts+=" --enable-alsa"
 

Why are you only passing --enable-alsa only x86?

Because for our powerpc stuff we actually want different options. ALSA is not a dependency we want.

Quoted 14 lines
Quoted 14 lines
configure +8 -1
+fi
+
+qemudir=`pwd`/qemu
+
+#configure user dir
+(cd user; ./configure --prefix="$prefix" --kerneldir="$libkvm_kerneldir" \
+          $user_opts --arch="$arch")
+(cd qemu; ./configure --target-list=$target_exec \
     --disable-kqemu --extra-cflags="-I $PWD/../user" \
     --extra-ldflags="-L $PWD/../user" \
     --enable-kvm --kernel-path="$libkvm_kerneldir" \
-    --enable-alsa \
     ${disable_gcc_check:+"--disable-gcc-check"} \
Quoted 8 lines

configure while [[ "$1" = -* ]]; do · line 128

Quoted 4 lines
configure +2 -1
-    --prefix="$prefix"
+    --prefix="$prefix" \
+    $qemu_opts --cpu="$arch"
 

I don't think this is right. You're using two different --cpu options for i386 and x86_64. There really shouldn't be a --cpu option at all for x86.

So the --cpu option is actually a hidden option in qemu & is not on the qemu help page .. who know why it isn't but the it's in the code.

It makes since though that if you are going to specify cross-prefix= then there is little reason to specify the cpu on the qemu line. As it should detect everything from cross compiler.

I'll test this out and send a new patch with the 2 changes.

Quoted 32 lines

Regards,

Anthony Liguori

Quoted 21 lines
configure +1 -1
 )
 
 
-
 cat <<EOF > config.mak
+ARCH=$arch
 PREFIX=$prefix
 KERNELDIR=$kerneldir

WANT_MODULE=$want_module

configure +1 -2
+CC=$cross_prefix$cc
 EOF
-
 
 
-------------------------------------------------------------------------

This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
------------------------------------------------------------------------

Quoted 4 lines

_______________________________________________
kvm-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Quoted 9 lines

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
kvm-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/

#4 lore raw
Quoted 12 lines · Jerone Young
Quoted 10 lines · Anthony Liguori
Quoted 8 lines · Jerone Young

This patch is an improved version of patches sent last week to enable the top level configuration file for cross compile. This currently allows x86 & x86-64 to cross compile. But will soon be sending patches for powerpc embedded once this is accepted. This patches to latest git and is in git format ;-)

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

------------------------------------------------------------------------

Why are you only passing --enable-alsa only x86?

Because for our powerpc stuff we actually want different options. ALSA is not a dependency we want.

Well, you don't want the dependency, but does that mean noone will ever want the dependency on anything but x86?

I'm curious why --enable-alsa is here in the first place. QEMU will use SDL audio by default. Perhaps Avi can shed light on why added in the first place?

Regards,

Anthony Liguori

Quoted 23 lines
Quoted 13 lines
Quoted 13 lines
configure +8 -1
+fi
+
+qemudir=`pwd`/qemu
+
+#configure user dir
+(cd user; ./configure --prefix="$prefix" --kerneldir="$libkvm_kerneldir" \
+          $user_opts --arch="$arch")
+(cd qemu; ./configure --target-list=$target_exec \
     --disable-kqemu --extra-cflags="-I $PWD/../user" \
     --extra-ldflags="-L $PWD/../user" \
     --enable-kvm --kernel-path="$libkvm_kerneldir" \
-    --enable-alsa \
     ${disable_gcc_check:+"--disable-gcc-check"} \
Quoted 9 lines

configure while [[ "$1" = -* ]]; do · line 126

Quoted 5 lines
configure +2 -1
-    --prefix="$prefix"
+    --prefix="$prefix" \
+    $qemu_opts --cpu="$arch"

I don't think this is right. You're using two different --cpu options for i386 and x86_64. There really shouldn't be a --cpu option at all for x86.

Quoted 54 lines

So the --cpu option is actually a hidden option in qemu & is not on the qemu help page .. who know why it isn't but the it's in the code.

It makes since though that if you are going to specify cross-prefix= then there is little reason to specify the cpu on the qemu line. As it should detect everything from cross compiler.

I'll test this out and send a new patch with the 2 changes.

Quoted 41 lines

Regards,

Anthony Liguori

Quoted 21 lines

)

configure +2 -3
-
 cat <<EOF > config.mak
+ARCH=$arch
 PREFIX=$prefix
 KERNELDIR=$kerneldir
 WANT_MODULE=$want_module
+CC=$cross_prefix$cc
 EOF
-
 
 
-------------------------------------------------------------------------

This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
------------------------------------------------------------------------

Quoted 5 lines

_______________________________________________
kvm-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
kvm-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw

So it appears that trying to remove --cpu option will not work. Qemu still wants to compile to the arch of the machine you are compiling on without it. Even with cross compiler specified. So qemu still thinks the host CPU is going to be i386, even though I specified an x86-64 cross compilers. So Qemu will intern use -m32 cflag as well as not make the correct assumptions during build.

So same goes for power. This option is how we cross compile qemu today on our x86 machines to the run on the our embedded power boards.

So I'll leave the patch alone for now until Avi weighs in on it. But everything that is currently there keeps functionality that was already there.

Quoted 113 lines · Anthony Liguori
Quoted 12 lines · Jerone Young
Quoted 10 lines · Anthony Liguori
Quoted 8 lines · Jerone Young

This patch is an improved version of patches sent last week to enable the top level configuration file for cross compile. This currently allows x86 & x86-64 to cross compile. But will soon be sending patches for powerpc embedded once this is accepted. This patches to latest git and is in git format ;-)

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

------------------------------------------------------------------------

Why are you only passing --enable-alsa only x86?

Because for our powerpc stuff we actually want different options. ALSA is not a dependency we want.

Well, you don't want the dependency, but does that mean noone will ever want the dependency on anything but x86?

I'm curious why --enable-alsa is here in the first place. QEMU will use SDL audio by default. Perhaps Avi can shed light on why added in the first place?

Regards,

Anthony Liguori

Quoted 23 lines
Quoted 13 lines
Quoted 13 lines
configure +8 -1
+fi
+
+qemudir=`pwd`/qemu
+
+#configure user dir
+(cd user; ./configure --prefix="$prefix" --kerneldir="$libkvm_kerneldir" \
+          $user_opts --arch="$arch")
+(cd qemu; ./configure --target-list=$target_exec \
     --disable-kqemu --extra-cflags="-I $PWD/../user" \
     --extra-ldflags="-L $PWD/../user" \
     --enable-kvm --kernel-path="$libkvm_kerneldir" \
-    --enable-alsa \
     ${disable_gcc_check:+"--disable-gcc-check"} \
Quoted 9 lines

configure while [[ "$1" = -* ]]; do · line 126

Quoted 5 lines
configure +2 -1
-    --prefix="$prefix"
+    --prefix="$prefix" \
+    $qemu_opts --cpu="$arch"

I don't think this is right. You're using two different --cpu options for i386 and x86_64. There really shouldn't be a --cpu option at all for x86.

Quoted 54 lines

So the --cpu option is actually a hidden option in qemu & is not on the qemu help page .. who know why it isn't but the it's in the code.

It makes since though that if you are going to specify cross-prefix= then there is little reason to specify the cpu on the qemu line. As it should detect everything from cross compiler.

I'll test this out and send a new patch with the 2 changes.

Quoted 41 lines

Regards,

Anthony Liguori

Quoted 21 lines

)

configure +2 -3
-
 cat <<EOF > config.mak
+ARCH=$arch
 PREFIX=$prefix
 KERNELDIR=$kerneldir
 WANT_MODULE=$want_module
+CC=$cross_prefix$cc
 EOF
-
 
 
-------------------------------------------------------------------------

This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
------------------------------------------------------------------------

Quoted 5 lines

_______________________________________________
kvm-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
kvm-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Quoted 9 lines

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
kvm-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/

#7 lore raw

PATCH RESEND 1/1 Add cross compile to top level configuration file

In reply to a message not in the archive

This new patch removes gcc 3.x checks, as well as adds environment variables $CFLAGS & $LDFLAGS to include libs to qemu for cross compile. I was going to add this in another patch. But they should probably go in now. So an example for power is to include zlib so before running configure you do:
export LDFLAGS="-L/home/public/zlib-ppc/lib"
export CFLAGS="-I/home/public/zlib-ppc/include"

configure +50 -32
diff -r ff2feafadcac configure
@@ -3,32 +3,29 @@ prefix=/usr/local
 prefix=/usr/local
 kerneldir=/lib/modules/$(uname -r)/build
 want_module=1
-qemu_cc=$(ls /usr/bin/gcc3* /usr/bin/gcc-3* 2>/dev/null | tail -n1)
+cc=gcc
 disable_gcc_check=
+cross_prefix=
+arch=`uname -m`
+target_exec=
 
 usage() {
     cat <<-EOF
 	Usage: $0 [options]
 
 	Options include:
-
+	    --arch=ARCH            architecture to compile for ($arch)
+	    --cross-prefix=PREFIX  prefix for cross compiler
 	    --prefix=PREFIX        where to install things ($prefix)
 	    --with-patched-kernel  don't use external module
 	    --kerneldir=DIR        kernel build directory ($kerneldir)
-	    --qemu-cc="$qemu_cc"   compiler for qemu (needs gcc3.x) ($qemu_cc)
+	    --qemu-cc=CC           compiler for qemu (needs to be gcc 3.x)
+	                           Not valid if used with --cross-prefix	
 	    --disable-gcc-check    don't insist on gcc-3.x
-                                   - this will break running without kvm
+	                           CAUTION: using this option may break build
 EOF
     exit 1
 }
-
-
-# prefer gcc if its version is 3.* ( over a compat-gcc )
-# do it before parsing command line arguments to enable the user
-#    to specify a specific gcc he/she likes.
-if gcc -v 2>&1 | grep -q 'gcc *version *3\.[2-4]\.[0-9]'; then
-	qemu_cc=gcc
-fi
 
 while [[ "$1" = -* ]]; do
     opt="$1"; shift
@@ -48,11 +45,17 @@ while [[ "$1" = -* ]]; do
 	    want_module=
 	    ;;
 	--qemu-cc)
-	    qemu_cc="$arg"
+	    cc="$arg"
 	    ;;
 	--disable-gcc-check)
 	    disable_gcc_check=1
 	    ;;
+	--arch)
+	    arch="$arg"
+	    ;;
+	--cross-prefix)
+	    cross_prefix="$arg"
+            ;;
 	--help)
 	    usage
 	    ;;
@@ -62,39 +65,54 @@ while [[ "$1" = -* ]]; do
     esac
 done
 
-if [[ -z "$qemu_cc" ]]; then
-    echo "$0: cannot locate gcc 3.x. please install it or specify with --qemu-cc"
-    exit 1
-fi
 
+#set kenel directory
 libkvm_kerneldir="$kerneldir"
 if (( want_module )); then
     libkvm_kerneldir=$(readlink -f kernel)
 fi
 
-target_cpu() {
-    if [[ $(uname -m) = i?86 ]]; then
-	echo x86_64
-    else
-	uname -m
-    fi
-}
+#if arch is an x86 arch set to i386
+if [[ $arch = i?86 ]]; then
+  arch="i386"
+fi
 
-(cd user; ./configure --prefix="$prefix" --kerneldir="$libkvm_kerneldir")
-(cd qemu; ./configure --target-list=$(target_cpu)-softmmu --cc="$qemu_cc" \
-    --disable-kqemu --extra-cflags="-I $PWD/../user" \
-    --extra-ldflags="-L $PWD/../user" \
+#see if using a cross compiler or not
+qemu_opts=
+user_opts=
+if [[ -z $cross_prefix ]]; then
+    qemu_opts+=" --cc=$cc"
+    user_opts+=" --cc=$cc"
+else
+    qemu_opts+=" --cross-prefix=$cross_prefix"
+    user_opts+=" --cross-prefix=$cross_prefix"
+fi
+
+#set parameters compiling
+if [ "$arch" = "i386" -o "$arch" = "x86_64" ]; then
+    target_exec="x86_64-softmmu"
+    qemu_opts+=" --enable-alsa"
+fi
+
+qemudir=`pwd`/qemu
+
+#configure user dir
+(cd user; ./configure --prefix="$prefix" --kerneldir="$libkvm_kerneldir" \
+          $user_opts --arch="$arch")
+(cd qemu; ./configure --target-list=$target_exec \
+    --disable-kqemu --extra-cflags="-I $PWD/../user $CFLAGS" \
+    --extra-ldflags="-L $PWD/../user $LDFLAGS" \
     --enable-kvm --kernel-path="$libkvm_kerneldir" \
-    --enable-alsa \
     ${disable_gcc_check:+"--disable-gcc-check"} \
-    --prefix="$prefix"
+    --prefix="$prefix" \
+    $qemu_opts --cpu=$arch
 )
 
 
-
 cat <<EOF > config.mak
+ARCH=$arch
 PREFIX=$prefix
 KERNELDIR=$kerneldir
 WANT_MODULE=$want_module
+CC=$cross_prefix$cc
 EOF
-
Quoted 113 lines · Anthony Liguori
Quoted 12 lines · Jerone Young
Quoted 10 lines · Anthony Liguori
Quoted 8 lines · Jerone Young

This patch is an improved version of patches sent last week to enable the top level configuration file for cross compile. This currently allows x86 & x86-64 to cross compile. But will soon be sending patches for powerpc embedded once this is accepted. This patches to latest git and is in git format ;-)

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

------------------------------------------------------------------------

Why are you only passing --enable-alsa only x86?

Because for our powerpc stuff we actually want different options. ALSA is not a dependency we want.

Well, you don't want the dependency, but does that mean noone will ever want the dependency on anything but x86?

I'm curious why --enable-alsa is here in the first place. QEMU will use SDL audio by default. Perhaps Avi can shed light on why added in the first place?

Regards,

Anthony Liguori

Quoted 23 lines
Quoted 13 lines
Quoted 13 lines
(quoted diff) +8 -1
+fi
+
+qemudir=`pwd`/qemu
+
+#configure user dir
+(cd user; ./configure --prefix="$prefix" --kerneldir="$libkvm_kerneldir" \
+          $user_opts --arch="$arch")
+(cd qemu; ./configure --target-list=$target_exec \
     --disable-kqemu --extra-cflags="-I $PWD/../user" \
     --extra-ldflags="-L $PWD/../user" \
     --enable-kvm --kernel-path="$libkvm_kerneldir" \
-    --enable-alsa \
     ${disable_gcc_check:+"--disable-gcc-check"} \
Quoted 9 lines

Review

Quoted 5 lines
(quoted diff) +2 -1
-    --prefix="$prefix"
+    --prefix="$prefix" \
+    $qemu_opts --cpu="$arch"

I don't think this is right. You're using two different --cpu options for i386 and x86_64. There really shouldn't be a --cpu option at all for x86.

Quoted 54 lines

So the --cpu option is actually a hidden option in qemu & is not on the qemu help page .. who know why it isn't but the it's in the code.

It makes since though that if you are going to specify cross-prefix= then there is little reason to specify the cpu on the qemu line. As it should detect everything from cross compiler.

I'll test this out and send a new patch with the 2 changes.

Quoted 41 lines

Regards,

Anthony Liguori

Quoted 21 lines

)

(quoted diff) +2 -3
-
 cat <<EOF > config.mak
+ARCH=$arch
 PREFIX=$prefix
 KERNELDIR=$kerneldir
 WANT_MODULE=$want_module
+CC=$cross_prefix$cc
 EOF
-
 
 
-------------------------------------------------------------------------

This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
------------------------------------------------------------------------

Quoted 5 lines

_______________________________________________
kvm-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
kvm-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Quoted 9 lines

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
kvm-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/

#8 lore raw
Quoted 9 lines · Jerone Young

This new patch removes gcc 3.x checks, as well as adds environment variables $CFLAGS & $LDFLAGS to include libs to qemu for cross compile. I was going to add this in another patch. But they should probably go in now. So an example for power is to include zlib so before running configure you do:
export LDFLAGS="-L/home/public/zlib-ppc/lib"
export CFLAGS="-I/home/public/zlib-ppc/include"

Let's not add dependencies on environment variables. Explicit --options please.

Quoted 27 lines

diff -r ff2feafadcac configure

configure +6 -2
@@ -3,32 +3,29 @@ prefix=/usr/local
 prefix=/usr/local
 kerneldir=/lib/modules/$(uname -r)/build
 want_module=1
-qemu_cc=$(ls /usr/bin/gcc3* /usr/bin/gcc-3* 2>/dev/null | tail -n1)
 
 
 
+cc=gcc
 disable_gcc_check=
+cross_prefix=
+arch=`uname -m`
+target_exec=
 
 usage() {
     cat <<-EOF
 	Usage: $0 [options]
 
 	Options include:
-
+	    --arch=ARCH            architecture to compile for ($arch)
+	    --cross-prefix=PREFIX  prefix for cross compiler

configure prefix=/usr/local · line 29

Quoted 10 lines
configure +3 -2
 	    --prefix=PREFIX        where to install things ($prefix)
 	    --with-patched-kernel  don't use external module
 	    --kerneldir=DIR        kernel build directory ($kerneldir)
-	    --qemu-cc="$qemu_cc"   compiler for qemu (needs gcc3.x) ($qemu_cc)
+	    --qemu-cc=CC           compiler for qemu (needs to be gcc 3.x)
+	                           Not valid if used with --cross-prefix	
 	    --disable-gcc-check    don't insist on gcc-3.x
-                                   - this will break running without kvm
+	                           CAUTION: using this option may break build
 

Looks like a step back in terms of the amount of information provided to the user.

configure while [[ "$1" = -* ]]; do · line 49

Quoted 9 lines
configure +1 -1
 while [[ "$1" = -* ]]; do
     opt="$1"; shift
@@ -48,11 +45,17 @@ while [[ "$1" = -* ]]; do
 	    want_module=
 	    ;;
 	--qemu-cc)
-	    qemu_cc="$arg"
+	    cc="$arg"
 

This forces everything to be compiled with $cc, not just qemu? Or is the kernel/ dierctory not affected by this?

configure while [[ "$1" = -* ]]; do · line 110

Quoted 2 lines
configure +1 -0
+qemudir=`pwd`/qemu
 

Add quoting so we can pretend we're safe in the presence of whitespace in $PWD.

Signature · 8 lines
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/

A message that is not in the archive (sent off-list or not yet received): 47148B90.2020607-atKUWr5tajBWk0Htik3J/[email protected]

#10 lore raw
Quoted 11 lines · Avi Kivity
Quoted 9 lines · Jerone Young

This new patch removes gcc 3.x checks, as well as adds environment variables $CFLAGS & $LDFLAGS to include libs to qemu for cross compile. I was going to add this in another patch. But they should probably go in now. So an example for power is to include zlib so before running configure you do:
export LDFLAGS="-L/home/public/zlib-ppc/lib"
export CFLAGS="-I/home/public/zlib-ppc/include"

Quoted 2 lines

Let's not add dependencies on environment variables. Explicit --options please.

ok will do this in the next redo.

Quoted 33 lines
Quoted 33 lines

diff -r ff2feafadcac configure

configure +7 -3
@@ -3,32 +3,29 @@ prefix=/usr/local
 prefix=/usr/local
 kerneldir=/lib/modules/$(uname -r)/build
 want_module=1
-qemu_cc=$(ls /usr/bin/gcc3* /usr/bin/gcc-3* 2>/dev/null | tail -n1)
 
 
 
+cc=gcc
 disable_gcc_check=
+cross_prefix=
+arch=`uname -m`
+target_exec=
 
 usage() {
     cat <<-EOF
 	Usage: $0 [options]
 
 	Options include:
-
+	    --arch=ARCH            architecture to compile for ($arch)
+	    --cross-prefix=PREFIX  prefix for cross compiler
 	    --prefix=PREFIX        where to install things ($prefix)
 	    --with-patched-kernel  don't use external module
 	    --kerneldir=DIR        kernel build directory ($kerneldir)
-	    --qemu-cc="$qemu_cc"   compiler for qemu (needs gcc3.x) ($qemu_cc)
+	    --qemu-cc=CC           compiler for qemu (needs to be gcc 3.x)
Quoted 8 lines

configure prefix=/usr/local · line 29

Quoted 5 lines
configure +2 -1
+	                           Not valid if used with --cross-prefix	
 	    --disable-gcc-check    don't insist on gcc-3.x
-                                   - this will break running without kvm
+	                           CAUTION: using this option may break build
 

Looks like a step back in terms of the amount of information provided to the user.

I'll add the text back with the CAUTION:

Quoted 13 lines

configure while [[ "$1" = -* ]]; do · line 49

Quoted 10 lines
configure +1 -1
 while [[ "$1" = -* ]]; do
     opt="$1"; shift
@@ -48,11 +45,17 @@ while [[ "$1" = -* ]]; do
 	    want_module=
 	    ;;
 	--qemu-cc)
-	    qemu_cc="$arg"
+	    cc="$arg"
 

This forces everything to be compiled with $cc, not just qemu? Or is the kernel/ dierctory not affected by this?

I can create two but it will make things very complicated. This only will effect the qemu and user directory, but not the kernel directory. Currently kernel directory is used for headers by these two.

If a user wants to change this they can run the configure script in user directory manually.

Really I can just change it to just the option is --cc and remove the qemu part. That actually makes more since.

Otherwise you end up with something more complicated like having to specify which one needs the cross compiler and not, which need this specific gcc, just bad. Really you should be compiling both with the same gcc anyway. If you want to do something different then you really should go into both directories and run configure stand alone.

Quoted 8 lines

configure while [[ "$1" = -* ]]; do · line 110

Quoted 3 lines
configure +1 -0
+qemudir=`pwd`/qemu
 

Add quoting so we can pretend we're safe in the presence of whitespace in $PWD.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/

#11 lore raw
Quoted 22 lines · Jerone Young
Quoted 14 lines

configure while [[ "$1" = -* ]]; do · line 50

Quoted 11 lines

while [[ "$1" = -* ]]; do

     opt="$1"; shift
configure +1 -1
@@ -48,11 +45,17 @@ while [[ "$1" = -* ]]; do
 	    want_module=
 	    ;;
 	--qemu-cc)
-	    qemu_cc="$arg"
+	    cc="$arg"
 
 

This forces everything to be compiled with $cc, not just qemu? Or is the kernel/ dierctory not affected by this?

I can create two but it will make things very complicated. This only will effect the qemu and user directory, but not the kernel directory. Currently kernel directory is used for headers by these two.

If a user wants to change this they can run the configure script in user directory manually.

Quoted 9 lines

Really I can just change it to just the option is --cc and remove the qemu part. That actually makes more since.

Otherwise you end up with something more complicated like having to specify which one needs the cross compiler and not, which need this specific gcc, just bad. Really you should be compiling both with the same gcc anyway. If you want to do something different then you really should go into both directories and run configure stand alone.

So long as the kernel isn't affected I don't mind a common cc for user/ and qemu/.

Signature · 8 lines
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
#12 lore raw
In reply to Jerone Young
Quoted 1 line · Jerone Young

This new patch

btw, if it's an updated patch, don't put [RESEND] in there, it confuses me. Put in v2, v3, etc. so I know it's something new.

A [RESEND] is for when I've dropped a patch without comment (which should not happen normally).

Signature · 8 lines
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
#13 lore raw
In reply to a message not in the archive
Quoted 4 lines · Anthony Liguori

I'm curious why --enable-alsa is here in the first place. QEMU will use SDL audio by default. Perhaps Avi can shed light on why added in the first place?

<shrug> seemed like a good idea at the time. It's not like I actually know what goes on in the qemu sound emulation innards.

Signature · 8 lines
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
#14 lore raw
In reply to Jerone Young
Quoted 26 lines · Jerone Young
Quoted 13 lines · Anthony Liguori
Quoted 13 lines
configure +8 -1
+fi
+
+qemudir=`pwd`/qemu
+
+#configure user dir
+(cd user; ./configure --prefix="$prefix" --kerneldir="$libkvm_kerneldir" \
+          $user_opts --arch="$arch")
+(cd qemu; ./configure --target-list=$target_exec \
     --disable-kqemu --extra-cflags="-I $PWD/../user" \
     --extra-ldflags="-L $PWD/../user" \
     --enable-kvm --kernel-path="$libkvm_kerneldir" \
-    --enable-alsa \
     ${disable_gcc_check:+"--disable-gcc-check"} \
Quoted 9 lines

configure while [[ "$1" = -* ]]; do · line 126

Quoted 5 lines
configure +2 -1
-    --prefix="$prefix"
+    --prefix="$prefix" \
+    $qemu_opts --cpu="$arch"

I don't think this is right. You're using two different --cpu options for i386 and x86_64. There really shouldn't be a --cpu option at all for x86.

Quoted 9 lines

So the --cpu option is actually a hidden option in qemu & is not on the qemu help page .. who know why it isn't but the it's in the code.

It makes since though that if you are going to specify cross-prefix= then there is little reason to specify the cpu on the qemu line. As it should detect everything from cross compiler.

I'll test this out and send a new patch with the 2 changes.

So, instead of doing the funky $qemu_opts thing, why not just do:

   ${cross_prefix:+"--cross-prefix=${cross_prefix} --cpu=${arch}"}

Regards,

Anthony Liguori

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/

A message that is not in the archive (sent off-list or not yet received): [email protected]

#16 lore raw
Quoted 34 lines · Anthony Liguori
Quoted 33 lines · Jerone Young
Quoted 13 lines · Anthony Liguori
Quoted 13 lines
configure +8 -1
+fi
+
+qemudir=`pwd`/qemu
+
+#configure user dir
+(cd user; ./configure --prefix="$prefix" --kerneldir="$libkvm_kerneldir" \
+          $user_opts --arch="$arch")
+(cd qemu; ./configure --target-list=$target_exec \
     --disable-kqemu --extra-cflags="-I $PWD/../user" \
     --extra-ldflags="-L $PWD/../user" \
     --enable-kvm --kernel-path="$libkvm_kerneldir" \
-    --enable-alsa \
     ${disable_gcc_check:+"--disable-gcc-check"} \
Quoted 9 lines

configure while [[ "$1" = -* ]]; do · line 126

Quoted 5 lines
configure +2 -1
-    --prefix="$prefix"
+    --prefix="$prefix" \
+    $qemu_opts --cpu="$arch"

I don't think this is right. You're using two different --cpu options for i386 and x86_64. There really shouldn't be a --cpu option at all for x86.

So the --cpu option is actually a hidden option in qemu & is not on the qemu help page .. who know why it isn't but the it's in the code.

It makes since though that if you are going to specify cross-prefix= then there is little reason to specify the cpu on the qemu line. As it should detect everything from cross compiler.

Quoted 6 lines
Quoted 2 lines

I'll test this out and send a new patch with the 2 changes.

So, instead of doing the funky $qemu_opts thing, why not just do:

   ${cross_prefix:+"--cross-prefix=${cross_prefix} --cpu=${arch}"}

Well you could but what I need to is satisfy the situation that if you have --qemu-cc specified that it not use it. I'm not sure how you do this in one line in bash. So I have

if [[ -z $cross_prefix ]]; then

	  qemu_opts+=" --cc=$cc"
else
	  qemu_opts+=" --cross-prefix=$cross_prefix"

fi

Also after this options are added to $qemu_opts based on what architecture you are compiling for. For now you only see x86-64 & i386. But this is about to change .. if I can ever get this patch in :-)

Also it becomes even more complicated with the next version of the patch I'll be sending out in out.

Quoted 6 lines

Regards,

Anthony Liguori

Quoted 9 lines

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
kvm-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/

#17 lore raw
Quoted 51 lines · Jerone Young
Quoted 37 lines · Anthony Liguori
Quoted 35 lines · Jerone Young
Quoted 14 lines · Anthony Liguori
Quoted 14 lines
(quoted diff) +8 -2
+fi
+
+qemudir=`pwd`/qemu
+
+#configure user dir
+(cd user; ./configure --prefix="$prefix" --kerneldir="$libkvm_kerneldir" \
+          $user_opts --arch="$arch")
+(cd qemu; ./configure --target-list=$target_exec \
     --disable-kqemu --extra-cflags="-I $PWD/../user" \
     --extra-ldflags="-L $PWD/../user" \
     --enable-kvm --kernel-path="$libkvm_kerneldir" \
-    --enable-alsa \
     ${disable_gcc_check:+"--disable-gcc-check"} \
-    --prefix="$prefix"
Quoted 10 lines

Review

Quoted 5 lines
(quoted diff) +2 -0
+    --prefix="$prefix" \
+    $qemu_opts --cpu="$arch"

I don't think this is right. You're using two different --cpu options for i386 and x86_64. There really shouldn't be a --cpu option at all for x86.

So the --cpu option is actually a hidden option in qemu & is not on the qemu help page .. who know why it isn't but the it's in the code.

It makes since though that if you are going to specify cross-prefix= then there is little reason to specify the cpu on the qemu line. As it should detect everything from cross compiler.

Quoted 7 lines
Quoted 3 lines

I'll test this out and send a new patch with the 2 changes.

So, instead of doing the funky $qemu_opts thing, why not just do:

${cross_prefix:+"--cross-prefix=${cross_prefix} --cpu=${arch}"}

Well you could but what I need to is satisfy the situation that if you have --qemu-cc specified that it not use it. I'm not sure how you do this in one line in bash. So I have

Quoted 6 lines

if [[ -z $cross_prefix ]]; then

	  qemu_opts+=" --cc=$cc"
else
	  qemu_opts+=" --cross-prefix=$cross_prefix"

fi

Unconditionally passing --cc to qemu seems like a bad idea to me. I think what you really want is:

	${cross_prefix:+"--cross-prefix=${cross_prefix} --cpu=${arch}"} \
	${qemu_cc:+"--cc=${qemu_cc}"}

QEMU doesn't perform the same checks if you explicitly pass --cc so if you do this unconditionally, it will do ugly things like try to use gcc4 instead of finding gcc3.2

Regards,

Anthony Liguori

Quoted 4 lines

Also after this options are added to $qemu_opts based on what architecture you are compiling for. For now you only see x86-64 & i386. But this is about to change .. if I can ever get this patch in :-)

Quoted 24 lines

Also it becomes even more complicated with the next version of the patch I'll be sending out in out.

Quoted 15 lines

Regards,

Anthony Liguori

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
kvm-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/