qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] qemu: fix out of tree cross compile


From: Alexey Kardashevskiy
Subject: Re: [Qemu-devel] [PATCH] qemu: fix out of tree cross compile
Date: Tue, 28 May 2013 00:11:02 +1000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130402 Thunderbird/17.0.5

On 05/27/2013 08:24 PM, Peter Maydell wrote:
> On 27 May 2013 07:13, Alexey Kardashevskiy <address@hidden> wrote:
>> QEMU uses headers from source directory, however the "asm" symlink was
>> created in the build directory what broke KVM stuff compilation.
>>
>> Signed-off-by: Alexey Kardashevskiy <address@hidden>
>> ---
>>  configure |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/configure b/configure
>> index 5ae7e4a..9c3c5e5 100755
>> --- a/configure
>> +++ b/configure
>> @@ -4135,7 +4135,7 @@ if test "$linux" = "yes" ; then
>>    esac
>>      # For non-KVM architectures we will not have asm headers
>>      if [ -e "$source_path/linux-headers/asm-$linux_arch" ]; then
>> -      symlink "$source_path/linux-headers/asm-$linux_arch" linux-headers/asm
>> +      symlink "$source_path/linux-headers/asm-$linux_arch" 
>> $source_path/linux-headers/asm
> 
> This is definitely wrong -- the asm symlink must be created
> in the build tree, because you could have two build trees
> which are building for different architectures and need
> different symlink targets. (More generally, an out of tree
> build should never create files in the source tree, because
> the point of out of tree builds is to leave the source tree
> in a pristine state.)

Ok, ok. Then I'll post another patch in a a response to this.

> What is the actual bug here? QEMU builds fine for me, because
> the build directory is also in the include path via "-I.".

Does you build directory beside inside the source tree directory? I cannot
see the other way for it to work. -I <blabla>/linux-headers must be added,
"-I." is not enough.

The actual bug is that it does not cross compile until I apply this or the
other patch.

This is how I run ./configure:
/home/alexey/pcipassthru/qemu-impreza/configure
--source-path=/home/alexey/pcipassthru/qemu-impreza
--target-list=ppc64-softmmu
--cpu=ppc64
--cross-prefix=powerpc64-linux-
--prefix=/home/alexey/pcipassthru/lib4qemu/install
--extra-ldflags=-L/home/alexey/pcipassthru/lib4qemu/usr/lib64
'--extra-cflags=--sysroot=/home/alexey/pcipassthru/lib4qemu/
-I/home/alexey/pcipassthru/lib4qemu/usr/include -D__EXCEPTIONS
-D__LONG_DOUBLE_128__ -D__NO_INLINE__ -Wno-redundant-decls
-Wno-missing-prototypes -Wmissing-include-dirs'
--disable-werror
--enable-fdt
--enable-attr
--enable-kvm
--enable-profiler
--disable-seccomp
--enable-trace-backend=stderr
--enable-debug
--disable-debug-tcg
--enable-debug-info

This is where the compilation fails on:
powerpc64-linux-gcc \
-I/home/alexey/pcipassthru/qemu-impreza/tcg
-I/home/alexey/pcipassthru/qemu-impreza/tcg/ppc64
-I/home/alexey/pcipassthru/qemu-impreza/linux-headers
-I.
-I/home/alexey/pcipassthru/qemu-impreza
-I/home/alexey/pcipassthru/qemu-impreza/include
-I/home/alexey/pcipassthru/qemu-impreza/target-ppc
-Itarget-ppc
-D_GNU_SOURCE
-D_FILE_OFFSET_BITS=64
-D_LARGEFILE_SOURCE
-Wstrict-prototypes
-Wredundant-decls -Wall
-Wundef
-Wwrite-strings
-Wmissing-prototypes
-fno-strict-aliasing
--sysroot=/home/alexey/pcipassthru/lib4qemu/
-I/home/alexey/pcipassthru/lib4qemu/usr/include
-D__EXCEPTIONS -D__LONG_DOUBLE_128__ -D__NO_INLINE__
-Wno-redundant-decls -Wno-missing-prototypes
-Wmissing-include-dirs  -Wendif-labels
-Wmissing-include-dirs -Wempty-body
-Wnested-externs -Wformat-security
-Wformat-y2k -Winit-self -Wignored-qualifiers
-Wold-style-declaration -Wold-style-definition
-Wtype-limits
-I/home/alexey/pcipassthru/lib4qemu/usr/include
-I/home/alexey/pcipassthru/lib4qemu/usr/include/p11-kit-1
-I/home/alexey/pcipassthru/lib4qemu/usr/include
-I/home/alexey/pcipassthru/lib4qemu/usr/include/libusb-1.0
-I/home/alexey/pcipassthru/lib4qemu/usr/include
-I/home/alexey/pcipassthru/lib4qemu/usr/include/pixman-1
-I../linux-headers
-I..
-I/home/alexey/pcipassthru/qemu-impreza/target-ppc
-DNEED_CPU_H
-I/home/alexey/pcipassthru/qemu-impreza/include
-pthread
-I/home/alexey/pcipassthru/lib4qemu/usr/include/glib-2.0
-I/home/alexey/pcipassthru/lib4qemu/usr/lib64/glib-2.0/include
-MMD -MP -MT target-ppc/kvm.o -MF target-ppc/kvm.d -g
-I/home/alexey/pcipassthru/lib4qemu/usr/include -c
-o target-ppc/kvm.o
/home/alexey/pcipassthru/qemu-impreza/target-ppc/kvm.c
/home/alexey/pcipassthru/qemu-impreza/hw/ppc/xics.c: In function
'icp_get_kvm_state':
/home/alexey/pcipassthru/qemu-impreza/hw/ppc/xics.c:186:15: error:
'KVM_REG_PPC_ICP_STATE' undeclared (first use in this function)
         .id = KVM_REG_PPC_ICP_STATE,
               ^
...




-- 
Alexey



reply via email to

[Prev in Thread] Current Thread [Next in Thread]