Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 761448

Summary: app-emulation/xen-tools-4.15.1-r2 USE="ovmf" fails to link with ld.gold: fatal error: -pie and -static are incompatible
Product: Gentoo Linux Reporter: nmm
Component: Current packagesAssignee: Tomáš Mózes <hydrapolic>
Status: CONFIRMED ---    
Severity: normal CC: esigra, nmm, proxy-maint, sam, xen
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 269315    
Attachments: build log
output of emerge --info
emerge environment
output of emerge -pqv '=app-emulation/xen-tools-4.13.2-r1::gentoo'
output of emerge --info '=app-emulation/xen-tools-4.13.2-r1::gentoo'

Description nmm 2020-12-23 23:32:08 UTC
Created attachment 679350 [details]
build log

Package xen-tools has been failing to emerge for a few days now - i haven't got a working Xen installation yet. The system is recently updated (with emerge --ask --update --changed-use --deep --keep-going --with-bdeps=y @world).

When issuing emerge --ask  app-emulation/xen-tools, it seems it'll upgrade the python version:

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] app-emulation/xen-tools-4.13.2-r1  USE="ovmf*" PYTHON_SINGLE_TARGET="python3_8* -python3_7*" 

It eventually fails with:
/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: fatal error: -pie and -static are incompatible

There are a lot of -fpie flags in the output, but i see no -static.

The end of the emerge states:
 * Messages for package app-emulation/xen-tools-4.13.2-r1:

 * Forcing usage of the BFD linker instead of GOLD
 * ERROR: app-emulation/xen-tools-4.13.2-r1::gentoo failed (compile phase):
 *   emake failed
 * 

So i tried with:
LD=ld.bfd emerge --ask  app-emulation/xen-tools 

but get the same result. The kernel doesn't like gold either but anyway i assume "forcing" made my attempt futile.

My USE flags for this package are:

app-emulation/xen-tools python pygrub ovmf

# required by app-emulation/xen-tools-4.13.2-r1::gentoo[ovmf,python_single_target_python3_7]
# required by app-emulation/xen-4.13.2-r1::gentoo
# required by @selected
# required by @world (argument)
>=dev-lang/python-3.7.9:3.7 sqlite

HTH
Comment 1 nmm 2020-12-23 23:32:58 UTC
Created attachment 679353 [details]
output of emerge --info
Comment 2 nmm 2020-12-23 23:33:22 UTC
Created attachment 679356 [details]
emerge environment
Comment 3 nmm 2020-12-23 23:33:48 UTC
Created attachment 679359 [details]
output of emerge -pqv '=app-emulation/xen-tools-4.13.2-r1::gentoo'
Comment 4 nmm 2020-12-23 23:34:10 UTC
Created attachment 679362 [details]
output of emerge --info '=app-emulation/xen-tools-4.13.2-r1::gentoo'
Comment 5 nmm 2020-12-23 23:35:48 UTC
Portage 3.0.9 (python 3.6.12-final-0, default/linux/amd64/17.1, gcc-9.2.0, glibc-2.32-r3, 5.4.80-gentoo-r1 x86_64)
=================================================================
System uname: Linux-5.4.80-gentoo-r1-x86_64-AMD_Ryzen_7_1800X_Eight-Core_Processor-with-gentoo-2.7
KiB Mem:    32888928 total,   9804436 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Sat, 19 Dec 2020 00:45:01 +0000
sh bash 5.0_p18
ld GNU gold (Gentoo 2.33.1 p2 2.33.1) 1.16
app-shells/bash:          5.0_p18::gentoo
dev-java/java-config:     2.3.1::gentoo
dev-lang/perl:            5.30.3::gentoo
dev-lang/python:          2.7.18-r4::gentoo, 3.6.12::gentoo, 3.7.9::gentoo, 3.8.6::gentoo, 3.9.0::gentoo
dev-util/cmake:           3.17.4-r1::gentoo
sys-apps/baselayout:      2.7::gentoo
sys-apps/openrc:          0.42.1::gentoo
sys-apps/sandbox:         2.20::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r5::gentoo
sys-devel/automake:       1.13.4-r2::gentoo, 1.16.2-r1::gentoo
sys-devel/binutils:       2.33.1-r1::gentoo, 2.34-r2::gentoo
sys-devel/gcc:            9.2.0-r2::gentoo, 9.3.0-r2::gentoo
sys-devel/gcc-config:     2.3.2-r1::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 5.4-r1::gentoo (virtual/os-headers)
sys-libs/glibc:           2.32-r3::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: webrsync
    sync-uri: http://ftp.rnl.tecnico.ulisboa.pt/pub/gentoo/gentoo-distfiles/
    priority: -1000
    sync-webrsync-verify-signature: yes

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=znver1 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/gnupg/qualified.txt /usr/share/maven-bin-3.6/conf"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=znver1 -pipe"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -march=znver1 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -march=znver1 -pipe"
GENTOO_MIRRORS="http://ftp.rnl.tecnico.ulisboa.pt/pub/gentoo/gentoo-distfiles/ http://mirrors.evowise.com/gentoo/ http://ftp.dei.uc.pt/pub/linux/gentoo/ https://mirrors.evowise.com/gentoo/ https://ftp.rnl.tecnico.ulisboa.pt/pub/gentoo/gentoo-distfiles/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en pt eo ja"
MAKEOPTS="-j12"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="acl alsa amd64 berkdb bzip2 cli crypt dri fortran gdbm iconv icu libglvnd libtirpc multilib ncurses nls nptl openmp pam pcre readline seccomp smp split-usr ssl tcpd unicode vim-syntax xattr zfs zlib" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="pc efi-64" INPUT_DEVICES="evdev" KERNEL="linux" L10N="en en-US pt pt-PT eo ja ja-JP" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2 php7-3 php7-4" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_8" PYTHON_TARGETS="python2_7 python3_8" RUBY_TARGETS="ruby25 ruby26" SANE_BACKENDS="hp" USERLAND="GNU" VIDEO_CARDS="radeon" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 6 nmm 2021-01-20 18:45:54 UTC
This effectively blocks installing or upgrading the Xen hypervisor.
Comment 7 Tomáš Mózes 2021-01-21 06:08:56 UTC
Seems like ovmf does not respect $LD and always uses ld directly which is ld.gold in your case.

Can you please try to emerge binutils with USE="-default-gold" and then try to build xen-tools again?

By the way, you have multiple gcc/binutils versions - if you just use on of them, remove the redundant version. Be sure you have switched to the new version before doing so.
Comment 8 nmm 2021-01-21 22:37:33 UTC
I would've thought binutils is managed automagically, it's not a package i like to poke around with - maybe i have some packages that still depend on the older version?

# eselect binutils list
 [1] x86_64-pc-linux-gnu-2.33.1 *
 [2] x86_64-pc-linux-gnu-2.34

# USE="-default-gold" emerge --ask binutils

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] sys-devel/binutils-2.34-r2  USE="-default-gold*" 

# eselect binutils set 2

# emerge --ask  app-emulation/xen-tools 
These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild     U  ] app-emulation/xen-tools-4.13.2-r2 [4.13.2-r1] USE="ovmf*" PYTHON_SINGLE_TARGET="python3_8* -python3_7*" 


Compilation successful, thank you.
Comment 9 Tomáš Mózes 2021-01-22 04:17:31 UTC
If you don't need multiple versions, it's best to move to the latest and drop the old one.

I usually do it like this:
emerge -avu1 sys-devel/binutils && eselect binutils set 2 && emerge -av1 unzip bzip2 && emerge -avP sys-devel/binutils

Some time ago I had a broken binutils installation so before removing the old one I'm checking if I can actually build something with the new one.

Glad your xen-tools is building now, but it's not a fix, it's a workaround as of now.
Comment 10 Agostino Sarubbo gentoo-dev 2021-12-13 08:10:54 UTC
tinderbox has reproduced this issue with version 4.15.1-r2 - Updating summary.