[COMMITTED] ld: restore CC_FOR_TARGET if bailing out early for LTO tests

Message ID a376c787f1417abedb3c51516942c0077892313c.1787909218.git.sam@gentoo.org
State New
Headers
Series [COMMITTED] ld: restore CC_FOR_TARGET if bailing out early for LTO tests |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_binutils_build--master-arm fail Patch failed to apply
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 fail Patch failed to apply

Commit Message

Sam James Aug. 28, 2026, 9:26 a.m. UTC
  Fixup c562e4ffa94c50ee974200a7457e435cec411a43 as we need to restore
CC_FOR_TARGET which may not be Clang if we return early because of missing
objects.

	PR ld/34576
	* testsuite/ld-plugin/lto.exp (llvm_lto_tests): Restore
	CC_FOR_TARGET on return.
---
Committed.

 ld/testsuite/ld-plugin/lto.exp | 1 +
 1 file changed, 1 insertion(+)


base-commit: 1469a04f30917ef6a2bf4afc73e442b836574563
  

Patch

diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp
index 41593efc253..faa7c68770d 100644
--- a/ld/testsuite/ld-plugin/lto.exp
+++ b/ld/testsuite/ld-plugin/lto.exp
@@ -1485,6 +1485,7 @@  proc llvm_lto_tests {} {
 
    if {![file exists tmpdir/pr34572a.o]
        || ![file exists tmpdir/pr34572b.o]} {
+	set CC_FOR_TARGET "$CC_FOR_TARGET_saved"
 	return
     }