[PATCH powerpc64le] Use the target 'objcopy' when cross-compiling.

Joseph Myers joseph@codesourcery.com
Thu Jul 8 16:49:43 GMT 2021


On Thu, 8 Jul 2021, Ludovic Courtès via Libc-alpha wrote:

> > Hmm.  Why doesn't '$CC -print-prog-name=objcopy' result in the right
> > command name?
> 
> Is it supposed to?  Looking at gcc/gcc.c:find_a_file, I’m not sure.
> For me it prints ‘objcopy’, and when I run:
> 
>   strace aarch64-linux-gnu-gcc -print-prog-name=objcopy
> 
> … I only see it look for ‘objcopy’, not ‘aarch64-linux-gnu-objcopy’.

I'd expect it to look for objcopy in $exec_prefix/$target/bin (binutils 
installs it as objcopy in that directory and as $target-objcopy in 
$exec_prefix/bin, see TOOL_PROGS in binutils/Makefile.am).  (That path may 
well in turn be computed via GCC's libexecsubdir, I see output such as 
/scratch/jmyers/glibc-bot/install/compilers/aarch64-linux-gnu/lib/gcc/aarch64-glibc-linux-gnu/12.0.0/../../../../aarch64-glibc-linux-gnu/bin/objcopy.)

I'd expect the code to work both before and after the patch.  If there is 
some advantage to the change proposed in the patch, it would be a good 
idea for the commit message to explain in more detail the circumstances 
when the objcopy in $exec_prefix/$target/bin isn't found.

-- 
Joseph S. Myers
joseph@codesourcery.com


More information about the Libc-alpha mailing list