binutils Newspaper
OCTOBER 6, 2026
ld — Committed

ld testsuite: Restore CC_FOR_TARGET on early exit

Fix committed to ld testsuite to restore the CC_FOR_TARGET variable when exiting early during LTO tests, preventing potential issues if a non-Clang compiler wa…

Sam James reports the commitment of a fixup for a previous change in the GNU linker’s testsuite. The change ensures that the CC_FOR_TARGET variable is correctly restored to its saved value (CC_FOR_TARGET_saved) when the llvm_lto_tests procedure exits early due to missing objects. This prevents potential issues where CC_FOR_TARGET might incorrectly remain set to Clang if it was previously configured that way, even if a different compiler is intended for subsequent tests.

In the Thread 1 participant
  1. Sam James proposer

    Announces the commitment of a fixup to restore CC_FOR_TARGET in the ld testsuite's LTO tests.

    “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.”

In Details

This is a notification about a committed fix to the binutils testsuite, specifically within the ld/testsuite/ld-plugin/lto.exp file. The change addresses a subtle issue in the llvm_lto_tests procedure. If this procedure returns early because required objects are missing, it must restore the CC_FOR_TARGET variable to its saved state (CC_FOR_TARGET_saved). Failure to do so could leave CC_FOR_TARGET pointing to Clang even if it was not the intended compiler for subsequent tests, potentially causing cascading failures. This fix ensures proper environment cleanup during test execution.

For Context
CC_FOR_TARGET
A variable, typically used in build systems or test suites, that specifies the C compiler to be used for cross-compilation or for building tools for a target system.
LTO
Link-Time Optimization. A compiler optimization technique where optimizations are performed across multiple source files during the linking phase.
testsuite
A collection of tests designed to verify the correctness of a software program or component.
PR ld/34576
A specific bug report (Problem Report) filed against the GNU linker (ld), identified by number 34576.
Filed Under: linkertestsuiteCILTObinutils