Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Error compiling external modules on 4.9.5/4.9.6-r1
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
assaf
Apprentice
Apprentice


Joined: 14 Feb 2005
Posts: 152
Location: http://localhost

PostPosted: Thu Feb 02, 2017 12:24 am    Post subject: [SOLVED] Error compiling external modules on 4.9.5/4.9.6-r1 Reply with quote

I'm currently running gentoo-sources-4.4.26 mostly stable and was trying to upgrade to 4.9.5 (and then 4.9.6-r1)
All external modules i try to recompile fail with the newer kernels, usually complaining about "no rule to make target" on one of the object files.

Am i missing something that needs to be keyworded or something messed up with my machine? Or did something change with the kernel's makefiles?

For example:
Code:
make: Entering directory '/usr/src/linux-4.9.6-gentoo-r1'
make[1]: *** No rule to make target '/tmp/portage/media-video/bcwc_pcie-9999/work/bcwc_pcie-9999/fthd_hw.o', needed by '/tmp/portage/media-video/bcwc_pcie-9999/work/bcwc_pcie-9999/facetimehd.o'.  Stop.
make: *** [Makefile:1490: _module_/tmp/portage/media-video/bcwc_pcie-9999/work/bcwc_pcie-9999] Error 2
make: Leaving directory '/usr/src/linux-4.9.6-gentoo-r1'


Last edited by assaf on Thu Feb 02, 2017 8:25 pm; edited 1 time in total
Back to top
View user's profile Send private message
audiodef
Watchman
Watchman


Joined: 06 Jul 2005
Posts: 6319
Location: /usr/lib64/lv2

PostPosted: Thu Feb 02, 2017 4:10 am    Post subject: Reply with quote

Is this manual config or genkernel? If manual, did you cp an old .config? Did you make oldconfig, make defconfig, make clean, or whatever is appropriate for your needs?
_________________
Gentoo Studio: A Gentoo-based, professional digital audio workstation OS.
Back to top
View user's profile Send private message
assaf
Apprentice
Apprentice


Joined: 14 Feb 2005
Posts: 152
Location: http://localhost

PostPosted: Thu Feb 02, 2017 4:36 am    Post subject: Reply with quote

I'm using genkernel to build but with my own customized .config which I copied from the previous kernel, and ran make oldconfig (like I always do).

Running make with -d there's seems to be a difference when running against the old and new kernels:

With the old kernel:
Code:
 Trying implicit prerequisite '/tmp/portage/media-video/bcwc_pcie-9999/work/bcwc_pcie-9999/fthd_hw.c'.
 Trying rule prerequisite 'FORCE'.
 Found an implicit rule for '/tmp/portage/media-video/bcwc_pcie-9999/work/bcwc_pcie-9999/fthd_hw.o'.
  Considering target file '/tmp/portage/media-video/bcwc_pcie-9999/work/bcwc_pcie-9999/fthd_hw.c'.


With the new:
Code:
 Trying implicit prerequisite '/tmp/portage/media-video/bcwc_pcie-9999/work/bcwc_pcie-9999/fthd_hw.c'.
 Trying rule prerequisite 'tools/objtool/objtool'.
 Trying pattern rule with stem 'fthd_hw'.
 Trying implicit prerequisite '/tmp/portage/media-video/bcwc_pcie-9999/work/bcwc_pcie-9999/fthd_hw.S'.
 Trying pattern rule with stem 'fthd_hw.o'.
 Trying implicit prerequisite '/tmp/portage/media-video/bcwc_pcie-9999/work/bcwc_pcie-9999/fthd_hw.o_shipped'.
 Trying pattern rule with stem 'fthd_hw'.
 Trying implicit prerequisite '/tmp/portage/media-video/bcwc_pcie-9999/work/bcwc_pcie-9999/fthd_hw.c'.
 Trying rule prerequisite 'tools/objtool/objtool'.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 7285
Location: almost Mile High in the USA

PostPosted: Thu Feb 02, 2017 4:51 am    Post subject: Reply with quote

These are all external DKMS so they may not line up with latest...

Try installing a 4.8 kernel as an experiment. A quick look at a webpage seems to indicate it just got a commit for 4.8 kernels...
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
assaf
Apprentice
Apprentice


Joined: 14 Feb 2005
Posts: 152
Location: http://localhost

PostPosted: Thu Feb 02, 2017 4:54 am    Post subject: Reply with quote

I did try with 4.8 and also with vanilla-sources, same issue.
This is just an example - I'm getting similar errors with other modules as well.

The error seems to be Makefile related (or maybe there's a hidden error message somewhere?).
It seems pretty basic: you have an .o file, you need to build the .c file, but it doesn't even try to.

Maybe something changed in kbuild after 4.4?
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 7285
Location: almost Mile High in the USA

PostPosted: Thu Feb 02, 2017 5:58 am    Post subject: Reply with quote

Are these from an overlay? Is there one from the default repository that doesn't work?

Despite a 9999 I can't be sure that the latest git was actually pulled or not..
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
assaf
Apprentice
Apprentice


Joined: 14 Feb 2005
Posts: 152
Location: http://localhost

PostPosted: Thu Feb 02, 2017 6:13 am    Post subject: Reply with quote

I've compared the git commit number and it's the latest one (in the mainline branch).

Another example - vmware-modules:
Code:
>>> Compiling source in /tmp/portage/app-emulation/vmware-modules-308.1.0/work ...
 * Preparing vmblock module
make -j9 -l8 HOSTCC=x86_64-pc-linux-gnu-gcc CROSS_COMPILE=x86_64-pc-linux-gnu- 'LDFLAGS=-m elf_x86_64' auto-build KERNEL_DIR=/usr/src/linux KBUILD_OUTPUT=/lib/modules/4.9.6-gentoo-r1/build
Using kernel build system.
make -C /lib/modules/4.9.6-gentoo-r1/build SUBDIRS=$PWD SRCROOT=$PWD/. \
  MODULEBUILDDIR= modules
make[1]: Entering directory '/usr/src/linux-4.9.6-gentoo-r1'
make[2]: Entering directory '/usr/src/linux-4.9.6-gentoo-r1'
make[3]: *** No rule to make target '/tmp/portage/app-emulation/vmware-modules-308.1.0/work/vmblock-only/linux/filesystem.o', needed by '/tmp/portage/app-emulation/vmware-modules-308.1.0/work/vmblock-only/vmblock.o'.  Stop.
make[2]: *** [/usr/src/linux-4.9.6-gentoo-r1/Makefile:1490: _module_/tmp/portage/app-emulation/vmware-modules-308.1.0/work/vmblock-only] Error 2


I think if I write a hello world kernel module I will get the same error.
Back to top
View user's profile Send private message
assaf
Apprentice
Apprentice


Joined: 14 Feb 2005
Posts: 152
Location: http://localhost

PostPosted: Thu Feb 02, 2017 8:01 pm    Post subject: Reply with quote

Looks like the problem is with the kernel .config. I tried make defconfig on a clean vanilla-sources-4.9.6 and the compilation passes.
Looking for the offending config option now...
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 7285
Location: almost Mile High in the USA

PostPosted: Thu Feb 02, 2017 8:05 pm    Post subject: Reply with quote

A lot of these external modules do not build properly if you didn't actually cleanly build the kernel (at least the setup region after .config was changed) before building the module.

I'm surprised that there are so many modules that failed build, would imply more than just a config option and some systemic error like the clean build.
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3806
Location: Austro Bavaria

PostPosted: Thu Feb 02, 2017 8:11 pm    Post subject: Reply with quote

Just my opinion:

Quote:
I'm using genkernel to build but with my own customized .config


Leave out genkernel and do it properly by hand. Just the good old compile by hand and file manipulation by hand. Those scripts are buggy by hell, add a layer of possible errors, make things complicated
Back to top
View user's profile Send private message
assaf
Apprentice
Apprentice


Joined: 14 Feb 2005
Posts: 152
Location: http://localhost

PostPosted: Thu Feb 02, 2017 8:24 pm    Post subject: Reply with quote

Found it! I enabled stack validations, but didn't notice this error message:

Code:
Cannot use CONFIG_STACK_VALIDATION, please install libelf-dev, libelf-devel or elfutils-libelf-devel


Installed elfutils, and now it works!
Back to top
View user's profile Send private message
audiodef
Watchman
Watchman


Joined: 06 Jul 2005
Posts: 6319
Location: /usr/lib64/lv2

PostPosted: Fri Feb 03, 2017 12:57 am    Post subject: Reply with quote

There's often a little trip-up somewhere. Until recent versions, I had to always disable building documentation in tree when invoking --menuconfig. Now it seems to have been removed, thank goodness.
_________________
Gentoo Studio: A Gentoo-based, professional digital audio workstation OS.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum