Skip to content
This repository was archived by the owner on Apr 13, 2024. It is now read-only.

Commit f9732af

Browse files
authored
Merge pull request #166 from nathanchance/lto
driver: Disable LTO/CFI by default
2 parents dc0a414 + 7f29bc9 commit f9732af

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

driver.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ setup_variables() {
99
"-c"|"--clean") cleanup=true ;;
1010
"-j"|"--jobs") shift; jobs=$1 ;;
1111
"-j"*) jobs=${1/-j} ;;
12+
"--lto") disable_lto=false ;;
1213
"-h"|"--help")
1314
cat usage.txt
1415
exit 0 ;;
@@ -269,6 +270,8 @@ build_linux() {
269270
[[ $ARCH != "x86_64" ]] && cat ../configs/tt.config >> .config
270271
# Disable ftrace on arm32: https://github.com/ClangBuiltLinux/linux/issues/35
271272
[[ $ARCH == "arm" ]] && ./scripts/config -d CONFIG_FTRACE
273+
# Disable LTO and CFI unless explicitly requested
274+
${disable_lto:=true} && ./scripts/config -d CONFIG_LTO -d CONFIG_LTO_CLANG
272275
fi
273276
# Make sure we build with CONFIG_DEBUG_SECTION_MISMATCH so that the
274277
# full warning gets printed and we can file and fix it properly.

usage.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,7 @@ Optional parameters:
4242
-j | --jobs
4343
Pass this value to make. The script will use all cores by default but
4444
this isn't always the best value.
45+
--lto
46+
By default, the script turns off LTO/CFI for quicker build times. If
47+
your machine can handle the more intensive compile, pass this flag
48+
to avoid attempting to disable it. This does not enable LTO explicitly.

0 commit comments

Comments
 (0)