Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 859553 - sys-fs/vhba ignores Clang and fails to build
Summary: sys-fs/vhba ignores Clang and fails to build
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Michał Górny
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-07-20 14:28 UTC by xleb
Modified: 2022-07-20 21:30 UTC (History)
0 users

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


Attachments
build log (build.log,3.65 KB, text/x-log)
2022-07-20 14:28 UTC, xleb
Details
emerge --info (emerge_info,8.93 KB, text/plain)
2022-07-20 14:29 UTC, xleb
Details

Note You need to log in before you can comment on or make changes to this bug.
Description xleb 2022-07-20 14:28:35 UTC
Created attachment 792581 [details]
build log

I've built the kernel with Clang and now I can't build this package because it defaults to GCC while trying to use Clang specific flags 
Clang is set to be the compiler for the package in /etc/portage/package.env and /etc/portage/env/ but it still defaults to GCC

In short this is what happens

 * Preparing vhba module
make -j3 -l3 HOSTCC=clang 'LDFLAGS=-m elf_x86_64' KDIR=/usr/src/linux modules 
make -C /usr/src/linux M=/var/tmp/portage/sys-fs/vhba-20211218/work/vhba-module-20211218 modules
make[1]: Entering directory '/usr/src/linux-5.18.11-xanmod'
warning: the compiler differs from the one used to build the kernel
  The kernel was built by: clang version 14.0.4
  You are using:           x86_64-pc-linux-gnu-gcc (Gentoo 11.3.0 p5) 11.3.0
  CC [M]  /var/tmp/portage/sys-fs/vhba-20211218/work/vhba-module-20211218/vhba.o
x86_64-pc-linux-gnu-gcc: error: unrecognized command-line option ‘-Qunused-arguments’
x86_64-pc-linux-gnu-gcc: error: unrecognized command-line option ‘-mretpoline-external-thunk’
x86_64-pc-linux-gnu-gcc: error: unrecognized command-line option ‘-fsplit-lto-unit’
make[2]: *** [scripts/Makefile.build:288: /var/tmp/portage/sys-fs/vhba-20211218/work/vhba-module-20211218/vhba.o] Error 1
make[1]: *** [Makefile:1839: /var/tmp/portage/sys-fs/vhba-20211218/work/vhba-module-20211218] Error 2
make[1]: Leaving directory '/usr/src/linux-5.18.11-xanmod'
make: *** [Makefile:14: modules] Error 2
 * ERROR: sys-fs/vhba-20211218::gentoo failed (compile phase):
 *   emake failed

Including build.log and --info
Comment 1 xleb 2022-07-20 14:29:03 UTC
Created attachment 792584 [details]
emerge --info