Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 843053 - media-video/v4l2loopback-0.12.5-r1: forces gcc even when kernel built with clang
Summary: media-video/v4l2loopback-0.12.5-r1: forces gcc even when kernel built with clang
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Aaron W. Swenson
Depends on:
Reported: 2022-05-07 04:11 UTC by Logan Perkins
Modified: 2022-05-08 00:32 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Logan Perkins 2022-05-07 04:11:01 UTC
The ebuild for v4l2loopback overrides CC, LD, and related environment variables to point at gcc (and related tools).  This leads to compile time errors if the kernel used a different compiler (obvious example is clang, but a non-systemwide gcc may have the same issue).  

Reproducible: Always

Steps to Reproduce:
1. Build the kernel with CC=clang + LD=ld.lld
2. Invoke CC=clang LD=ld.lld emerge media-video/v4l2loopback
3. Observe error
Actual Results:  
The relevant section of the build log is:

warning: the compiler differs from the one used to build the kernel
  The kernel was built by: clang version 13.0.1
  You are using:           x86_64-pc-linux-gnu-gcc (Gentoo 11.2.1_p20220115 p4) 11.2.1 20220115
  CC [M]  /var/tmp/portage/media-video/v4l2loopback-0.12.5-r1/work/v4l2loopback-0.12.5/v4l2loopback.o
x86_64-pc-linux-gnu-gcc: error: unrecognized command-line option ‘-Qunused-arguments’

Expected Results:  
Package merges cleanly

The reason it can give the warning is because the built kernel sources record what compiler was used (and what options it was given).  Instead of guessing, the ebuild should pull this information.  It already does for the options to pass to the compiler, but not for the compiler executable itself.