2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-16 09:13:55 +08:00
linux-next/arch
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
..
alpha provide arch_test_bit_acquire for architectures that define test_bit 2022-08-27 09:49:54 -07:00
arc Kbuild updates for v5.20 2022-08-10 10:40:41 -07:00
arm ARM: SoC fixes for 6.0-rc6 2022-09-22 11:10:11 -07:00
arm64 arm64 fixes for -rc7 2022-09-23 15:28:51 -07:00
csky Merge 'irq/loongarch', 'pci/ctrl/loongson' and 'pci/header-cleanup-immutable' 2022-08-11 21:06:14 +08:00
hexagon provide arch_test_bit_acquire for architectures that define test_bit 2022-08-27 09:49:54 -07:00
ia64 provide arch_test_bit_acquire for architectures that define test_bit 2022-08-27 09:49:54 -07:00
loongarch LoongArch: mm: Remove the unneeded result variable 2022-09-03 18:01:27 +08:00
m68k provide arch_test_bit_acquire for architectures that define test_bit 2022-08-27 09:49:54 -07:00
microblaze - The usual batches of cleanups from Baoquan He, Muchun Song, Miaohe 2022-08-05 16:32:45 -07:00
mips MIPS: Loongson32: Fix PHY-mode being left unspecified 2022-09-19 16:31:32 +02:00
nios2 nios2: move core-y in arch/nios2/Makefile to arch/nios2/Kbuild 2022-09-29 04:40:14 +09:00
openrisc Updates to various subsystems which I help look after. lib, ocfs2, 2022-08-07 10:03:24 -07:00
parisc parisc: Allow CONFIG_64BIT with ARCH=parisc 2022-09-15 07:59:37 +02:00
powerpc kbuild: build init/built-in.a just once 2022-09-29 04:40:15 +09:00
riscv RISC-V Fixes for 6.0-rc7 2022-09-23 08:51:05 -07:00
s390 kbuild: build init/built-in.a just once 2022-09-29 04:40:15 +09:00
sh asm-generic: Conditionally enable do_softirq_own_stack() via Kconfig. 2022-09-05 17:20:55 +02:00
sparc asm-generic: Conditionally enable do_softirq_own_stack() via Kconfig. 2022-09-05 17:20:55 +02:00
um arch: um: Mark the stack non-executable to fix a binutils warning 2022-09-21 09:11:42 +02:00
x86 kbuild: build init/built-in.a just once 2022-09-29 04:40:15 +09:00
xtensa Merge 'irq/loongarch', 'pci/ctrl/loongson' and 'pci/header-cleanup-immutable' 2022-08-11 21:06:14 +08:00
.gitignore
Kconfig asm-generic: Conditionally enable do_softirq_own_stack() via Kconfig. 2022-09-05 17:20:55 +02:00