[PATCH] scripts/generate_iga64_codes: fix path of iga64_macros.h

Kamil Konieczny kamil.konieczny at linux.intel.com
Thu Dec 12 14:11:17 UTC 2024


Hi Andrzej,
On 2024-12-12 at 13:45:39 +0100, Andrzej Hajda wrote:
> The build process fails if the build dir is not a subdir of the project.
> 
> Fixes: cba1773fd01d ("scripts/generate_iga64_codes: add iga64_macros.h to checksum calculation")
> Signed-off-by: Andrzej Hajda <andrzej.hajda at intel.com>

Works for me and looks good,
Reviewed-by: Kamil Konieczny <kamil.konieczny at linux.intel.com>

> ---
>  lib/meson.build              | 2 +-
>  scripts/generate_iga64_codes | 6 ++++--
>  2 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/lib/meson.build b/lib/meson.build
> index 640513e6c52c..beaf43dffc5b 100644
> --- a/lib/meson.build
> +++ b/lib/meson.build
> @@ -252,7 +252,7 @@ iga64_generated_codes = custom_target(
>      input : [ 'iga64_generated_codes.c' ] + iga64_assembly_libs,
>      output : 'iga64_generated_codes.c',
>      depend_files : 'iga64_macros.h',
> -    command : [ generate_iga64_codes, '-o', '@OUTPUT@', '-i', '@INPUT@' ]
> +    command : [ 'env', 'IGT_SRCDIR=@0@'.format(source_root), generate_iga64_codes, '-o', '@OUTPUT@', '-i', '@INPUT@' ]
>  )
>  
>  lib_intermediates += static_library('igt-iga64_generated_codes.c',
> diff --git a/scripts/generate_iga64_codes b/scripts/generate_iga64_codes
> index 652bf01a080c..3f207e9ff1a8 100755
> --- a/scripts/generate_iga64_codes
> +++ b/scripts/generate_iga64_codes
> @@ -22,6 +22,8 @@ die() {
>      exit 1
>  }
>  
> +: ${IGT_SRCDIR:=..}
> +
>  # parse args
>  while getopts ':i:o:' opt; do
>      case $opt in
> @@ -40,7 +42,7 @@ while  read -d $'\0' asm; do
>  done < <(for f in $LIBS; do objcopy --dump-section .iga64_assembly=/dev/stdout $f.p/*.o /dev/null; done)
>  
>  # check if we need to recompile - checksum difference and compiler present
> -MD5_ASMS="$(md5sum <<< "$(< ../lib/iga64_macros.h) ${ASMS[@]}" | cut -b1-32)"
> +MD5_ASMS="$(md5sum <<< "$(< $IGT_SRCDIR/lib/iga64_macros.h) ${ASMS[@]}" | cut -b1-32)"
>  MD5_PRE="$(grep -Po '(?<=^#define MD5_SUM_IGA64_ASMS )\S{32,32}' $INPUT 2>/dev/null)"
>  
>  if [ "$MD5_ASMS" = "$MD5_PRE" ]; then
> @@ -90,7 +92,7 @@ EOF
>  # Compiles assembly to binary representation sent to stdout.
>  compile_iga64() {
>      cmd="cpp -P - -o $WD/$asm_name.$gen_name.asm"
> -    cmd+=" -DGEN_VER=$gen_ver -D'ARG(n)=($IGA64_ARG0 + (n))' -imacros ../lib/iga64_macros.h"
> +    cmd+=" -DGEN_VER=$gen_ver -D'ARG(n)=($IGA64_ARG0 + (n))' -imacros $IGT_SRCDIR/lib/iga64_macros.h"
>      eval "$cmd" <<<"$asm_body" || die "cpp error for $asm_name.$gen_name\ncmd: $cmd"
>      cmd="iga64 -Xauto-deps -Wall -p=$gen_name"
>      cmd+=" $WD/$asm_name.$gen_name.asm"
> 
> ---
> base-commit: 7812065f4aebab1629b570bd78ef71e09480b359
> change-id: 20241212-fix_iga64_macros_path-5c38885d3d94
> 
> Best regards,
> -- 
> Andrzej Hajda <andrzej.hajda at intel.com>
> 


More information about the igt-dev mailing list