Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 753860

Summary: media-video/v4l2loopback: build failed when build kernel out-of-tree
Product: Gentoo Linux Reporter: OwenJia <aptx945>
Component: Current packagesAssignee: Aaron W. Swenson <titanofold>
Status: UNCONFIRMED ---    
Severity: normal CC: andrewammerlaan, joakim.tjernlund, jstein
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description OwenJia 2020-11-10 14:47:09 UTC
i have a custom kernel build directory (for security reason), and using KERNEL_DIR refer to it, 

eg. KERNEL_DIR=/path/to/kernel_build

it's works fine for nvidia-drivers, but when i trying to install v4l2loopback, it just doesn't work.

the Makefile in the package:
```
KERNELRELEASE   ?= `uname -r`
KERNEL_DIR      ?= /lib/modules/$(KERNELRELEASE)/build

all: v4l2loopback.ko
v4l2loopback: v4l2loopback.ko
v4l2loopback.ko:
        @echo "Building v4l2-loopback driver..."
        $(MAKE) -C $(KERNEL_DIR) M=$(PWD) modules
```


here is the build.log i got:
```
 * v4l2loopback-0.12.5.tar.gz BLAKE2B SHA512 size ;-) ...                                                                       [ ok ]
 * Determining the location of the kernel source code
 * Found kernel source directory:
 *     /usr/src/linux-5.8.18-gentoo
 * Found kernel object directory:
 *     /path/to/kernel_build
 * Found sources for kernel version:
 *     5.8.18-gentoo
 * Checking for suitable kernel configuration options...                                                                        [ ok ]
>>> Unpacking source...
>>> Unpacking v4l2loopback-0.12.5.tar.gz to /var/tmp/portage/media-video/v4l2loopback-0.12.5-r1/work
>>> Source unpacked in /var/tmp/portage/media-video/v4l2loopback-0.12.5-r1/work
>>> Preparing source in /var/tmp/portage/media-video/v4l2loopback-0.12.5-r1/work/v4l2loopback-0.12.5 ...
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/media-video/v4l2loopback-0.12.5-r1/work/v4l2loopback-0.12.5 ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/media-video/v4l2loopback-0.12.5-r1/work/v4l2loopback-0.12.5 ...
ln: failed to create symbolic link 'Module.symvers': File exists
 * Preparing v4l2loopback module
make -j9 HOSTCC=x86_64-pc-linux-gnu-gcc CROSS_COMPILE=x86_64-pc-linux-gnu- 'LDFLAGS=-m elf_x86_64' all
Building v4l2-loopback driver...
make -C /usr/src/linux-5.8.18-gentoo M=/var/tmp/portage/media-video/v4l2loopback-0.12.5-r1/work/v4l2loopback-0.12.5 modules
make[1]: Entering directory '/usr/src/linux-5.8.18-gentoo'

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

make[1]: *** [Makefile:719: include/config/auto.conf] Error 1
make[1]: Leaving directory '/usr/src/linux-5.8.18-gentoo'
make: *** [Makefile:43: v4l2loopback.ko] Error 2
 * ERROR: media-video/v4l2loopback-0.12.5-r1::gentoo failed (compile phase):
 *   emake failed
 *
 * If you need support, post the output of `emerge --info '=media-video/v4l2loopback-0.12.5-r1::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=media-video/v4l2loopback-0.12.5-r1::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/media-video/v4l2loopback-0.12.5-r1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/media-video/v4l2loopback-0.12.5-r1/temp/environment'.
 * Working directory: '/var/tmp/portage/media-video/v4l2loopback-0.12.5-r1/work/v4l2loopback-0.12.5'
 * S: '/var/tmp/portage/media-video/v4l2loopback-0.12.5-r1/work/v4l2loopback-0.12.5'
```
Comment 1 OwenJia 2020-11-11 15:21:28 UTC
not sure why, but when i set KBUILD_OUTPUT to empty, it's compiled.

logs here:
```
KERNEL_DIR=/path/to/kernel_build KBUILD_OUTPUT= ebuild /usr/portage/media-video/v4l2loopback/v4l2loopback-0.12.5-r1.ebuild clean compile[0/48400]
 * v4l2loopback-0.12.5.tar.gz BLAKE2B SHA512 size ;-) ...                                                                       [ ok ]
 * Determining the location of the kernel source code
 * Found kernel source directory:
 *     /usr/src/linux-5.8.18-gentoo
 * Found kernel object directory:
 *     /path/to/kernel_build
 * Found sources for kernel version:
 *     5.8.18-gentoo
 * Checking for suitable kernel configuration options...                                                                        [ ok ]
>>> Unpacking source...
>>> Unpacking v4l2loopback-0.12.5.tar.gz to /var/tmp/portage/media-video/v4l2loopback-0.12.5-r1/work
>>> Source unpacked in /var/tmp/portage/media-video/v4l2loopback-0.12.5-r1/work
>>> Preparing source in /var/tmp/portage/media-video/v4l2loopback-0.12.5-r1/work/v4l2loopback-0.12.5 ...
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/media-video/v4l2loopback-0.12.5-r1/work/v4l2loopback-0.12.5 ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/media-video/v4l2loopback-0.12.5-r1/work/v4l2loopback-0.12.5 ...
ln: failed to create symbolic link 'Module.symvers': File exists
 * Preparing v4l2loopback module
make -j9 HOSTCC=x86_64-pc-linux-gnu-gcc CROSS_COMPILE=x86_64-pc-linux-gnu- 'LDFLAGS=-m elf_x86_64' all 
Building v4l2-loopback driver...
make -C /usr/src/linux-5.8.18-gentoo M=/var/tmp/portage/media-video/v4l2loopback-0.12.5-r1/work/v4l2loopback-0.12.5 modules
make[1]: Entering directory '/usr/src/linux-5.8.18-gentoo'
make[2]: Entering directory '/path/to/kernel_build'
  CC [M]  /var/tmp/portage/media-video/v4l2loopback-0.12.5-r1/work/v4l2loopback-0.12.5/v4l2loopback.o
  MODPOST /var/tmp/portage/media-video/v4l2loopback-0.12.5-r1/work/v4l2loopback-0.12.5/Module.symvers
  CC [M]  /var/tmp/portage/media-video/v4l2loopback-0.12.5-r1/work/v4l2loopback-0.12.5/v4l2loopback.mod.o
  LD [M]  /var/tmp/portage/media-video/v4l2loopback-0.12.5-r1/work/v4l2loopback-0.12.5/v4l2loopback.ko
make[2]: Leaving directory '/path/to/kernel_build'
make[1]: Leaving directory '/usr/src/linux-5.8.18-gentoo'
>>> Source compiled.
```
Comment 2 Joakim Tjernlund 2022-03-19 16:02:22 UTC
I get an odd build failure when building v4l2loopback-9999.ebuild that I don't understand, 0.12.5-r1 does build.

ebuild /usr/portage/media-video/v4l2loopback/v4l2loopback-9999.ebuild clean merge
 * Determining the location of the kernel source code
 * Found kernel source directory:
 *     /usr/src/linux
 * Found sources for kernel version:
 *     5.15.29-gentoo-x86_64
 * Checking for suitable kernel configuration options...                 [ ok ]
>>> Unpacking source...
 * Repository id: umlaeute_v4l2loopback.git
 * To override fetched repository properties, use:
 *   EGIT_OVERRIDE_REPO_UMLAEUTE_V4L2LOOPBACK
 *   EGIT_OVERRIDE_BRANCH_UMLAEUTE_V4L2LOOPBACK
 *   EGIT_OVERRIDE_COMMIT_UMLAEUTE_V4L2LOOPBACK
 *   EGIT_OVERRIDE_COMMIT_DATE_UMLAEUTE_V4L2LOOPBACK
 * 
 * Fetching https://github.com/umlaeute/v4l2loopback.git ...
git fetch https://github.com/umlaeute/v4l2loopback.git +HEAD:refs/git-r3/HEAD
git symbolic-ref refs/git-r3/media-video/v4l2loopback/0/__main__ refs/git-r3/HEAD
 * Checking out https://github.com/umlaeute/v4l2loopback.git to /var/tmp/portage/media-video/v4l2loopback-9999/work/v4l2loopback-9999 ...
git checkout --quiet refs/git-r3/HEAD
GIT update -->
   repository:               https://github.com/umlaeute/v4l2loopback.git
   at the commit:            2199283ee936b9930038552b7a0890ec1736e7a2
>>> Source unpacked in /var/tmp/portage/media-video/v4l2loopback-9999/work
>>> Preparing source in /var/tmp/portage/media-video/v4l2loopback-9999/work/v4l2loopback-9999 ...
>>> Source prepared.
Adding -fdebug-prefix-map to CFLAGS/CXXFLAGS
>>> Configuring source in /var/tmp/portage/media-video/v4l2loopback-9999/work/v4l2loopback-9999 ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/media-video/v4l2loopback-9999/work/v4l2loopback-9999 ...
ln: failed to create symbolic link 'Module.symvers': File exists
 * Preparing v4l2loopback module
make -j8 -l6 -s HOSTCC=x86_64-pc-linux-gnu-gcc 'LDFLAGS=-m elf_x86_64' all 
Building v4l2-loopback driver...
cc: error: unrecognized command-line option ‘-m’
make[1]: *** [<builtin>: v4l2loopback-ctl] Error 1
make: *** [Makefile:85: utils/v4l2loopback-ctl] Error 2
 * ERROR: media-video/v4l2loopback-9999::gentoo failed (compile phase):
 *   emake failed
Comment 3 Andrew Ammerlaan gentoo-dev 2023-06-21 08:30:41 UTC
Does this still happen with version 0.12.7?