Hi,
I am trying to run Xen on Juno r0 board and while compiling the Xen code getting following error -
make xen XEN_ARCH_TARGET=arm64 debug=y CONFIG_EARLY_PRINTK=juno
make -C xen install
make[1]: Entering directory `/home/nishaj/Xen/xen/xen'
make -f Rules.mk _install
make[2]: Entering directory `/home/nishaj/Xen/xen/xen'
make -C tools
make[3]: Entering directory `/home/nishaj/Xen/xen/xen/tools'
make symbols
make[4]: Entering directory `/home/nishaj/Xen/xen/xen/tools'
make[4]: `symbols' is up to date.
make[4]: Leaving directory `/home/nishaj/Xen/xen/xen/tools'
make[3]: Leaving directory `/home/nishaj/Xen/xen/xen/tools'
make -f /home/nishaj/Xen/xen/xen/Rules.mk include/xen/compile.h
make[3]: Entering directory `/home/nishaj/Xen/xen/xen'
Xen 4.6-unstable
make[3]: Leaving directory `/home/nishaj/Xen/xen/xen'
[ -e include/asm ] || ln -sf asm-x86 include/asm
[ -e arch/x86/efi ] && for f in boot.c runtime.c compat.c efi.h;\
do ln -nsf ../../../common/efi/$f arch/x86/efi/; done;\
true
make -f /home/nishaj/Xen/xen/xen/Rules.mk -C include
make[3]: Entering directory `/home/nishaj/Xen/xen/xen/include'
mkdir -p compat
grep -v 'DEFINE_XEN_GUEST_HANDLE(long)' public/callback.h | \
python /home/nishaj/Xen/xen/xen/tools/compat-build-source.py >compat/callback.c.new
mv -f compat/callback.c.new compat/callback.c
/home/nishaj/gcc-linaro-4.9-2014.11-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc -E -O1 -fno-omit-frame-pointer -m64 -g -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wdeclaration-after-statement -Wno-unused-but-set-variable -Wno-unused-local-typedefs -I/home/nishaj/Xen/xen/xen/include -I/home/nishaj/Xen/xen/xen/include/asm-x86/mach-generic -I/home/nishaj/Xen/xen/xen/include/asm-x86/mach-default -msoft-float -fno-stack-protector -fno-exceptions -Wnested-externs -mno-red-zone -mno-sse -fpic -fno-asynchronous-unwind-tables -DGCC_HAS_VISIBILITY_ATTRIBUTE -fno-builtin -fno-common -Werror -Wredundant-decls -Wno-pointer-arith -pipe -g -D__XEN__ -nostdinc -fno-optimize-sibling-calls -DCONFIG_SHADOW_PAGING -DVERBOSE -DHAS_ACPI -DHAS_GDBSX -DHAS_PASSTHROUGH -DHAS_MEM_ACCESS -DHAS_MEM_PAGING -DHAS_MEM_SHARING -DHAS_PCI -DHAS_IOPORTS -DHAS_PDX -fno-omit-frame-pointer -DCONFIG_FRAME_POINTER -fno-optimize-sibling-calls -O1 -fno-omit-frame-pointer -m64 -g -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wdeclaration-after-statement -Wno-unused-but-set-variable -Wno-unused-local-typedefs -include public/xen-compat.h -m32 -o compat/callback.i compat/callback.c
aarch64-linux-gnu-gcc: error: unrecognized command line option '-m64'
aarch64-linux-gnu-gcc: error: unrecognized command line option '-msoft-float'
aarch64-linux-gnu-gcc: error: unrecognized command line option '-mno-red-zone'
aarch64-linux-gnu-gcc: error: unrecognized command line option '-mno-sse'
aarch64-linux-gnu-gcc: error: unrecognized command line option '-m32'
make[3]: *** [compat/callback.i] Error 1
rm compat/callback.c
make[3]: Leaving directory `/home/nishaj/Xen/xen/xen/include'
make[2]: *** [/home/nishaj/Xen/xen/xen/xen] Error 2
make[2]: Leaving directory `/home/nishaj/Xen/xen/xen'
make[1]: *** [install] Error 2
make[1]: Leaving directory `/home/nishaj/Xen/xen/xen'
make: *** [install-xen] Error 2
Please let me know how to resolve it ?
Thanks.
aarch64-linux-gnu-gcc: error: unrecognized command line option '-m64' aarch64-linux-gnu-gcc: error: unrecognized command line option '-msoft-float' aarch64-linux-gnu-gcc: error: unrecognized command line option '-mno-red-zone' aarch64-linux-gnu-gcc: error: unrecognized command line option '-mno-sse' aarch64-linux-gnu-gcc: error: unrecognized command line option '-m64' aarch64-linux-gnu-gcc: error: unrecognized command line option '-m32'
You're getting these errors because you are passing x86 / x86_64 flags to the aarch64 cross compiler. This suggests you haven't correctly configured Xen / your build system for cross compilation.
I'm able to get it working by following the instructions here to cross compile using sbuild, with a couple of differences:
This is the make invocation used in the linked tutorial, adjusted to target xen rather than dist-tools:
# Update autoconf machinery with versions that know about arm64 (chroot)$ cp /usr/share/misc/config.{sub,guess} . # Configure (chroot)$ CONFIG_SITE=/etc/dpkg-cross/cross-config.arm64 ./configure --build=x86_64-unknown-linux-gnu --host=aarch64-linux-gnu # Cross compile (chroot)$ make dist-tools CROSS_COMPILE=aarch64-linux-gnu- XEN_TARGET_ARCH=arm64
# Update autoconf machinery with versions that know about arm64
(chroot)$ cp /usr/share/misc/config.{sub,guess} .
# Configure
(chroot)$ CONFIG_SITE=/etc/dpkg-cross/cross-config.arm64 ./configure --build=x86_64-unknown-linux-gnu --host=aarch64-linux-gnu
# Cross compile
(chroot)$ make dist-tools CROSS_COMPILE=aarch64-linux-gnu- XEN_TARGET_ARCH=arm64
Note the CROSS_COMPILE=aarch64-linux-gnu- in addition to the XEN_TARGET_ARCH=arm64 (you only have the latter). I recommend you follow the Xen cross compilation instructions here for arm64 and see if that works for you.
Hope that helps,
Ash.
Hi Ash,
I am setting CROSS_COMPILE to gcc-linaro-4.9-2014.11-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu- during compilation apart from XEN_TARGET_ARCH=arm64
Also I tried above but getting following errors -
sbuild-createchroot --components=main,universe saucy /srv/chroots/saucy-armhf-cross http://archive.ubuntu.com/ubuntu/
mkdir /srv/chroots/saucy-armhf-cross
I: SUITE: saucy
I: TARGET: /srv/chroots/saucy-armhf-cross
I: MIRROR: http://archive.ubuntu.com/ubuntu/
I: Running debootstrap --arch=amd64 --variant=buildd --verbose --include=fakeroot,build-essential --components=main,universe --resolve-deps saucy /srv/chroots/saucy-armhf-cross http://archive.ubuntu.com/ubuntu/
I: Retrieving Release
E: Failed getting release file http://archive.ubuntu.com/ubuntu/dists/saucy/Release
E: Error running debootstrap at /usr/sbin/sbuild-createchroot line 200.
I couldn't find libpxman-1-0:arm64 packages while doing apt-get install, do i need chroot working for this ?
Please let me know how to solve it ?
Thanks
Sorry, I forgot to mention that I used trusty rather than saucy. You can see the available distributions for Ubuntu here, and saucy isn't on the list.
And yes, you'll want to be installing libpxman-1-0:arm64 and libpxman-1-dev:arm64 from inside the chroot environment.
I have successfully installed sbuild/schroot and cross compiling environment after using trusty as code name.
But I am still getting below errors during compilation -
#make xen CROSS_COMPILE=aarch64-linux-gnu- XEN_TARGET_ARCH=arm64
make[1]: Entering directory `/home/username/Xen/xen/xen'
make[2]: Entering directory `/home/username/Xen/xen/xen'
make[3]: Entering directory `/home/username/Xen/xen/xen/tools'
make[4]: Entering directory `/home/username/Xen/xen/xen/tools'
make[4]: Leaving directory `/home/username/Xen/xen/xen/tools'
make[3]: Leaving directory `/home/username/Xen/xen/xen/tools'
make -f /home/username/Xen/xen/xen/Rules.mk include/xen/compile.h
make[3]: Entering directory `/home/username/Xen/xen/xen'
Xen 4.4.0
make[3]: Leaving directory `/home/username/Xen/xen/xen'
[ -e include/asm ] || ln -sf asm-arm include/asm
make -f /home/username/Xen/xen/xen/Rules.mk -C include
make[3]: Entering directory `/home/username/Xen/xen/xen/include'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/home/username/Xen/xen/xen/include'
make -f /home/username/Xen/xen/xen/Rules.mk -C arch/arm asm-offsets.s
make[3]: Entering directory `/home/username/Xen/xen/xen/arch/arm'
make[3]: *** No rule to make target `/home/username/Xen/xen/xen/include/asm/arm64/bug.h', needed by `asm-offsets.s'. Stop.
make[3]: Leaving directory `/home/username/Xen/xen/xen/arch/arm'
make[2]: *** [/home/username/Xen/xen/xen/xen] Error 2
make[2]: Leaving directory `/home/username/Xen/xen/xen'
make[1]: Leaving directory `/home/username/Xen/xen/xen'
I'm not sure what's going wrong there. Out of interest, where are you getting the Xen sources from? These are the steps I take to compile Xen from inside the chroot environment:
$ git clone git://xenbits.xen.org/xen.git $ cd xen $ git checkout stable-4.5 $ cp /usr/share/misc/config.{sub,guess} . $ CONFIG_SITE=/etc/dpkg-cross/cross-config.arm64 ./configure --build=x86_64-unknown-linux-gnu --host=aarch64-linux-gnu $ make -j8 xen CROSS_COMPILE=aarch64-linux-gnu- XEN_TARGET_ARCH=arm64
$ git clone git://xenbits.xen.org/xen.git
$ cd xen
$ git checkout stable-4.5
$ cp /usr/share/misc/config.{sub,guess} .
$ CONFIG_SITE=/etc/dpkg-cross/cross-config.arm64 ./configure --build=x86_64-unknown-linux-gnu --host=aarch64-linux-gnu
$ make -j8 xen CROSS_COMPILE=aarch64-linux-gnu- XEN_TARGET_ARCH=arm64
Can you try this?
Thanks. I can build now Xen image using above steps.
Can you please also let me know how to run this image on Juno r0 platform ?
I was following below link and previously trying to build master and stable-4.4 branches.
http://community.arm.com/groups/processors/blog/2014/03/28/virtualization-on-arm-with-xen
I couldn't find any where else steps to run xen for Juno.
With Xen being an open source project, this is going beyond the scope of what we can help you with (both in terms of this forum and also in terms of our official support channels i.e. support@arm.com).
I recommend you consult the open source community for help with this. The following links on the Xen website may be of use to you:
Xen ARM with Virtualization Extensions - Xenbe carefull about the header's definition notice