InBetweenNames / gentooLTO

A Gentoo Portage configuration for building with -O3, Graphite, and LTO optimizations
GNU General Public License v2.0
570 stars 97 forks source link

Vitualbox won't compile after changing the system to LTO #435

Closed rafaelfortes closed 4 years ago

rafaelfortes commented 4 years ago

I installed a new system and after everything was up and running decided to give gentooLTO a go, so far has been great with exception of three packages that will not compile without LTO by "FLAGS-=-flto" and/or completely removing the gentooLTO optimizations (created a custom ltoworkarounds file with "FLAGS="-march=znver2 -O2 -pipe -fomit-frame-pointer") and with GOLD or BFD linkerm the results are the same. In the case of VirtualBox I tried versions 5.2.32 and 6.0.14 and one thing that I noticed is that the ebuild is forcing the use of BFD linker and when the build fails it seems to be the linker to cause it, see below the beginning and end of build.log. For chromium and powerdevil I will create separate issues later.

 * Package:    app-emulation/virtualbox-5.2.32
 * Repository: gentoo
 * Maintainer: polynomial-c@gentoo.org
 * USE:        abi_x86_64 alsa amd64 elibc_glibc kernel_linux opengl opus pam python_targets_pytho
n2_7 qt5 sdk udev userland_GNU vnc
 * FEATURES:   network-sandbox preserve-libs sandbox userpriv usersandbox
app-emulation/virtualbox: 2 minutes, 26 seconds average for
 1 merge
2019-09-08T14:48:49 >>> app-emulation/virtualbox: 2 minutes, 26
 seconds
 * /etc/portage/package.cflags/ltoworkarounds.conf -
> app-emulation/virtualbox: *FLAGS-=-flto*
 * /etc/portage/package.cflags/ltoworkaroundsMine.conf -> app-emulation/virtualbox: *FLAGS="-march=znver2
 -O2 -pipe -fomit-frame-pointer"
 * FEATURES='assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distl
ocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox
 preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch us
erpriv usersandbox usersync xattr'
 * CFLAGS='-march=znver2 -O2 -pipe -fomit-frame-pointer'
 * CXXFLAGS='-march=znver2 -O2 -pipe -fomit-frame-pointer'
 * FFLAGS='-march=znver2 -O2 -pipe -fomit-frame-pointer'
 * FCFLAGS='-march=znver2 -O2 -pipe -fomit-frame-pointer'
 * F77FLAGS='-march=znver2 -O2 -pipe -fomit-frame-pointer'
 * MAKEOPTS='-j25'
 * gcc (Gentoo 9.2.0-r1 p2) 9.2.0
 * Linux rafael 4.19.66-gentoo #1 SMP PREEMPT Sun Sep 15 13:44:24 -03 2019 x86_64 AMD Ryzen 9 3900X 12-Co
re Processor AuthenticAMD GNU/Linux
 * Forcing usage of the BFD linker instead of GOLD
>>> Unpacking source...
>>> Unpacking VirtualBox-5.2.32.tar.bz2 to /var/tmp/portage/app-emulation/virtualbox-5.2.32/work
>>> Unpacking virtualbox-5.2.16-patches-02.tar.xz to /var/tmp/portage/app-emulation/virtualbox-5.2.32/work
>>> Source unpacked in /var/tmp/portage/app-emulation/virtualbox-5.2.32/work
>>> Preparing source in /var/tmp/portage/app-emulation/virtualbox-5.2.32/work/VirtualBox-5.2.32 ...
 * Applying patches from /var/tmp/portage/app-emulation/virtualbox-5.2.32/work/patches ...
 *   001_virtualbox-5.0.16-mesa-check.patch ...                                                             [ ok ]
 *   002_virtualbox-5.2.16-remove-configure-checks.patch ...                                                [ ok ]
 *   003_virtualbox-4.0.2-restore_old_machines_dir.patch ...                                                [ ok ]
 *   004_virtualbox-4.1.2-vboxpci-build.patch ...                                                           [ ok ]
 *   005_virtualbox-4.2.26-asneeded.patch ...                                                               [ ok ]
 *   006_virtualbox-4.2.18-vboxwebsrv_fix.patch ...                                                         [ ok ]
 *   009-virtualbox-5.1.0-add_missing_gl_header.patch ...                                                   [ ok ]
 *   010_virtualbox-5.2.12-qt511.patch ...                                                                  [ ok ]
 *   011_virtualbox-5.2.14-xpcom_const.patch ...                                                            [ ok ]
 *   012_virtualbox-5.2.16-opus_automagic.patch ...                                                         [ ok ]
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/app-emulation/virtualbox-5.2.32/work/VirtualBox-5.2.32 ...
./configure --with-gcc=x86_64-pc-linux-gnu-gcc --with-g++=x86_64-pc-linux-gnu-g++ --disable-dbus --disable-kmods --
disable-docs --disable-java --disable-devmapper --build-libopus --disable-pulse --disable-python --enable-vnc
Checking for environment: Determined build machine: linux.amd64, target machine: linux.amd64, OK.
Checking for kBuild: found, OK.
Checking for Open Watcom: 
  ** Open Watcom was not found, using alternative BIOS sources!
Checking for iasl: found version 20180810, OK.
Checking for xslt: found, OK.
Checking for pthread: found, OK.
Checking for libxml2: found version 2.9.9, OK.
Checking for libIDL: found version 0.8.14, OK.
Checking for ssl: found version OpenSSL 1.1.1d  10 Sep 2019, OK.
Checking for libcurl: found version 7.66.0, OK.
Checking for libvpx: found version 1.7.0, OK.
Checking for libopus: found, OK.
Checking for zlib: found version 1.2.11, OK.
Checking for libpng: found version 1.6.37+apng, OK.
Checking for SDL: found version 1.2.15, OK.
Checking for X libraries: Checking for Xcursor: found, OK.
Checking for Xinerama: found, OK.
Checking for Xrandr: found, OK.
Checking for Xmu: found, OK.
Checking for Mesa / GLU: Checking for Qt5: found version 5.12.5, OK.
Checking for Qt5 devtools: found version moc 5.12.5, OK.
Checking for static stc++ library: found, OK.
Checking for ALSA: found version 1.1.8, OK.
Checking for libcap library: found, OK.
Checking for compiler.h: compiler.h not found, OK.
Checking for 32-bit support: OK.
Checking for libvncserver: found version 0.9.12, OK.

Successfully generated '/var/tmp/portage/app-emulation/virtualbox-5.2.32/work/VirtualBox-5.2.32/AutoConfig.kmk' and
 '/var/tmp/portage/app-emulation/virtualbox-5.2.32/work/VirtualBox-5.2.32/env.sh'.
Source '/var/tmp/portage/app-emulation/virtualbox-5.2.32/work/VirtualBox-5.2.32/env.sh' once before you start to bu
ild VBox:

  source /var/tmp/portage/app-emulation/virtualbox-5.2.32/work/VirtualBox-5.2.32/env.sh
  kmk

To compile the kernel modules, do:

  cd ./out/linux.amd64/release/bin/src
  make

  +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++
  Hardening is enabled which means that the VBox binaries will not run from
  the binary directory. The binaries have to be installed suid root and some
  more prerequisites have to be fulfilled which is normally done by installing
  the final package. For development, the hardening feature can be disabled
  by specifying the --disable-hardening parameter. Please never disable that
  feature for the final distribution!
  +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++

Enjoy!
...
/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld.bfd: skipping incompatible /usr/lib/libpthread.a when searching for -lpthread
/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld.bfd: skipping incompatible /usr/lib/librt.so when searching for -lrt
/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld.bfd: skipping incompatible /usr/lib/librt.a when searching for -lrt
/usr/lib/gcc/x86_64-pc-  INST VBoxXPCOM => {C}/out/linux.amd64/release/bin/VBoxXPCOM.so
kmk_builtin_install --hard-link-files-when-possible    -- /var/tmp/portage/app-emulation/virtualbox-5.2.32/work/VirtualBox-5.2.32/out/linux.amd64/release/obj/VBoxXPCOM/VBoxXPCOM.so /var/tmp/portage/app-emulation/virtualbox-5.2.32/work/VirtualBox-5.2.32/out/linux.amd64/release/bin/VBoxXPCOM.so
  LD VBoxCAPI
kmk_builtin_rm -f -- /var/tmp/portage/app-emulation/virtualbox-5.2.32/work/VirtualBox-5.2.32/out/linux.amd64/release/obj/VBoxCAPI/VBoxCAPI.dep /var/tmp/portage/app-emulation/virtualbox-5.2.32/work/VirtualBox-5.2.32/out/linux.amd64/release/obj/VBoxCAPI/VBoxCAPI.so  /var/tmp/portage/app-emulation/virtualbox-5.2.32/work/VirtualBox-5.2.32/out/linux.amd64/release/obj/VBoxCAPI/VBoxCAPI.map 
g++ -shared               -fPIC '-Wl,-rpath,/usr/lib64/virtualbox'  -Wl,-z,noexecstack,-z,relro -Wl,--as-needed -Wl,-O1 -Wl,--as-needed -fuse-ld=bfd -m64   -o /var/tmp/portage/app-emulation/virtualbox-5.2.32/work/VirtualBox-5.2.32/out/linux.amd64/release/obj/VBoxCAPI/VBoxCAPI.so -Wl,-soname=VBoxCAPI.so /var/tmp/portage/app-emulation/virtualbox-5.2.32/work/VirtualBox-5.2.32/out/linux.amd64/release/obj/VBoxCAPI/VBoxCAPI.o     -lpthread   -lm   -lrt   /var/tmp/portage/app-emulation/virtualbox-5.2.32/work/VirtualBox-5.2.32/out/linux.amd64/release/bin/VBoxRT.so   -ldl   /var/tmp/portage/app-emulation/virtualbox-5.2.32/work/VirtualBox-5.2.32/out/linux.amd64/release/lib/VBoxCOM.a   /var/tmp/portage/app-emulation/virtualbox-5.2.32/work/VirtualBox-5.2.32/out/linux.amd64/release/bin/VBoxXPCOM.so 
linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld.bfd: skipping incompatible /usr/lib/libdl.so when searching for -ldl
/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld.bfd: skipping incompatible /usr/lib/libdl.a when searching for -ldl
/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld.bfd: skipping incompatible /usr/lib/libssl.so when searching for -lssl
/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld.bfd: skipping incompatible /usr/lib/libssl.a when searching for -lssl
/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld.bfd: skipping incompatible /usr/lib/libcrypto.so when searching for -lcrypto
/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld.bfd: skipping incompatible /usr/lib/libcrypto.a when searching for -lcrypto
/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld.bfd: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld.bfd: skipping incompatible /usr/lib/libm.a when searching for -lm
/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld.bfd: skipping incompatible /usr/lib/libc.so when searching for -lc
/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld.bfd: skipping incompatible /usr/lib/libc.a when searching for -lc
lto1: internal compiler error: in streamer_get_pickled_tree, at tree-streamer-in.c:1115
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://bugs.gentoo.org/> for instructions.
lto-wrapper: fatal error: g++ returned 1 exit status
compilation terminated.
/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld.bfd: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
kmk: *** [/usr/share/kBuild/footer-pass2-compiling-targets.kmk:667: /var/tmp/portage/app-emulation/virtualbox-5.2.32/work/VirtualBox-5.2.32/out/linux.amd64/release/obj/rdesktop-vrdp/rdesktop-vrdp] Error 1
kmk: *** Waiting for unfinished jobs....
kmk_builtin_append -n "/var/tmp/portage/app-emulation/virtualbox-5.2.32/work/VirtualBox-5.2.32/out/linux.amd64/release/obj/VBoxAPIWrap/gen/MachineWrap.o.dep" "" "/var/tmp/portage/app-emulation/virtualbox-5.2.32/work/VirtualBox-5.2.32/out/linux.amd64/release/obj/VBoxAPIWrap/MachineWrap.cpp:" ""
  IPRT: Testing mangling using nm... 
nm -p -t x /var/tmp/portage/app-emulation/virtualbox-5.2.32/work/VirtualBox-5.2.32/out/linux.amd64/release/obj/RuntimeR3/RuntimeR3.a /var/tmp/portage/app-emulation/virtualbox-5.2.32/work/VirtualBox-5.2.32/out/linux.amd64/release/obj/RuntimeR0/RuntimeR0.a /var/tmp/portage/app-emulation/virtualbox-5.2.32/work/VirtualBox-5.2.32/out/linux.amd64/release/obj/RuntimeRC/RuntimeRC.a  2> /dev/null \
        | /usr/bin/kmk_sed -n \
                -e 's/^[0-9a-f][0-9a-f]* //' \
                -e '/^[TUDB] /!d' \
                -e 's/^. //' \
                 \
                \
                -e '/^g_cchrt/d'\
                -e '/^g_frt/d'\
                -e '/^g_offrt/d'\
                -e '/^g_pfnrt/d'\
                -e '/^g_rt/d'\
                -e '/^g_szrt/d'\
                -e '/^g_ProcessSelf/d'\
                -e '/^g_u64ProgramStart/d'\
                -e '/^g_enmProcessPriority/d'\
                -e '/^g_hDbgModStrCache/d'\
                -e '/^g_pfnR0Darwin/d'\
                -e '/^g_pDarwinLockGroup/d'\
                 \
                 -e '/^g_kLdrRdrFileOps/d' \
                       \
                -e '/^g_[ac]VTG/d' \
                -e '/^g_VTGObjHeader/d' \
                -e '/^g_VTGProbeData/d' \
                -e '/^VTGProbeStub/d' \
                -e '/^g_achVTGStringTable/d' \
                -e '/^g_acVTGProbeEnabled/d' \
                \
                -e '/^RTDBusLoadLib/d' \
                \
                -e '/^RT/p' \
                -e '/^g_/p' \
        | /usr/bin/kmk_sed -nf "/var/tmp/portage/app-emulation/virtualbox-5.2.32/work/VirtualBox-5.2.32/out/linux.amd64/release/obj/Runtime/mangling.run"
kmk_builtin_append -t /var/tmp/portage/app-emulation/virtualbox-5.2.32/work/VirtualBox-5.2.32/out/linux.amd64/release/obj/Runtime/mangling.run
kmk_builtin_append -n "/var/tmp/portage/app-emulation/virtualbox-5.2.32/work/VirtualBox-5.2.32/out/linux.amd64/release/obj/VBoxSVC/src-server/MachineImpl.o.dep" "" "/var/tmp/portage/app-emulation/virtualbox-5.2.32/work/VirtualBox-5.2.32/src/VBox/Main/src-server/MachineImpl.cpp:" ""
kmk_builtin_append -n "/var/tmp/portage/app-emulation/virtualbox-5.2.32/work/VirtualBox-5.2.32/out/linux.amd64/release/obj/VMMR0/VMMAll/IEMAll.o.dep" "" "/var/tmp/portage/app-emulation/virtualbox-5.2.32/work/VirtualBox-5.2.32/src/VBox/VMM/VMMAll/IEMAll.cpp:" ""
kmk_builtin_append -n "/var/tmp/portage/app-emulation/virtualbox-5.2.32/work/VirtualBox-5.2.32/out/linux.amd64/release/obj/VMMRC/VMMAll/IEMAll.o.dep" "" "/var/tmp/portage/app-emulation/virtualbox-5.2.32/work/VirtualBox-5.2.32/src/VBox/VMM/VMMAll/IEMAll.cpp:" ""
kmk: *** Exiting with status 2
 * ERROR: app-emulation/virtualbox-5.2.32::gentoo failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=app-emulation/virtualbox-5.2.32::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=app-emulation/virtualbox-5.2.32::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/app-emulation/virtualbox-5.2.32/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/app-emulation/virtualbox-5.2.32/temp/environment'.
 * Working directory: '/var/tmp/portage/app-emulation/virtualbox-5.2.32/work/VirtualBox-5.2.32'
 * S: '/var/tmp/portage/app-emulation/virtualbox-5.2.32/work/VirtualBox-5.2.32'
!!! When you file a bug report, please include the following information:
GENTOO_VM=  CLASSPATH="" JAVA_HOME="/etc/java-config-2/current-system-vm"
JAVACFLAGS="" COMPILER=""
and of course, the output of emerge --info =virtualbox-5.2.32

Is there a way in ltoworkarounds to force the linker to be GOLD? could be some library or other package that Virtualbox depends on that also need to be compiled without LTO?

elsandosgrande commented 4 years ago
  1. You can choose which linker to use by putting -fuse-ld=[bfd/gold] in the CFLAGS, which is how I do it ( https://gcc.gnu.org/onlinedocs/gcc-9.2.0/gcc/Link-Options.html#Link-Options )
  2. Please share your emerge --info output with us, as it seems like you are running a hardened profile
  3. skipping incompatible /usr/lib/libdl.a when searching for -ldl, where /usr/lib is for 32-bit binaries and /usr/lib64 for 64-bit ones; VirtualBox is being compiled as an amd64 (64-bit) program, while the compiler and linker are being served IA-32 (32-bit) libraries, which are not compatible (at least this is my guess from personal experience, https://bugs.gentoo.org/show_bug.cgi?id=690676 and https://bugs.gentoo.org/show_bug.cgi?id=691274 , and the little information you have currently provided us with regarding your system)
sandy@sandys-pavilion:/usr/src/linux$ emerge --info virtualbox
Portage 2.3.78 (python 3.7.5-final-0, default/linux/amd64/17.1/desktop/plasma/systemd, gcc-9.2.0, glibc-2.29-r6, 5.3.7-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-5.3.7-gentoo-x86_64-AMD_A9-9410_RADEON_R5,_5_COMPUTE_CORES_2C+3G-with-gentoo-2.6
KiB Mem:     7533992 total,   1069204 free
KiB Swap:   16777212 total,  16748272 free
Timestamp of repository gentoo: Thu, 31 Oct 2019 15:30:01 +0000
Head commit of repository gentoo: 3aeef5adfe325a8ab4ab59d80e750b94ee54cb9c
Timestamp of repository jorgicio: Thu, 31 Oct 2019 14:29:21 +0000
Head commit of repository jorgicio: 3749c82bbe5a72c8bd3098f76383b56b396c23ad

Timestamp of repository kde: Tue, 29 Oct 2019 22:25:25 +0000
Head commit of repository kde: 5fcabba9ef7f6d971a6ea37a52a6add042cef67b

Timestamp of repository lto-overlay: Wed, 16 Oct 2019 15:45:27 +0000
Head commit of repository lto-overlay: 942c90c8938349ba37297c0d6d28cad5f0b09921

Timestamp of repository matrix: Sun, 20 Oct 2019 11:25:12 +0000
Head commit of repository matrix: f76e012dfc39db34d484f5356585199934ae51bd

Timestamp of repository mv: Sun, 20 Oct 2019 07:29:10 +0000
Head commit of repository mv: bcd15be060e30ad0eb4cb25e4b08eba31d7ca289

Timestamp of repository steam-overlay: Sun, 20 Oct 2019 07:29:16 +0000
Head commit of repository steam-overlay: 015300bb294fa559644603cf79426bb8ca59a14e

sh bash 5.0_p11
ld GNU ld (Gentoo 2.32 p2) 2.32.0
ccache version 3.7.5 [disabled]
app-shells/bash:          5.0_p11::gentoo
dev-java/java-config:     2.2.0-r4::gentoo
dev-lang/perl:            5.30.0::gentoo
dev-lang/python:          2.7.16-r102::lto-overlay, 3.6.9-r1::lto-overlay, 3.7.5-r1::gentoo
dev-util/ccache:          3.7.5::gentoo
dev-util/cmake:           3.15.5::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/sandbox:         2.18::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.11.6-r3::gentoo, 1.13.4-r2::gentoo, 1.16.1-r1::gentoo
sys-devel/binutils:       2.32-r1::gentoo
sys-devel/gcc:            8.3.0-r2::gentoo, 9.2.0-r1::gentoo
sys-devel/gcc-config:     2.1::gentoo
sys-devel/libtool:        2.4.6-r5::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 5.3::gentoo (virtual/os-headers)
sys-libs/glibc:           2.29-r6::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-jobs: 1
    sync-rsync-extra-opts: 
    sync-rsync-verify-metamanifest: yes

jorgicio
    location: /var/db/repos/jorgicio
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/jorgicio.git
    masters: gentoo

kde
    location: /var/db/repos/kde
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/kde.git
    masters: gentoo

localrepo
    location: /var/db/repos/localrepo
    masters: gentoo

lto-overlay
    location: /var/db/repos/lto-overlay
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/lto-overlay.git
    masters: gentoo mv

matrix
    location: /var/db/repos/matrix
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/matrix.git
    masters: gentoo

mv
    location: /var/db/repos/mv
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/mv.git
    masters: gentoo

steam-overlay
    location: /var/db/repos/steam-overlay
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/steam-overlay.git
    masters: gentoo

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O3 -march=bdver4 -pipe -pthread -fira-hoist-pressure -fira-loop-pressure -fbranch-target-load-optimize -fweb -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=2 -fuse-linker-plugin -fuse-ld=bfd -Wall -Wextra"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc/locale* /etc/nginx/nginx.conf /etc/portage/make.conf /etc/sudoers /etc/systemd/logind.conf /etc/systemd/system/ /usr/lib/sysctl.d/90-override.conf"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.3/ext-active/ /etc/php/cgi-php7.3/ext-active/ /etc/php/cli-php7.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O3 -march=bdver4 -pipe -pthread -fira-hoist-pressure -fira-loop-pressure -fbranch-target-load-optimize -fweb -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=2 -fuse-linker-plugin -fuse-ld=bfd -Wall -Wextra"
DISTDIR="/usr/portage/distfiles"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN 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="-O3 -march=bdver4 -pipe -pthread -fira-hoist-pressure -fira-loop-pressure -fbranch-target-load-optimize -fweb -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=2 -fuse-linker-plugin -fuse-ld=bfd -Wall -Wextra"
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 sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O3 -march=bdver4 -pipe -pthread -fira-hoist-pressure -fira-loop-pressure -fbranch-target-load-optimize -fweb -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=2 -fuse-linker-plugin -fuse-ld=bfd -Wall -Wextra"
GENTOO_MIRRORS="http://ftp.ntua.gr/pub/linux/gentoo/ https://mirrors.evowise.com/gentoo/ https://ftp.halifax.rwth-aachen.de/gentoo/ http://ftp.halifax.rwth-aachen.de/gentoo/"
LANG="en_US.UTF-8"
LDFLAGS="-O3 -march=bdver4 -pipe -pthread -fira-hoist-pressure -fira-loop-pressure -fbranch-target-load-optimize -fweb -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=2 -fuse-linker-plugin -fuse-ld=bfd -Wall -Wextra -Wl,-O1 -Wl,--as-needed -Wl,-O3"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
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="* 7zip X a52 aac acl acpi activities aio alsa amd64 amr amrenc androiddump apache2 appstream aribsub asm audiofile bash-completion berkdb bluetooth branding brightness-control browser-integration bzip2 cairo caps cdda cddb cdio cdr cdrom cgroup-hybrid cholmod ciscodump cjk clamdtop cli color-management colord connection-sharing context corefonts cracklib crypt cups cxx cycles d3d9 dav1d dbus declarative designer dri dri3 drm dts dvd dvdr egl emboss encode eps examples exif extras fam farstream fcitx fcitx4 fdt ffmpeg fftw filecaps flac fluidsynth fontconfig fortran fpm frei0r ftp fuse gallium gbm gd gdbm gentoo-vm geolocation gif git glamor gles gles1 gles2 gles3 glib gme gmp gnuefi gnuplot googledrive gpg gpm gps graphite grub gsl gstreamer gtk gtk3 guile guile2 handbook hardened heif hpn iconv icu id3tag imagemagick introspection ipv6 iso java joystick jpeg jpeg2k json kde kdenlive kipi kms kwallet latex layers lcms ldap lensfun libaom libass libcaca libdrm libinput libkms libnotify libtirpc libxml2 llvm lm-sensors lrz lto lz4 lzma lzo mad man matroska mem-scramble minizip mng modern-top mount mousepad mp3 mp4 mpeg mpi mtp multilib musepack mysql mysqli native-headset ncurses networkmanager nfs nghttp2 nginx nls nptl numpy ogg omxil openal opencl opencv openexr opengl openh264 openimageio openmp opus orientation osmesa pam pango pch pci pcre pdf pdfimport phonon pie plasma png policykit posix postproc postscript ppds prison projectm ptex pulseaudio python qalculate qml qt4 qt5 qtmedia quad quicktime rar raw readline realtime rubberband sasl sbc sbsms scanner scripts sdl seccomp semantic-desktop sha3 shout sid skins smi sound sox speex spell spice split-usr sqlite ssl startup-notification svg swaybar swaybg swaymsg swaynag symlink sync-plugin-portage system-llvm systemd systemtap taglib tcpd theora threads tiff tls-heartbeat tools touchpad truetype twolame udev udisks umfpack unicode unwind upower usb usbredir user-permissions user-session utils uuid v4l vaapi vala vamp vcd vdpau video vim-pager vim-syntax virgl virt-network vlc vorbis vpx vulkan vulkan-overlay wallpapers wayland webengine webp widgets wifi wireshark-plugins wxwidgets x264 x265 xattr xcb xcomposite xml xpm xv xvid yaml zlib zvbi" ABI_X86="32 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="fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good acc_power nopl nonstop_tsc cpuid extd_apicid aperfmperf pni pclmulqdq monitor ssse3 sse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs xop skinit wdt lwp fma4 tce nodeid_msr tbm perfctr_core perfctr_nb bpext ptsc mwaitx cpb hw_pstate ssbd vmmcall fsgsbase bmi1 avx2 smep bmi2 xsaveopt arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif overflow_recov" 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="efi-64" INPUT_DEVICES="libinput wacom" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="AMDGPU WebAssembly" NETBEANS_MODULES="apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websvccommon xml" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python3_7 python3_6 python2_7" RUBY_TARGETS="ruby24 ruby25" USERLAND="GNU" VIDEO_CARDS="amdgpu radeonsi 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, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================
                        Package Settings
=================================================================

app-emulation/virtualbox-6.0.14::gentoo was built with the following:
USE="alsa java opengl opus pam pulseaudio python qt5 sdk udev -debug -doc -dtrace -headless -libressl -lvm -pax_kernel -vboxwebsrv -vnc" ABI_X86="(64)" PYTHON_SINGLE_TARGET="python3_7 -python2_7 -python3_5 -python3_6" PYTHON_TARGETS="python2_7 python3_6 python3_7 -python3_5"
CFLAGS="-O3 -march=bdver4 -pipe -pthread -fira-hoist-pressure -fira-loop-pressure -fbranch-target-load-optimize -fweb -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -fuse-linker-plugin -fuse-ld=bfd -Wall -Wextra -Wl,-O1 -Wl,--as-needed -Wl,-O3"
CXXFLAGS="-O3 -march=bdver4 -pipe -pthread -fira-hoist-pressure -fira-loop-pressure -fbranch-target-load-optimize -fweb -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -fuse-linker-plugin -fuse-ld=bfd -Wall -Wextra -Wl,-O1 -Wl,--as-needed -Wl,-O3"
LDFLAGS="-O3 -march=bdver4 -pipe -pthread -fira-hoist-pressure -fira-loop-pressure -fbranch-target-load-optimize -fweb -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -fuse-linker-plugin -fuse-ld=bfd -Wall -Wextra -Wl,-O1 -Wl,--as-needed -Wl,-O3"
  1. BFD (GNU ld) is recommended because it is actually still supported (it was also causing some kind of trouble a few months ago, but I am unable to recall the specifics at the moment)
rafaelfortes commented 4 years ago

Hi, see below my emerge --info virtualbox

rafael rafael # emerge --info virtualbox 
Portage 2.3.76 (python 3.6.9-final-0, default/linux/amd64/17.1/desktop/plasma, gcc-9.2.0, glibc-2.29-r2, 4.19.66-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.19.66-gentoo-x86_64-AMD_Ryzen_9_3900X_12-Core_Processor-with-gentoo-2.6
KiB Mem:    32903128 total,  25519064 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Sat, 02 Nov 2019 13:00:01 +0000
Head commit of repository gentoo: 95f3d2d96181cf192b59ad1672041b977c64df72
sh bash 4.4_p23-r1
ld GNU gold (Gentoo 2.32 p2 2.32.0) 1.16
ccache version 3.7.4 [disabled]
app-shells/bash:          4.4_p23-r1::gentoo
dev-java/java-config:     2.2.0-r4::gentoo
dev-lang/perl:            5.28.2-r1::gentoo
dev-lang/python:          2.7.16-r102::lto-overlay, 3.6.9::gentoo
dev-util/ccache:          3.7.4::gentoo
dev-util/cmake:           3.14.6::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/openrc:          0.41.2::gentoo
sys-apps/sandbox:         2.13::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.16.1-r1::gentoo
sys-devel/binutils:       2.32-r1::gentoo
sys-devel/gcc:            8.3.0-r1::gentoo, 9.2.0-r1::gentoo
sys-devel/gcc-config:     2.0::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 4.19::gentoo (virtual/os-headers)
sys-libs/glibc:           2.29-r2::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-max-age: 24
    sync-rsync-extra-opts: 
    sync-rsync-verify-jobs: 1

jorgicio
    location: /var/lib/layman/jorgicio
    sync-type: laymansync
    sync-uri: https://github.com/jorgicio/jorgicio-gentoo.git
    masters: gentoo
    priority: 50

lto-overlay
    location: /var/lib/layman/lto-overlay
    sync-type: laymansync
    sync-uri: https://github.com/InBetweenNames/gentooLTO.git
    masters: gentoo mv
    priority: 50

mv
    location: /var/lib/layman/mv
    sync-type: laymansync
    sync-uri: https://anongit.gentoo.org/git/user/mv.git
    masters: gentoo
    priority: 50

steam-overlay
    location: /var/lib/layman/steam-overlay
    masters: gentoo
    priority: 50

zugaina
    location: /var/lib/layman/zugaina
    sync-type: laymansync
    sync-uri: rsync://gentoo.zugaina.org/zugaina-portage
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE geekbench truecrypt-3.0 bh-luxi AdobeFlash-11.x Google-TOS Oracle-BCLA-JavaSE PUEL google-chrome NVIDIA-CUDA teamspeak3 MPEG-4 CUDPP unRAR spideroak NVIDIA-r2 linux-fw-redistributable no-source-code freedist linux-firmware CC-BY-ND-3.0 dropbox ValveSteamLicense MSttfEULA VIGRA SIFT FraunhoferFDK"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=znver2 -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=25 -fuse-linker-plugin -pipe -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /var/spool/munin-async/.ssh"
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="-march=znver2 -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=25 -fuse-linker-plugin -pipe -fomit-frame-pointer"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN 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="-march=znver2 -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=25 -fuse-linker-plugin -pipe -fomit-frame-pointer"
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 sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=znver2 -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=25 -fuse-linker-plugin -pipe -fomit-frame-pointer"
GENTOO_MIRRORS="https://gentoo.c3sl.ufpr.br/ https://mirror.csclub.uwaterloo.ca/gentoo-distfiles/ https://gentoo.osuosl.org/"
LANG="pt_BR.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="pt_BR"
MAKEOPTS="-j25"
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="X a52 aac acpi activities alsa amd64 argyllcms bash-completion berkdb branding bzip2 cairo cdr clang cli consolekit crypt cups cxx dbus declarative dri dts dvd dvdr emboss encode exif fam fat fdk ffmpeg flac fortran gdbm gif glamor gold gpm graphite gtk hddtemp iconv icu inspector ipv6 jpeg kde kdenlive kipi kwallet lapack lastfm lcms ldap libnotify libtirpc lm-sensors lzma mad mng mp3 mp4 mpeg multilib ncurses nfsv41 nls nptl ntfs nvenc ogg opencl opengl openmp opus pam pango pcre pdf phonon plasma png policykit ppds qml qt5 rdesktop readline samba sdl seccomp semantic-desktop sift spell split-usr sqlite ssl startup-notification static-libs steamruntime svc svg swat sync-plugin-portage tcpd theora threads tiff truetype udev udisks unicode upower usb uvm vdpau vnc vorbis vpx widevine widgets wxwidgets x264 x265 xattr xcb xcomposite xml xorg xv xvid zenmap zip zlib" ABI_X86="64 32" ADA_TARGET="gnat_2018" ALSA_CARDS="hda-intel" 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="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt sha sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3" 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="efi-64 pc" INPUT_DEVICES="evdev" KERNEL="linux" L10N="pt-BR" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" NETBEANS_MODULES="apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websvccommon xml" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python3_6 python2_7" RUBY_TARGETS="ruby24 ruby25" USERLAND="GNU" VIDEO_CARDS="nvidia" 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

=================================================================
                        Package Settings
=================================================================

app-emulation/virtualbox-5.2.26-r1::gentoo was built with the following:
USE="alsa opengl opus pam qt5 sdk udev vnc -debug -doc -headless -java -libressl -lvm -pax_kernel -pulseaudio -python -vboxwebsrv" ABI_X86="(64)" PYTHON_TARGETS="python2_7"
CFLAGS="-march=znver1 -O2 -pipe"
CXXFLAGS="-march=znver1 -O2 -pipe"

I hadn't noticed that the libraries were 32bit, but this wasn't happening before LTO, should I change something at the ebuild?

elsandosgrande commented 4 years ago
  1. Ebuilds have no effect on libraries
  2. Was your transition to 17.1 smooth (like mine), or did you have issues?
  3. It is recommended that you have ACCEPT_KEYWORDS=~amd64 set in your make.conf when using GentooLTO, as we do not test against the stable version of Gentoo and recommend to use the latest version of the compiler of your choice (some people are successfully using Clang instead of GCC, though I am not sure how smooth the transition was for them)
  4. What is your output of equery belongs libcrypto.so? Mine is:
 * Searching for libcrypto.so ...
dev-libs/openssl-1.1.1d-r2 (/usr/lib64/libcrypto.so -> libcrypto.so.1.1)
dev-libs/openssl-1.1.1d-r2 (/usr/lib/libcrypto.so -> libcrypto.so.1.1)

If it says bash: equery: command not found, then install app-portage/gentoolkit and try again. If you do not see a lib64 entry, your system needs troubleshooting.

jiblime commented 4 years ago

Is there a way in ltoworkarounds to force the linker to be GOLD?

In short, not really.

Emerge ltoize with USE override-flagomatic. This will link a script in /etc/portage/bashrc.d to overwrite all the functions in the flag-o-matic.eclass at build time. The original eclass file is located at /var/db/repos/gentoo/eclass/flag-o-matic.eclass if you would like to take a look.

By erasing all the eclass functions, what override-flagomatic will do is remove all ebuild forced flag modifications and allow you to use all of your own. The problem with this is that it can break emerges where changing or adding a flag is needed. You can emerge ltoize with override-flagomatic, build the package, then rebuild ltoize without it so you don't have to worry about random breakages in other packages.

What I generally do is copy the package into a local overlay and edit it from there. Unfortunately, I don't think there is a one-and-done way to force a linker when it's built into an ebuild like that.

elsandosgrande commented 4 years ago

@jiblime -fuse-ld=gold

rafaelfortes commented 4 years ago
  1. Ebuilds have no effect on libraries
  2. Was your transition to 17.1 smooth (like mine), or did you have issues?
  3. It is recommended that you have ACCEPT_KEYWORDS=~amd64 set in your make.conf when using GentooLTO, as we do not test against the stable version of Gentoo and recommend to use the latest version of the compiler of your choice (some people are successfully using Clang instead of GCC, though I am not sure how smooth the transition was for them)
  4. What is your output of equery belongs libcrypto.so? Mine is:
 * Searching for libcrypto.so ...
dev-libs/openssl-1.1.1d-r2 (/usr/lib64/libcrypto.so -> libcrypto.so.1.1)
dev-libs/openssl-1.1.1d-r2 (/usr/lib/libcrypto.so -> libcrypto.so.1.1)

If it says bash: equery: command not found, then install app-portage/gentoolkit and try again. If you do not see a lib64 entry, your system needs troubleshooting.

Sorry for the late reply, didn't have time the last few days.

  1. I did not transition, installed fresh directly on 17.1
  2. I'll will try rebuilding everything with ~amd64, but it will take sometime, if it works I'll update here.
  3. Pretty much the same output
    * Searching for libcrypto.so ... 
    app-backup/spideroak-bin-7.5.0 (/opt/SpiderOakONE/lib/libcrypto.so)
    dev-libs/openssl-1.1.1d-r2 (/usr/lib/libcrypto.so -> libcrypto.so.1.1)
    dev-libs/openssl-1.1.1d-r2 (/usr/lib64/libcrypto.so -> libcrypto.so.1.1)
jiblime commented 4 years ago

@jiblime -fuse-ld=gold

Pretty surprised tc-ld-disable-gold doesn't filter ld.gold from *FLAGS. Nice catch.

If the package still fails to compile, you can also try -fuse-ld=lld with sys-devel/lld installed

elsandosgrande commented 4 years ago

Maybe his .pc file for the library(ies) is not pointing towards /usr/lib64? That's what happened with Rubberband.

rafaelfortes commented 4 years ago

So, it took some time but recompiled my whole system with ACCEPT_KEYWORDS="~amd64"... and still have the same problem with virtualbox. (uploaded to a google drive with the full log if anyone want to take a better look https://drive.google.com/open?id=161w-wZchG8fhUR_SUOoAlfcyCbYe2-T5) Using -fuse-ld=gold apparently did not work, still got the message saying bfd was being used.

@elsandosgrande what do you mean by .pc file? don't know this extension. And if the problem is with the ebuild or something of the sort, why would only happen after I changed to LTO (it compiled fine before)?

elsandosgrande commented 4 years ago

.pc file -> pkg-config file. By "Rubberband", I am referring to this: https://bugs.gentoo.org/691274.

rafaelfortes commented 4 years ago

Checked pkg-config (didn't even know I had this, learned one more thing today :) ) and there is no .pc file for virtualbox. Virtualbox ebuild has no reference to /usr/lib or /usr/lib64 directly, only to get_libdir function. I'm kind in a loss here, don't know how to debug this, any ideas?

elsandosgrande commented 4 years ago

You don't have a VirtualBox .pc file because VirtualBox is not yet installed. Even then, it would be irrelevant, as pkg-config looks at the pc files of libraries being used. Did you look at the linked forum posts @rafaelfortes?

Anyway, the line before Please submit a full bug report is probably the actual error here, since I just saw that some packages still get that skipping incompatible output, while not failing at all. Could you please post the latter half of the build log in a GitHub gist?

rafaelfortes commented 4 years ago

@elsandosgrande created a gist as requested, included the beginning of emerge process and after around line 430 a section of the end of the build. if you need it to have more data just ask.

https://gist.github.com/rafaelfortes/d256fb546ced4b22f5ac4ce018e37a51

elsandosgrande commented 4 years ago
  1. VirtualBox strips flags. That one I didn't know. It even lies to Portage about it.
  2. I'm not seeing much of anything here. Could you attach the full log file in a reply here and check the .pc files of the libraries mentioned in those skips like I did in https://bugs.gentoo.org/691274 using equery and see if any show what is shown in the ticket I linked to?
rafaelfortes commented 4 years ago

I could not create a gist with the entire build.log file, github just gives an error, apparently it is way too long, but did upload to google drive here build.log. Checked the pc files, most libs don't have .pc files associated, only found for libssl and libcrypto, but I do have two .pc files for each, one at /usr/lib/pkgconfig and another at /usr/lib64/pkgconfig. The ones at 'lib' reference internally to '/usr/lib' and the ones at 'lib64' reference '/usr/lib64', as one would expect. The thing is, should I have these two folders with .pc files, can the linker be looking for the libraries at the wrong folder because of it? One thing, could this be cause by a bad environmental variable? maybe I'm missing a '/usr/lib64' somewhere?

elsandosgrande commented 4 years ago

All right... I am not seeing anything out of the ordinary yet and don't have the time right now to rebuild VirtualBox for the sole purpose of comparing the logs. Also, other libraries should have respective pkg-config files. For example, after running equery belongs /usr/lib/libX11.so, I got x11-libs/libX11-1.6.9 (/usr/lib/libX11.so -> libX11.so.6.3.0), from which I was able to see which package owns the library. Then, by doing equery files x11-libs/libX11-1.6.9 and looking for .pc files, I found /usr/lib/pkgconfig/x11-xcb.pc, /usr/lib/pkgconfig/x11.pc, /usr/lib64/pkgconfig/x11-xcb.pc and /usr/lib64/pkgconfig/x11.pc. To emphasize, having one mere library with a misconfigured pkg-config file was enough to bring everything down to a grinding halt in the issue ticket linked above.

@jiblime Pardon the mention, but do you have any ideas here? I am truly stumped.

rafaelfortes commented 4 years ago

So, after a few weeks of traveling for work and being busy decided to compile virtualbox again and it worked... I tried version 6.1.0 this time. I guess the issue is closed, thank you @elsandosgrande for your efforts trying to solve this, its appreciated.

elsandosgrande commented 4 years ago

I'm glad that it worked out.