I'm using Ubuntu 17.04 , and I manually upgraded my kernel version to 4.12.8 using the tool ukuu (Ubuntu Kernel Update Utility).

When trying to launch vmware (it is already installed), it asks me to give it the path to gcc-7.1 to compile vmware modules.

enter image description here

I didn't understand why vmware asked me that, because I installed the vmware modules without any problem in the previous kernel versions in the same computer.

After some researches, I found out that vmware compile its modules using the same gcc version that is used to compile the current kernel. As I installed this kernel version manually, I didn't have gcc-7.1 on my computer.

My question is (sorry for this long speech I had to give) : How can I force vmware to use another gcc version to compile its modules ?

  • can you install GCC version 7.1.0 first, then provide VMware the path to that GCC version? – Timothy Pulliam Aug 23 '17 at 20:42
  • There is no gcc-7.1 in the official repository. I did find another repository (sudo add-apt-repository ppa:ubuntu-toolchain-r/test) but it didn't contain gcc 7.1.0 . – Sidahmed Aug 23 '17 at 20:46
  • 2
    I think you should be able to download the tarball and compile it from source if needed. Tarball is located at ftp.gnu.org/gnu/gcc/gcc-7.1.0 – Timothy Pulliam Aug 23 '17 at 20:53
  • There is no way to force vmware to use another gcc version ? – Sidahmed Aug 23 '17 at 20:54
  • @Sidahmed sudo add-apt-repository ppa:jonathonf/gcc-7.1 – GAD3R Aug 23 '17 at 21:32

Short answer: you should not.

Long answer:

That's not that VMware stubbornly wants a particular GCC version for no reason. It's very unwise to compile a kernel module with another GCC than the one used for the kernel itself: if there is any ABI change between the two gcc versions, you will probably corrupt and crash your system.

If you ever convinced VMware to compile its modules with your GCC version, the kernel would refuse to load them. You would then have to binary-edit the modules in order to replace the GCC signature with the right one.

But, all in all, is that worth the risk? It would be preferable to either download/compile GCC 7.1, or recompile your kernel with your current GCC version.


Adding my comment as an answer since it answered your question.

I think you should be able to download the tarball and compile it from source if needed. Tarball is located at https://ftp.gnu.org/gnu/gcc/gcc-7.1.0/

Download the tarball then run the usual ./configure, make, make install

  • Better pass --program-suffix=-7.1 to ../gcc-7.1.0/configure and never build GCC inside its source tree. – Basile Starynkevitch Aug 24 '17 at 16:42
  • @Basile Starynkevitch I know this is a stupid question, but why never build GCC inside the source tree? Is the build process different for GCC? Or this simply best practice for compiling from source in general? – Timothy Pulliam Aug 24 '17 at 16:50
  • 2
    Because it is documented as a must (more precisely, a strong recommendation). The inside source tree build is not tested by GCC developers and is likely to break something. – Basile Starynkevitch Aug 24 '17 at 16:51
  • 1
    you should edit your answer to add that precision – Basile Starynkevitch Aug 24 '17 at 16:53
  • Here is a Good tutorial to build gcc 7.1. Follow this – Moulick Aug 26 '17 at 6:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.