mkubecek / vmware-host-modules

Patches needed to build VMware (Player and Workstation) host modules against recent kernels
GNU General Public License v2.0
2.3k stars 372 forks source link

make error generated/autoconf.h: No such file or directory #11

Closed CoCoThink closed 5 years ago

CoCoThink commented 6 years ago

I have encountered an error when making. My system is Manjaro.

Here are the details.

Using standalone build system. In file included from ./autoconf/geninclude.c:20:0: ./include/compat_autoconf.h:38:13: fatal error: generated/autoconf.h: No such file or directory

include <generated/autoconf.h>

         ^~~~~~~~~~~~~~~~~~~~~~

compilation terminated. In file included from .././autoconf/geninclude.c:20:0: .././include/compat_autoconf.h:38:13: fatal error: generated/autoconf.h: No such file or directory

include <generated/autoconf.h>

         ^~~~~~~~~~~~~~~~~~~~~~

compilation terminated. Dependencies for hostif.c cc1: error: code model kernel does not support PIC mode make[1]: [.././Makefile.normal:132: hostif.d] Error 1 make: [Makefile.normal:143: deps] Error 2

mkubecek commented 6 years ago

This doesn't look like a problem with the patches, rather missing devel package or wrong compiler options. Can you check if build works with unpatched module sources from VMware? (Preferrably 14.1.1, those should build against kernels up to 4.16-rc4 even without the patches, just with more warnings.)

For the next time: when reporting problems, don't forget to say (1) which branch are you building and (2) against which kernel.

gariepyalex commented 6 years ago

Had the issue on arch linux, the package linux-headers was missing.

alsetema commented 5 years ago

Hello there, unfortunately having the same issue on Artix Linux, compiling against 5.0.9-artix1-1-ARTIX. The error code is the following:

make -C vmmon-only 
make[1]: Entering directory '/home/alsetema/vmware-host-modules-p15.0.4-k5.1/vmmon-only'
Using standalone build system.
In file included from ./autoconf/geninclude.c:20:
./include/compat_autoconf.h:38:13: fatal error: generated/autoconf.h: No such file or directory

# include <generated/autoconf.h>
             ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: Entering directory '/home/alsetema/vmware-host-modules-p15.0.4-k5.1/vmmon-only/driver-5.0.9-artix1-1-ARTIX'
In file included from .././autoconf/geninclude.c:20:
.././include/compat_autoconf.h:38:13: fatal error: generated/autoconf.h: No such file or directory

  # include <generated/autoconf.h>
             ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Dependencies for bootstrap.c
cc1: error: code model kernel does not support PIC mode
make[2]: *** [.././Makefile.normal:140: bootstrap.d] Error 1
make[2]: Leaving directory '/home/alsetema/vmware-host-modules-p15.0.4-k5.1/vmmon-only/driver-5.0.9-artix1-1-ARTIX'
make[1]: *** [Makefile.normal:143: deps] Error 2
make[1]: Leaving directory '/home/alsetema/vmware-host-modules-p15.0.4-k5.1/vmmon-only'
make: *** [Makefile:21: vmmon-only] Error 2

Compiling for version 15.0.4 of workstation player.

I have been reading online that it could be an issue with the kernel headers I am using, but cannot provide any more information unfortunately... Any clues?

dfpr commented 5 years ago

UPDATE: error disappeared after a restart lol

Same error on openSUSE Leap 15.1 even after installing the kernel sources it spits this nice error:

You should not include /usr/include/{linux,asm}/ header files directly for the compilation of kernel modules.

glibc now uses kernel header files from a well-defined working kernel version (as recommended by Linus Torvalds) These files are glibc internal and may not match the currently running kernel. They should only be included via other system header files - user space programs should not directly include <linux/.h> or <asm/.h> as well.

Since Linux 2.6, the kernel module build process has been updated such that users building modules should not typically need to specify additional include directories at all.

To build kernel modules, ensure you have the build environment available either via the kernel-devel and kernel--devel packages or a properly configured kernel source tree.

Then, modules can be built using: make -C M=/home/abuild/rpmbuild/BUILD/linux-glibc-devel-4.15

For the currently running kernel there will be a symbolic link pointing to the build environment located at /lib/modules/4.12.14-lp151.24-default/build for use as .

If you are seeing this message, your environment is not configured properly.

Please adjust the Makefile accordingly.

KERNEL_VERSION macro is not defined, environment is busted Include compat_version.h before compat_autoconf.h No Module support in this kernel. Please configure with CONFIG_MODULES

mkubecek commented 5 years ago

You don't need kernel sources, you need kernel-default-devel (and kernel-devel but that would be installed as a dependency). Also make sure you clean up leftovers from previous failed builds before trying again.

NathanAtOffice commented 3 years ago

Maybe you need apt-get install linux-headers-$(uname -r).

z2z63 commented 1 year ago

Reinstalling linux-headers doesn't work, but it works after restarting

auguysha commented 6 months ago

@nathan-liu-pro solution solved this issue for me