linux/arch/loongarch
Menglong Dong bd0a905c22 arch: Add the macro COMPILE_OFFSETS to all the asm-offsets.c
[ Upstream commit 35561bab76 ]

The include/generated/asm-offsets.h is generated in Kbuild during
compiling from arch/SRCARCH/kernel/asm-offsets.c. When we want to
generate another similar offset header file, circular dependency can
happen.

For example, we want to generate a offset file include/generated/test.h,
which is included in include/sched/sched.h. If we generate asm-offsets.h
first, it will fail, as include/sched/sched.h is included in asm-offsets.c
and include/generated/test.h doesn't exist; If we generate test.h first,
it can't success neither, as include/generated/asm-offsets.h is included
by it.

In x86_64, the macro COMPILE_OFFSETS is used to avoid such circular
dependency. We can generate asm-offsets.h first, and if the
COMPILE_OFFSETS is defined, we don't include the "generated/test.h".

And we define the macro COMPILE_OFFSETS for all the asm-offsets.c for this
purpose.

Signed-off-by: Menglong Dong <dongml2@chinatelecom.cn>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2025-11-02 22:18:04 +09:00
..
boot LoongArch: dts: Add eMMC/SDIO controller support to Loongson-2K2000 2025-08-05 19:00:22 +08:00
configs sound updates #2 for 6.17-rc1 2025-08-01 12:26:24 -07:00
crypto loongarch/crc32: expose CRC32 functions through lib 2024-12-01 17:23:01 -08:00
include LoongArch: KVM: Fix VM migration failure with PTW enabled 2025-09-18 19:44:22 +08:00
kernel arch: Add the macro COMPILE_OFFSETS to all the asm-offsets.c 2025-11-02 22:18:04 +09:00
kvm LoongArch: KVM: Avoid copy_*_user() with lock hold in kvm_pch_pic_regs_access() 2025-09-18 19:44:25 +08:00
lib lib/crc: loongarch: Migrate optimized CRC code into lib/crc/ 2025-06-30 09:31:57 -07:00
mm mm/pagewalk: split walk_page_range_novma() into kernel/user parts 2025-07-09 22:42:05 -07:00
net LoongArch: BPF: Fix uninitialized symbol 'retval_off' 2025-10-15 12:04:19 +02:00
pci LoongArch: Fix build warnings about export.h 2025-06-26 20:07:18 +08:00
power LoongArch: Save and restore CSR.CNTC for hibernation 2025-05-14 22:17:52 +08:00
vdso LoongArch: vDSO: Remove -nostdlib complier flag 2025-08-05 19:00:22 +08:00
Kbuild LoongArch: Migrate to the generic rule for built-in DTB 2025-01-25 18:51:33 +08:00
Kconfig LoongArch: Update help info of ARCH_STRICT_ALIGN 2025-09-18 19:43:42 +08:00
Kconfig.debug LoongArch: Only allow OBJTOOL & ORC unwinder if toolchain supports -mthin-add-sub 2024-06-21 10:18:40 +08:00
Makefile LoongArch: Fix build error for LTO with LLVM-18 2025-10-19 16:37:08 +02:00