Error compiling vmhgfs on 3.12 #2

Closed
joefiorini opened this Issue Dec 6, 2013 · 11 comments

Comments

Projects
None yet
5 participants
@joefiorini

I'm having trouble getting vmhgfs to compile with the provided patch on the 3.12 kernel. I'm trying to build on Archlinux. Here's the output I'm getting:

In file included from /tmp/modconfig-cAothp/vmhgfs-only/inode.c:38:0:
/tmp/modconfig-cAothp/vmhgfs-only/inode.c: In function ‘HgfsPackSetattrRequest’:
/tmp/modconfig-cAothp/vmhgfs-only/./shared/compat_cred.h:43:29: error: request for member ‘val’ in something not a structure or union
 #define KUID2UID(kuid) (kuid.val)
                             ^
/tmp/modconfig-cAothp/vmhgfs-only/inode.c:520:27: note: in expansion of macro ‘KUID2UID’
          attrV2->userId = KUID2UID(iattr->ia_uid);
                           ^
/tmp/modconfig-cAothp/vmhgfs-only/./shared/compat_cred.h:44:29: error: request for member ‘val’ in something not a structure or union
 #define KGID2GID(kgid) (kgid.val)
                             ^
/tmp/modconfig-cAothp/vmhgfs-only/inode.c:526:28: note: in expansion of macro ‘KGID2GID’
          attrV2->groupId = KGID2GID(iattr->ia_gid);
                            ^
/tmp/modconfig-cAothp/vmhgfs-only/./shared/compat_cred.h:43:29: error: request for member ‘val’ in something not a structure or union
 #define KUID2UID(kuid) (kuid.val)
                             ^
/tmp/modconfig-cAothp/vmhgfs-only/inode.c:623:27: note: in expansion of macro ‘KUID2UID’
          attrV2->userId = KUID2UID(iattr->ia_uid);
                           ^
/tmp/modconfig-cAothp/vmhgfs-only/./shared/compat_cred.h:44:29: error: request for member ‘val’ in something not a structure or union
 #define KGID2GID(kgid) (kgid.val)
                             ^
/tmp/modconfig-cAothp/vmhgfs-only/inode.c:629:28: note: in expansion of macro ‘KGID2GID’
          attrV2->groupId = KGID2GID(iattr->ia_gid);
                            ^
scripts/Makefile.build:308: recipe for target '/tmp/modconfig-cAothp/vmhgfs-only/inode.o' failed
make[2]: *** [/tmp/modconfig-cAothp/vmhgfs-only/inode.o] Error 1
Makefile:1228: recipe for target '_module_/tmp/modconfig-cAothp/vmhgfs-only' failed
make[1]: *** [_module_/tmp/modconfig-cAothp/vmhgfs-only] Error 2make[1]: Leaving directory '/usr/src/linux-3.12.2-1-ARCH'
Makefile:130: recipe for target 'vmhgfs.ko' failed
make: *** [vmhgfs.ko] Error 2
make: Leaving directory '/tmp/modconfig-cAothp/vmhgfs-only'

I did some searching and found a couple stack overflow posts saying that this error means that you should use "->" instead of "."; I tried making that change myself and the error changed to:

/tmp/modconfig-9aRYHR/vmhgfs-only/./shared/compat_cred.h:43:29: error: invalid type argument of ‘->’ (have ‘kuid_t’)
 #define KUID2UID(kuid) (kuid->val)
                             ^
/tmp/modconfig-9aRYHR/vmhgfs-only/inode.c:517:27: note: in expansion of macro ‘KUID2UID’
          attrV2->userId = KUID2UID(iattr->ia_uid);
                           ^
/tmp/modconfig-9aRYHR/vmhgfs-only/./shared/compat_cred.h:44:29: error: invalid type argument of ‘->’ (have ‘kgid_t’)
 #define KGID2GID(kgid) (kgid->val)
                             ^
/tmp/modconfig-9aRYHR/vmhgfs-only/inode.c:523:28: note: in expansion of macro ‘KGID2GID’
          attrV2->groupId = KGID2GID(iattr->ia_gid);
                            ^
/tmp/modconfig-9aRYHR/vmhgfs-only/./shared/compat_cred.h:43:29: error: invalid type argument of ‘->’ (have ‘kuid_t’)
 #define KUID2UID(kuid) (kuid->val)
                             ^
/tmp/modconfig-9aRYHR/vmhgfs-only/inode.c:620:27: note: in expansion of macro ‘KUID2UID’
          attrV2->userId = KUID2UID(iattr->ia_uid);
                           ^
/tmp/modconfig-9aRYHR/vmhgfs-only/./shared/compat_cred.h:44:29: error: invalid type argument of ‘->’ (have ‘kgid_t’)
 #define KGID2GID(kgid) (kgid->val)
                             ^
/tmp/modconfig-9aRYHR/vmhgfs-only/inode.c:626:28: note: in expansion of macro ‘KGID2GID’
          attrV2->groupId = KGID2GID(iattr->ia_gid);
                            ^

Which (according to my searches) means that you should use "." instead of "->". My best guess is that kgid and kuid are getting passed in differently in different contexts, but I'm not that great with C; what do you think?

@rasa

This comment has been minimized.

Show comment
Hide comment
@rasa

rasa Dec 10, 2013

Owner

Joe,

You're the second Arch Linux user to have issues compiling these patches. Unfortunately, I can't help as I'm currently travelling in India and don't have the bandwidth (literally, and figuratively) to help, until I get home in late December, sorry.

Owner

rasa commented Dec 10, 2013

Joe,

You're the second Arch Linux user to have issues compiling these patches. Unfortunately, I can't help as I'm currently travelling in India and don't have the bandwidth (literally, and figuratively) to help, until I get home in late December, sorry.

@misheska

This comment has been minimized.

Show comment
Hide comment
@misheska

misheska Dec 10, 2013

FYI, for what it’s worth, I also tried getting them working for my ArchLinux Packer templates ( https://github.com/misheska/basebox-packer/tree/master/template/archlinux ) and punted on making shared folders work on VMware. I looked into it for a bit, and it seemed like it was going to be a lot of work to get even the current VMware Fusion/Workstation tools to compile with that version of the kernel.

On Dec 10, 2013, at 6:34 AM, Ross Smith II notifications@github.com wrote:

Joe,

You're the second Arch Linux user to have issues compiling these patches. Unfortunately, I can't help as I'm currently travelling in India and don't have the bandwidth (literally, and figuratively) to help, until I get home in late December, sorry.


Reply to this email directly or view it on GitHub.

FYI, for what it’s worth, I also tried getting them working for my ArchLinux Packer templates ( https://github.com/misheska/basebox-packer/tree/master/template/archlinux ) and punted on making shared folders work on VMware. I looked into it for a bit, and it seemed like it was going to be a lot of work to get even the current VMware Fusion/Workstation tools to compile with that version of the kernel.

On Dec 10, 2013, at 6:34 AM, Ross Smith II notifications@github.com wrote:

Joe,

You're the second Arch Linux user to have issues compiling these patches. Unfortunately, I can't help as I'm currently travelling in India and don't have the bandwidth (literally, and figuratively) to help, until I get home in late December, sorry.


Reply to this email directly or view it on GitHub.

@rasa

This comment has been minimized.

Show comment
Hide comment
@rasa

rasa Dec 10, 2013

Owner

I was able to compile successfully on 3.12, but I've only tried using Trusty (Ubuntu 14.04).

Owner

rasa commented Dec 10, 2013

I was able to compile successfully on 3.12, but I've only tried using Trusty (Ubuntu 14.04).

@misheska

This comment has been minimized.

Show comment
Hide comment
@misheska

misheska Dec 10, 2013

Good to hear, so it’s probably easier than I thought!

On Dec 10, 2013, at 6:43 AM, Ross Smith II notifications@github.com wrote:

I was able to compile successfully on 3.12, but I've only tried using Trusty (Ubuntu 14.04).


Reply to this email directly or view it on GitHub.

Good to hear, so it’s probably easier than I thought!

On Dec 10, 2013, at 6:43 AM, Ross Smith II notifications@github.com wrote:

I was able to compile successfully on 3.12, but I've only tried using Trusty (Ubuntu 14.04).


Reply to this email directly or view it on GitHub.

@gavinhungry

This comment has been minimized.

Show comment
Hide comment
@gavinhungry

gavinhungry Dec 12, 2013

Seeing something similar on Arch as well, using VMwareTools-9.6.1-1378637.tar.gz.

$ uname -rm
3.12.4-1-ARCH x86_64
In file included from /tmp/modconfig-geVbIL/vmhgfs-only/fsutil.c:34:0:
/tmp/modconfig-geVbIL/vmhgfs-only/fsutil.c: In function ‘HgfsChangeFileAttributes’:
/tmp/modconfig-geVbIL/vmhgfs-only/./shared/compat_cred.h:43:29: error: request for member ‘val’ in something not a structure or union
 #define KUID2UID(kuid) (kuid.val)
                             ^
/tmp/modconfig-geVbIL/vmhgfs-only/fsutil.c:681:7: note: in expansion of macro ‘KUID2UID’
       KUID2UID(inode->i_uid) = si->uid;
       ^
/tmp/modconfig-geVbIL/vmhgfs-only/./shared/compat_cred.h:43:29: error: request for member ‘val’ in something not a structure or union
 #define KUID2UID(kuid) (kuid.val)
                             ^
/tmp/modconfig-geVbIL/vmhgfs-only/fsutil.c:683:7: note: in expansion of macro ‘KUID2UID’
       KUID2UID(inode->i_uid) = attr->userId;
       ^
/tmp/modconfig-geVbIL/vmhgfs-only/./shared/compat_cred.h:44:29: error: request for member ‘val’ in something not a structure or union
 #define KGID2GID(kgid) (kgid.val)
                             ^
/tmp/modconfig-geVbIL/vmhgfs-only/fsutil.c:686:7: note: in expansion of macro ‘KGID2GID’
       KGID2GID(inode->i_gid) = si->gid;
       ^
/tmp/modconfig-geVbIL/vmhgfs-only/./shared/compat_cred.h:44:29: error: request for member ‘val’ in something not a structure or union
 #define KGID2GID(kgid) (kgid.val)
                             ^
/tmp/modconfig-geVbIL/vmhgfs-only/fsutil.c:688:7: note: in expansion of macro ‘KGID2GID’
       KGID2GID(inode->i_gid) = attr->groupId;
       ^
/tmp/modconfig-geVbIL/vmhgfs-only/fsutil.c: In function ‘HgfsSetUidGid’:
/tmp/modconfig-geVbIL/vmhgfs-only/./shared/compat_cred.h:43:29: error: request for member ‘val’ in something not a structure or union
 #define KUID2UID(kuid) (kuid.val)
                             ^
/tmp/modconfig-geVbIL/vmhgfs-only/fsutil.c:1664:4: note: in expansion of macro ‘KUID2UID’
    KUID2UID(setUidGid.ia_uid) = uid;
    ^
/tmp/modconfig-geVbIL/vmhgfs-only/./shared/compat_cred.h:44:29: error: request for member ‘val’ in something not a structure or union
 #define KGID2GID(kgid) (kgid.val)
                             ^
/tmp/modconfig-geVbIL/vmhgfs-only/fsutil.c:1672:7: note: in expansion of macro ‘KGID2GID’
       KGID2GID(setUidGid.ia_gid) = gid;
       ^
scripts/Makefile.build:308: recipe for target '/tmp/modconfig-geVbIL/vmhgfs-only/fsutil.o' failed
make[2]: *** [/tmp/modconfig-geVbIL/vmhgfs-only/fsutil.o] Error 1
make[2]: *** Waiting for unfinished jobs....
Makefile:1228: recipe for target '_module_/tmp/modconfig-geVbIL/vmhgfs-only' failed
make[1]: *** [_module_/tmp/modconfig-geVbIL/vmhgfs-only] Error 2
make[1]: Leaving directory '/usr/src/linux-3.12.4-1-ARCH'
Makefile:130: recipe for target 'vmhgfs.ko' failed
make: *** [vmhgfs.ko] Error 2
make: Leaving directory '/tmp/modconfig-geVbIL/vmhgfs-only'

Seeing something similar on Arch as well, using VMwareTools-9.6.1-1378637.tar.gz.

$ uname -rm
3.12.4-1-ARCH x86_64
In file included from /tmp/modconfig-geVbIL/vmhgfs-only/fsutil.c:34:0:
/tmp/modconfig-geVbIL/vmhgfs-only/fsutil.c: In function ‘HgfsChangeFileAttributes’:
/tmp/modconfig-geVbIL/vmhgfs-only/./shared/compat_cred.h:43:29: error: request for member ‘val’ in something not a structure or union
 #define KUID2UID(kuid) (kuid.val)
                             ^
/tmp/modconfig-geVbIL/vmhgfs-only/fsutil.c:681:7: note: in expansion of macro ‘KUID2UID’
       KUID2UID(inode->i_uid) = si->uid;
       ^
/tmp/modconfig-geVbIL/vmhgfs-only/./shared/compat_cred.h:43:29: error: request for member ‘val’ in something not a structure or union
 #define KUID2UID(kuid) (kuid.val)
                             ^
/tmp/modconfig-geVbIL/vmhgfs-only/fsutil.c:683:7: note: in expansion of macro ‘KUID2UID’
       KUID2UID(inode->i_uid) = attr->userId;
       ^
/tmp/modconfig-geVbIL/vmhgfs-only/./shared/compat_cred.h:44:29: error: request for member ‘val’ in something not a structure or union
 #define KGID2GID(kgid) (kgid.val)
                             ^
/tmp/modconfig-geVbIL/vmhgfs-only/fsutil.c:686:7: note: in expansion of macro ‘KGID2GID’
       KGID2GID(inode->i_gid) = si->gid;
       ^
/tmp/modconfig-geVbIL/vmhgfs-only/./shared/compat_cred.h:44:29: error: request for member ‘val’ in something not a structure or union
 #define KGID2GID(kgid) (kgid.val)
                             ^
/tmp/modconfig-geVbIL/vmhgfs-only/fsutil.c:688:7: note: in expansion of macro ‘KGID2GID’
       KGID2GID(inode->i_gid) = attr->groupId;
       ^
/tmp/modconfig-geVbIL/vmhgfs-only/fsutil.c: In function ‘HgfsSetUidGid’:
/tmp/modconfig-geVbIL/vmhgfs-only/./shared/compat_cred.h:43:29: error: request for member ‘val’ in something not a structure or union
 #define KUID2UID(kuid) (kuid.val)
                             ^
/tmp/modconfig-geVbIL/vmhgfs-only/fsutil.c:1664:4: note: in expansion of macro ‘KUID2UID’
    KUID2UID(setUidGid.ia_uid) = uid;
    ^
/tmp/modconfig-geVbIL/vmhgfs-only/./shared/compat_cred.h:44:29: error: request for member ‘val’ in something not a structure or union
 #define KGID2GID(kgid) (kgid.val)
                             ^
/tmp/modconfig-geVbIL/vmhgfs-only/fsutil.c:1672:7: note: in expansion of macro ‘KGID2GID’
       KGID2GID(setUidGid.ia_gid) = gid;
       ^
scripts/Makefile.build:308: recipe for target '/tmp/modconfig-geVbIL/vmhgfs-only/fsutil.o' failed
make[2]: *** [/tmp/modconfig-geVbIL/vmhgfs-only/fsutil.o] Error 1
make[2]: *** Waiting for unfinished jobs....
Makefile:1228: recipe for target '_module_/tmp/modconfig-geVbIL/vmhgfs-only' failed
make[1]: *** [_module_/tmp/modconfig-geVbIL/vmhgfs-only] Error 2
make[1]: Leaving directory '/usr/src/linux-3.12.4-1-ARCH'
Makefile:130: recipe for target 'vmhgfs.ko' failed
make: *** [vmhgfs.ko] Error 2
make: Leaving directory '/tmp/modconfig-geVbIL/vmhgfs-only'
@raymond-w-ko

This comment has been minimized.

Show comment
Hide comment
@raymond-w-ko

raymond-w-ko Dec 14, 2013

Contributor

Okay I think I figured out what is causing this. In patches/vmhgfs/vmhgfs-uid-gid-kernel-3.12-tools-9.6.1.patch line 131 there is:

#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0)

This appears to be incorrect, as according to http://lxr.free-electrons.com/source/include/linux/uidgid.h?v=3.5 , this has existed in at least 3.5. It should be

#ifdef CONFIG_UIDGID_STRICT_TYPE_CHECKS

My guess is that Ubuntu has the stricter check and has set this kernel config option on, and Arch Linux has this not set: https://projects.archlinux.org/svntogit/packages.git/tree/trunk/config?h=packages/linux

With my change it compiles, and I need to test this to see if this actually works.

DISCLAIMER: Note that I have not done any kernel development so I don't know the implications of this.

Contributor

raymond-w-ko commented Dec 14, 2013

Okay I think I figured out what is causing this. In patches/vmhgfs/vmhgfs-uid-gid-kernel-3.12-tools-9.6.1.patch line 131 there is:

#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0)

This appears to be incorrect, as according to http://lxr.free-electrons.com/source/include/linux/uidgid.h?v=3.5 , this has existed in at least 3.5. It should be

#ifdef CONFIG_UIDGID_STRICT_TYPE_CHECKS

My guess is that Ubuntu has the stricter check and has set this kernel config option on, and Arch Linux has this not set: https://projects.archlinux.org/svntogit/packages.git/tree/trunk/config?h=packages/linux

With my change it compiles, and I need to test this to see if this actually works.

DISCLAIMER: Note that I have not done any kernel development so I don't know the implications of this.

@raymond-w-ko

This comment has been minimized.

Show comment
Hide comment
@raymond-w-ko

raymond-w-ko Dec 14, 2013

Contributor

On an semi-related note, blacklisting of the stock kernel's vmw_vmci is necessary as VMWare Tool's vmci seems to conflict with this. Without blacklisting module vmhgfs does not load.

On the other hand, barring some minor warnings, the direction to setup systemd files in the arch wiki seems to work fine.

Contributor

raymond-w-ko commented Dec 14, 2013

On an semi-related note, blacklisting of the stock kernel's vmw_vmci is necessary as VMWare Tool's vmci seems to conflict with this. Without blacklisting module vmhgfs does not load.

On the other hand, barring some minor warnings, the direction to setup systemd files in the arch wiki seems to work fine.

@gavinhungry

This comment has been minimized.

Show comment
Hide comment
@gavinhungry

gavinhungry Dec 16, 2013

@raymond-w-ko,

Thank you, the change you proposed worked for me. vmhgfs builds now, and after hard-blacklisting vmw_vmci (install vmw_vmci /bin/false), and loading vmci, vmhgfs loads and works just fine.

@raymond-w-ko,

Thank you, the change you proposed worked for me. vmhgfs builds now, and after hard-blacklisting vmw_vmci (install vmw_vmci /bin/false), and loading vmci, vmhgfs loads and works just fine.

@rasa

This comment has been minimized.

Show comment
Hide comment
@rasa

rasa Dec 18, 2013

Owner

If someone can send me a pull request, I will merge it in. Thanks.

Owner

rasa commented Dec 18, 2013

If someone can send me a pull request, I will merge it in. Thanks.

@raymond-w-ko

This comment has been minimized.

Show comment
Hide comment
Contributor

raymond-w-ko commented Dec 18, 2013

@rasa

This comment has been minimized.

Show comment
Hide comment
@rasa

rasa Dec 19, 2013

Owner

Merged, thanks!

Owner

rasa commented Dec 19, 2013

Merged, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment