[PATCH] ld/testsuite: correct aarch64 uses of load_lib

Matthieu Longo matthieu.longo@arm.com
Fri Dec 13 13:50:06 GMT 2024


On 2024-12-13 10:11, Jan Beulich wrote:
> Using $srcdir/$subdir directly doesn't work, at least not with expect
> 5.45, dejagnu 1.6, and an out-of-tree build (I assume it's the latter
> aspect which is crucial here). Make use of $libdirs instead.
> 

That is what I did in the original version of this patch, and Richard 
Sandiford suggested to change it to load_file 
$srcdir/$subdir/lib/aarch64-elf-lib.exp.

The reason is that the change to libdirs (a global variable in my 
understanding) would probably carry over to other test directories when 
we run the whole testsuite.
The environment seen by those others directories would have some AArch64 
target-dependent definitions in it. This would be a change in behavior 
compared to before, and would potentially cause some issues. It would 
also mean that the test environment of those tests would be different 
when run individually, or run *after* the AArch64 tests have run.

My environment: $runtest --version
DejaGnu version 1.6.3
Expect version  5.45.4
Tcl version     8.6

The only difference with the versions you mentioned and my environment 
is probably the minor numbers. What is the full version of your tools ?
Also, please can you give more information about this "out-of-tree 
build" that you mentioned ?

> --- a/ld/testsuite/ld-aarch64/aarch64-elf.exp
> +++ b/ld/testsuite/ld-aarch64/aarch64-elf.exp
> @@ -23,7 +23,8 @@ if { ![is_elf_format] || ![istarget "aar
>       return
>   }
>   
> -load_lib $srcdir/$subdir/lib/aarch64-elf-lib.exp
> +lappend libdirs $srcdir/$subdir/lib
> +load_lib aarch64-elf-lib.exp
>   
>   # List contains test-items with 3 items followed by 2 lists:
>   # 0:name 1:ld early options 2:ld late options 3:assembler options
> --- a/ld/testsuite/ld-aarch64/protections/aarch64-protections.exp
> +++ b/ld/testsuite/ld-aarch64/protections/aarch64-protections.exp
> @@ -23,7 +23,8 @@ if { ![is_elf_format] || ![istarget "aar
>     return
>   }
>   
> -load_lib $srcdir/$subdir/../lib/aarch64-elf-lib.exp
> +lappend libdirs $srcdir/$subdir/../lib
> +load_lib aarch64-elf-lib.exp
>   
>   set test_list [lsort [glob -nocomplain $srcdir/$subdir/*.d]]
>   set test_lp64_list [lsort [glob -nocomplain $srcdir/$subdir/bti-far-*.d]]



More information about the Binutils mailing list