Re: [PATCH v6 26/30 (mawk fix)] objtool: Add function to get the name of a CPU feature
From: Peter Zijlstra
Date: Mon Nov 24 2025 - 14:36:07 EST
On Mon, Nov 24, 2025 at 05:48:55PM +0100, Alexandre Chartre wrote:
> diff --git a/tools/objtool/arch/x86/Build b/tools/objtool/arch/x86/Build
> index 3dedb2fd8f3a0..b95448ee01ee4 100644
> --- a/tools/objtool/arch/x86/Build
> +++ b/tools/objtool/arch/x86/Build
> @@ -12,3 +12,13 @@ $(OUTPUT)arch/x86/lib/inat-tables.c: $(inat_tables_script) $(inat_tables_maps)
> $(OUTPUT)arch/x86/decode.o: $(OUTPUT)arch/x86/lib/inat-tables.c
>
> CFLAGS_decode.o += -I$(OUTPUT)arch/x86/lib
> +
> +cpu_features = ../arch/x86/include/asm/cpufeatures.h
> +cpu_features_script = ../arch/x86/tools/gen-cpu-feature-names-x86.awk
> +
> +$(OUTPUT)arch/x86/lib/cpu-feature-names.c: $(cpu_features_script) $(cpu_features)
> + $(Q)$(call echo-cmd,gen)$(AWK) -f $(cpu_features_script) $(cpu_features) > $@
> +
> +$(OUTPUT)arch/x86/special.o: $(OUTPUT)arch/x86/lib/cpu-feature-names.c
> +
> +CFLAGS_special.o := -I$(OUTPUT)arch/x86/lib
If you'd been careful, you'd have taken the commit from tip and noticed
its Build fragment is slightly different :-)
You're now re-introducing a race in the build where if you build
special.o before decode.o the lib directory isn't yet created and it
goes sideways.
Anyway, let me fold that awk delta into what I have.
Thanks!