Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 692320 - sys-kernel/gentoo-sources[experimental]: add zen2 support in 5011_enable-cpu-optimizations patch
Summary: sys-kernel/gentoo-sources[experimental]: add zen2 support in 5011_enable-cpu-...
Status: IN_PROGRESS
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal enhancement (vote)
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL: https://github.com/graysky2/kernel_gc...
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2019-08-17 01:55 UTC by Adam Carter
Modified: 2019-08-23 22:20 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Carter 2019-08-17 01:55:34 UTC
GCC 9 has a -march=znver2 option, please add to gentoo-sources.
Comment 1 Sergei Trofimovich gentoo-dev 2019-08-17 13:22:28 UTC
toolchain@ does not maintain sys-kernel/gentoo-sources[experimental] patches.
Comment 2 Mike Pagano gentoo-dev 2019-08-17 18:20:18 UTC
@kernel does not add patches to gcc

znver2 is part of gcc 9.

Not sure what patch you are referring to, as you did not include any info.
URL? Patch ?
Comment 3 Adam Carter 2019-08-17 23:47:28 UTC
Assuming 5011_enable-cpu-optimizations-for-gcc8.patch is conditionally applied based gcc >= 8, then this is not the right place to support this feature request, as the new arch arrived in gcc 9.

As the zen version 1 support is;
# grep znver 5011_enable-cpu-optimizations-for-gcc8.patch
+cflags-$(CONFIG_MZEN)	+= $(call cc-option,-march=znver1,-march=athlon)
+	  Enables -march=znver1
+        cflags-$(CONFIG_MZEN) += $(call cc-option,-march=znver1)

I'd imagine supporting zen version 2 would be something like; 
+cflags-$(CONFIG_MZEN2)	+= $(call cc-option,-march=znver2,-march=athlon)
+	  Enables -march=znver2
+        cflags-$(CONFIG_MZEN2) += $(call cc-option,-march=znver2)

Sorry if i've missed the point of the discussion.
Comment 4 Joonas Niilola gentoo-dev 2019-08-18 05:57:56 UTC
@Adam, 
Use the -march=native (CONFIG_MNATIVE) option.

COLLECT_GCC_OPTIONS='-E' '-march=native'
 /usr/libexec/gcc/x86_64-pc-linux-gnu/9.2.0/cc1 -E -quiet - "-march=znver2"
... etc


@Mike, 
https://github.com/graysky2/kernel_gcc_patch he has updated it
Comment 5 Mike Pagano gentoo-dev 2019-08-18 19:54:54 UTC
Now I get your point. I'll take a look.
Comment 6 Mike Pagano gentoo-dev 2019-08-23 22:20:04 UTC
This will be in the next gentoo-sources release for 4.14,4.19 and 5.2