]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
testsuite, threads: fix LD_LIBRARY_PATH in 'tls-sepdebug.exp'
authorRohr, Stephan <stephan.rohr@intel.com>
Mon, 29 Jan 2024 15:05:40 +0000 (07:05 -0800)
committerStephan Rohr <stephan.rohr@intel.com>
Tue, 24 Sep 2024 06:59:48 +0000 (23:59 -0700)
Some compilers (e.g. the Intel compiler) may dynamically link against
dependencies.  The test uses the 'set env' command to set the
LD_LIBRARY_PATH to a test specific value.  Update the 'set env' command
to also provide the users LD_LIBARY_PATH to gdb.

Approved-By: Tom Tromey <tom@tromey.com>
gdb/testsuite/gdb.threads/tls-sepdebug.exp

index 14a0c45c7d953f870d343bccd9c74a5791e86d4e..4a322e05fc0371d6cbac2e981a77d73fafee1bc5 100644 (file)
@@ -65,16 +65,21 @@ if  { [gdb_compile_pthreads \
 }
 
 set absdir [file dirname [standard_output_file ${binsharedbase}]]
+if { [info exists ::env(LD_LIBRARY_PATH)] } {
+    set ld_library_path $::env(LD_LIBRARY_PATH)
+} else {
+    set ld_library_path ""
+}
 
-foreach ld_library_path [list $absdir [relative_filename [pwd] $absdir]] \
+foreach library_path [list $absdir [relative_filename [pwd] $absdir]] \
        name { absolute relative } {
     with_test_prefix $name {
 
        # Restart, but defer loading until after setting LD_LIBRARY_PATH.
        clean_restart
-
-       gdb_test_no_output "set env LD_LIBRARY_PATH=$ld_library_path" \
-                          "set env LD_LIBRARY_PATH"
+       gdb_test_no_output \
+           "set env LD_LIBRARY_PATH=$ld_library_path:$library_path" \
+           "set env LD_LIBRARY_PATH"
 
        gdb_load ${binmainfile}