# additional-cpu-opts missing in 4.20.11 gentoo-sources???

## wrc1944

The Patch #5010_enable-additional-cpu-optimizations-for-gcc-4.9.patch is missing in today's gentoo-sources update to 4.20.11.   :Shocked: 

Is this just an oversight, or has it actually been dropped after years of really making these opts convenient in gentoo-sources? 

This is a must have patch!   :Rolling Eyes:   Lots of us have come to rely on this just being there. 

https://github.com/graysky2/kernel_gcc_patch/tree/c9779b8a43e1355f6a95a889661ff707e707234e (This is wrong link, see below)

https://dev.gentoo.org/~mpagano/genpatches/patches-4.20-10.html

Or, does it no longer correctly apply in 4.20.11? Worked fine in 4.20.10, as usual.

```
 Emerging (1 of 1) sys-kernel/gentoo-sources-4.20.11::gentoo

 * linux-4.20.tar.xz BLAKE2B SHA512 size ;-) ...                                                                                                                          [ ok ]

 * genpatches-4.20-11.base.tar.xz BLAKE2B SHA512 size ;-) ...                                                                                                             [ ok ]

 * genpatches-4.20-11.extras.tar.xz BLAKE2B SHA512 size ;-) ...                                                                                                           [ ok ]

 * genpatches-4.20-11.experimental.tar.xz BLAKE2B SHA512 size ;-) ...                                                                                                     [ ok ]

>>> Preparing to unpack ...

>>> Unpacking source...

>>> Unpacking linux-4.20.tar.xz to /var/tmp/portage/sys-kernel/gentoo-sources-4.20.11/work

>>> Unpacking genpatches-4.20-11.base.tar.xz to /var/tmp/portage/sys-kernel/gentoo-sources-4.20.11/work/patches

>>> Unpacking genpatches-4.20-11.extras.tar.xz to /var/tmp/portage/sys-kernel/gentoo-sources-4.20.11/work/patches

>>> Unpacking genpatches-4.20-11.experimental.tar.xz to /var/tmp/portage/sys-kernel/gentoo-sources-4.20.11/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 ]

 * 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-4.20.1.patch (-p1) ...                                                                                                                             [ ok ]

 * Applying 1001_linux-4.20.2.patch (-p1) ...                                                                                                                             [ ok ]

 * Applying 1002_linux-4.20.3.patch (-p1) ...                                                                                                                             [ ok ]

 * Applying 1003_linux-4.20.4.patch (-p1) ...                                                                                                                             [ ok ]

 * Applying 1004_linux-4.20.5.patch (-p1) ...                                                                                                                             [ ok ]

 * Applying 1005_linux-4.20.6.patch (-p1) ...                                                                                                                             [ ok ]

 * Applying 1006_linux-4.20.7.patch (-p1) ...                                                                                                                             [ ok ]

 * Applying 1007_linux-4.20.8.patch (-p1) ...                                                                                                                             [ ok ]

 * Applying 1008_linux-4.20.9.patch (-p1) ...                                                                                                                             [ ok ]

 * Applying 1009_linux-4.20.10.patch (-p1) ...                                                                                                                            [ ok ]

 * Applying 1010_linux-4.20.11.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 4400_alpha-sysctl-uac.patch (-p1) ...                                                                                                                         [ ok ]

 * Applying 4567_distro-Gentoo-Kconfig.patch (-p1) ...                                                                                                                    [ ok ]

>>> Source unpacked in /var/tmp/portage/sys-kernel/gentoo-sources-4.20.11/work

>>> Preparing source in /var/tmp/portage/sys-kernel/gentoo-sources-4.20.11/work/linux-4.20.11-gentoo ...

>>> Source prepared.

>>> Configuring source in /var/tmp/portage/sys-kernel/gentoo-sources-4.20.11/work/linux-4
```

----------

## wrc1944

I downloaded the correct patch from graysky, and applied it myself, and it worked, as usual.     :Smile:   Compiling kernel now.  I'm assuming leaving it out was just an oversight.

I expect all to be well, but will post back if not. BTW, the correct link is: https://github.com/graysky2/kernel_gcc_patch/blob/master/enable_additional_cpu_optimizations_for_gcc_v4.9%2B_kernel_v4.13%2B.patch

The other link above was an old version.

```
gentoo-main ~ # cd /usr/src/linux-4.20.11-gentoo

gentoo-main /usr/src/linux-4.20.11-gentoo # patch -p1 < enable_additional_cpu_optimizations_for_gcc_v4.9+_kernel_v4.13+.patch

patching file arch/x86/include/asm/module.h

patching file arch/x86/Kconfig.cpu

Hunk #10 succeeded at 499 (offset -13 lines).

Hunk #11 succeeded at 538 (offset -13 lines).

patching file arch/x86/Makefile

Hunk #1 succeeded at 118 (offset -6 lines).

patching file arch/x86/Makefile_32.cpu

gentoo-main /usr/src/linux-4.20.11-gentoo #
```

----------

## CaptainBlood

 *wrc1944 wrote:*   

> ... BTW, the correct link is: https://github.com/graysky2/kernel_gcc_patch/blob/master/enable_additional_cpu_optimizations_for_gcc_v4.9%2B_kernel_v4.13%2B.patch
> 
> The other link above was an old version...

 

S**t! Got to do it allover again!  :Crying or Very sad: 

Thks 4 ur attention, interest & support.

----------

## wrc1944

 :Embarassed:  Sorry I had the old link posted first. 

Hopefully, Mike Pagano (the genpatches dev) will add the gcc opts 5010 patch. IIRC, this happened once before about 2 years ago. No big deal, as one can always DIY.

Here's where I got the final link to the newest 5010 patch.  https://dev.gentoo.org/~mpagano/genpatches/patches-4.20-10.html  (at bottom of page.

----------

## mpagano

So here's the mess...

The 5010 patch is still there, but won't apply if you are using gcc v8.

This change was made because I had committed the cpu optimization patch for >= gcc v8 and both

can't be applied at the same time. (Obviously)

Then...

I found out that the gcc v8 patch does not apply to 4.20.11 as I was releasing it.

Fun times.

I'll probably end up just seeing if I can fix the problems with the gcc v8 patch tomorrow and then commit for 4.20.12 or 4.20.11-r1. There might even be pull requests upstream to fix it.  I have to check.

Sorry about the mess.

Either way, this will be fixed at least over this weekend.

----------

## mpagano

Test results from anyone interested welcome:

https://gitweb.gentoo.org/proj/linux-patches.git/diff/5011_enable-cpu-optimizations-for-gcc8.patch?h=4.20

----------

## wrc1944

Mike,

Thanks very much! The 5011 patch looks great. I assume this will be in the next 4.20.12 gentoo-sources and beyond the upcoming 5.0.0, but NOT for when gcc-9.x.x is available. Is this correct?

I'm also curious about the 5010 patch and why I was able to use it successfully on 3 Gentoo installs with kernel 4.20.11 and gcc-8.2.

I guess what confuses me is:

mpagano wrote:  *Quote:*   

> This change was made because I had committed the cpu optimization patch for >= gcc v8 and both
> 
> can't be applied at the same time. (Obviously)
> 
> Then...
> ...

 

What am I missing here?   :Confused: 

----------

## mpagano

 *wrc1944 wrote:*   

> Mike,
> 
> Thanks very much! The 5011 patch looks great. I assume this will be in the next 4.20.12 gentoo-sources and beyond the upcoming 5.0.0, but NOT for when gcc-9.x.x is available. Is this correct?
> 
> I'm also curious about the 5010 patch and why I was able to use it successfully on 3 Gentoo installs with kernel 4.20.11 and gcc-8.2.
> ...

 

Looking back, I think I was applying both at the same time.  Either way, these are now applied according to upstream.

----------

