linux/arch/riscv
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 Allwinner fixes for 6.17 2025-09-23 22:30:57 +02:00
configs soc: defconfig updates for 6.16 2025-07-29 11:27:41 -07:00
crypto lib/crypto: riscv/sha512: Migrate optimized SHA-512 code to library 2025-06-30 09:26:19 -07:00
errata RISC-V: errata: Use medany for relocatable builds 2025-03-26 15:56:37 -07:00
include RISC-V: Define pgprot_dmacoherent() for non-coherent devices 2025-10-29 14:10:27 +01:00
kernel arch: Add the macro COMPILE_OFFSETS to all the asm-offsets.c 2025-11-02 22:18:04 +09:00
kvm RISC-V: KVM: Write hgatp register with valid mode bits 2025-10-15 12:03:59 +02:00
lib Crypto library updates for 6.17 2025-07-28 17:58:52 -07:00
mm riscv: mm: Use mmu-type from FDT to limit SATP mode 2025-10-29 14:10:17 +01:00
net riscv, bpf: Sign extend struct ops return values properly 2025-10-15 12:03:33 +02:00
purgatory Crypto library updates for 6.17 2025-07-28 17:58:52 -07:00
tools riscv: Stop considering R_RISCV_NONE as bad relocations 2025-07-16 08:13:55 -07:00
Kbuild riscv: migrate to the generic rule for built-in DTB 2025-03-18 13:30:13 +00:00
Kconfig riscv: Only allow LTO with CMODEL_MEDANY 2025-09-04 16:25:46 -06:00
Kconfig.debug riscv: Add tests for riscv module loading 2023-11-07 14:59:32 -08:00
Kconfig.errata riscv: Add ghostwrite vulnerability 2025-01-18 12:33:39 -08:00
Kconfig.socs riscv: add Andes SoC family Kconfig support 2025-07-21 16:51:52 +02:00
Kconfig.vendor riscv: Add SiFive xsfvqmaccdod and xsfvqmaccqoq vendor extensions 2025-05-08 11:01:43 -07:00
Makefile riscv: Implement HAVE_DYNAMIC_FTRACE_WITH_CALL_OPS 2025-06-05 11:09:30 -07:00
Makefile.postlink kbuild: Create intermediate vmlinux build with relocations preserved 2025-03-17 00:29:50 +09:00