linux/scripts
Matthias Maennich 76081a5f72 FROMLIST: kbuild: mkcompile_h: consider timestamp if KBUILD_BUILD_TIMESTAMP is set
To avoid unnecessary recompilations, mkcompile_h does not regenerate
compile.h if just the timestamp changed.
Though, if KBUILD_BUILD_TIMESTAMP is set, an explicit timestamp for the
build was requested, in which case we should not ignore it.

If a user follows the documentation for reproducible builds [1] and
defines KBUILD_BUILD_TIMESTAMP as the git commit timestamp, a clean
build will have the correct timestamp. A subsequent cherry-pick (or
amend) changes the commit timestamp and if an incremental build is done
with a different KBUILD_BUILD_TIMESTAMP now, that new value is not taken
into consideration. But it should for reproducibility.

Hence, whenever KBUILD_BUILD_TIMESTAMP is explicitly set, do not ignore
UTS_VERSION when making a decision about whether the regenerated version
of compile.h should be moved into place.

[1] https://www.kernel.org/doc/html/latest/kbuild/reproducible-builds.html

Cc: Masahiro Yamada <masahiroy@kernel.org>
Cc: linux-kbuild@vger.kernel.org
Bug: 189077755
Link: https://lore.kernel.org/r/20210612141838.1073085-1-maennich@google.com
Signed-off-by: Matthias Maennich <maennich@google.com>
Change-Id: I47a1b9e079346be82794ec93a449258e086945eb
2021-06-16 12:19:04 +00:00
..
atomic
basic
clang-tools scripts/clang-tools: switch explicitly to Python 3 2021-06-03 09:00:52 +02:00
coccinelle
dtc
dummy-tools kbuild: dummy-tools: fix inverted tests for gcc 2021-03-30 14:31:50 +02:00
gcc-plugins
gdb
genksyms
kconfig Merge 5.10.38 into android12-5.10 2021-05-20 15:35:25 +02:00
ksymoops
mod Merge 5.10.38 into android12-5.10 2021-05-20 15:35:25 +02:00
package
selinux
tracing tweewide: Fix most Shebang lines 2021-05-22 11:40:55 +02:00
.gitignore
adjust_autoksyms.sh
asn1_compiler.c
bin2c.c
bloat-o-meter scripts: switch explicitly to Python 3 2021-05-22 11:40:55 +02:00
bootgraph.pl
bpf_helpers_doc.py
cc-can-link.sh
check_extable.sh
check-sysctl-docs
checkincludes.pl
checkkconfigsymbols.py
checkpatch.pl
checkstack.pl
checksyscalls.sh
checkversion.pl
clang-version.sh
cleanfile
cleanpatch
coccicheck
config tweewide: Fix most Shebang lines 2021-05-22 11:40:55 +02:00
const_structs.checkpatch
decode_stacktrace.sh
decodecode
depmod.sh ANDROID: Kbuild: Add support for KBUILD_MIXED_TREE 2021-04-15 10:28:24 +01:00
dev-needs.sh
diffconfig scripts: switch explicitly to Python 3 2021-05-22 11:40:55 +02:00
documentation-file-ref-check
export_report.pl
extract_xc3028.pl
extract-cert.c
extract-ikconfig
extract-module-sig.pl
extract-sys-certs.pl
extract-vmlinux
faddr2line
file-size.sh
find-unused-docs.sh
gcc-goto.sh
gcc-ld
gcc-plugin.sh
gcc-version.sh
gcc-x86_32-has-stack-protector.sh
gcc-x86_64-has-stack-protector.sh
gen_autoksyms.sh BACKPORT: kbuild: fix UNUSED_KSYMS_WHITELIST for Clang LTO 2021-06-10 20:26:11 -07:00
gen_ksymdeps.sh
generate_cfi_kallsyms.pl ANDROID: Add missing CFI jump table symbols to kallsyms 2021-05-11 17:56:41 +00:00
generate_initcall_order.pl
get_abi.pl tweewide: Fix most Shebang lines 2021-05-22 11:40:55 +02:00
get_dvb_firmware
get_maintainer.pl
gfp-translate
headerdep.pl
headers_check.pl
headers_install.sh
insert-sys-cert.c
jobserver-exec
kallsyms.c kallsyms: fix nonconverging kallsyms table with lld 2021-02-17 11:02:24 +01:00
Kbuild.include
Kconfig.include
kernel-doc
ld-version.sh
leaking_addresses.pl
Lindent
link-vmlinux.sh ANDROID: Add missing CFI jump table symbols to kallsyms 2021-05-11 17:56:41 +00:00
lld-version.sh
Makefile scripts: set proper OpenSSL include dir also for sign-file 2021-02-17 11:02:28 +01:00
Makefile.asm-generic
Makefile.build ANDROID: kbuild: lto: permit the use of .a archives in LTO modules 2021-06-11 07:49:58 +00:00
Makefile.clean
Makefile.dtbinst
Makefile.extrawarn
Makefile.gcc-plugins
Makefile.headersinst
Makefile.host
Makefile.kasan Merge 5.10.33 into android12-5.10 2021-04-29 13:57:47 +02:00
Makefile.kcov
Makefile.kcsan
Makefile.lib FROMLIST: BACKPORT: Kbuild: Support nested composite objects 2021-03-03 15:45:49 -08:00
Makefile.modfinal ANDROID: Add missing CFI jump table symbols to kallsyms 2021-05-11 17:56:41 +00:00
Makefile.modinst
Makefile.modpost ANDROID: modpost: Check for KBUILD_MIXED_TREE for Modules.symvers 2021-05-20 23:47:36 +00:00
Makefile.modsign
Makefile.package
Makefile.ubsan
Makefile.userprogs
makelst
markup_oops.pl
mkcompile_h FROMLIST: kbuild: mkcompile_h: consider timestamp if KBUILD_BUILD_TIMESTAMP is set 2021-06-16 12:19:04 +00:00
mkmakefile
mksysmap
mkuboot.sh
module.lds.S ANDROID: crypto: fips140 - perform load time integrity check 2021-06-11 07:49:58 +00:00
modules-check.sh
nsdeps
objdiff
parse-maintainers.pl
patch-kernel
profile2linkerlist.pl
prune-kernel
recordmcount.c ftrace: Have recordmcount use w8 to read relp->r_info in arm64_is_fake_mcount 2021-03-09 11:11:14 +01:00
recordmcount.h
recordmcount.pl riscv: Workaround mcount name prior to clang-13 2021-05-22 11:40:53 +02:00
setlocalversion ANDROID: scripts/setlocalversion: allow running in a subdir 2021-02-23 16:42:21 -08:00
show_delta tweewide: Fix most Shebang lines 2021-05-22 11:40:55 +02:00
sign-file.c
sorttable.c
sorttable.h
spdxcheck-test.sh
spdxcheck.py
spelling.txt
sphinx-pre-install tweewide: Fix most Shebang lines 2021-05-22 11:40:55 +02:00
split-man.pl tweewide: Fix most Shebang lines 2021-05-22 11:40:55 +02:00
stackdelta
stackusage
subarch.include
tags.sh
tools-support-relr.sh FROMLIST: Makefile: fix GDB warning with CONFIG_RELR 2021-03-27 01:06:50 +00:00
unifdef.c
ver_linux
xen-hypercalls.sh
xz_wrap.sh