linux/arch/s390
Masahiro Yamada 2df8220cc5 kbuild: build init/built-in.a just once
Kbuild builds init/built-in.a twice; first during the ordinary
directory descending, second from scripts/link-vmlinux.sh.

We do this because UTS_VERSION contains the build version and the
timestamp. We cannot update it during the normal directory traversal
since we do not yet know if we need to update vmlinux. UTS_VERSION is
temporarily calculated, but omitted from the update check. Otherwise,
vmlinux would be rebuilt every time.

When Kbuild results in running link-vmlinux.sh, it increments the
version number in the .version file and takes the timestamp at that
time to really fix UTS_VERSION.

However, updating the same file twice is a footgun. To avoid nasty
timestamp issues, all build artifacts that depend on init/built-in.a
are atomically generated in link-vmlinux.sh, where some of them do not
need rebuilding.

To fix this issue, this commit changes as follows:

[1] Split UTS_VERSION out to include/generated/utsversion.h from
    include/generated/compile.h

    include/generated/utsversion.h is generated just before the
    vmlinux link. It is generated under include/generated/ because
    some decompressors (s390, x86) use UTS_VERSION.

[2] Split init_uts_ns and linux_banner out to init/version-timestamp.c
    from init/version.c

    init_uts_ns and linux_banner contain UTS_VERSION. During the ordinary
    directory descending, they are compiled with __weak and used to
    determine if vmlinux needs relinking. Just before the vmlinux link,
    they are compiled without __weak to embed the real version and
    timestamp.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2022-09-29 04:40:15 +09:00
..
appldata s390/appldata: use struct_size() helper 2020-06-29 16:32:34 +02:00
boot kbuild: build init/built-in.a just once 2022-09-29 04:40:15 +09:00
configs s390: update defconfigs 2022-08-30 21:57:07 +02:00
crypto s390 updates for 5.20 merge window 2022-08-06 17:05:21 -07:00
hypfs s390/hypfs: avoid error message under KVM 2022-08-15 17:19:51 +02:00
include asm-generic: SOFTIRQ_ON_OWN_STACK rework 2022-09-09 07:23:29 -04:00
kernel s390/smp: enforce lowcore protection on CPU restart 2022-09-07 14:04:01 +02:00
kvm KVM: s390: pci: register pci hooks without interpretation 2022-09-21 16:18:38 +02:00
lib s390/nospec: build expoline.o for modules_prepare target 2022-07-13 15:21:55 +02:00
mm s390/mm: remove useless hugepage address alignment 2022-08-30 21:57:07 +02:00
net s390/bpf: Fix typo in comment 2022-05-23 11:25:53 -07:00
pci KVM: s390: pci: Hook to access KVM lowlevel from VFIO 2022-08-29 13:29:28 +02:00
purgatory s390/purgatory: remove duplicated build rule of kexec-purgatory.o 2022-06-30 14:18:16 +02:00
tools KVM: s390: Add facility 197 to the allow list 2022-07-13 15:25:25 +02:00
Kbuild kbuild: use more subdir- for visiting subdirectories while cleaning 2021-10-24 13:49:46 +09:00
Kconfig Random number generator updates for Linux 6.0-rc1. 2022-08-02 17:31:35 -07:00
Kconfig.debug s390/Kconfig.debug: fix indentation 2022-06-01 12:03:15 +02:00
Makefile s390/nospec: remove unneeded header includes 2022-07-13 15:21:55 +02:00