Changeset View
Standalone View
sys/conf/kern.mk
Show First 20 Lines • Show All 325 Lines • ▼ Show 20 Lines | |||||
LD_EMULATION_armv7=armelf_fbsd | LD_EMULATION_armv7=armelf_fbsd | ||||
LD_EMULATION_i386=elf_i386_fbsd | LD_EMULATION_i386=elf_i386_fbsd | ||||
LD_EMULATION_powerpc= elf32ppc_fbsd | LD_EMULATION_powerpc= elf32ppc_fbsd | ||||
LD_EMULATION_powerpcspe= elf32ppc_fbsd | LD_EMULATION_powerpcspe= elf32ppc_fbsd | ||||
LD_EMULATION_powerpc64= elf64ppc_fbsd | LD_EMULATION_powerpc64= elf64ppc_fbsd | ||||
LD_EMULATION_powerpc64le= elf64lppc_fbsd | LD_EMULATION_powerpc64le= elf64lppc_fbsd | ||||
LD_EMULATION_riscv64= elf64lriscv | LD_EMULATION_riscv64= elf64lriscv | ||||
LD_EMULATION=${LD_EMULATION_${MACHINE_ARCH}} | LD_EMULATION=${LD_EMULATION_${MACHINE_ARCH}} | ||||
# | |||||
# Autogenerated files must be located in the current object directory | |||||
# and not the one belonging to the parent build. This prevents kernel | |||||
# modules from using autogenerated files from the kernel build. | |||||
# This is only an issue when <bsd.subdir.mk> is used. | |||||
# | |||||
.NOPATH: ${CLEAN} ${CLEANFILES} | |||||
imp: I thought the whole point of kernel builds was to use the files from the kerndir if they… | |||||
hselaskyAuthorUnsubmitted Done Inline ActionsFor the kernel option files, it works like that. But for some other files generated during build there seems to be a race (See D40191) The kernel module generate the required files (See D40191) regardless of presence in the kernel build directory. And because the kernel build directory is in the .PATH, then the kernel module build think the files are already generated and start building code, while at the same time generating these files locally to the kernel module build. This opens up a window where the compiler may access files in the middle of being generated. Most of the time it is OK, but sometimes it triggers. Generated files are added to CLEAN and CLEANFILES (depending on kmod or kernel build - I added both, because this file is used by both). Generated files are local to the current object directory, and when bsd.subdir.mk is used, then the .NOPATH prevents shadowing. hselasky: For the kernel option files, it works like that.
But for some other files generated during… | |||||
impUnsubmitted Not Done Inline ActionsBut thr opt_*.h files should not come from . They should come from the kernel. So you've not fixed a race, but are now using the wrong file because there is no shadowing here: just two different scenarios the files are generated under. Yhe build would "work" but generate bad compiles solently. imp: But thr opt_*.h files should not come from . They should come from the kernel. So you've not… | |||||
hselaskyAuthorUnsubmitted Done Inline ActionsYes, correct. So CFLAGS must remain. And .NOPATH is probably the solution. hselasky: Yes, correct. So CFLAGS must remain. And .NOPATH is probably the solution. |
I thought the whole point of kernel builds was to use the files from the kerndir if they existed and only generate the fallback files if they do not. Doesn't this break that?