Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 350739 - vmware-modules-238.3 in vmware-overlay will not compile with 2.6.37 kernel
Summary: vmware-modules-238.3 in vmware-overlay will not compile with 2.6.37 kernel
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo VMWare Bug Squashers [disabled]
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-05 18:43 UTC by Harris Landgarten
Modified: 2011-03-14 13:38 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build log (build.log,8.77 KB, text/plain)
2011-01-07 08:15 UTC, DaggyStyle
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Harris Landgarten 2011-01-05 18:43:21 UTC
make[1]: Leaving directory `/usr/src/linux-2.6.37-gentoo'
/var/tmp/paludis/app-emulation-vmware-modules-238.3/work/vmci-only/linux/driver.c: In function ���LinuxDriver_Open���:
/var/tmp/paludis/app-emulation-vmware-modules-238.3/work/vmci-only/linux/driver.c:375:4: error: implicit declaration of function ���init_MUTEX���
make[3]: *** [/var/tmp/paludis/app-emulation-vmware-modules-238.3/work/vmci-only/linux/driver.o] Error 1
make[2]: *** [_module_/var/tmp/paludis/app-emulation-vmware-modules-238.3/work/vmci-only] Error 2
make[1]: *** [sub-make] Error 2
make: *** [vmci.ko] Error 2
/usr/libexec/paludis/utils/emake: emake returned error 2

The following patch I found upstream is supposed to deal with this issue:

diff -ru original//vmci-only/include/compat_semaphore.h patched//vmci-only/include/compat_semaphore.h
--- original//vmci-only/include/compat_semaphore.h      2010-11-11 15:37:25.000000000 -0500
+++ patched//vmci-only/include/compat_semaphore.h       2010-11-20 10:11:56.000000000 -0500
@@ -28,7 +28,7 @@
 #endif


-#if defined CONFIG_PREEMPT_RT && LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31)
+#if (defined CONFIG_PREEMPT_RT && LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31)) || LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
    /*
     * The -rt patch series changes the name of semaphore/mutex initialization
     * routines (across the entire kernel).  Probably to identify locations that
@@ -41,7 +41,7 @@
       #define DECLARE_MUTEX(_m)  DEFINE_SEMAPHORE(_m)
    #endif
    #ifndef init_MUTEX
-      #define init_MUTEX(_m) semaphore_init(_m)
+      #define init_MUTEX(_m) sema_init(_m,1)
    #endif
 #endif

It would have to be tested and adapted to the ebuild.



Reproducible: Always
Comment 1 Harris Landgarten 2011-01-06 00:53:03 UTC
These changes allowed compile to complete using ebuild:


diff -ru original/vmci-only/include/compat_semaphore.h patched/vmci-only/include/compat_semaphore.h
--- original/vmci-only/include/compat_semaphore.h 2010-11-11 15:37:25.000000000 -0500
+++ patched/vmci-only/include/compat_semaphore.h 2010-11-20 10:11:56.000000000 -0500
@@ -28,7 +28,7 @@
#endif


-#if defined CONFIG_PREEMPT_RT && LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31)
+#if (defined CONFIG_PREEMPT_RT && LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31)) || LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
/*
* The -rt patch series changes the name of semaphore/mutex initialization
* routines (across the entire kernel). Probably to identify locations that
@@ -41,7 +41,7 @@
#define DECLARE_MUTEX(_m) DEFINE_SEMAPHORE(_m)
#endif
#ifndef init_MUTEX
- #define init_MUTEX(_m) semaphore_init(_m)
+ #define init_MUTEX(_m) sema_init(_m,1)
#endif
#endif

diff -ru original/vmnet-only/compat_semaphore.h patched/vmnet-only/compat_semaphore.h
--- original/vmnet-only/compat_semaphore.h 2010-11-11 15:37:23.000000000 -0500
+++ patched/vmnet-only/compat_semaphore.h 2010-11-20 10:11:56.000000000 -0500
@@ -28,7 +28,7 @@
#endif


-#if defined CONFIG_PREEMPT_RT && LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31)
+#if (defined CONFIG_PREEMPT_RT && LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31)) || LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
/*
* The -rt patch series changes the name of semaphore/mutex initialization
* routines (across the entire kernel). Probably to identify locations that
@@ -41,7 +41,7 @@
#define DECLARE_MUTEX(_m) DEFINE_SEMAPHORE(_m)
#endif
#ifndef init_MUTEX
- #define init_MUTEX(_m) semaphore_init(_m)
+ #define init_MUTEX(_m) sema_init(_m,1)
#endif
#endif

diff -ru original/vsock-only/shared/compat_semaphore.h patched/vsock-only/shared/compat_semaphore.h
--- original/vsock-only/shared/compat_semaphore.h 2010-11-11 13:04:44.000000000 -0500
+++ patched/vsock-only/shared/compat_semaphore.h 2010-11-20 10:11:56.000000000 -0500
@@ -28,7 +28,7 @@
#endif


-#if defined CONFIG_PREEMPT_RT && LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31)
+#if (defined CONFIG_PREEMPT_RT && LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31)) || LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
/*
* The -rt patch series changes the name of semaphore/mutex initialization
* routines (across the entire kernel). Probably to identify locations that
@@ -41,7 +41,7 @@
#define DECLARE_MUTEX(_m) DEFINE_SEMAPHORE(_m)
#endif
#ifndef init_MUTEX
- #define init_MUTEX(_m) semaphore_init(_m)
+ #define init_MUTEX(_m) sema_init(_m,1)
#endif
#endif

Comment 2 Harris Landgarten 2011-01-06 02:01:26 UTC
diff -ru original/vmmon-only/linux/driver.c patched/vmmon-only/linux/driver.c
this change is needed as well:

--- original/vmmon-only/linux/driver.c 2010-11-11 13:37:22.000000000 -0700
+++ patched/vmmon-only/linux/driver.c 2010-11-24 12:05:48.924489002 -0700
@@ -145,7 +145,7 @@
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) && \
(defined(CONFIG_SMP) || defined(CONFIG_PREEMPT))
-# define kernel_locked_by_current() kernel_locked()
+# define kernel_locked_by_current() (current->lock_depth >= 0)
#else
# define kernel_locked_by_current() 0
#endif
Comment 3 Vadim Kuznetsov (RETIRED) gentoo-dev 2011-01-06 02:28:44 UTC
fixed in vmware overlay. thanks.
Comment 4 DaggyStyle 2011-01-06 18:06:26 UTC
still fails here.
 * Preparing vmmon module
make -j3 HOSTCC=x86_64-pc-linux-gnu-gcc CROSS_COMPILE=x86_64-pc-linux-gnu- LDFLAGS= auto-build VMWARE_VER=VME_V65 KERNEL_DIR=/usr/src/linux KBUILD_OUTPUT=/lib/modules/2.6.37-gentoo/build 
Using 2.6.x kernel build system.
make -C /lib/modules/2.6.37-gentoo/build SUBDIRS=$PWD SRCROOT=$PWD/. \
          MODULEBUILDDIR= modules
make[1]: Entering directory `/usr/src/linux-2.6.37-gentoo'
make[1]: warning: jobserver unavailable: using -j1.  Add `+' to parent make rule.
  CC [M]  /var/tmp/portage/app-emulation/vmware-modules-238.3/work/vmmon-only/linux/driver.o
/var/tmp/portage/app-emulation/vmware-modules-238.3/work/vmmon-only/linux/driver.c: In function ‘LinuxDriver_Ioctl’:
/var/tmp/portage/app-emulation/vmware-modules-238.3/work/vmmon-only/linux/driver.c:1736:7: error: implicit declaration of function ‘unlock_kernel’
/var/tmp/portage/app-emulation/vmware-modules-238.3/work/vmmon-only/linux/driver.c:1742:7: error: implicit declaration of function ‘lock_kernel’
make[3]: *** [/var/tmp/portage/app-emulation/vmware-modules-238.3/work/vmmon-only/linux/driver.o] Error 1
make[2]: *** [_module_/var/tmp/portage/app-emulation/vmware-modules-238.3/work/vmmon-only] Error 2
make[1]: *** [sub-make] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.37-gentoo'
make: *** [vmmon.ko] Error 2
emake failed
 * ERROR: app-emulation/vmware-modules-238.3 failed:
 *   Unable to emake HOSTCC=x86_64-pc-linux-gnu-gcc CROSS_COMPILE=x86_64-pc-linux-gnu- LDFLAGS=   auto-build VMWARE_VER=VME_V65 KERNEL_DIR=/usr/src/linux KBUILD_OUTPUT=/lib/modules/2.6.37-gentoo/build
Comment 5 Vadim Kuznetsov (RETIRED) gentoo-dev 2011-01-06 18:25:56 UTC
(In reply to comment #4)
> still fails here.
Please attach full build.log and grep your .config for
CONFIG_LOCK_KERNEL and CONFIG_BLK
Comment 6 DaggyStyle 2011-01-07 08:15:33 UTC
Created attachment 259116 [details]
build log

dagg@Starfleet /usr/src/linux $ cat .config | grep CONFIG_LOCK_KERNEL
dagg@Starfleet /usr/src/linux $ cat .config | grep CONFIG_BLK
# CONFIG_BLK_DEV_INITRD is not set
# CONFIG_BLK_DEV_BSG is not set
# CONFIG_BLK_DEV_INTEGRITY is not set
CONFIG_BLK_DEV=y
# CONFIG_BLK_DEV_FD is not set
# CONFIG_BLK_CPQ_DA is not set
# CONFIG_BLK_CPQ_CISS_DA is not set
# CONFIG_BLK_DEV_DAC960 is not set
# CONFIG_BLK_DEV_UMEM is not set
# CONFIG_BLK_DEV_COW_COMMON is not set
CONFIG_BLK_DEV_LOOP=y
# CONFIG_BLK_DEV_CRYPTOLOOP is not set
# CONFIG_BLK_DEV_DRBD is not set
# CONFIG_BLK_DEV_NBD is not set
# CONFIG_BLK_DEV_SX8 is not set
# CONFIG_BLK_DEV_UB is not set
# CONFIG_BLK_DEV_RAM is not set
# CONFIG_BLK_DEV_HD is not set
# CONFIG_BLK_DEV_RBD is not set
CONFIG_BLK_DEV_SD=y
CONFIG_BLK_DEV_SR=y
# CONFIG_BLK_DEV_SR_VENDOR is not set
# CONFIG_BLK_DEV_MD is not set
CONFIG_BLK_DEV_DM=y

why didn't you labeled this ebuild as r1?
Comment 7 Harris Landgarten 2011-01-07 22:40:26 UTC
Works fine here
Comment 8 Vadim Kuznetsov (RETIRED) gentoo-dev 2011-01-08 00:00:16 UTC
(In reply to comment #6)
> dagg@Starfleet /usr/src/linux $ cat .config | grep CONFIG_LOCK_KERNEL
You need to enable CONFIG_LOCK_KERNEL

> why didn't you labeled this ebuild as r1?
Because those who is running stable (2.6.36) do not need to reinstall.

Comment 9 Michael Niggli 2011-01-31 11:04:30 UTC
I had the same issue as DaggyStyle. After adding epatch lines for sk_sleep.patch and iommu_map.patch to the ebuild, it compiled on ~amd64 with tuxonice-sources-2.6.37. :-)
Comment 10 DaggyStyle 2011-01-31 16:19:26 UTC
solved here too
Comment 11 Andrey Vul 2011-03-14 13:38:06 UTC
With 2.6.33.7-rt30, vmnet still won't compile after patching:
/var/tmp/portage/app-emulation/vmware-modules-238.3-r3/work/vmnet-only/driver.c:117:37: error: macro "DEFINE_SEMAPHORE" requires 2 arguments, but only 1 given
/var/tmp/portage/app-emulation/vmware-modules-238.3-r3/work/vmnet-only/driver.c:117:1: warning: data definition has no type or storage class
/var/tmp/portage/app-emulation/vmware-modules-238.3-r3/work/vmnet-only/driver.c:117:1: warning: type defaults to ‘int’ in declaration of ‘DEFINE_SEMAPHORE’