Created attachment 705087 [details] Build log (in gzip format) Hello, app-emulation/virtualbox-6.1.20-r1 compilation fails, as displayed in build log in attachment. Using GCC 11.1.0 with kernel 5.11.17, and Python 3.8. [ebuild U ] app-emulation/virtualbox-6.1.20-r1:0/6.1::gentoo [6.1.18:0/6.1::gentoo] USE="alsa lvm opengl opus pam pulseaudio qt5 sdk udev -debug -doc -dtrace -headless -java -pax_kernel -python -vboxwebsrv -vnc (-libressl%)" PYTHON_SINGLE_TARGET="python3_8 -python3_7 -python3_9%" 161,690 KiB Best regards,
Created attachment 705093 [details] emerge --info 'app-emulation/virtualbox'
Created attachment 705420 [details] build.log with GCC 10 I've got compilation error almost in the same stage with stable gcc (10.2.0-r5). But it's a seg fault. Not really sure if it's the same issue or not.
(In reply to Mike Limansky from comment #2) > Created attachment 705420 [details] > build.log with GCC 10 > > I've got compilation error almost in the same stage with stable gcc > (10.2.0-r5). But it's a seg fault. Not really sure if it's the same issue or > not. Hello Mike, Indeed, I also have a Segmentation Fault, however still related to kbuild in my case. Could you please try to recompile dev-util/kbuild, and confirm you might have the same issues than bug #788691? Thanks. Also, I tried to compile VirtualBox version 6.1.22, I now really think dev-util/kbuild is the root issue.
I have this bug too. kmk: *** Exiting with status 2 GEN {T}/Runtime/errmsgdata.h kmk_builtin_redirect -wo /var/tmp/portage/app-emulation/virtualbox-6.1.22/work/VirtualBox-6.1.22/out/linux.amd64/release/obj/Runtime/errmsgdata.h -- /usr/bin/kmk_sed -f /var/tmp/portage/app-emulation/virtualbox-6.1.22/work/VirtualBox-6.1.22/src/VBox/Runtime/common/err/errmsg.sed /var/tmp/portage/app-emulation/virtualbox-6.1.22/work/VirtualBox-6.1.22/include/iprt/err.h /var/tmp/portage/app-emulation/virtualbox-6.1.22/work/VirtualBox-6.1.22/include/VBox/err.h kmk: *** [/var/tmp/portage/app-emulation/virtualbox-6.1.22/work/VirtualBox-6.1.22/src/VBox/Runtime/Makefile.kmk:3667: /var/tmp/portage/app-emulation/virtualbox-6.1.22/work/VirtualBox-6.1.22/out/linux.amd64/release/obj/Runtime/errmsgdata.h] Segmentation fault I originally had a bug even getting the Kbuild pre-requisite package compiled - Bug #788691, but I managed to hack it and get that compiled, move past it, but now I have this "errmsgdata.h" bug with virtualbox itself.... I have also tried kbuild binaries from debian. (The errors all manifest the same regardless, likewise between vbox 6.1.20 , .22 and .26 ) -However I can report a partial success!? I managed to get past this error message, by manually running this command: # cd /var/tmp/portage/app-emulation/virtualbox-6.1.22/work/VirtualBox-6.1.22/ # /usr/bin/kmk_sed -f /var/tmp/portage/app-emulation/virtualbox-6.1.22/work/VirtualBox-6.1.22/src/VBox/Runtime/common/err/errmsg.sed /var/tmp/portage/app-emulation/virtualbox-6.1.22/work/VirtualBox-6.1.22/include/iprt/err.h /var/tmp/portage/app-emulation/virtualbox-6.1.22/work/VirtualBox-6.1.22/include/VBox/err.h > /var/tmp/portage/app-emulation/virtualbox-6.1.22/work/VirtualBox-6.1.22/out/linux.amd64/release/obj/Runtime/errmsgdata.h That uses "kmk_sed" and uses the shell > to redirect and populates the relevant file "errmsgdata.h" so the build can proceed. For some reason "kmk_builtin_redirect" just segfaults... Unfortunately, However, this hack/fix alone does not resolve the build. It proceeds past the original "errmsgdata.h" error, compiles somewhat more, but then gets stuck on some "isomaker docbook manual xml" stuff, and that has stumped me, and requires a new bug report, but is likely all related to kbuild somehow. This: xsltproc docbook-refentry-to-C-help.xsl - {T}/Runtime/man/isomakercmd-man.xml The failing command: $(QUIET)$(call VBOX_XSLTPROC_WITH_CAT, -a+to "$@") --stringparam 'g_sMode' 'cmd' $(VBOX_DOCBOOK_REFENTRY_TO_H_HELP) /var/tmp/portage/app-emulation/virtualbox-6.1.26/work/VirtualBox-6.1.26/out/linux.amd64/release/obj/Runtime/man/isomakercmd-man.xml
(In reply to genBTC from comment #4) I figured everything out finally. I ended up being able to hack/compile virtualbox. It required emerge =dev-util/kbuild-9999 (unmasking ~amd64 and using SVN to download latest revision 3499 from the SVN trunk) At that point, a bug remained that "kmk -v" resulted in "kmk - kBuild version 0.1.9998 (r0)" (revision 0) - the "revision 3499" did not get compiled in, and there is a check for this version number in Virtualbox's Config.KMK file @ line 177 that checks for the revision. I commented that entire check revision section out, and re-ran the ebuild compile. successfully. There was 1 additional bug partway through involving "iPxeBaseBin". for some reason there is a giant linker command being run that tries to execute "N" --no-check-sections --gc-sections, it says "N not found" - Its obvious it should actually use "ld" instead. Copying and pasting that giant command, and manually running it with "ld", (also manually re-did the next "objcopy" step, since it was shown as failing also), then re-ran the ebuild compile... Then it worked! Then: ebuild install , ebuild qmerge. Success! The moral of the story is: 1) we need Kbuild fixed in gentoo (I advise bundling the 3499 revision from trunk into a .tar.gz file (because SVN had a bunch of pre-reqs), and creating a new .3499 ebuild that does whatever the -9999 version does, with 1 extra patch to make sure the binary gets marked as revision 3499 instead of 0). 2) and we need Virtualbox fixed in gentoo (patch the iPxeBaseBin: N -> ld bug) the specifics of which/why are beyond me.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=68e5e01daa13f366aa7faccc63c10575e6f972e9 commit 68e5e01daa13f366aa7faccc63c10575e6f972e9 Author: Lars Wendler <polynomial-c@gentoo.org> AuthorDate: 2021-08-25 08:36:15 +0000 Commit: Lars Wendler <polynomial-c@gentoo.org> CommitDate: 2021-08-25 08:39:30 +0000 dev-util/kbuild: Bump to version 0.1.9998.3499 Thanks-to: <genBTC@gmx.com> Bug: https://bugs.gentoo.org/787572 Bug: https://bugs.gentoo.org/788691 Signed-off-by: Lars Wendler <polynomial-c@gentoo.org> dev-util/kbuild/Manifest | 1 + .../kbuild/files/kbuild-0.1.9998.3499-gold.patch | 15 +++++ ...98.3499-kash-no_separate_parser_allocator.patch | 11 ++++ dev-util/kbuild/kbuild-0.1.9998.3499.ebuild | 75 ++++++++++++++++++++++ 4 files changed, 102 insertions(+)
Please give dev-util/kbuild-0.1.9998.3499 a try and report back your results.
(In reply to Lars Wendler (Polynomial-C) from comment #7) > Please give dev-util/kbuild-0.1.9998.3499 a try and report back your results. Sorry for taking so long to get back to you but the KBuild link stage is still bugged. see other bugpage: https://bugs.gentoo.org/788691#c8
This is caused by bug #788691 Even with kmk compiled, virtualbox fails to build on a hardened kernel.