when using genkernel, is the kernel compiled using the custom cflags in the /etc/portage/make.conf when the
Code: Select all
genkernel all
Code: Select all
genkernel all
Code: Select all
nano /etc/genkernel.conf
Code: Select all
KERNEL_CFLAGS="-O2 -march=native -pipe -fomit-frame-pointer"
Code: Select all
genkernel all
Code: Select all
nano /var/log/genkernel.log
My entry was:genkernel.log wrote:* KERNEL_CFLAGS
genkernel.log wrote: * KERNEL_CFLAGS set in config file to "-O2 -march=native -pipe -fomit-frame-pointer"
Code: Select all
# Genkernel uses an independent configuration for MAKEOPTS, and does not source
# /etc/portage/make.conf . You can override the default setting by uncommenting
# and tweaking the following line. Default setting is set up by
# ${GK_SHARE}/${ARCH_OVERRIDE}/config.sh . The recommended value for -j
# argument is: <number of processors>*<number of cores per processor>+1
#MAKEOPTS="$(portageq envvar MAKEOPTS)"
Does that mean that CFLAGS can be gotten from make.conf?Gladdle wrote:May i quote from the file /etc/genkernel.conf:Code: Select all
# Genkernel uses an independent configuration for MAKEOPTS, and does not source # /etc/portage/make.conf . You can override the default setting by uncommenting # and tweaking the following line. Default setting is set up by # ${GK_SHARE}/${ARCH_OVERRIDE}/config.sh . The recommended value for -j # argument is: <number of processors>*<number of cores per processor>+1 #MAKEOPTS="$(portageq envvar MAKEOPTS)"

See post #2 in this thread, I think that post answer your questions.Hu wrote: Matching size is suspicious, but not definitive. What command line did make use to run gcc on the kernel source? What did you do that you expected to influence the kernel's build?
Code: Select all
lee /boot # md5sum vmlinuz-6.1.19-gentoo-x86_64
eb33224e0a715b8fb78a25047f0572ed vmlinuz-6.1.19-gentoo-x86_64
lee /boot # md5sum vmlinuz-6.1.19-gentoo-x86_64.old
54e162e35f0e8772be3c013f454e67cb vmlinuz-6.1.19-gentoo-x86_64.old
lee /boot # du -b vmlinuz-6.1.19-gentoo-x86_64
10238784 vmlinuz-6.1.19-gentoo-x86_64
lee /boot # du -b vmlinuz-6.1.19-gentoo-x86_64.old
10238784 vmlinuz-6.1.19-gentoo-x86_64.old
lee /boot #

Ionen wrote:As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though
I would suggest MAKEOPTS="V=1" in /etc/genkernel.conf. Not tested though.GDH-gentoo wrote:For a manual build of the kernel, make V=1 makefile_target will show the full compiler invocations, including compiler options used. I don't know how to do it when Genkernel is used to build the kernel, though.

Addedsublogic wrote:I would suggest MAKEOPTS="V=1" in /etc/genkernel.conf. Not tested though.GDH-gentoo wrote:For a manual build of the kernel, make V=1 makefile_target will show the full compiler invocations, including compiler options used. I don't know how to do it when Genkernel is used to build the kernel, though.
Code: Select all
KERNEL_CFLAGS="-O2 -march=native -pipe -fomit-frame-pointer"Code: Select all
MAKEOPTS="-j5 V=1"Code: Select all
genkernel --zfs allCode: Select all
less +F /var/log/genkernel.log
I built the kernel usingHu wrote:That post does not show the output of make as it invoked gcc. That post assumes use of genkernel. It's not clear from your most recent posts if you built the kernel by hand or if you let genkernel do it.
Code: Select all
genkernel allI would love the learn how to do thatHu wrote: You might be able to derive the answer from the contents of the kernel's generated dependency files (*.cmd files).
The files are plain text, in a format suitable for inclusion in GNU make, so cat /path/to/.cmd-file should work. You should find these files in your $KBUILD_OUTPUT directory (default for basic kernel build: .; default for genkernel: unknown). find "${KBUILD_OUTPUT:-.}" -name '*.cmd' should work to find them, if run from the kernel build directory.EliasJonsson wrote:I would love the learn how to do thatHu wrote:You might be able to derive the answer from the contents of the kernel's generated dependency files (*.cmd files).
That can also pick CFLAGS for you, yes. However, most build systems, including the kernel build system, also allow the user to pass arbitrary additional flags. These flags can help or hurt, but it is the user's choice to use them.logrusx wrote:I think the kernel CFLAGS are defined by what processor family is selected in your kernel config.