Absolutely! Would it help to file an improvement bug? Against gentoo-sources generally?kajzer wrote:IMHO that USE flag should be removed and the additional CPU optimizations patch should be included with the rest of the patches.

Code: Select all
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="6"
ETYPE="sources"
K_WANT_GENPATCHES="base extras"
K_GENPATCHES_VER="2"
inherit kernel-2
detect_version
detect_arch
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches"
IUSE="experimental"
DESCRIPTION="Full sources including the Gentoo patchset for the ${KV_MAJOR}.${KV_MINOR} kernel tree"
SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI}"
pkg_postinst() {
kernel-2_pkg_postinst
einfo "For more info on this patchset, and how to report problems, see:"
einfo "${HOMEPAGE}"
}
pkg_postrm() {
kernel-2_pkg_postrm
}Code: Select all
amd64 ~ # emerge gentoo-sources -pv
These are the packages that would be merged, in order:
Calculating dependencies... done!
[ebuild R ] sys-kernel/gentoo-sources-5.1.1:5.1.1::gentoo USE="experimental -build -symlink" 103,755 KiBCode: Select all
2019-05-12 12:28:34 (2.06 MB/s) - ‘/usr/portage/distfiles/linux-5.1.tar.xz.__download__’ saved [106244476/106244476]
* linux-5.1.tar.xz BLAKE2B SHA512 size ;-) ... [ ok ]
* genpatches-5.1-2.base.tar.xz BLAKE2B SHA512 size ;-) ... [ ok ]
* genpatches-5.1-2.extras.tar.xz BLAKE2B SHA512 size ;-) ... [ ok ]
>>> Preparing to unpack ...
>>> Unpacking source...
>>> Unpacking linux-5.1.tar.xz to /var/tmp/portage/sys-kernel/gentoo-sources-5.1.1/work
>>> Unpacking genpatches-5.1-2.base.tar.xz to /var/tmp/portage/sys-kernel/gentoo-sources-5.1.1/work/patches
>>> Unpacking genpatches-5.1-2.extras.tar.xz to /var/tmp/portage/sys-kernel/gentoo-sources-5.1.1/work/patches
* Excluding Patch #5010_enable-additional-cpu-optimizations-for-gcc.patch ... [ ok ]
* Excluding Patch #5010_enable-additional-cpu-optimizations-for-gcc-4.9.patch ... [ ok ]
* Excluding Patch #5010_enable-additional-cpu-optimizations-for-gcc.patch ... [ ok ]
* Excluding Patch #5010_enable-additional-cpu-optimizations-for-gcc-4.9.patch ... [ ok ]
* Applying 1000_linux-5.1.1.patch (-p1) ... [ ok ]
* Applying 1500_XATTR_USER_PREFIX.patch (-p1) ... [ ok ]
* Applying 1510_fs-enable-link-security-restrictions-by-default.patch (-p1) ... [ ok ]
* Applying 2500_usb-storage-Disable-UAS-on-JMicron-SATA-enclosure.patch (-p1) ... [ ok ]
* Applying 2600_enable-key-swapping-for-apple-mac.patch (-p1) ... [ ok ]
* Applying 4567_distro-Gentoo-Kconfig.patch (-p1) ... [ ok ]
>>> Source unpacked in /var/tmp/portage/sys-kernel/gentoo-sources-5.1.1/work
>>> Preparing source in /var/tmp/portage/sys-kernel/gentoo-sources-5.1.1/work/linux-5.1.1-gentoo ...
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/sys-kernel/gentoo-sources-5.1.1/work/linux-5.1.1-gentoo ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/sys-kernel/gentoo-sources-5.1.1/work/linux-5.1.1-gentoo ...
>>> Source compiled.
>>> Test phase [not enabled]: sys-kernel/gentoo-sources-5.1.1
>>> Install gentoo-sources-5.1.1 into /var/tmp/portage/sys-kernel/gentoo-sources-5.1.1/image/ category sys-kernel
>>> Copying sources ...
>>> Completed installing gentoo-sources-5.1.1 into /var/tmp/portage/sys-kernel/gentoo-sources-5.1.1/image/
* Final size of build directory: 4 KiB
* Final size of installed tree: 965256 KiB (942.6 MiB)

Code: Select all
+config MZEN
+ bool "AMD Zen"
+ ---help---
+ Select this for AMD Family 17h Zen processors.
+
+ Enables -march=znver1
...
+ cflags-$(CONFIG_MZEN) += $(call cc-option,-march=znver1)
Code: Select all
amd64 ~ # cd /usr/src/linux-5.1.1-gentoo
amd64 /usr/src/linux-5.1.1-gentoo # patch -p1 < 5011_enable-cpu-optimizations-for-gcc8.patch
patching file arch/x86/Makefile_32.cpu
patching file arch/x86/Kconfig.cpu
patching file arch/x86/Makefile
patching file arch/x86/include/asm/module.hCode: Select all
export KCLAGS='-march=native'
make
make install
Code: Select all
# Add any arch overrides and user supplied CPPFLAGS, AFLAGS and CFLAGS as the
# last assignments
KBUILD_CPPFLAGS += $(ARCH_CPPFLAGS) $(KCPPFLAGS)
KBUILD_AFLAGS += $(ARCH_AFLAGS) $(KAFLAGS)
KBUILD_CFLAGS += $(ARCH_CFLAGS) $(KCFLAGS)