History

kbuild: generate autoksyms.h early

When doing a cold build, autoksyms.h starts empty, and is updated late in the build process to have visibility over the symbols used by in-tree drivers. But since the symbol whitelist is known upfront, it can be used to pre-populate autoksyms.h and maximize the amount of code that can be compiled to its final state in a single pass, hence reducing build time. Do this by using gen_autoksyms.sh to initialize autoksyms.h instead of creating an empty file.

Quentin Perret committed 6 years ago

Commit 88694cf1 parent cd195bc2 files · +7 −3Browse files

Unified · Split

2 files
  1. Makefile +5 −2
  2. scripts/gen_autoksyms.sh +2 −1
Makefile+5−2
@@ -1066,9 +1066,12 @@ endif · 1065 unmodified lines
1066 1066
1067autoksyms_h := $(if $(CONFIG_TRIM_UNUSED_KSYMS), include/generated/autoksyms.h)1067autoksyms_h := $(if $(CONFIG_TRIM_UNUSED_KSYMS), include/generated/autoksyms.h)
1068 1068
1069quiet_cmd_autoksyms_h = GEN $@
1070 cmd_autoksyms_h = mkdir -p $(dir $@); \
1071 $(CONFIG_SHELL) $(srctree)/scripts/gen_autoksyms.sh $@
1072
1069$(autoksyms_h):1073$(autoksyms_h):
1070 $(Q)mkdir -p $(dir $@)1074 $(call cmd,autoksyms_h)
1071 $(Q)touch $@
1072 1075
1073ARCH_POSTLINK := $(wildcard $(srctree)/arch/$(SRCARCH)/Makefile.postlink)1076ARCH_POSTLINK := $(wildcard $(srctree)/arch/$(SRCARCH)/Makefile.postlink)
1074 1077
scripts/gen_autoksyms.sh+2−1
@@ -39,7 +39,8 @@ cat > "$output_file" << EOT · 38 unmodified lines
39 39
40EOT40EOT
41 41
42sed 's/ko$/mod/' modules.order |42[ -f modules.order ] && modlist=modules.order || modlist=/dev/null
43sed 's/ko$/mod/' $modlist |
43xargs -n1 sed -n -e '2{s/ /\n/g;/^$/!p;}' -- |44xargs -n1 sed -n -e '2{s/ /\n/g;/^$/!p;}' -- |
44cat - "$ksym_wl" |45cat - "$ksym_wl" |
45sort -u |46sort -u |

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t