]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix temp-dir leakage in per-bfd-sharing.exp
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Wed, 2 Jun 2021 17:18:04 +0000 (19:18 +0200)
committerBernd Edlinger <bernd.edlinger@hotmail.de>
Wed, 2 Jun 2021 19:24:45 +0000 (21:24 +0200)
Whan using clang as compiler this compile step fails due to the
unknown option "-Wl,--build-id".  This leaks the already created
temp-dir.

Fixed by compiling first, and creating the temp-dir only when the
compile succeeded.

2021-06-02  Bernd Edlinger  <bernd.edlinger@hotmail.de>

* gdb.dwarf2/per-bfd-sharing.exp: Fix temp-dir leakage.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.dwarf2/per-bfd-sharing.exp

index a0469c8623b8678c85bc81181db6eb8b29c7e827..7959f58c3c47b2793a778d263821395150a08326 100644 (file)
@@ -1,3 +1,7 @@
+2021-06-02  Bernd Edlinger  <bernd.edlinger@hotmail.de>
+
+       * gdb.dwarf2/per-bfd-sharing.exp: Fix temp-dir leakage.
+
 2021-06-02  Carl Love  <cel@us.ibm.com>
 
        * gdb.threads/threadapply.c: Add global mybarrier.
index 081088a983997ce7a2909c43cf0645ddae61a593..48a30fa741c07507d97e8faa70f01837447633b8 100644 (file)
 
 standard_testfile
 
+if { [build_executable "failed to prepare" $testfile $srcfile \
+         {debug additional_flags=-Wl,--build-id}] == -1 } {
+    return
+}
+
 lassign [remote_exec host mktemp -d] ret cache_dir
 
 # The output of mktemp contains an end of line, remove it.
@@ -30,11 +35,6 @@ if { $ret != 0 } {
 
 verbose -log "Index cache dir: $cache_dir"
 
-if { [build_executable "failed to prepare" $testfile $srcfile \
-         {debug additional_flags=-Wl,--build-id}] == -1 } {
-    return
-}
-
 # Populate the index-cache.
 with_test_prefix "populate index cache" {
     clean_restart