[Solved] vboxsf don't compile on 32bit linux kernel-5.2.21

Discussions about using Linux guests in VirtualBox.
Post Reply
biotec
Posts: 7
Joined: 9. Oct 2016, 11:45

[Solved] vboxsf don't compile on 32bit linux kernel-5.2.21

Post by biotec »

Hi!

VirtualBox Guest additions (at least 6.0.12 and 6.0.14) fail to fully compile on a 32-bit Linux with kernel 5.2.20 or 5.2.21. The same compile ok on a 64-bit Linux (same version numbers).

Under the 32-bit kernel, vboxguest module compiles ok, but compilation fails when atempting to build the vboxsf module:

Code: Select all

=== Building 'vboxguest' module ===
make[1]: Entering directory '/opt/VBoxGuestAdditions-6.0.14/src/vboxguest-6.0.14/vboxguest'
make V= CONFIG_MODULE_SIG= -C /lib/modules/5.2.21-porteus/build M=/opt/VBoxGuestAdditions-6.0.14/src/vboxguest-6.0.14/vboxguest SRCROOT=/opt/VBoxGuestAdditions-6.0.14/src/vboxguest-6.0.14/vboxguest -j1 modules
make[2]: Entering directory '/usr/src/linux-5.2.21'
  Building modules, stage 2.
  MODPOST 1 modules
make[2]: Leaving directory '/usr/src/linux-5.2.21'
make[1]: Leaving directory '/opt/VBoxGuestAdditions-6.0.14/src/vboxguest-6.0.14/vboxguest'

=== Building 'vboxsf' module ===
make[1]: Entering directory '/opt/VBoxGuestAdditions-6.0.14/src/vboxguest-6.0.14/vboxsf'
make V= CONFIG_MODULE_SIG= -C /lib/modules/5.2.21-porteus/build M=/opt/VBoxGuestAdditions-6.0.14/src/vboxguest-6.0.14/vboxsf SRCROOT=/opt/VBoxGuestAdditions-6.0.14/src/vboxguest-6.0.14/vboxsf -j1 modules
make[2]: Entering directory '/usr/src/linux-5.2.21'
  CC [M]  /opt/VBoxGuestAdditions-6.0.14/src/vboxguest-6.0.14/vboxsf/regops.o
/opt/VBoxGuestAdditions-6.0.14/src/vboxguest-6.0.14/vboxsf/regops.c: In function 'vbsf_lock_kernel_pages':
/opt/VBoxGuestAdditions-6.0.14/src/vboxguest-6.0.14/vboxsf/regops.c:1388:1: error: unsupported size for integer register
 1388 | }
      | ^
make[3]: *** [scripts/Makefile.build:279: /opt/VBoxGuestAdditions-6.0.14/src/vboxguest-6.0.14/vboxsf/regops.o] Error 1
make[2]: *** [Makefile:1597: _module_/opt/VBoxGuestAdditions-6.0.14/src/vboxguest-6.0.14/vboxsf] Error 2
make[2]: Leaving directory '/usr/src/linux-5.2.21'
make[1]: *** [/opt/VBoxGuestAdditions-6.0.14/src/vboxguest-6.0.14/vboxsf/Makefile-footer.gmk:111: vboxsf] Error 2
make[1]: Leaving directory '/opt/VBoxGuestAdditions-6.0.14/src/vboxguest-6.0.14/vboxsf'
make: *** [Makefile:48: vboxsf] Error 1
(vboxvideo module can be built successfully with 'make vboxvideo' too, from /opt/VBoxGuestAdditions-6.0.14/src/vboxguest-6.0.14/).

Any idea what is wrong?
Last edited by socratis on 27. Oct 2019, 19:31, edited 1 time in total.
Reason: Marked as [Solved].
biotec
Posts: 7
Joined: 9. Oct 2016, 11:45

Re: vboxsf don't compile on 32bit linux kernel-5.2.21

Post by biotec »

Found the solution myself.
You need to add

Code: Select all

VBOXMOD_CFLAGS += -O2
to the Makefile in the vboxsf source directory. Not required to compile on a 64-bit guest.
It would be nice if this could be fixed upstream. Apparently it is not a new problem.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: vboxsf don't compile on 32bit linux kernel-5.2.21

Post by socratis »

'biotec', this is interesting, because AFAIK, the "O" flag is just a different optimization level. Can you give some context about your setup? What's the guest for example? I don't remember the GAs compiling giving such an output as in your original message, could you explain that?

I'm going to mark this thread as [Solved] in any event, and I'll notify the devs as well. Thank you for the feedback and the solution!
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Post Reply