linux60: Restore O3 feature as the builtin config was removed

Fixes https://github.com/Frogging-Family/linux-tkg/issues/582
This commit is contained in:
Tk-Glitch
2022-09-01 16:02:45 +02:00
parent d65f578346
commit 5ef15e3fa4
3 changed files with 58 additions and 5 deletions

View File

@@ -872,6 +872,8 @@ case $_basever in
# MM Dirty Soft for WRITE_WATCH support in Wine
0001-mm-Support-soft-dirty-flag-reset-for-VA-range.patch
0002-mm-Support-soft-dirty-flag-read-with-reset.patch
# O3
0013-optimize_harder_O3.patch
)
sha256sums=('9fbca4f2bbea82311c877377497174b5521f33daf3b0e29cacec92601780e2b3'
#upcoming_kernel_patch_sha256
@@ -894,7 +896,8 @@ case $_basever in
'2ab9ea2d3ef43cfb5cf680ee2262f5671fd5ea980921f33abf2208f9892e9009'
'213ecf1ba59dc87ed1844c3473d575b85ffe3a567f86735e8c6239c92dbbb493'
'1b656ad96004f27e9dc63d7f430b50d5c48510d6d4cd595a81c24b21adb70313'
'b0319a7dff9c48b2f3e3d3597ee154bf92223149a633a8b7ce4026252db86da6')
'b0319a7dff9c48b2f3e3d3597ee154bf92223149a633a8b7ce4026252db86da6'
'8c3875e4935ecf258131f8da4ac819e9fb57439efff31549c0f11693c3601544')
;;
esac

View File

@@ -1005,11 +1005,17 @@ _tkg_srcprep() {
_disable "CC_OPTIMIZE_HARDER"
fi
elif [ "$_compileroptlevel" = "2" ]; then
_disable "CC_OPTIMIZE_FOR_PERFORMANCE"
if [ "$_basever" != "54" ]; then
_enable "CC_OPTIMIZE_FOR_PERFORMANCE_O3"
if [[ "$_basever" = 6* ]]; then
tkgpatch="$srcdir/0013-optimize_harder_O3.patch"
_msg="Patching O3 optimization"
_tkg_patcher
else
_enable "CC_OPTIMIZE_HARDER"
_disable "CC_OPTIMIZE_FOR_PERFORMANCE"
if [ "$_basever" != "54" ]; then
_enable "CC_OPTIMIZE_FOR_PERFORMANCE_O3"
else
_enable "CC_OPTIMIZE_HARDER"
fi
fi
elif [ "$_compileroptlevel" = "3" ]; then
_disable "CC_OPTIMIZE_FOR_PERFORMANCE"

View File

@@ -0,0 +1,44 @@
diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -442,13 +442,13 @@ endif
HOSTPKG_CONFIG = pkg-config
KBUILD_USERHOSTCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes \
- -O2 -fomit-frame-pointer -std=gnu11 \
+ -O3 -fomit-frame-pointer -std=gnu11 \
-Wdeclaration-after-statement
KBUILD_USERCFLAGS := $(KBUILD_USERHOSTCFLAGS) $(USERCFLAGS)
KBUILD_USERLDFLAGS := $(USERLDFLAGS)
KBUILD_HOSTCFLAGS := $(KBUILD_USERHOSTCFLAGS) $(HOST_LFS_CFLAGS) $(HOSTCFLAGS)
-KBUILD_HOSTCXXFLAGS := -Wall -O2 $(HOST_LFS_CFLAGS) $(HOSTCXXFLAGS)
+KBUILD_HOSTCXXFLAGS := -Wall -O3 $(HOST_LFS_CFLAGS) $(HOSTCXXFLAGS)
KBUILD_HOSTLDFLAGS := $(HOST_LFS_LDFLAGS) $(HOSTLDFLAGS)
KBUILD_HOSTLDLIBS := $(HOST_LFS_LIBS) $(HOSTLDLIBS)
@@ -757,7 +757,7 @@ KBUILD_CFLAGS += $(call cc-disable-warning, format-overflow)
KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE
-KBUILD_CFLAGS += -O2
+KBUILD_CFLAGS += -O3
else ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
KBUILD_CFLAGS += -Os
endif
diff --git a/init/Kconfig b/init/Kconfig
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1401,10 +1401,10 @@ choice
default CC_OPTIMIZE_FOR_PERFORMANCE
config CC_OPTIMIZE_FOR_PERFORMANCE
- bool "Optimize for performance (-O2)"
+ bool "Optimize for performance (-O3)"
help
This is the default optimization level for the kernel, building
- with the "-O2" compiler flag for best performance and most
+ with the "-O3" compiler flag for best performance and most
helpful compile-time warnings.
config CC_OPTIMIZE_FOR_SIZE