我原来的gcc版本是5.4.1的,把gcc设置为6.2版本的,运行上面的程序,提示如下:
'vmmon.tar' -> 'vmmon.tar.bak'
'vmnet.tar' -> 'vmnet.tar.bak'
patching file vmmon-only/linux/hostif.c
Hunk #1 already applied at 1165-1167.
patching file vmnet-only/userif.c
Hunk #1 NOT MERGED at 116-126.
Stopping VMware services:
VMware Authentication Daemon done
VM communication interface socket family done
Virtual machine communication interface done
Virtual machine monitor done
Blocking file system done
make: Entering directory '/tmp/modconfig-x5hshL/vmmon-only'
Using kernel build system.
/usr/bin/make -C /lib/modules/4.9.0-deepin4-amd64/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
MODULEBUILDDIR= modules
make[1]: Entering directory '/usr/src/linux-headers-4.9.0-deepin4-amd64'
CC [M] /tmp/modconfig-x5hshL/vmmon-only/linux/driverLog.o
CC [M] /tmp/modconfig-x5hshL/vmmon-only/linux/driver.o
CC [M] /tmp/modconfig-x5hshL/vmmon-only/linux/hostif.o
CC [M] /tmp/modconfig-x5hshL/vmmon-only/common/apic.o
CC [M] /tmp/modconfig-x5hshL/vmmon-only/common/memtrack.o
CC [M] /tmp/modconfig-x5hshL/vmmon-only/common/hashFunc.o
CC [M] /tmp/modconfig-x5hshL/vmmon-only/common/vmx86.o
CC [M] /tmp/modconfig-x5hshL/vmmon-only/common/cpuid.o
/tmp/modconfig-x5hshL/vmmon-only/linux/driver.c:1283:1: warning: always_inline function might not be inlinable [-Wattributes]
LinuxDriverSyncReadTSCs(uint64 *delta) // OUT: TSC max - TSC min
^~~~~~~~~~~~~~~~~~~~~~~
CC [M] /tmp/modconfig-x5hshL/vmmon-only/common/task.o
CC [M] /tmp/modconfig-x5hshL/vmmon-only/common/comport.o
CC [M] /tmp/modconfig-x5hshL/vmmon-only/common/phystrack.o
CC [M] /tmp/modconfig-x5hshL/vmmon-only/vmcore/moduleloop.o
LD [M] /tmp/modconfig-x5hshL/vmmon-only/vmmon.o
Building modules, stage 2.
MODPOST 1 modules
CC /tmp/modconfig-x5hshL/vmmon-only/vmmon.mod.o
LD [M] /tmp/modconfig-x5hshL/vmmon-only/vmmon.ko
make[1]: Leaving directory '/usr/src/linux-headers-4.9.0-deepin4-amd64'
/usr/bin/make -C $PWD SRCROOT=$PWD/. \
MODULEBUILDDIR= postbuild
make[1]: Entering directory '/tmp/modconfig-x5hshL/vmmon-only'
make[1]: 'postbuild' is up to date.
make[1]: Leaving directory '/tmp/modconfig-x5hshL/vmmon-only'
cp -f vmmon.ko ./../vmmon.o
make: Leaving directory '/tmp/modconfig-x5hshL/vmmon-only'
make: Entering directory '/tmp/modconfig-x5hshL/vmnet-only'
Using kernel build system.
/usr/bin/make -C /lib/modules/4.9.0-deepin4-amd64/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
MODULEBUILDDIR= modules
make[1]: Entering directory '/usr/src/linux-headers-4.9.0-deepin4-amd64'
CC [M] /tmp/modconfig-x5hshL/vmnet-only/driver.o
CC [M] /tmp/modconfig-x5hshL/vmnet-only/hub.o
CC [M] /tmp/modconfig-x5hshL/vmnet-only/userif.o
CC [M] /tmp/modconfig-x5hshL/vmnet-only/netif.o
/tmp/modconfig-x5hshL/vmnet-only/userif.c: In function ‘UserifLockPage’:
/tmp/modconfig-x5hshL/vmnet-only/userif.c:116:1: error: version control conflict marker in file
<<<<<<<
^~~~~~~
/tmp/modconfig-x5hshL/vmnet-only/userif.c:126:1: error: version control conflict marker in file
>>>>>>>
^~~~~~~
/tmp/modconfig-x5hshL/vmnet-only/userif.c:130:1: error: version control conflict marker in file
=======
^~~~~~~
/tmp/modconfig-x5hshL/vmnet-only/userif.c:132:1: error: version control conflict marker in file
>>>>>>>
^~~~~~~
In file included from /usr/src/linux-headers-4.9.0-deepin4-common/include/linux/pci.h:35:0,
from /tmp/modconfig-x5hshL/vmnet-only/compat_netdevice.h:27,
from /tmp/modconfig-x5hshL/vmnet-only/netif.c:43:
/usr/src/linux-headers-4.9.0-deepin4-common/include/linux/pci_ids.h:2253:0: warning: "CI_VENDOR_ID_VMWARE" redefined
#define PCI_VENDOR_ID_VMWARE 0x15ad
In file included from /tmp/modconfig-x5hshL/vmnet-only/net.h:38:0,
from /tmp/modconfig-x5hshL/vmnet-only/vnetInt.h:26,
from /tmp/modconfig-x5hshL/vmnet-only/netif.c:42:
/tmp/modconfig-x5hshL/vmnet-only/vm_device_version.h:56:0: note: this is the location of the previous definition
#define PCI_VENDOR_ID_VMWARE 0x15AD
/usr/src/linux-headers-4.9.0-deepin4-common/scripts/Makefile.build:298: recipe for target '/tmp/modconfig-x5hshL/vmnet-only/userif.o' failed
make[4]: *** [/tmp/modconfig-x5hshL/vmnet-only/userif.o] Error 1
make[4]: *** 正在等待未完成的任务....
/usr/src/linux-headers-4.9.0-deepin4-common/Makefile:1513: recipe for target '_module_/tmp/modconfig-x5hshL/vmnet-only' failed
make[3]: *** [_module_/tmp/modconfig-x5hshL/vmnet-only] Error 2
Makefile:150: recipe for target 'sub-make' failed
make[2]: *** [sub-make] Error 2
Makefile:8: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.9.0-deepin4-amd64'
Makefile:120: recipe for target 'vmnet.ko' failed
make: *** [vmnet.ko] Error 2
make: Leaving directory '/tmp/modconfig-x5hshL/vmnet-only'
Unable to install all modules. See log for details.
https://gist.github.com/nanpuyue/d6fccf18d11ee3030ba935ae86cfe437
直接下载:
vmware-kernel-4.9-patch.sh