diff mbox series

[2/2] kernel: drop patch adding hardcoded kernel compilation flags

Message ID 20220615103637.11190-2-zajec5@gmail.com
State Accepted
Delegated to: Rafał Miłecki
Headers show
Series [1/2] kernel: support setting extra CFLAGS for kernel compilation | expand

Commit Message

Rafał Miłecki June 15, 2022, 10:36 a.m. UTC
From: Rafał Miłecki <rafal@milecki.pl>

1. KCFLAGS should be used for custom flags
2. Optimization flags are arch / SoC specific
3. -fno-reorder-blocks may *worsen* network performace on some SoCs
4. Usage of flags was *reversed* since 5.4 and noone reported that

If we really need custom flags then CONFIG_KERNEL_CFLAGS should get
default value adjusted properly (per target).

Ref: 4e0c54bc5bc8 ("kernel: add support for kernel 5.4")
Link: http://lists.openwrt.org/pipermail/openwrt-devel/2022-June/038853.html
Link: https://patchwork.ozlabs.org/project/openwrt/patch/20190409093046.13401-1-zajec5@gmail.com/
Cc: Felix Fietkau <nbd@nbd.name>
Cc: Hauke Mehrtens <hauke@hauke-m.de>
Cc: Rui Salvaterra <rsalvaterra@gmail.com>
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
 .../pending-5.10/201-extra_optimization.patch | 25 -------------------
 .../pending-5.15/201-extra_optimization.patch | 25 -------------------
 2 files changed, 50 deletions(-)
 delete mode 100644 target/linux/generic/pending-5.10/201-extra_optimization.patch
 delete mode 100644 target/linux/generic/pending-5.15/201-extra_optimization.patch

Comments

Hauke Mehrtens June 20, 2022, 6:12 p.m. UTC | #1
On 6/15/22 12:36, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
> 
> 1. KCFLAGS should be used for custom flags
> 2. Optimization flags are arch / SoC specific
> 3. -fno-reorder-blocks may *worsen* network performace on some SoCs
> 4. Usage of flags was *reversed* since 5.4 and noone reported that
> 
> If we really need custom flags then CONFIG_KERNEL_CFLAGS should get
> default value adjusted properly (per target).
> 
> Ref: 4e0c54bc5bc8 ("kernel: add support for kernel 5.4")
> Link: http://lists.openwrt.org/pipermail/openwrt-devel/2022-June/038853.html
> Link: https://patchwork.ozlabs.org/project/openwrt/patch/20190409093046.13401-1-zajec5@gmail.com/
> Cc: Felix Fietkau <nbd@nbd.name>
> Cc: Hauke Mehrtens <hauke@hauke-m.de>
> Cc: Rui Salvaterra <rsalvaterra@gmail.com>
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>

Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
diff mbox series

Patch

diff --git a/target/linux/generic/pending-5.10/201-extra_optimization.patch b/target/linux/generic/pending-5.10/201-extra_optimization.patch
deleted file mode 100644
index dcf39c574f..0000000000
--- a/target/linux/generic/pending-5.10/201-extra_optimization.patch
+++ /dev/null
@@ -1,25 +0,0 @@ 
-From: Felix Fietkau <nbd@nbd.name>
-Subject: Upgrade to Linux 2.6.19
-
-- Includes large parts of the patch from #1021 by dpalffy
-- Includes RB532 NAND driver changes by n0-1
-
-[john@phrozen.org: feix will add this to his upstream queue]
-
-lede-commit: bff468813f78f81e36ebb2a3f4354de7365e640f
-Signed-off-by: Felix Fietkau <nbd@nbd.name>
----
- Makefile | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
---- a/Makefile
-+++ b/Makefile
-@@ -739,7 +739,7 @@ KBUILD_CFLAGS += -O2
- else ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3
- KBUILD_CFLAGS += -O3
- else ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
--KBUILD_CFLAGS += -Os
-+KBUILD_CFLAGS += -Os -fno-reorder-blocks -fno-tree-ch
- endif
- 
- # Tell gcc to never replace conditional load with a non-conditional one
diff --git a/target/linux/generic/pending-5.15/201-extra_optimization.patch b/target/linux/generic/pending-5.15/201-extra_optimization.patch
deleted file mode 100644
index 96e93dde9b..0000000000
--- a/target/linux/generic/pending-5.15/201-extra_optimization.patch
+++ /dev/null
@@ -1,25 +0,0 @@ 
-From: Felix Fietkau <nbd@nbd.name>
-Subject: Upgrade to Linux 2.6.19
-
-- Includes large parts of the patch from #1021 by dpalffy
-- Includes RB532 NAND driver changes by n0-1
-
-[john@phrozen.org: feix will add this to his upstream queue]
-
-lede-commit: bff468813f78f81e36ebb2a3f4354de7365e640f
-Signed-off-by: Felix Fietkau <nbd@nbd.name>
----
- Makefile | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
---- a/Makefile
-+++ b/Makefile
-@@ -756,7 +756,7 @@ KBUILD_CFLAGS += -O2
- else ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3
- KBUILD_CFLAGS += -O3
- else ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
--KBUILD_CFLAGS += -Os
-+KBUILD_CFLAGS += -Os -fno-reorder-blocks -fno-tree-ch
- endif
- 
- # Tell gcc to never replace conditional load with a non-conditional one