Hello Everyone,
I am reposting the following message to linaro-dev as I am using the following linaro toolchain for ARM64 cross-compilation: https://wiki.linaro.org/HowTo/BuildArm64Kernel
In fact, I am trying to compile qemu for Aarch64 but so far I haven't been able to configure qemu for this purpose. My first objective is to just configure and cross-compile qemu for Aarch64, which is currently blocked by the qemu's dependency on cross-compiled "glib-2.12" or later. For example, when I use the following configure command:
./configure --cross-prefix=aarch64-linux-gnu- --target-list=arm-softmmu --enable-fdt --static
I get the following error: ERROR: glib-2.12 required to compile QEMU
This is a well-known dependency and the following pages are linked to this issue (directly or indirectly) and I have tried all of them without any success:
https://bugs.launchpad.net/linaro-oe/+bug/1097561 http://people.debian.org/~wookey/bootstrap.html http://wiki.xen.org/wiki/Xen_ARM_with_Virtualization_Extensions/CrossCompili... https://wiki.linaro.org/Platform/DevPlatform/CrossCompile/arm64bootstrap
I have also tried the latest git repository from John Rigby but I get the same error: https://git.linaro.org/gitweb?p=people/jcrigby/qemu-aarch64.git%3Ba=summary
Anyways, I want to know how we can resolve this dependency ?
Some of you might suggest to cross-compile the glib-2.12 from sources found at: http://www.linuxfromscratch.org/blfs/view/6.3/general/glib2.html http://www.gtk.org/api/2.6/glib/glib-cross-compiling.html
but even this option doesn't work for me as the apparent lacking support for Aarch64 in "glib-2.12". I have used the following configure command: ./configure --prefix=/my/prefix/path --host=aarch64-linux-gnu --cache-file=aarch64.cache
with the following aarch64.cache file contents:
glib_cv_long_long_format=I64 glib_cv_stack_grows=no
Any pointers and/or directions for a possible solution will be highly appreciated.
Thanks in advance, Hamayun
On Thu, 16 May 2013 14:25:07 +0200 "Mian M. Hamayun" m.hamayun@virtualopensystems.com wrote:
but even this option doesn't work for me as the apparent lacking support for Aarch64 in "glib-2.12". I have used the following configure command: ./configure --prefix=/my/prefix/path --host=aarch64-linux-gnu --cache-file=aarch64.cache
Current dpkg-cross has a cross-config cache file for Aarch64 (arm64) but you also need to specify the --build triplet or some packages won't detect the cross-compilation.
The dpkg-cross config file is best handled as an environment variable:
http://wiki.debian.org/CrossBuildPackagingGuidelines
CONFIG_SITE=/etc/dpkg-cross/cross-config.$DEB_HOST_ARCH so CONFIG_SITE=/etc/dpkg-cross/cross-config.arm64
If you think there are other values not listed in the dpkg-cross files, please file a bug against the package in Debian, but start with the existing cache values. If those do not work, try *extending* the cache list.
with the following aarch64.cache file contents:
glib_cv_long_long_format=I64 glib_cv_stack_grows=no
That is almost certainly too short. The cache file needs to specify all necessary values for the entire cross-build.
+++ Mian M. Hamayun [2013-05-16 14:25 +0200]:
Hello Everyone,
I am reposting the following message to linaro-dev as I am using the following linaro toolchain for ARM64 cross-compilation: https://wiki.linaro.org/HowTo/BuildArm64Kernel
In fact, I am trying to compile qemu for Aarch64 but so far I haven't been able to configure qemu for this purpose.
I didn't think qemu had aarch64 support. Has that been done now?
Do you have a pointer to the sources so you are using so I can try it myself?
You mention this as something you tried second: ssh://git.linaro.org/srv/git.linaro.org/git/people/jcrigby/qemu-aarch64.git
I'll have a go with that.
My first objective is to just configure and cross-compile qemu for Aarch64, which is currently blocked by the qemu's dependency on cross-compiled "glib-2.12" or later. For example, when I use the following configure command:
./configure --cross-prefix=aarch64-linux-gnu- --target-list=arm-softmmu --enable-fdt --static
I get the following error: ERROR: glib-2.12 required to compile QEMU
This is a well-known dependency and the following pages are linked to this issue (directly or indirectly) and I have tried all of them without any success:
https://bugs.launchpad.net/linaro-oe/+bug/1097561 http://people.debian.org/~wookey/bootstrap.html http://wiki.xen.org/wiki/Xen_ARM_with_Virtualization_Extensions/CrossCompili... https://wiki.linaro.org/Platform/DevPlatform/CrossCompile/arm64bootstrap
Well, there is an arm64 glib2.0 in my repo, so that's a good start: http://people.debian.org/~wookey/bootstrap/ubunturepo/pool/main/g/glib2.0/
Making qemu easily cross-compilable is on my list anyway so lets have a look. Checking the debian package I find a build-deps list as long as your arm:
Build-Depends: debhelper (>= 9), # In comments below we also specify (system-specific) arguments # to qemu's configure script, -- optional features which depend # on build-dependencies. # pc-bios/*.dts => *.dtb (PPC firmware) device-tree-compiler, texi2html, texinfo, python, # --enable-linux-aio linux-* libaio-dev [linux-any], # --audio-drv-list=pa,alsa,sdl,oss linux-* # --audio-drv-list=pa,oss,sdl kfreebsd-* libasound2-dev [linux-any], # for virtfs # --enable-attr libattr1-dev, # --enable-bluez linux-* libbluetooth-dev [linux-any], # --enable-brlapi libbrlapi-dev, # --enable-virtfs linux-* # needed for virtfs libcap-dev [linux-any], # --enable-cap-ng linux-* libcap-ng-dev [linux-any], # --enable-curl libcurl4-gnutls-dev, # --enable-fdt libfdt-dev, # --enable-vnc-tls # --enable-vnc-ws libgnutls-dev, # --enable-curses libncurses5-dev, # --with-system-pixman libpixman-1-dev, # audio-drv-list += pa libpulse-dev, # --enable-vnc-sasl libsasl2-dev, # --enable-sdl libsdl1.2-dev (>> 1.2.1), # --enable-seccomp linux-amd64|linux-i386 libseccomp-dev (>> 1.0.0) [linux-amd64 linux-i386], # --enable-spice linux-amd64|linux-i386 libspice-server-dev (>= 0.12.2~) [linux-amd64 linux-i386], # needed for sdl libx11-dev, # --enable-xen linux-amd64|linux-i386 libxen-dev [linux-amd64 linux-i386], # XXX need to check minimum linux-headers requiriment linux-libc-dev (>= 2.6.34) [linux-any], # --enable-uuid uuid-dev, # --enable-xfsctl linux-* xfslibs-dev [linux-any], # always needed zlib1g-dev, # other optional features we enable # --enable-vnc # --enable-vnc-png # --enable-kvm linux-* # --enable-vhost-net linux-* # is it really linux-specific? ##--enable-glusterfs todo # --enable-rbd librados-dev, librbd-dev, Build-Conflicts: oss4-dev
But at least helpfully commented about options. Which parts of that do you need? Will 'really basic' do?
Anyways, I want to know how we can resolve this dependency ?
Ideally you'd be able to do apt-get install libglib2.0-dev:arm64 in a raring chroot (pointing at the arm64 bootstrap/port repo), but I find that there is currently version skew in libpcrecpp0 and libstdc++6
Now that raring has stopped moving it's worth updating these arm64 builds to match and give a stable build base, so I'll do that today and see if things get a bit easier, and get back to you.
Some of you might suggest to cross-compile the glib-2.12 from sources found at:
That shouldn't be necessary - that's been done already.
Wookey
On 17 May 2013 11:11, Wookey wookey@wookware.org wrote:
+++ Mian M. Hamayun [2013-05-16 14:25 +0200]:
I am reposting the following message to linaro-dev as I am using the following linaro toolchain for ARM64 cross-compilation: https://wiki.linaro.org/HowTo/BuildArm64Kernel
In fact, I am trying to compile qemu for Aarch64 but so far I haven't been able to configure qemu for this purpose.
I didn't think qemu had aarch64 support. Has that been done now?
People are trying to add it, which is why this thread started. It's a bit hard to test patches if you can't even configure qemu because its dependencies aren't present in the cross environment.
Do you have a pointer to the sources so you are using so I can try it myself?
You mention this as something you tried second: ssh://git.linaro.org/srv/git.linaro.org/git/people/jcrigby/qemu-aarch64.git
I'll have a go with that.
It is all still work-in-progress. There's also a set of patches from Huawei which add aarch64 host (ie tcg target) support.
Making qemu easily cross-compilable is on my list anyway so lets have a look. Checking the debian package I find a build-deps list as long as your arm:
Most of these are optional if you're just building QEMU from a git source tree, as you note.
But at least helpfully commented about options. Which parts of that do you need? Will 'really basic' do?
The really critical stuff is zlib and glib.
Note that nobody here is asking about "how do I compile the qemu debian package" -- just building from a source tree is all that's needed.
Ideally you'd be able to do apt-get install libglib2.0-dev:arm64 in a raring chroot (pointing at the arm64 bootstrap/port repo), but I find that there is currently version skew in libpcrecpp0 and libstdc++6
Now that raring has stopped moving it's worth updating these arm64 builds to match and give a stable build base, so I'll do that today and see if things get a bit easier, and get back to you.
Thanks, that will help I think.
-- PMM
On 05/17/2013 12:19 PM, Peter Maydell wrote:
On 17 May 2013 11:11, Wookeywookey@wookware.org wrote:
+++ Mian M. Hamayun [2013-05-16 14:25 +0200]:
I am reposting the following message to linaro-dev as I am using the following linaro toolchain for ARM64 cross-compilation: https://wiki.linaro.org/HowTo/BuildArm64Kernel
In fact, I am trying to compile qemu for Aarch64 but so far I haven't been able to configure qemu for this purpose.
I didn't think qemu had aarch64 support. Has that been done now?
People are trying to add it, which is why this thread started. It's a bit hard to test patches if you can't even configure qemu because its dependencies aren't present in the cross environment.
Do you have a pointer to the sources so you are using so I can try it myself?
You mention this as something you tried second: ssh://git.linaro.org/srv/git.linaro.org/git/people/jcrigby/qemu-aarch64.git
I'll have a go with that.
It is all still work-in-progress. There's also a set of patches from Huawei which add aarch64 host (ie tcg target) support.
Making qemu easily cross-compilable is on my list anyway so lets have a look. Checking the debian package I find a build-deps list as long as your arm:
Most of these are optional if you're just building QEMU from a git source tree, as you note.
But at least helpfully commented about options. Which parts of that do you need? Will 'really basic' do?
The really critical stuff is zlib and glib.
Note that nobody here is asking about "how do I compile the qemu debian package" -- just building from a source tree is all that's needed.
Exactly. We are interested in compilation from qemu sources and get the external dependencies resolved. zlib cross-compilation for aarch64 is easy, but its the glib which is causing problems.
Ideally you'd be able to do apt-get install libglib2.0-dev:arm64 in a raring chroot (pointing at the arm64 bootstrap/port repo), but I find that there is currently version skew in libpcrecpp0 and libstdc++6
Now that raring has stopped moving it's worth updating these arm64 builds to match and give a stable build base, so I'll do that today and see if things get a bit easier, and get back to you.
Thanks, that will help I think.
Yes, it will be enough, I hope.
-- PMM
linaro-dev mailing list linaro-dev@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-dev
-- Hamayun
+++ Peter Maydell [2013-05-17 11:19 +0100]:
Making qemu easily cross-compilable is on my list anyway so lets have a look. Checking the debian package I find a build-deps list as long as your arm:
Most of these are optional if you're just building QEMU from a git source tree, as you note.
But at least helpfully commented about options. Which parts of that do you need? Will 'really basic' do?
The really critical stuff is zlib and glib.
Note that nobody here is asking about "how do I compile the qemu debian package" -- just building from a source tree is all that's needed.
Right.
Ideally you'd be able to do apt-get install libglib2.0-dev:arm64 in a raring chroot (pointing at the arm64 bootstrap/port repo), but I find that there is currently version skew in libpcrecpp0 and libstdc++6
Now that raring has stopped moving it's worth updating these arm64 builds to match and give a stable build base, so I'll do that today and see if things get a bit easier, and get back to you.
OK. After I've rebuilt libstdc++6, libffi, libgcc1, libpcre3, and linux-libc-dev (but not eglibc yet) we get to an installable state.
So I followed the instructions on https://wiki.linaro.org/Platform/DevPlatform/CrossCompile/arm64bootstrap to set up a raring chroot.
(And note that the pinning in /etc/apt/preferences.d/bootstrap is still needed until I rebuild eglibc too, which needs a profile patch updating, so I've skipped it for now)
(Stop at 'Use with sbuild' because you are not doing that, but building upstream source directly in the chroot).
Then I entered the chroot with schroot -c raring-amd64-sbuild
and inside did: sudo dpkg --add-architecture arm64 sudo apt-get update sudo apt-get install libglib2.0-dev:arm64 zlib1g-dev:arm64 libpixman-1-dev:arm64 sudo apt-get install crossbuild-essential-arm64 (27MB of stuff) sudo apt-get install python ./configure --target-list=arm-softmmu --cross-prefix=aarch64-linux-gnu-
for that configure to work you need http://patchwork.ozlabs.org/patch/243412/
So that gives a cross-environment that satisfies the qemu configure.
You need other patches from that series for it to actually build, but I'll leave it to you from here :-)
Thanks to Peter Maydell for supplying qemu runes and patches.
Complain if this doesn't get you going.
Notes:
Don't install sbuild inside the chroot - that can break things.
A couple of wiki pages have been updated in this process, but a lot more updating is needed to make this properly easy. I notce that the start page: https://wiki.linaro.org/Platform/DevPlatform/CrossCompile/CrossbuildingQuick... doesn't really cover this case of building 'not-packaged stuff, using multiarch', and clearly it should.
And the page on 'multiarch crossbuilding' is woefully out of date.
If I was being snarky I might point out that this would already have been working and up-to-date when you wanted to use it if people hadn't insisted that this work was not wanted and I should stop. Still, it didn't take long to get going, and fortunately you don't need anything that we haven't built yet.
Wookey
Hi,
First of all, many thanks for your kind support. I have been able to setup a crossbuild chroot environment for aarch64. I can now configure and compile qemu using this environment.
Please find a minor observation inlined below and comment if necessary:
On 05/17/2013 07:16 PM, Wookey wrote:
+++ Peter Maydell [2013-05-17 11:19 +0100]:
Making qemu easily cross-compilable is on my list anyway so lets have a look. Checking the debian package I find a build-deps list as long as your arm:
Most of these are optional if you're just building QEMU from a git source tree, as you note.
But at least helpfully commented about options. Which parts of that do you need? Will 'really basic' do?
The really critical stuff is zlib and glib.
Note that nobody here is asking about "how do I compile the qemu debian package" -- just building from a source tree is all that's needed.
Right.
Ideally you'd be able to do apt-get install libglib2.0-dev:arm64 in a raring chroot (pointing at the arm64 bootstrap/port repo), but I find that there is currently version skew in libpcrecpp0 and libstdc++6
Now that raring has stopped moving it's worth updating these arm64 builds to match and give a stable build base, so I'll do that today and see if things get a bit easier, and get back to you.
OK. After I've rebuilt libstdc++6, libffi, libgcc1, libpcre3, and linux-libc-dev (but not eglibc yet) we get to an installable state.
So I followed the instructions on https://wiki.linaro.org/Platform/DevPlatform/CrossCompile/arm64bootstrap to set up a raring chroot.
(And note that the pinning in /etc/apt/preferences.d/bootstrap is still needed until I rebuild eglibc too, which needs a profile patch updating, so I've skipped it for now)
(Stop at 'Use with sbuild' because you are not doing that, but building upstream source directly in the chroot).
If I stop here and exit the sbuild-shell environment right-away, the following package installations remain temporary. And I have to re-install them after each execution of "schroot -c raring-amd64-sbuild" command. To solve this issue, I donnot exit immediately here and continue with the following installs within the sbuild-shell environment to make these changes 'permanent'.
Then I entered the chroot with schroot -c raring-amd64-sbuild
and inside did: sudo dpkg --add-architecture arm64 sudo apt-get update sudo apt-get install libglib2.0-dev:arm64 zlib1g-dev:arm64 libpixman-1-dev:arm64 sudo apt-get install crossbuild-essential-arm64 (27MB of stuff) sudo apt-get install python ./configure --target-list=arm-softmmu --cross-prefix=aarch64-linux-gnu-
for that configure to work you need http://patchwork.ozlabs.org/patch/243412/
So that gives a cross-environment that satisfies the qemu configure.
You need other patches from that series for it to actually build, but I'll leave it to you from here :-)
thats fine ... :)
Thanks to Peter Maydell for supplying qemu runes and patches.
Complain if this doesn't get you going.
Notes:
Don't install sbuild inside the chroot - that can break things.
A couple of wiki pages have been updated in this process, but a lot more updating is needed to make this properly easy. I notce that the start page: https://wiki.linaro.org/Platform/DevPlatform/CrossCompile/CrossbuildingQuick... doesn't really cover this case of building 'not-packaged stuff, using multiarch', and clearly it should.
And the page on 'multiarch crossbuilding' is woefully out of date.
If I was being snarky I might point out that this would already have been working and up-to-date when you wanted to use it if people hadn't insisted that this work was not wanted and I should stop. Still, it didn't take long to get going, and fortunately you don't need anything that we haven't built yet.
Wookey
Thanks again.
Best Regards, Mian M. Hamayun
On 05/17/2013 07:16 PM, Wookey wrote:
+++ Mian M. Hamayun [2013-05-20 20:13 +0200]:
Hi,
First of all, many thanks for your kind support. I have been able to setup a crossbuild chroot environment for aarch64. I can now configure and compile qemu using this environment.
Excellent.
(Stop at 'Use with sbuild' because you are not doing that, but building upstream source directly in the chroot).
If I stop here and exit the sbuild-shell environment right-away, the following package installations remain temporary. And I have to re-install them after each execution of "schroot -c raring-amd64-sbuild" command.
Yes. If you want to make permanent changes to a (tarball or snapshot) chroot then start it with: sudo schroot -c source:<chrootname> (sbuild-shell is equivalent to this)
If you want changes made in the chroot to be temporary then start it with schroot -c <chrootname>
For your purposes it makes sense to put all the crosstools and (cross)build-deps into the base chroot.
Wookey