From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-trivial@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH] qemu: fix out of tree cross compile
Date: Tue, 28 May 2013 00:11:02 +1000 [thread overview]
Message-ID: <51A36976.80608@ozlabs.ru> (raw)
In-Reply-To: <CAFEAcA_qOtFuVPem2mbK7TmM4rac-ZVmdn8HYRnkHPx5iiPSOg@mail.gmail.com>
On 05/27/2013 08:24 PM, Peter Maydell wrote:
> On 27 May 2013 07:13, Alexey Kardashevskiy <aik@ozlabs.ru> 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 <aik@ozlabs.ru>
>> ---
>> 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
next prev parent reply other threads:[~2013-05-27 14:11 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-27 6:13 [Qemu-trivial] [PATCH] qemu: fix out of tree cross compile Alexey Kardashevskiy
2013-05-27 10:24 ` [Qemu-trivial] [Qemu-devel] " Peter Maydell
2013-05-27 14:11 ` Alexey Kardashevskiy [this message]
2013-05-27 14:12 ` [Qemu-trivial] " Alexey Kardashevskiy
2013-05-27 15:02 ` Paolo Bonzini
2013-05-27 22:59 ` Alexey Kardashevskiy
2013-05-27 23:44 ` [Qemu-trivial] [PATCH v2] " Alexey Kardashevskiy
2013-05-27 23:49 ` [Qemu-trivial] [PATCH v3] " Alexey Kardashevskiy
2013-05-28 8:54 ` Paolo Bonzini
2013-05-28 9:12 ` [Qemu-trivial] [Qemu-devel] " Andreas Färber
2013-05-28 9:21 ` Paolo Bonzini
2013-05-29 13:17 ` Anthony Liguori
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51A36976.80608@ozlabs.ru \
--to=aik@ozlabs.ru \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).