From 6124f4248888484f419671f4f7bd40d253d3de06 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Fri, 3 Jun 2022 10:22:25 +0200 Subject: configure: arrange to use appropriate objcopy Using the system objcopy is wrong when other configure checks have probed a different set of binutils (I've noticed the problem on a system where the base objcopy can't deal with compressed debug sections). Arrange for the matching one to be picked up, first and foremost if an "in tree" one is available, by mirroring respective logic already present for nm. gcc/ * Makefile.in (ORIGINAL_OBJCOPY_FOR_TARGET): New. * configure.ac: Check for objcopy, producing ORIGINAL_OBJCOPY_FOR_TARGET. * configure: Update accordingly. * exec-tool.in (ORIGINAL_OBJCOPY_FOR_TARGET): New. Handle objcopy. --- gcc/exec-tool.in | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'gcc/exec-tool.in') diff --git a/gcc/exec-tool.in b/gcc/exec-tool.in index cf72227..3a0fefa 100644 --- a/gcc/exec-tool.in +++ b/gcc/exec-tool.in @@ -17,7 +17,7 @@ # along with GCC; see the file COPYING3. If not see # . -# Invoke as, ld or nm from the build tree. +# Invoke as, ld, nm, or objcopy from the build tree. ORIGINAL_AS_FOR_TARGET="@ORIGINAL_AS_FOR_TARGET@" ORIGINAL_LD_FOR_TARGET="@ORIGINAL_LD_FOR_TARGET@" @@ -25,6 +25,7 @@ ORIGINAL_LD_BFD_FOR_TARGET="@ORIGINAL_LD_BFD_FOR_TARGET@" ORIGINAL_LD_GOLD_FOR_TARGET="@ORIGINAL_LD_GOLD_FOR_TARGET@" ORIGINAL_PLUGIN_LD_FOR_TARGET="@ORIGINAL_PLUGIN_LD_FOR_TARGET@" ORIGINAL_NM_FOR_TARGET="@ORIGINAL_NM_FOR_TARGET@" +ORIGINAL_OBJCOPY_FOR_TARGET="@ORIGINAL_OBJCOPY_FOR_TARGET@" ORIGINAL_DSYMUTIL_FOR_TARGET="@ORIGINAL_DSYMUTIL_FOR_TARGET@" exeext=@host_exeext@ fast_install=@enable_fast_install@ @@ -72,6 +73,11 @@ case "$invoked" in prog=nm-new$exeext dir=binutils ;; + objcopy) + original=$ORIGINAL_OBJCOPY_FOR_TARGET + prog=objcopy$exeext + dir=binutils + ;; dsymutil) original=$ORIGINAL_DSYMUTIL_FOR_TARGET # We do not build this in tree - but still want to be able to execute -- cgit v1.1