This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Compiling Xen for Juno

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 '-m64'

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.

Parents
  • Hi,

    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:

    • I had to install libpxman-1-0:arm64 and libpxman-1-dev:arm64 on the chroot
    • I didn't bother making the dist-tools target, instead directly making the xen target

    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

    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.

Reply
  • Hi,

    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:

    • I had to install libpxman-1-0:arm64 and libpxman-1-dev:arm64 on the chroot
    • I didn't bother making the dist-tools target, instead directly making the xen target

    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

    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.

Children