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

H.J. Lu hjl.tools@gmail.com
Thu Jul 8 00:07:22 GMT 2021


On Wed, Jul 7, 2021 at 3:06 PM Ludovic Courtès via Libc-alpha
<libc-alpha@sourceware.org> wrote:
>
> Hi,
>
> Florian Weimer <fweimer@redhat.com> skribis:
>
> > * Ludovic Courtès via Libc-alpha:
> >
> >> When cross-compiling to powerpc64le-linux-gnu,
> >> sysdeps/powerpc/powerpc64/le/Makefile would use "objcopy", leading to
> >> errors like:
> >>
> >>   objcopy: Unable to recognise the format of the input file `…/no_ldbl_gnu_attribute.o'
> >>
> >> This patch changes 'configure.ac' to use AC_CHECK_TOOL rather than
> >> '$CC -print-prog-name=objcopy' to determine the value of the OBJCOPY
> >> variable.  That way, OBJCOPY is set to TRIPLET-objcopy when
> >> cross-compiling for TRIPLET.
> >
> > 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’.
>
> Could it be a packaging issue?

Your cross compiler isn't built properly.   Glibc scripts/build-many-glibcs.py
can build proper cross compilers.

-- 
H.J.


More information about the Libc-alpha mailing list