LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Can't Compile VirtualBox 1.6.6 In Slackware Current (http://www.linuxquestions.org/questions/slackware-14/cant-compile-virtualbox-1-6-6-in-slackware-current-685795/)

Woodsman 11-24-2008 02:08 PM

Can't Compile VirtualBox 1.6.6 In Slackware Current
 
This past weekend I was getting my hands dirty testing Slackware Current. After resolving several issues I proceeded to create a new VirtualBox vboxdrv kernel module. The effort failed and I realized, Oops! New kernel here --- I need to rebuild the entire VirtualBox package.

I am unable to build VirtualBox 1.6.6 in Slackware Current.

I am using my own modified version of the original build script that appeared at slacky.eu many months ago (before any build scripts were available at slackbuilds.org). The build script has worked well for me since version 1.5.6.

Just to be sure, I again built the VirtualBox 1.6.6 package in Slackware 12.1. No problems.

The problem seems related to gcc and possibly the newer kernel 2.6.27.7. There were many bug reports about the early release candidate versions of 2.6.27. The 1.6.6 change log indicates those bugs were resolved and I found no subsequent bug reports about 2.6.27.

Another possibility is a problem with some of the kernel source include files.

I don't know where the actual error starts but here is the tail-end of the compile effort:

Code:

kBuild: Compiling RuntimeR0Drv - /home/public/builds/slackware-packages/tmp/VirtualBox-1.6.6/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c
/home/public/builds/slackware-packages/tmp/VirtualBox-1.6.6/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c: In function 'rtMemAlloc':
/home/public/builds/slackware-packages/tmp/VirtualBox-1.6.6/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c:138: error: '_PAGE_KERNEL_EXEC' undeclared (first use in this function)
/home/public/builds/slackware-packages/tmp/VirtualBox-1.6.6/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c:138: error: (Each undeclared identifier is reported only once
/home/public/builds/slackware-packages/tmp/VirtualBox-1.6.6/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c:138: error: for each function it appears in.)
kmk[3]: *** [/home/public/builds/slackware-packages/tmp/VirtualBox-1.6.6/out/linux.x86/release/obj/src/VBox/Runtime/RuntimeR0Drv/r0drv/linux/alloc-r0drv-linux.o] Error 1
The failing command:
        @gcc -c -O2 -nostdinc -iwithprefix include -Wall -Wstrict-prototypes -Wno-trigraphs -Wno-pointer-sign -fno-stack-protector -O2 -mtune=generic -fno-omit-frame-pointer -fno-strict-aliasing -fno-common -mpreferred-stack-boundary=2 -msoft-float -I/home/public/builds/slackware-packages/tmp/VirtualBox-1.6.6/src/VBox/Runtime/r0drv/linux -I/home/public/builds/slackware-packages/tmp/VirtualBox-1.6.6/src/VBox/Runtime -I/home/public/builds/slackware-packages/tmp/VirtualBox-1.6.6/src/VBox/Runtime/include -I/lib/modules/2.6.27.7/build/include -I/lib/modules/2.6.27.7/build/include/asm-i386/mach-default -I/lib/modules/2.6.27.7/build/include/asm-x86/mach-default -I/home/public/builds/slackware-packages/tmp/VirtualBox-1.6.6/include -I/home/public/builds/slackware-packages/tmp/VirtualBox-1.6.6/out/linux.x86/release -DVBOX -DVBOX_OSE -DRT_OS_LINUX -D_FILE_OFFSET_BITS=64 -DRT_ARCH_X86 -D__X86__ -D__KERNEL__ -DMODULE -DIN_RING0 -DIN_RT_R0 -DIN_RT_R0 -DRT_WITH_VBOX -DRT_WITHOUT_NOCRT_WRAPPERS -DMODULE -DKBUILD_MODNAME=KBUILD_STR\(vboxdrv\) -DKBUILD_BASENAME=KBUILD_STR\(vboxdrv\) -DIN_SUP_R0 -Wp,-MD,/home/public/builds/slackware-packages/tmp/VirtualBox-1.6.6/out/linux.x86/release/obj/src/VBox/Runtime/RuntimeR0Drv/r0drv/linux/alloc-r0drv-linux.o.dep -Wp,-MT,/home/public/builds/slackware-packages/tmp/VirtualBox-1.6.6/out/linux.x86/release/obj/src/VBox/Runtime/RuntimeR0Drv/r0drv/linux/alloc-r0drv-linux.o -Wp,-MP -o /home/public/builds/slackware-packages/tmp/VirtualBox-1.6.6/out/linux.x86/release/obj/src/VBox/Runtime/RuntimeR0Drv/r0drv/linux/alloc-r0drv-linux.o /home/public/builds/slackware-packages/tmp/VirtualBox-1.6.6/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c
kmk[3]: Leaving directory `/home/public/builds/slackware-packages/tmp/VirtualBox-1.6.6/src/VBox/Runtime'
kmk[2]: *** [pass_libraries_before] Error 2
kmk[2]: Leaving directory `/home/public/builds/slackware-packages/tmp/VirtualBox-1.6.6/src/VBox'
kmk[1]: *** [pass_libraries_before] Error 2
kmk[1]: Leaving directory `/home/public/builds/slackware-packages/tmp/VirtualBox-1.6.6/src'
kmk: *** [pass_libraries_before] Error 2

On a whim I enabled the build script to compile with GCC 3.4. I have not had to do that since the early days of VirtualBox 1.5.6. What the heck, I tried anyway. Same basic failure:

Code:

kBuild: Compiling RuntimeR0Drv - /home/public/builds/slackware-packages/tmp/VirtualBox-1.6.6/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c
/home/public/builds/slackware-packages/tmp/VirtualBox-1.6.6/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c: In function `rtMemAlloc':
/home/public/builds/slackware-packages/tmp/VirtualBox-1.6.6/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c:138: error: `_PAGE_KERNEL_EXEC' undeclared (first use in this function)
/home/public/builds/slackware-packages/tmp/VirtualBox-1.6.6/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c:138: error: (Each undeclared identifier is reported only once
/home/public/builds/slackware-packages/tmp/VirtualBox-1.6.6/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c:138: error: for each function it appears in.)
kmk[3]: *** [/home/public/builds/slackware-packages/tmp/VirtualBox-1.6.6/out/linux.x86/release/obj/src/VBox/Runtime/RuntimeR0Drv/r0drv/linux/alloc-r0drv-linux.o] Error 1
The failing command:
        @/usr/gcc34/bin/gcc34 -c -O2 -nostdinc -iwithprefix include -Wall -Wstrict-prototypes -Wno-trigraphs  -O2  -fno-omit-frame-pointer -fno-strict-aliasing -fno-common -mpreferred-stack-boundary=2 -msoft-float -I/home/public/builds/slackware-packages/tmp/VirtualBox-1.6.6/src/VBox/Runtime/r0drv/linux -I/home/public/builds/slackware-packages/tmp/VirtualBox-1.6.6/src/VBox/Runtime -I/home/public/builds/slackware-packages/tmp/VirtualBox-1.6.6/src/VBox/Runtime/include -I/lib/modules/2.6.27.7/build/include -I/lib/modules/2.6.27.7/build/include/asm-i386/mach-default -I/lib/modules/2.6.27.7/build/include/asm-x86/mach-default -I/home/public/builds/slackware-packages/tmp/VirtualBox-1.6.6/include -I/home/public/builds/slackware-packages/tmp/VirtualBox-1.6.6/out/linux.x86/release -DVBOX -DVBOX_OSE -DRT_OS_LINUX -D_FILE_OFFSET_BITS=64 -DRT_ARCH_X86 -D__X86__ -D__KERNEL__ -DMODULE -DIN_RING0 -DIN_RT_R0 -DIN_RT_R0 -DRT_WITH_VBOX -DRT_WITHOUT_NOCRT_WRAPPERS -DMODULE -DKBUILD_MODNAME=KBUILD_STR\(vboxdrv\) -DKBUILD_BASENAME=KBUILD_STR\(vboxdrv\) -DIN_SUP_R0 -Wp,-MD,/home/public/builds/slackware-packages/tmp/VirtualBox-1.6.6/out/linux.x86/release/obj/src/VBox/Runtime/RuntimeR0Drv/r0drv/linux/alloc-r0drv-linux.o.dep -Wp,-MT,/home/public/builds/slackware-packages/tmp/VirtualBox-1.6.6/out/linux.x86/release/obj/src/VBox/Runtime/RuntimeR0Drv/r0drv/linux/alloc-r0drv-linux.o -Wp,-MP -o /home/public/builds/slackware-packages/tmp/VirtualBox-1.6.6/out/linux.x86/release/obj/src/VBox/Runtime/RuntimeR0Drv/r0drv/linux/alloc-r0drv-linux.o /home/public/builds/slackware-packages/tmp/VirtualBox-1.6.6/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c
kmk[3]: Leaving directory `/home/public/builds/slackware-packages/tmp/VirtualBox-1.6.6/src/VBox/Runtime'
kmk[2]: *** [pass_libraries_before] Error 2
kmk[2]: Leaving directory `/home/public/builds/slackware-packages/tmp/VirtualBox-1.6.6/src/VBox'
kmk[1]: *** [pass_libraries_before] Error 2
kmk[1]: Leaving directory `/home/public/builds/slackware-packages/tmp/VirtualBox-1.6.6/src'
kmk: *** [pass_libraries_before] Error

I prefer to remain with version 1.6.6 because I use VirtualBox for production and do not want to venture into the 2.0x series yet.

As always I appreciate any help or insight.

samac 11-25-2008 07:15 AM

Hi

I would try the slackbuild for VirtualBox 2.04OSE, it has been stable for me.

I understand that you are using VirtualBox for production, however you should try 2.04OSE as you are trying to compile 1.6.6 on current which shouldn't be considered stable enough to use on production machines.

Sorry this doesn't actually answer your question, but I am useless at debugging why compiles fail.

samac

Woodsman 11-26-2008 04:29 PM

Quote:

I understand that you are using VirtualBox for production, however you should try 2.04OSE as you are trying to compile 1.6.6 on current which shouldn't be considered stable enough to use on production machines.
I'm not trying to use Current for my production box. :) I am only testing Current. My production box remains 12.1. I like to help test Current when that branch is a few months old and approaches maturity.

Additional notes: I can compile 1.6.6 and 2.0.6 in Current if I use the 2.6.24.5 kernel. I cannot compile 1.6.6 with the 2.6.27.7 kernel. I can compile 2.0.6 with the 2.6.27.7 kernel. The problem would appear to be the kernel and not gcc, despite the error message.

I prefer to remain with 1.6.6 as the 2.0x series provides me nothing that I need or want.

I appreciate any help from some veteran software compilers. :)

Woodsman 11-26-2008 07:51 PM

Okay, the plot thickens! I can build version 1.6.6 in Current with the huge 2.6.27.7 kernel but not with my custom compiled 2.6.27.7 kernel. Yet I can build 1.6.6 with essentially the same kernel configuration with the 2.6.24.5 kernel in 12.1. There must be something awry with one of the new features added to the kernel.

Anybody with some best guesses or even wild guesses?

zhoun 11-26-2008 11:19 PM

check the vbox install log, /var/log/vbox-install.log
Maybe you should "make prepare" first.

Woodsman 11-26-2008 11:46 PM

Well boo-hoo! :mad:

I found the cause. VirtualBox 1.6.6 will not compile in Slackware Current with the 2.6.27.7 kernel if the kernel is configured for more than 4GB of RAM. When I temporarily compiled the 2.6.27.7 kernel to support 4GB of RAM or less, then VirtualBox 1.6.6 compiled.

I have the 2.6.24.5 kernel in 12.1 configured to support more than 4GB of RAM and 1.6.6 compiles fine there. Therefore something changed between 2.6.24.5 and 2.6.27.7 that stumps the VirtualBox build process. :(

Quote:

check the vbox install log, /var/log/vbox-install.log
That logs is from building the kernel driver, not building the VirtualBox software. :)

Woodsman 12-10-2008 11:50 PM

Can't Compile VirtualBox In Slackware 12.2
 
With 12.2 now official, I again tried compiling VirtualBox 2.0.6. I used my testing partitions with 12.2 installed and my own 2.6.27.7 kernel. Once again the compile failed. Now, I can build a temporary kernel with less than 4GB of RAM support and based upon my effort as posted previously, I should be able to compile VirtualBox.

I don't understand why I can compile on 12.1 with the 2.6.24.5 kernel and 4GB of RAM support but not 2.6.27.7. Anybody have any ideas?

Second, will compiling VB 2.0.6 with less than 4GB of RAM create problems when I restore my 12.2 system back to 4GB of RAM? I browsed the VB configure file and found no options for RAM requirements.

I depend upon VirtualBox for production and not being able to safely use VB in 12.2 would be a show stopper. :(

Thanks again.

Woodsman 12-12-2008 03:17 PM

Solved!
 
Sometimes I'm a bit slow. Sometimes I'm a bit stubborn. Sometimes I don't read. Sometimes I read but fail to comprehend. Fortunately, naturally occurring ignorance has a cure --- a willingness to learn. :)

The problem was not the 4GB barrier. That was only some kind of weird coincidence. The problem was between the keyboard and chair --- a lack of knowledge. Unknown to me, running 'make clean' or 'make mrproper' after building my kernel and then someday later trying to build VirtualBox caused the problem. The trick is to build the kernel and not run 'make clean' or 'make mrproper', or as zhoun mentioned previously (drum roll), run 'make prepare'.

Well, I spent many hours yesterday testing all of this. Compiling a kernel takes time. Building VirtualBox takes time. Several hours go by trying different variables and options. Eventually the eyeballs turn square.

Finally I convinced myself that all I needed was to run 'make prepare' in the kernel build directory before running the VirtualBox build script. No changes to the kernel >4GB RAM option, no need to change the kernel .config file.

I made two passes at building both VirtualBox 1.6.6 and 2.0.6 in 12.2 with the 2.6.27.7 kernel configured for >4GB RAM. No hitches.

If I run 'make clean' in the kernel build directory the VirtualBox build script fails rather quickly.

I never had run into this problem before. I guess I was just lucky to never have run 'make clean' or 'make mrproper' before building VirtualBox.

Not to mention the mystery of why VirtualBox would compile when I modified the RAM option in the kernel.

Sometimes learning a lesson takes all day and then some. I don't fully understand all the connections with the command, but I think I now grasp the big picture. I think the words 'make prepare' will be stamped in my mind for a few days. :)

As the old Groucho Marx joke goes, "Don't do that anymore!"

I am willing to embrace my own lack of knowledge as the cornerstone of the problem here. Conversely, I never had this problem with previous kernels. Seems the 2.6.27.7 kernel or something related is now different. :scratch: Perhaps previously the 'make clean' or 'make mrproper' commands did not remove certain critical files that other software needed to build and now with 2.6.27.7 that is the case. I say this because I had a similar problem with updating the 177.82 nvidia driver and kernel module. Another person had a similar problem with the nvidia driver and the 'make prepare' trick resolved the problem.

Still, if we keep our eyes and ears open we usually learn something every day.

Folks sometimes ask me what I do for recreation. I tell them sometimes I sit on the front porch. And do what? they ask. I tell them sometimes I sit and think, sometimes I just sit.

My head hurts and my butt is numb. Or is that my butt hurts and my head is numb? I don't know. After this experience I think I'll just sit for a bit. No thinking. :)

rob0t 12-18-2008 02:36 PM

Sorry to hijack the thread, but I can't build the kernel module for vbox 2.1.0 (the .run file), so I thought i'd drop my /var/log/vbox-install.log in here and see if you guys are thinking what I am thinking (since we're talking about kernel build issues:

Quote:

VirtualBox 2.1.0 installer, built 2008-12-17T10:57:49Z.

Testing system setup...
System setup appears correct.

Installing VirtualBox to /opt/VirtualBox-2.1.0

Output from the module build process (the Linux kernel build system) follows:

make KBUILD_VERBOSE=1 -C /lib/modules/2.6.24.5-smp/build SUBDIRS=/tmp/vbox.3 SRCROOT=/tmp/vbox.3 modules
test -e include/linux/autoconf.h -a -e include/config/auto.conf || ( \
echo; \
echo " ERROR: Kernel configuration is invalid."; \
echo " include/linux/autoconf.h or include/config/auto.conf are missing."; \
echo " Run 'make oldconfig && make prepare' on kernel src to fix it."; \
echo; \
/bin/false)

ERROR: Kernel configuration is invalid.
include/linux/autoconf.h or include/config/auto.conf are missing.
Run 'make oldconfig && make prepare' on kernel src to fix it.

mkdir -p /tmp/vbox.3/.tmp_versions ; rm -f /tmp/vbox.3/.tmp_versions/*

WARNING: Symbol version dump /usr/src/linux-2.6.24.5/Module.symvers
is missing; modules will have no dependencies and modversions.

make -f scripts/Makefile.build obj=/tmp/vbox.3
gcc -Wp,-MD,/tmp/vbox.3/linux/.SUPDrv-linux.o.d -nostdinc -isystem /usr/lib/gcc/i486-slackware-linux/4.2.3/include -D__KERNEL__ -I$
/tmp/vbox.3/linux/SUPDrv-linux.c:1: error: code model 'kernel' not supported in the 32 bit mode
/tmp/vbox.3/linux/SUPDrv-linux.c:1: sorry, unimplemented: 64-bit mode not compiled in
make[2]: *** [/tmp/vbox.3/linux/SUPDrv-linux.o] Error 1
make[1]: *** [_module_/tmp/vbox.3] Error 2
make: *** [vboxdrv] Error 2

End of the output from the Linux kernel build system.
Installation successful


Does this basically mean that I have to recompile my kernel (custom 2.6.24.5) with 64bit support?

Thanks,

rob0t

EDIT:

Or run make oldconfig && make proper as the error message instructs?


All times are GMT -5. The time now is 04:02 PM.