You are not logged in.

#1 2020-09-29 17:17:34

ccook13
Member
Registered: 2020-09-29
Posts: 8

Xen Hypervisor (`xen`) fails to build with GCC10

Continuing from comments on the AUR page for xen, currently myself and AUR user skyzh have encountered the following error when building with makepkg ([Edit] technically it's yay but I tried multiple times with both programs) (excerpt from my log follows):

ld -r -d -nostdlib -L/home/charlie/.cache/yay/xen/src/xen-4.14.0/stubdom/cross-root-x86_64/x86_64-xen-elf/lib -m elf_x86_64 -\( /home/charlie/.cache/yay/xen/src/xen-4.14.0/stubdom/vtpmmgr/vtpmmgr.a -T app.lds -\) -lm -lpolarssl --undefined main -o /home/charlie/.cache/yay/xen/src/xen-4.14.0/stubdom/mini-os-x86_64-vtpmmgr/mini-os_app.o
ld: /home/charlie/.cache/yay/xen/src/xen-4.14.0/stubdom/vtpmmgr/vtpmmgr.a(vtpm_cmd_handler.o):(.bss+0x0): multiple definition of `tpm_version'; /home/charlie/.cache/yay/xen/src/xen-4.14.0/stubdom/vtpmmgr/vtpmmgr.a(vtpmmgr.o):(.bss+0x0): first defined here
ld: /home/charlie/.cache/yay/xen/src/xen-4.14.0/stubdom/vtpmmgr/vtpmmgr.a(init.o):(.bss+0x0): multiple definition of `tpm_version'; /home/charlie/.cache/yay/xen/src/xen-4.14.0/stubdom/vtpmmgr/vtpmmgr.a(vtpmmgr.o):(.bss+0x0): first defined here
...
make[2]: *** [Makefile:157: /home/charlie/.cache/yay/xen/src/xen-4.14.0/stubdom/mini-os-x86_64-vtpmmgr/mini-os_app.o] Error 1
make[2]: Leaving directory '/home/charlie/.cache/yay/xen/src/xen-4.14.0/extras/mini-os'
make[1]: *** [Makefile:577: vtpmmgr-stubdom] Error 2
make[1]: Leaving directory '/home/charlie/.cache/yay/xen/src/xen-4.14.0/stubdom'
make: *** [Makefile:138: install-stubdom] Error 2
==> ERROR: A failure occurred in build().
    Aborting...
error making: xen

skyzh provided this link to a patch that should solve the problem, though I'm unfamiliar with applying git patches. Any advice on how to apply it would be most welcome.

Also, if it matters, the same error message occurs when building with GCC9 from the community repository, I figured it was worth a shot.

Last edited by ccook13 (2020-09-29 17:19:12)

Offline

#2 2020-09-29 17:56:57

loqs
Member
Registered: 2014-03-06
Posts: 18,045

Re: Xen Hypervisor (`xen`) fails to build with GCC10

Have you read Patching_packages#Applying_patches?
What changes did you make to switch to gcc9?  The error being the same would indicate gcc 10 was still in use.

Offline

#3 2020-09-29 19:19:32

ccook13
Member
Registered: 2020-09-29
Posts: 8

Re: Xen Hypervisor (`xen`) fails to build with GCC10

I executed:

sudo ln -s $(which gcc-9) /usr/local/bin/gcc; hash -r

The above log was from my GCC10 run. Here's the log from GCC9, if it matters:

gcc -mno-red-zone -O1 -fno-omit-frame-pointer -O1 -fno-omit-frame-pointer  -m64 -mno-red-zone -fno-reorder-blocks -fno-asynchronous-unwind-tables -m64 -DBUILD_ID -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wdeclaration-after-statement -Wno-unused-but-set-variable -Wno-unused-local-typedefs   -fno-stack-protector -fno-exceptions -fno-asynchronous-unwind-tables -fcf-protection=none -fno-builtin -Wall -Werror -Wredundant-decls -Wno-format -Wno-redundant-decls -Wformat -fno-stack-protector -fgnu89-inline -Wstrict-prototypes -Wnested-externs -Wpointer-arith -Winline -g -D__INSIDE_MINIOS__ -m64 -mno-red-zone -fno-reorder-blocks -fno-asynchronous-unwind-tables -DCONFIG_PARAVIRT -DCONFIG_SPARSE_BSS -DCONFIG_BLKFRONT -DCONFIG_TPMFRONT -DCONFIG_TPM_TIS -DCONFIG_TPMBACK -DCONFIG_XENBUS -D__XEN_INTERFACE_VERSION__=0x00030205 -isystem /home/charlie/.cache/yay/xen/src/xen-4.14.0/stubdom/../extras/mini-os/include -D__MINIOS__ -DHAVE_LIBC -isystem /home/charlie/.cache/yay/xen/src/xen-4.14.0/stubdom/../extras/mini-os/include/posix -isystem /home/charlie/.cache/yay/xen/src/xen-4.14.0/stubdom/../tools/xenstore/include  -isystem /home/charlie/.cache/yay/xen/src/xen-4.14.0/stubdom/../extras/mini-os/include/x86 -isystem /home/charlie/.cache/yay/xen/src/xen-4.14.0/stubdom/../extras/mini-os/include/x86/x86_64 -U __linux__ -U __FreeBSD__ -U __sun__ -nostdinc -isystem /home/charlie/.cache/yay/xen/src/xen-4.14.0/stubdom/../extras/mini-os/include/posix -isystem /home/charlie/.cache/yay/xen/src/xen-4.14.0/stubdom/cross-root-x86_64/x86_64-xen-elf/include -isystem /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/include -isystem /home/charlie/.cache/yay/xen/src/xen-4.14.0/stubdom/lwip-x86_64/src/include -isystem /home/charlie/.cache/yay/xen/src/xen-4.14.0/stubdom/lwip-x86_64/src/include/ipv4 -I/home/charlie/.cache/yay/xen/src/xen-4.14.0/stubdom/include -I/home/charlie/.cache/yay/xen/src/xen-4.14.0/stubdom/../xen/include -isystem /home/charlie/.cache/yay/xen/src/xen-4.14.0/stubdom/../extras/mini-os/include -D__MINIOS__ -DHAVE_LIBC -isystem /home/charlie/.cache/yay/xen/src/xen-4.14.0/stubdom/../extras/mini-os/include/posix -isystem /home/charlie/.cache/yay/xen/src/xen-4.14.0/stubdom/../tools/xenstore/include  -isystem /home/charlie/.cache/yay/xen/src/xen-4.14.0/stubdom/../extras/mini-os/include/x86 -isystem /home/charlie/.cache/yay/xen/src/xen-4.14.0/stubdom/../extras/mini-os/include/x86/x86_64 -c console/xencons_ring.c -o /home/charlie/.cache/yay/xen/src/xen-4.14.0/stubdom/mini-os-x86_64-vtpmmgr/console/xencons_ring.o
ld -r -d -nostdlib -L/home/charlie/.cache/yay/xen/src/xen-4.14.0/stubdom/cross-root-x86_64/x86_64-xen-elf/lib -m elf_x86_64 -\( /home/charlie/.cache/yay/xen/src/xen-4.14.0/stubdom/vtpmmgr/vtpmmgr.a -T app.lds -\) -lm -lpolarssl --undefined main -o /home/charlie/.cache/yay/xen/src/xen-4.14.0/stubdom/mini-os-x86_64-vtpmmgr/mini-os_app.o
ld: /home/charlie/.cache/yay/xen/src/xen-4.14.0/stubdom/vtpmmgr/vtpmmgr.a(vtpm_cmd_handler.o):(.bss+0x0): multiple definition of `tpm_version'; /home/charlie/.cache/yay/xen/src/xen-4.14.0/stubdom/vtpmmgr/vtpmmgr.a(vtpmmgr.o):(.bss+0x0): first defined here
ld: /home/charlie/.cache/yay/xen/src/xen-4.14.0/stubdom/vtpmmgr/vtpmmgr.a(init.o):(.bss+0x0): multiple definition of `tpm_version'; /home/charlie/.cache/yay/xen/src/xen-4.14.0/stubdom/vtpmmgr/vtpmmgr.a(vtpmmgr.o):(.bss+0x0): first defined here
ld: /home/charlie/.cache/yay/xen/src/xen-4.14.0/stubdom/vtpmmgr/vtpmmgr.a(tpm.o):(.bss+0x0): multiple definition of `tpm_version'; /home/charlie/.cache/yay/xen/src/xen-4.14.0/stubdom/vtpmmgr/vtpmmgr.a(vtpmmgr.o):(.bss+0x0): first defined here
...
make[2]: *** [Makefile:157: /home/charlie/.cache/yay/xen/src/xen-4.14.0/stubdom/mini-os-x86_64-vtpmmgr/mini-os_app.o] Error 1
make[2]: Leaving directory '/home/charlie/.cache/yay/xen/src/xen-4.14.0/extras/mini-os'
make[1]: *** [Makefile:577: vtpmmgr-stubdom] Error 2
make[1]: Leaving directory '/home/charlie/.cache/yay/xen/src/xen-4.14.0/stubdom'
make: *** [Makefile:138: install-stubdom] Error 2
==> ERROR: A failure occurred in build().
    Aborting...
error making: xen

Offline

#4 2020-09-29 19:20:07

ccook13
Member
Registered: 2020-09-29
Posts: 8

Re: Xen Hypervisor (`xen`) fails to build with GCC10

Also, I will read that now, thank you loqs.

[Edit] It seems to have worked, running the build now...

Last edited by ccook13 (2020-09-29 19:30:07)

Offline

#5 2020-09-29 19:27:39

loqs
Member
Registered: 2014-03-06
Posts: 18,045

Re: Xen Hypervisor (`xen`) fails to build with GCC10

Or build the package in a clean chroot.  It needs systemd adding as a makedepends then it builds without issue for me.  Some TPM package on your system is causing the build to add functionality including the incompatible code.

diff --git a/PKGBUILD b/PKGBUILD
index 6933ba2..45cff2e 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -30,7 +33,7 @@ makedepends=('zlib' 'python' 'ncurses' 'openssl' 'libx11' 'libuuid.so' 'yajl' 'l
          'bridge-utils' 'iproute2' 'inetutils' 'acpica' 'lib32-glibc' 'gnutls'
                 'vde2' 'lzo' 'pciutils' 'sdl') # last line from namcap, these depends are the xen depends
 # Actual makedepends.
-makedepends+=('wget' 'pandoc' 'valgrind' 'git' 'bin86' 'dev86' 'bison' 'gettext' 'flex' 'pixman' 'ocaml' 'fig2dev')
+makedepends+=('wget' 'pandoc' 'valgrind' 'git' 'bin86' 'dev86' 'bison' 'gettext' 'flex' 'pixman' 'ocaml' 'fig2dev' 'systemd')
 
 source=("https://downloads.xenproject.org/release/xen/$pkgver/$pkgname-$pkgver.tar.gz"{,.sig}
                "xen_4.14.0_fixes.patch"

Last edited by loqs (2020-09-29 19:28:07)

Offline

#6 2020-09-29 20:02:29

ccook13
Member
Registered: 2020-09-29
Posts: 8

Re: Xen Hypervisor (`xen`) fails to build with GCC10

It seems the patch worked. Thanks for the info (the wiki article), and for the alternative suggestion of a clean chroot, loqs. You really saved my bacon.

(Obligatory success log)

==> Tidying install...
  -> Removing libtool files...
  -> Purging unwanted files...
  -> Removing static library files...
  -> Stripping unneeded symbols from binaries and libraries...
strip: Unable to recognise the format of the input file `./usr/share/qemu-xen/qemu/hppa-firmware.img'
strip: Unable to recognise the format of the input file `./usr/share/qemu-xen/qemu/u-boot.e500'
strip: Unable to recognise the format of the input file `./usr/share/qemu-xen/qemu/openbios-sparc64'
strip: Unable to recognise the format of the input file `./usr/share/qemu-xen/qemu/s390-netboot.img'
strip: Unable to recognise the format of the input file `./usr/share/qemu-xen/qemu/openbios-sparc32'
strip: Unable to recognise the format of the input file `./usr/share/qemu-xen/qemu/s390-ccw.img'
strip: Unable to recognise the format of the input file `./usr/share/qemu-xen/qemu/openbios-ppc'
strip: Unable to recognise the format of the input file `./usr/share/qemu-xen/qemu/palcode-clipper'
  -> Compressing man and info pages...
==> Checking for packaging issues...
==> WARNING: Package contains reference to $srcdir
usr/lib/libxenlight.so.4.14.0
usr/lib/efi/xen.efi
usr/lib/xen/bin/elf2dmp
usr/lib/xen/bin/qemu-pr-helper
usr/lib/xen/bin/ivshmem-server
usr/lib/xen/bin/qemu-system-i386
usr/lib/xen/bin/qemu-nbd
usr/lib/xen/bin/qemu-img
usr/lib/xen/bin/virtfs-proxy-helper
usr/lib/xen/bin/qemu-storage-daemon
usr/lib/xen/bin/qemu-keymap
usr/lib/xen/bin/qemu-io
usr/lib/xen/bin/qemu-edid
usr/lib/xen/libexec/vhost-user-gpu
usr/lib/xen/libexec/virtiofsd
usr/lib/xen/boot/xen-shim
==> Creating package "xen"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Adding install file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Starting package_xen-docs()...
make -C docs install
make[1]: Entering directory '/home/charlie/Desktop/xen/src/xen-4.14.0/docs'
install -d -m0755 -p /home/charlie/Desktop/xen/pkg/xen-docs/usr/share/man
cp -r man1 /home/charlie/Desktop/xen/pkg/xen-docs/usr/share/man
install -d -m0755 -p /home/charlie/Desktop/xen/pkg/xen-docs/usr/share/man
cp -r man5 /home/charlie/Desktop/xen/pkg/xen-docs/usr/share/man
install -d -m0755 -p /home/charlie/Desktop/xen/pkg/xen-docs/usr/share/man
cp -r man7 /home/charlie/Desktop/xen/pkg/xen-docs/usr/share/man
install -d -m0755 -p /home/charlie/Desktop/xen/pkg/xen-docs/usr/share/man
cp -r man8 /home/charlie/Desktop/xen/pkg/xen-docs/usr/share/man
make -C figs
make[2]: Entering directory '/home/charlie/Desktop/xen/src/xen-4.14.0/docs/figs'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/charlie/Desktop/xen/src/xen-4.14.0/docs/figs'
install -d -m0755 -p /home/charlie/Desktop/xen/pkg/xen-docs/usr/share/doc/xen
[ ! -d html ] || cp -R html /home/charlie/Desktop/xen/pkg/xen-docs/usr/share/doc/xen
make[1]: Leaving directory '/home/charlie/Desktop/xen/src/xen-4.14.0/docs'
==> Tidying install...
  -> Removing libtool files...
  -> Purging unwanted files...
  -> Removing static library files...
  -> Stripping unneeded symbols from binaries and libraries...
  -> Compressing man and info pages...
==> Checking for packaging issues...
==> WARNING: Package contains reference to $srcdir
usr/share/doc/xen/html/hypercall/x86_32/.deps
usr/share/doc/xen/html/hypercall/x86_64/.deps
usr/share/doc/xen/html/hypercall/arm/.deps
==> Creating package "xen-docs"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: xen 4.14.0-1 (Tue 29 Sep 2020 03:53:04 PM EDT)
 charlie  ~  Desktop  xen  makepkg -si                                                                                              master 
==> WARNING: The package group has already been built, installing existing packages...
==> Installing xen package group with pacman -U...
[sudo] password for charlie: 
loading packages...
resolving dependencies...
looking for conflicting packages...

Package (2)  New Version  Net Change

xen          4.14.0-1     255.61 MiB
xen-docs     4.14.0-1       4.52 MiB

Total Installed Size:  260.13 MiB

:: Proceed with installation? [Y/n] Y
(2/2) checking keys in keyring                                                          [###################################################] 100%
(2/2) checking package integrity                                                        [###################################################] 100%
(2/2) loading package files                                                             [###################################################] 100%
(2/2) checking for file conflicts                                                       [###################################################] 100%
(2/2) checking available disk space                                                     [###################################################] 100%
:: Processing package changes...
(1/2) installing xen                                                                    [###################################################] 100%
   Bunch of Xen Notes: https://wiki.archlinux.org/index.php/Xen

   If booting via efi, copy the example /etc/xen/efi-xen.cfg to /boot/xen.cfg
   and edit the contents to match the settings you need.

   To make dom0 go: 

    systemctl enable xen-qemu-dom0-disk-backend.service
    systemctl enable xen-init-dom0.service
    systemctl enable xenconsoled.service

   Optional services are:
    systemctl enable xen-watchdog.service

   To start domains on boot:
    systemctl enable xendomains.service


Optional dependencies for xen
    ed2k-ovmf: UEFI support
    seabios: SeaBIOS payload support [installed]
    xen-docs: HTML documentation and man pages [pending]
    grub-xen-git: GRUB and pvgrub2 bootloader support
(2/2) installing xen-docs                                                               [###################################################] 100%
:: Running post-transaction hooks...
(1/3) Reloading system manager configuration...
(2/3) Creating temporary files...
(3/3) Arming ConditionNeedsUpdate...

Offline

Board footer

Powered by FluxBB