-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kernel: use KCFLAGS for passing EXTRA_OPTIMIZATION flags
This uses kernel's generic variable and doesn't require patching it with a custom Makefile change. It's expected *not* to change any behaviour. Signed-off-by: Rafał Miłecki <[email protected]> (cherry picked from commit 1d42af720c6b6dcfcdd0b89bce386fca1607dcb3) Signed-off-by: Kevin Darbyshire-Bryant <[email protected]> (cherry picked from commit 24e27bec9a6df1511a504cf04cd9578a23e74657)
- Loading branch information
Rafał Miłecki
committed
Jul 8, 2022
1 parent
bd84d51
commit 44fa330
Showing
3 changed files
with
4 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,18 +14,12 @@ Signed-off-by: Felix Fietkau <[email protected]> | |
|
||
--- a/Makefile | ||
+++ b/Makefile | ||
@@ -719,11 +719,11 @@ KBUILD_CFLAGS += $(call cc-disable-warni | ||
KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member) | ||
|
||
ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE | ||
-KBUILD_CFLAGS += -O2 | ||
+KBUILD_CFLAGS += -O2 $(EXTRA_OPTIMIZATION) | ||
@@ -723,7 +723,7 @@ KBUILD_CFLAGS += -O2 | ||
else ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3 | ||
-KBUILD_CFLAGS += -O3 | ||
+KBUILD_CFLAGS += -O3 $(EXTRA_OPTIMIZATION) | ||
KBUILD_CFLAGS += -O3 | ||
else ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE | ||
-KBUILD_CFLAGS += -Os | ||
+KBUILD_CFLAGS += -Os -fno-reorder-blocks -fno-tree-ch $(EXTRA_OPTIMIZATION) | ||
+KBUILD_CFLAGS += -Os -fno-reorder-blocks -fno-tree-ch | ||
endif | ||
|
||
# Tell gcc to never replace conditional load with a non-conditional one |