Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error building VirtualBox 5.1.4 with CCACHE_CPP2 enabled #129

Closed
scop opened this issue Sep 7, 2016 · 1 comment
Closed

Error building VirtualBox 5.1.4 with CCACHE_CPP2 enabled #129

scop opened this issue Sep 7, 2016 · 1 comment
Labels
bug Does not work as intended/documented
Milestone

Comments

@scop
Copy link
Contributor

scop commented Sep 7, 2016

Original bug report: https://bugzilla.redhat.com/show_bug.cgi?id=1373295

Reproducer:

First install VirtualBox's build dependencies. I guess this could be trimmed down to some extent, but for example for current Fedora x86_64 development this would be taken care of by:
dnf install iasl kBuild SDL-devel xalan-c-devel openssl-devel libcurl-devel libxslt-devel xerces-c-devel libIDL-devel yasm pulseaudio-libs-devel python2-devel desktop-file-utils libcap-devel qt5-qtbase-devel qt5-qtx11extras-devel qt5-linguist pam-devel mkisofs java-devel boost-devel libxml2-devel libpng-devel zlib-devel device-mapper-devel libvpx-devel makeself libdrm-devel libpciaccess-devel mesa-libGL-devel mesa-libOSMesa-devel mesa-libEGL-devel pixman-devel xorg-x11-proto-devel xorg-x11-server-devel libXcursor-devel libXcomposite-devel libXmu-devel libXinerama-devel "libstdc++-static(x86-64)" "libstdc++-static(x86-32)" "glibc(x86-32)" "glibc-devel(x86-32)" "libgcc(x86-32)"

Then proceed with getting and building:

$ curl -O http://download.virtualbox.org/virtualbox/5.1.4/VirtualBox-5.1.4.tar.bz2
$ tar xf VirtualBox-5.1.4.tar.bz2
$ cd VirtualBox-5.1.4
$ sed -i -e 's/\(\$cc_maj -eq 6 -a \$cc_min -gt\) 1/\1 2/' configure  # if gcc is >= 6.2
$ ./configure --disable-kmods --disable-docs --with-gcc="ccache gcc" --with-g++="ccache g++"
$ source ./env.sh
$ kmk KBUILD_VERBOSE=2

Results in bunch of errors like:

cc1: error: to generate dependencies you must specify either -M or -MM
cc1plus: error: to generate dependencies you must specify either -M or -MM

This is at least with current Fedora development, gcc 6.2.1, ccache 3.3 (and 3.2.7 with CCACHE_CPP2 turned on). Turning off CCACHE_CPP2 avoids the errors.

@jrosdahl
Copy link
Member

jrosdahl commented Sep 7, 2016

The root cause is that VirtualBox's build system for some strange reason uses -Wp,-MT,path and -Wp,-MP instead of the normal -MT path and -MP option forms, and ccache doesn't detect those forms. And for some reason, GCC complains when it gets -Wp,-MP without e.g. -Wp,-MD (which ccache does detect and strips) when it compiles normal source code but not when compiling preprocessed source code, which is why there's a build error when run_second_cpp is true.

@jrosdahl jrosdahl added the bug Does not work as intended/documented label Sep 7, 2016
@jrosdahl jrosdahl added this to the 3.2.8 milestone Feb 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Does not work as intended/documented
Projects
None yet
Development

No branches or pull requests

2 participants