qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [Bug 1658120] [NEW] building with gcc-aarch64-linux-gnu
@ 2017-01-20 15:21 Bilal Amarni
  2017-01-20 15:47 ` Peter Maydell
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Bilal Amarni @ 2017-01-20 15:21 UTC (permalink / raw)
  To: qemu-devel

Public bug reported:

Hi, while trying to build qemu v2.8.0 with gcc-aarch64-linux-gnu cross-
compiler I'm getting the following :


In file included from /usr/include/x86_64-linux-gnu/sys/syscall.h:31:0,
                 from /root/qemu/util/compatfd.c:21:
/root/qemu/util/compatfd.c: In function 'qemu_signalfd':
/root/qemu/util/compatfd.c:103:19: error: '__NR_signalfd' undeclared (first use in this function)
     ret = syscall(SYS_signalfd, -1, mask, _NSIG / 8);
                   ^
/root/qemu/util/compatfd.c:103:19: note: each undeclared identifier is reported only once for each function it appears in
/root/qemu/rules.mak:59: recipe for target 'util/compatfd.o' failed
make: *** [util/compatfd.o] Error 1


I had configured it with :

../configure --target-list=x86_64-linux-user --static --cpu=aarch64

And I'm on :

Linux ubuntu-512mb-fra1-01 4.4.0-59-generic #80-Ubuntu SMP Fri Jan 6
17:47:47 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

Thanks

** Affects: qemu
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1658120

Title:
  building with gcc-aarch64-linux-gnu

Status in QEMU:
  New

Bug description:
  Hi, while trying to build qemu v2.8.0 with gcc-aarch64-linux-gnu
  cross-compiler I'm getting the following :

  
  In file included from /usr/include/x86_64-linux-gnu/sys/syscall.h:31:0,
                   from /root/qemu/util/compatfd.c:21:
  /root/qemu/util/compatfd.c: In function 'qemu_signalfd':
  /root/qemu/util/compatfd.c:103:19: error: '__NR_signalfd' undeclared (first use in this function)
       ret = syscall(SYS_signalfd, -1, mask, _NSIG / 8);
                     ^
  /root/qemu/util/compatfd.c:103:19: note: each undeclared identifier is reported only once for each function it appears in
  /root/qemu/rules.mak:59: recipe for target 'util/compatfd.o' failed
  make: *** [util/compatfd.o] Error 1

  
  I had configured it with :

  ../configure --target-list=x86_64-linux-user --static --cpu=aarch64

  And I'm on :

  Linux ubuntu-512mb-fra1-01 4.4.0-59-generic #80-Ubuntu SMP Fri Jan 6
  17:47:47 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

  Thanks

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1658120/+subscriptions

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

* Re: [Qemu-devel] [Bug 1658120] [NEW] building with gcc-aarch64-linux-gnu
  2017-01-20 15:21 [Qemu-devel] [Bug 1658120] [NEW] building with gcc-aarch64-linux-gnu Bilal Amarni
@ 2017-01-20 15:47 ` Peter Maydell
  2017-01-20 15:50 ` Alex Bennée
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Peter Maydell @ 2017-01-20 15:47 UTC (permalink / raw)
  To: Bug 1658120; +Cc: QEMU Developers

On 20 January 2017 at 15:21, Bilal Amarni <1658120@bugs.launchpad.net> wrote:
> Hi, while trying to build qemu v2.8.0 with gcc-aarch64-linux-gnu cross-
> compiler I'm getting the following :
>
>
> In file included from /usr/include/x86_64-linux-gnu/sys/syscall.h:31:0,
>                  from /root/qemu/util/compatfd.c:21:
> /root/qemu/util/compatfd.c: In function 'qemu_signalfd':
> /root/qemu/util/compatfd.c:103:19: error: '__NR_signalfd' undeclared (first use in this function)
>      ret = syscall(SYS_signalfd, -1, mask, _NSIG / 8);
>                    ^
> /root/qemu/util/compatfd.c:103:19: note: each undeclared identifier is reported only once for each function it appears in
> /root/qemu/rules.mak:59: recipe for target 'util/compatfd.o' failed
> make: *** [util/compatfd.o] Error 1

You can see from the error message that the compile has
pulled in the include file /usr/include/x86_64-linux-gnu/sys/syscall.h
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-
You'll also need to ensure you have an aarch64-linux-gnu-pkg-config
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

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

* Re: [Qemu-devel] [Bug 1658120] [NEW] building with gcc-aarch64-linux-gnu
  2017-01-20 15:21 [Qemu-devel] [Bug 1658120] [NEW] building with gcc-aarch64-linux-gnu Bilal Amarni
  2017-01-20 15:47 ` Peter Maydell
@ 2017-01-20 15:50 ` Alex Bennée
  2017-01-21 13:14 ` [Qemu-devel] [Bug 1658120] " Bilal Amarni
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Alex Bennée @ 2017-01-20 15:50 UTC (permalink / raw)
  To: Bug 1658120; +Cc: qemu-devel


Bilal Amarni <1658120@bugs.launchpad.net> writes:

> Public bug reported:
>
> Hi, while trying to build qemu v2.8.0 with gcc-aarch64-linux-gnu cross-
> compiler I'm getting the following :
>
>
> In file included from /usr/include/x86_64-linux-gnu/sys/syscall.h:31:0,
>                  from /root/qemu/util/compatfd.c:21:
> /root/qemu/util/compatfd.c: In function 'qemu_signalfd':
> /root/qemu/util/compatfd.c:103:19: error: '__NR_signalfd' undeclared (first use in this function)
>      ret = syscall(SYS_signalfd, -1, mask, _NSIG / 8);
>                    ^
> /root/qemu/util/compatfd.c:103:19: note: each undeclared identifier is reported only once for each function it appears in
> /root/qemu/rules.mak:59: recipe for target 'util/compatfd.o' failed
> make: *** [util/compatfd.o] Error 1
>
>
> I had configured it with :
>
> ../configure --target-list=x86_64-linux-user --static --cpu=aarch64
>
> And I'm on :
>
> Linux ubuntu-512mb-fra1-01 4.4.0-59-generic #80-Ubuntu SMP Fri Jan 6
> 17:47:47 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

Do you have:

/usr/include/aarch64-linux-gnu/bits/syscall.h

In your system?

When cross compiling it is these sort of problems come from not having
the architecture specific development files. On Ubuntu you want
something like:

  apt-get build-dep -a arm64 qemu

--
Alex Bennée

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

* [Qemu-devel] [Bug 1658120] Re: building with gcc-aarch64-linux-gnu
  2017-01-20 15:21 [Qemu-devel] [Bug 1658120] [NEW] building with gcc-aarch64-linux-gnu Bilal Amarni
  2017-01-20 15:47 ` Peter Maydell
  2017-01-20 15:50 ` Alex Bennée
@ 2017-01-21 13:14 ` Bilal Amarni
  2017-01-21 13:15 ` Bilal Amarni
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Bilal Amarni @ 2017-01-21 13:14 UTC (permalink / raw)
  To: qemu-devel

Thanks for your replies,

I've managed to compile it using a chroot as suggested by Peter. I just
grabbed a pre-built rootfs from here : https://wiki.debian.org/Arm64Port
#Pre-built_Rootfses, then installed qemu-user-static with apt-get and
run the build from the chroot.

Somehow "apt-get build-dep -a arm64 qemu" didn't work, I had tried to do
"dpkg --add-architecture arm64 && apt-get update" before running this
command but it couldn't find the needed packages, not sure why.

In any case thanks for your help :)

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1658120

Title:
  building with gcc-aarch64-linux-gnu

Status in QEMU:
  Invalid

Bug description:
  Hi, while trying to build qemu v2.8.0 with gcc-aarch64-linux-gnu
  cross-compiler I'm getting the following :

  
  In file included from /usr/include/x86_64-linux-gnu/sys/syscall.h:31:0,
                   from /root/qemu/util/compatfd.c:21:
  /root/qemu/util/compatfd.c: In function 'qemu_signalfd':
  /root/qemu/util/compatfd.c:103:19: error: '__NR_signalfd' undeclared (first use in this function)
       ret = syscall(SYS_signalfd, -1, mask, _NSIG / 8);
                     ^
  /root/qemu/util/compatfd.c:103:19: note: each undeclared identifier is reported only once for each function it appears in
  /root/qemu/rules.mak:59: recipe for target 'util/compatfd.o' failed
  make: *** [util/compatfd.o] Error 1

  
  I had configured it with :

  ../configure --target-list=x86_64-linux-user --static --cpu=aarch64

  And I'm on :

  Linux ubuntu-512mb-fra1-01 4.4.0-59-generic #80-Ubuntu SMP Fri Jan 6
  17:47:47 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

  Thanks

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1658120/+subscriptions

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

* [Qemu-devel] [Bug 1658120] Re: building with gcc-aarch64-linux-gnu
  2017-01-20 15:21 [Qemu-devel] [Bug 1658120] [NEW] building with gcc-aarch64-linux-gnu Bilal Amarni
                   ` (2 preceding siblings ...)
  2017-01-21 13:14 ` [Qemu-devel] [Bug 1658120] " Bilal Amarni
@ 2017-01-21 13:15 ` Bilal Amarni
  2018-03-07  8:51 ` Cao Van Dong
  2018-03-07  9:37 ` philmd
  5 siblings, 0 replies; 8+ messages in thread
From: Bilal Amarni @ 2017-01-21 13:15 UTC (permalink / raw)
  To: qemu-devel

this was an issue in my setup

** Changed in: qemu
       Status: New => Invalid

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1658120

Title:
  building with gcc-aarch64-linux-gnu

Status in QEMU:
  Invalid

Bug description:
  Hi, while trying to build qemu v2.8.0 with gcc-aarch64-linux-gnu
  cross-compiler I'm getting the following :

  
  In file included from /usr/include/x86_64-linux-gnu/sys/syscall.h:31:0,
                   from /root/qemu/util/compatfd.c:21:
  /root/qemu/util/compatfd.c: In function 'qemu_signalfd':
  /root/qemu/util/compatfd.c:103:19: error: '__NR_signalfd' undeclared (first use in this function)
       ret = syscall(SYS_signalfd, -1, mask, _NSIG / 8);
                     ^
  /root/qemu/util/compatfd.c:103:19: note: each undeclared identifier is reported only once for each function it appears in
  /root/qemu/rules.mak:59: recipe for target 'util/compatfd.o' failed
  make: *** [util/compatfd.o] Error 1

  
  I had configured it with :

  ../configure --target-list=x86_64-linux-user --static --cpu=aarch64

  And I'm on :

  Linux ubuntu-512mb-fra1-01 4.4.0-59-generic #80-Ubuntu SMP Fri Jan 6
  17:47:47 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

  Thanks

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1658120/+subscriptions

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

* [Qemu-devel] [Bug 1658120] Re: building with gcc-aarch64-linux-gnu
  2017-01-20 15:21 [Qemu-devel] [Bug 1658120] [NEW] building with gcc-aarch64-linux-gnu Bilal Amarni
                   ` (3 preceding siblings ...)
  2017-01-21 13:15 ` Bilal Amarni
@ 2018-03-07  8:51 ` Cao Van Dong
  2018-03-07  9:51   ` Alex Bennée
  2018-03-07  9:37 ` philmd
  5 siblings, 1 reply; 8+ messages in thread
From: Cao Van Dong @ 2018-03-07  8:51 UTC (permalink / raw)
  To: qemu-devel

Hello everyone!!

I am having a issue when build qemu using gcc aarch64-linux-gnu-* on
ubuntu 16.04:

dong02@dong:~/qemu$ ./configure                                                  \
>     --prefix=/usr --cross-prefix=/usr/bin/aarch64-linux-gnu-   \
>     --target-list=aarch64-softmmu                              \
>     --enable-attr       --enable-fdt       --enable-kvm        \
>     --enable-sdl        --enable-system    --enable-tools      \
>     --audio-drv-list=                                          \
>     --disable-bluez     --disable-brlapi   --disable-bsd-user  \
>     --disable-cap-ng    --disable-curl     --disable-curses    \
>     --disable-docs      --disable-libiscsi --disable-linux-aio \
>     --disable-rbd       --disable-seccomp  --disable-slirp     \
>     --disable-sparse    --disable-spice    --disable-strip     \
>     --disable-usb-redir --disable-vde      --disable-virtfs    \
>     --disable-vnc       --disable-werror   --disable-xen

ERROR: zlib check failed
       Make sure to have the zlib libs and headers installed.

I installed zlib library: sudo apt-get install zlib1g-dev. However, result no change
Please help me!!

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1658120

Title:
  building with gcc-aarch64-linux-gnu

Status in QEMU:
  Invalid

Bug description:
  Hi, while trying to build qemu v2.8.0 with gcc-aarch64-linux-gnu
  cross-compiler I'm getting the following :

  
  In file included from /usr/include/x86_64-linux-gnu/sys/syscall.h:31:0,
                   from /root/qemu/util/compatfd.c:21:
  /root/qemu/util/compatfd.c: In function 'qemu_signalfd':
  /root/qemu/util/compatfd.c:103:19: error: '__NR_signalfd' undeclared (first use in this function)
       ret = syscall(SYS_signalfd, -1, mask, _NSIG / 8);
                     ^
  /root/qemu/util/compatfd.c:103:19: note: each undeclared identifier is reported only once for each function it appears in
  /root/qemu/rules.mak:59: recipe for target 'util/compatfd.o' failed
  make: *** [util/compatfd.o] Error 1

  
  I had configured it with :

  ../configure --target-list=x86_64-linux-user --static --cpu=aarch64

  And I'm on :

  Linux ubuntu-512mb-fra1-01 4.4.0-59-generic #80-Ubuntu SMP Fri Jan 6
  17:47:47 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

  Thanks

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1658120/+subscriptions

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

* [Qemu-devel] [Bug 1658120] Re: building with gcc-aarch64-linux-gnu
  2017-01-20 15:21 [Qemu-devel] [Bug 1658120] [NEW] building with gcc-aarch64-linux-gnu Bilal Amarni
                   ` (4 preceding siblings ...)
  2018-03-07  8:51 ` Cao Van Dong
@ 2018-03-07  9:37 ` philmd
  5 siblings, 0 replies; 8+ messages in thread
From: philmd @ 2018-03-07  9:37 UTC (permalink / raw)
  To: qemu-devel

Hi Cao Van Dong,

you need to install zlib1g-dev:arm64, see:

https://github.com/qemu/qemu/blob/master/tests/docker/dockerfiles
/debian-arm64-cross.docker

Regards,

Phil.

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1658120

Title:
  building with gcc-aarch64-linux-gnu

Status in QEMU:
  Invalid

Bug description:
  Hi, while trying to build qemu v2.8.0 with gcc-aarch64-linux-gnu
  cross-compiler I'm getting the following :

  
  In file included from /usr/include/x86_64-linux-gnu/sys/syscall.h:31:0,
                   from /root/qemu/util/compatfd.c:21:
  /root/qemu/util/compatfd.c: In function 'qemu_signalfd':
  /root/qemu/util/compatfd.c:103:19: error: '__NR_signalfd' undeclared (first use in this function)
       ret = syscall(SYS_signalfd, -1, mask, _NSIG / 8);
                     ^
  /root/qemu/util/compatfd.c:103:19: note: each undeclared identifier is reported only once for each function it appears in
  /root/qemu/rules.mak:59: recipe for target 'util/compatfd.o' failed
  make: *** [util/compatfd.o] Error 1

  
  I had configured it with :

  ../configure --target-list=x86_64-linux-user --static --cpu=aarch64

  And I'm on :

  Linux ubuntu-512mb-fra1-01 4.4.0-59-generic #80-Ubuntu SMP Fri Jan 6
  17:47:47 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

  Thanks

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1658120/+subscriptions

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

* Re: [Qemu-devel] [Bug 1658120] Re: building with gcc-aarch64-linux-gnu
  2018-03-07  8:51 ` Cao Van Dong
@ 2018-03-07  9:51   ` Alex Bennée
  0 siblings, 0 replies; 8+ messages in thread
From: Alex Bennée @ 2018-03-07  9:51 UTC (permalink / raw)
  To: Bug 1658120; +Cc: qemu-devel


Cao Van Dong <1658120@bugs.launchpad.net> writes:

> Hello everyone!!
>
> I am having a issue when build qemu using gcc aarch64-linux-gnu-* on
> ubuntu 16.04:
>
> dong02@dong:~/qemu$ ./configure                                                  \
>>     --prefix=/usr --cross-prefix=/usr/bin/aarch64-linux-gnu-   \
>>     --target-list=aarch64-softmmu                              \
>>     --enable-attr       --enable-fdt       --enable-kvm        \
>>     --enable-sdl        --enable-system    --enable-tools      \
>>     --audio-drv-list=                                          \
>>     --disable-bluez     --disable-brlapi   --disable-bsd-user  \
>>     --disable-cap-ng    --disable-curl     --disable-curses    \
>>     --disable-docs      --disable-libiscsi --disable-linux-aio \
>>     --disable-rbd       --disable-seccomp  --disable-slirp     \
>>     --disable-sparse    --disable-spice    --disable-strip     \
>>     --disable-usb-redir --disable-vde      --disable-virtfs    \
>>     --disable-vnc       --disable-werror   --disable-xen
>
> ERROR: zlib check failed
>        Make sure to have the zlib libs and headers installed.
>
> I installed zlib library: sudo apt-get install zlib1g-dev. However, result no change
> Please help me!!

You will have installed the x86 version of the zlib1g-dev libraries.
Unfortunately headers are not uniform across all architectures.

If you want to ensure you have all the appropriate headers for cross
compiling QEMU do:

  apt-get build-dep -a arm64 qemu

But you may well run into problems if the distribution isn't fully
multi-arch clean. This is one of the reasons we use docker to isolate
our various cross build environments:

  make docker-test-build@debian-arm64-cross J=9 TARGET_LIST=aarch64-softmmu

--
Alex Bennée

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

end of thread, other threads:[~2018-03-07  9:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-20 15:21 [Qemu-devel] [Bug 1658120] [NEW] building with gcc-aarch64-linux-gnu Bilal Amarni
2017-01-20 15:47 ` Peter Maydell
2017-01-20 15:50 ` Alex Bennée
2017-01-21 13:14 ` [Qemu-devel] [Bug 1658120] " Bilal Amarni
2017-01-21 13:15 ` Bilal Amarni
2018-03-07  8:51 ` Cao Van Dong
2018-03-07  9:51   ` Alex Bennée
2018-03-07  9:37 ` philmd

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).