LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-12-2016, 02:18 PM   #1
vladimir1986
Member
 
Registered: Jul 2011
Posts: 112

Rep: Reputation: Disabled
Failing to compile VirtualBox module on custom module


Hello there!

I am having a bit of a problem here: I am using Slackware with a custom kernel, and I also need to use VirtualBox. VirtualBox need a kernel module in order to work.

When I first installed it from a Slackpkg on the stock kernel, it worked perfectly and added a nice /etc/rc.d/rc.vboxdrv to manage it. This is important, because this script was used to update the driver in custom Kernels via "vboxdrv setup"

But now they changed it and doing /etc/rc.d/rc.vboxdrv setup will prompt this error: "Not implemented! Please use the virtualbox-kernel.SlackBuild available at SlackBuilds.org instead."

But If I try to install the SlackBuild from my new Kernel, it fails during compile time. Doing it using the older kernel works, but I get a module for the old Kernel, so it is not useful at all!

The only error I can see when I try to compile is: "1: error: implicit declaration of function 'page_cache_release' [-Werror=implicit-function-declaration]
", but I honestly don't know what it means, so I can't do much about it

Is in there any way of using VirtualBox with a custom Kernel on Slackware?

Thank you in advance!
 
Old 08-12-2016, 02:31 PM   #2
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 15.0 + Multilib
Posts: 2,159

Rep: Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512
vladimir1986 --

It seems that the configure.ac files for newer versions of a lot of programs default to -Werror ( treat warnings as errors ).

You might be able to get past that particular error by appending -Wno-error=implicit-function-declaration to the CFLAGS and / or CXXFLAGS in the SlackBuild.

If that doesn't do it, maybe the gcc warning options documentation has an answer.

-- kjh

Last edited by kjhambrick; 08-12-2016 at 02:37 PM. Reason: typo: changed - to =
 
Old 08-12-2016, 03:10 PM   #3
vladimir1986
Member
 
Registered: Jul 2011
Posts: 112

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by kjhambrick View Post
vladimir1986 --

It seems that the configure.ac files for newer versions of a lot of programs default to -Werror ( treat warnings as errors ).

You might be able to get past that particular error by appending -Wno-error=implicit-function-declaration to the CFLAGS and / or CXXFLAGS in the SlackBuild.

If that doesn't do it, maybe the gcc warning options documentation has an answer.

-- kjh
Agh: any reason they did that? I find it dumb to default to such option! it is very rare to find a code without warnings.

I added a line to my SlackBuild

SLKCFLAGS="-Wnoerror=implicit-function-declaration"


That did loads of nothing: It seems it doesn't work on C++, but I'll think that it is written in C. I also tried to simply play with CFLAGS and CXXFLAGS, but same result (SLKCFLAGS should deal with both as needed anyway). I am still getting the same warning.

I didn't see any option to simply disable this behaviour from any warning, I also tried simply Wnoerror and Wno-implicit, but that damn thing doesn't want to die, and I get the same warning.

I am finding weird it compiles with the old kernel too. May it be a bug?
 
Old 08-12-2016, 03:32 PM   #4
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 15.0 + Multilib
Posts: 2,159

Rep: Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512
Dang, vladimir1986, you've exceeded my personal knowledge base

I downloaded and built the virtualbox-kernel package without any errors.

Worse, there were no instances of -Werror in any of the virtualbox-kernel Makefiles.

Maybe you could find the -Werror in the Makefiles and modify the already-existing sed command in the Slackbuild ?

[EDIT] I just noticed that virtualbox-kernel.SlackBuild does not set CFLAGS, CCFLAGS or SLKFLAGS.

Nor does it invoke a configure script.

I suppose you'll have to `sed` the Makefiles to eliminate the -Werror Args ...

[/EDIT]

-- kjh

Code:
# get into the SBo source dir
#
cd /tmp/SBo/virtualbox-kernel-5.0.14
#
# find the Makefiles
#
find  -type f -iname "Makefile*"

./vboxdrv/Makefile
./vboxnetflt/Makefile
./vboxpci/Makefile
./vboxnetadp/Makefile
./Makefile
#
# look for -Werror in the Makefiles
#
grep -- -Werror $(find . -type f -iname Makefile)

<<no output>>
#
# look for -W in the Makefiles
#
grep -- -W $(find . -type f -iname Makefile)

./vboxdrv/Makefile:         -Wno-declaration-after-statement
./vboxnetflt/Makefile:      -Wno-declaration-after-statement
./vboxnetadp/Makefile:      -Wno-declaration-after-statement

Last edited by kjhambrick; 08-12-2016 at 03:51 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to compile kernel module program when include sys/socket.h in module program zerop Linux - Kernel 2 07-23-2014 06:51 PM
My test module is failing to load PercyZA Linux - Kernel 1 08-27-2012 01:16 PM
[SOLVED] virtualbox 4.0 won't compile it's vboxdrv module radiodee1 Debian 2 07-16-2011 01:01 PM
Compile and load kernel module automatically after boot? (Intel NIC module) touser Linux - Newbie 3 08-29-2009 08:45 PM
custom geforce video card--custom module? bandofmercy Linux - Hardware 3 10-14-2004 06:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration