Is it possible to create a USE flag for custom CFLAGS and LDFLAGS? Its Horrible to replace this by hand. Reproducible: Always
umm, what? You want a use flag to insert custom *FLAGS when you compile the kernel? eg. "cd /usr/src/linux ; make" That isn't possible because that no longer involves the ebuild.
If the USE flag is enabled the ebuild patch the /usr/src/linux-.../Makefile and the HOSTCFLAGS and HOSTCXXFLAGS vars getting his values from the /etc/make.conf file.
(In reply to comment #2) > If the USE flag is enabled the ebuild patch the /usr/src/linux-.../Makefile and > the HOSTCFLAGS and HOSTCXXFLAGS vars getting his values from the /etc/make.conf > file. > Learn something every day. Thanks for the info, do you have a patch as well that works?
I dont know how to create a path but i only changed HOSTCFLAGS = ... HOSTCXXFLAGS = ... to HOSTCFLAGS = $(shell portageq envvar CFLAGS) HOSTCXXFLAGS = $(shell portageq envvar CXXFLAGS)
Afaik, custom cflags in your kernel is frowned upon because the kernel is so different than all the other software on your system so it already has a set of fine-tuned cflags... However, that's just knowledge i've gleaned off the general internets, so it may be entirely wrong.
Created attachment 162724 [details, diff] linux-kernel-custom-cflags.patch If you still must do it however, here's a patch...
Russell, thanks for the patch, maybe it's useful for someone. Although, this is potentially dangerous for end users so it's better that the people interested patch their own sources or create their own ebuild. Supporting this officially may result in buggy or even unbootable kernels and angry users.