Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
e
os
android_vendor_lineage
Commits
961af007
Commit
961af007
authored
Dec 03, 2021
by
Chirayu Desai
Committed by
dianlujitao
Feb 13, 2022
Browse files
kernel: Implement build time LTO choice
Change-Id: I898eb50fadb6bde5beebf46f443c5de7e6acc907
parent
3191fee6
Changes
1
Hide whitespace changes
Inline
Side-by-side
build/tasks/kernel.mk
View file @
961af007
...
...
@@ -55,6 +55,8 @@
# aarch64-linux-gnu- for arm64
# x86_64-linux-gnu- for x86
#
# KERNEL_LTO = Optional, force LTO to none / thin / full
#
# NEED_KERNEL_MODULE_ROOT = Optional, if true, install kernel
# modules in root instead of vendor
# NEED_KERNEL_MODULE_SYSTEM = Optional, if true, install kernel
...
...
@@ -275,6 +277,31 @@ endef
# $(2): The defconfig to process (just the filename, no need for full path to file)
define
make-kernel-config
$(call
internal-make-kernel-target,$(1),
VARIANT_DEFCONFIG
=
$(VARIANT_DEFCONFIG)
SELINUX_DEFCONFIG
=
$(SELINUX_DEFCONFIG)
$(2)
)
$(hide)
if
[
"$(KERNEL_LTO)"
=
"none"
];
then
\
$(KERNEL_SRC)/scripts/config
--file
$(1)/.config
\
-d
LTO_CLANG
\
-e
LTO_NONE
\
-d
LTO_CLANG_THIN
\
-d
LTO_CLANG_FULL
\
-d
THINLTO;
\
$(call
make-kernel-target,olddefconfig);
\
elif
[
"$(KERNEL_LTO)"
=
"thin"
];
then
\
$(KERNEL_SRC)/scripts/config
--file
$(1)/.config
\
-e
LTO_CLANG
\
-d
LTO_NONE
\
-e
LTO_CLANG_THIN
\
-d
LTO_CLANG_FULL
\
-e
THINLTO;
\
$(call
make-kernel-target,olddefconfig);
\
elif
[
"$(KERNEL_LTO)"
=
"full"
];
then
\
$(KERNEL_SRC)/scripts/config
--file
$(1)/.config
\
-e
LTO_CLANG
\
-d
LTO_NONE
\
-d
LTO_CLANG_THIN
\
-e
LTO_CLANG_FULL
\
-d
THINLTO;
\
$(call
make-kernel-target,olddefconfig);
\
fi
$(hide)
if
[
!
-z
"$(KERNEL_CONFIG_OVERRIDE)"
];
then
\
echo
"Overriding kernel config with '$(KERNEL_CONFIG_OVERRIDE)'"
;
\
echo
$(KERNEL_CONFIG_OVERRIDE)
>>
$(1)/.config;
\
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment