building with gcc-aarch64-linux-gnu
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
QEMU |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Hi, while trying to build qemu v2.8.0 with gcc-aarch64-
In file included from /usr/include/
/root/qemu/
/root/qemu/
ret = syscall(
/root/qemu/
/root/qemu/
make: *** [util/compatfd.o] Error 1
I had configured it with :
../configure --target-
And I'm on :
Linux ubuntu-
Thanks
On 20 January 2017 at 15:21, Bilal Amarni <email address hidden> wrote: linux-gnu cross- x86_64- linux-gnu/ sys/syscall. h:31:0, util/compatfd. c:21: util/compatfd. c: In function 'qemu_signalfd': util/compatfd. c:103:19: error: '__NR_signalfd' undeclared (first use in this function) SYS_signalfd, -1, mask, _NSIG / 8); util/compatfd. c:103:19: note: each undeclared identifier is reported only once for each function it appears in rules.mak: 59: recipe for target 'util/compatfd.o' failed
> Hi, while trying to build qemu v2.8.0 with gcc-aarch64-
> compiler I'm getting the following :
>
>
> In file included from /usr/include/
> from /root/qemu/
> /root/qemu/
> /root/qemu/
> ret = syscall(
> ^
> /root/qemu/
> /root/qemu/
> make: *** [util/compatfd.o] Error 1
You can see from the error message that the compile has x86_64- linux-gnu/ sys/syscall. h
pulled in the include file /usr/include/
from the host, which is the x86-64 version. This is an
indication that either your cross compiler is broken, or
you're not using it at all.
> ../configure --target- list=x86_ 64-linux- user --static --cpu=aarch64
You haven't told configure to use a cross compiler at all,
so it is building with the x86 system compiler, which
doesn't work. You shouldn't need to use the --cpu argument
at all, because if you get the build to use the right
compiler it can figure that out itself. (Passing --cpu=aarch64
tells configure "ignore the fact this is an x86 compiler
and assume it's aarch64 instead", which just results in
things breaking because that assumption is wrong.)
You need to pass configure --cross- prefix= aarch64- linux-gnu- linux-gnu- pkg-config
You'll also need to ensure you have an aarch64-
and that you have cross versions of all QEMU's library
dependencies (notably zlib and glib) in the right place that
your cross-compiler can find them, and that your cross
pkg-config is set up to point to them.
On Ubuntu, you may find it easier to set up a cross-architecture
chroot and do the build in that (where it looks like a native
build). Cross-compilation of software with non-trivial
dependencies is always an enormous pain in the neck.
thanks
-- PMM