summaryrefslogtreecommitdiff
path: root/scripts/adjust_autoksyms.sh
AgeCommit message (Collapse)Author
2018-03-21kbuild: make scripts/adjust_autoksyms.sh robust against timestamp racesNicolas Pitre
Some filesystems have timestamps with coarse precision that may allow for a recently built object file to have the same timestamp as the updated time on one of its dependency files. When that happens, the object file doesn't get rebuilt as it should. This is especially the case on filesystems that don't have sub-second time precision, such as ext3 or Ext4 with 128B inodes. Let's prevent that by making sure updated dependency files have a newer timestamp than the first file we created (i.e. autoksyms.h.tmpnew). Reported-by: Thomas Lindroth <thomas.lindroth@gmail.com> Signed-off-by: Nicolas Pitre <nico@linaro.org> Tested-by: Thomas Lindroth <thomas.lindroth@gmail.com> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2016-12-11kbuild: fix scripts/adjust_autoksyms.sh* for the no modules caseNicolas Pitre
When CONFIG_TRIM_UNUSED_KSYMS=y and no modules are actually selected, the adjust_autoksyms.sh script fails with: sed: can't read .tmp_versions/*.mod: No such file or directory Let's cope with that case gracefully. Signed-off-by: Nicolas Pitre <nico@linaro.org> Signed-off-by: Michal Marek <mmarek@suse.com>
2016-05-10kbuild: fix adjust_autoksyms.sh for modules that need only one symbolNicolas Pitre
When only one symbol was listed and therefore the line didn't contain any space to separate multiple symbols, that symbol got ignored. Reported-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Nicolas Pitre <nico@linaro.org> Signed-off-by: Michal Marek <mmarek@suse.com>
2016-03-29kbuild: create/adjust generated/autoksyms.hNicolas Pitre
Given the list of exported symbols needed by all modules, we can create a header file containing preprocessor defines for each of those symbols. Also, when some symbols are added and/or removed from the list, we can update the time on the corresponding files used as build dependencies for those symbols. And finally, if any symbol did change state, the corresponding source files must be rebuilt. The insertion or removal of an EXPORT_SYMBOL() entry within a module may create or remove the need for another exported symbol. This is why this operation has to be repeated until the list of needed exported symbols becomes stable. Only then the final kernel and modules link take place. Signed-off-by: Nicolas Pitre <nico@linaro.org> Acked-by: Rusty Russell <rusty@rustcorp.com.au>