Skip to content

Commit b75115a

Browse files
SebastianBoenashif
authored andcommitted
cmake: Fix dependency issue in x86 build scripts
Incremental builds have been broken in x86 due to a misconfigured dependency. mmu_tables.bin is always generated, even for "nothing to do" builds. We fix this by removing the stray dependency on user_mmu_tables.bin when not CONFIG_X86_KPTI. Steps to reproduce: Build any sample twice with qemu_x86 and observe that the second build regenerates mmu_tables.bin. Signed-off-by: Sebastian Bøe <[email protected]>
1 parent 707e229 commit b75115a

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

arch/x86/CMakeLists.txt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,20 @@ if(CONFIG_X86_MMU)
122122
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
123123
)
124124

125+
if(CONFIG_X86_KPTI)
126+
set(user_mmu_tables_bin user_mmu_tables.bin)
127+
endif()
128+
125129
add_custom_target(
126130
mmu_tables_bin_target
127131
DEPENDS
128-
user_mmu_tables.bin
129-
mmu_tables.bin
132+
mmu_tables.bin
133+
${user_mmu_tables_bin}
130134
)
131135
add_custom_command(
132-
OUTPUT mmu_tables.bin user_mmu_tables.bin
136+
OUTPUT
137+
mmu_tables.bin
138+
${user_mmu_tables_bin}
133139
COMMAND
134140
${PYTHON_EXECUTABLE}
135141
${ZEPHYR_BASE}/scripts/gen_mmu_x86.py

0 commit comments

Comments
 (0)