public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* Re: Unable to override OBJCOPY during configure
       [not found] <8zYgCGLOYwM4QgJYHpcrbsF6DkO65RlDeRBJnrDbMymP-oZNm2DkmzE6rd87MdmiS6nRtZF_iKpLXw3Nr3OuvhnCNfZwNPoEzv6zk_yQtNA=@protonmail.com>
@ 2021-02-05 11:41 ` Adhemerval Zanella
  2021-02-05 23:16   ` Ryan Burns
  0 siblings, 1 reply; 3+ messages in thread
From: Adhemerval Zanella @ 2021-02-05 11:41 UTC (permalink / raw)
  To: Ryan Burns, GNU C Library

			

On 03/02/2021 23:01, Ryan Burns via Libc-help wrote:
> Hi Libc-help,
> 
> I'm having trouble cross-compiling glibc to powerpc64le. Compiling to powerpc64le requires a working objcopy, which I have available via powerpc64le-unknown-linux-gnu-objcopy, and I can provide that at build time using "make OBJCOPY=powerpc64le-unknown-linux-gnu-objcopy".
> But the toplevel ./configure does OBJCOPY=`$CC -print-prog-name=objcopy` unconditionally, and is unable to find powerpc64le-unknown-linux-gnu-objcopy, so the later version check (to enforce the objcopy 2.26 minimum requirement) fails.
> Is it possible to manually specify the objcopy binary at configure time, or bypass the configure check for the objcopy version?
> 
> Thanks,
> Ryan
> 

If you have a cross-toolchain correctly configured, the '-print-prog-name=objcopy' 
should give the full path to the objcopy. On my system:

$ [...]/powerpc64le-glibc-linux-gnu-gcc -print-prog-name=objcopy
[...]/compilers/powerpc64le-linux-gnu/bin/../lib/gcc/powerpc64le-glibc-linux-gnu/8.3.1/../../../../powerpc64le-glibc-linux-gnu/bin/objcopy

Otherwise you can explicit set OBJCOPY to the objcopy during configure:

$ [...]/configure --prefix=/usr [...] OBJCOPY=/path/to/objcopy

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Unable to override OBJCOPY during configure
  2021-02-05 11:41 ` Unable to override OBJCOPY during configure Adhemerval Zanella
@ 2021-02-05 23:16   ` Ryan Burns
  2021-02-06  0:39     ` H.J. Lu
  0 siblings, 1 reply; 3+ messages in thread
From: Ryan Burns @ 2021-02-05 23:16 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: GNU C Library

Hmm, I tried providing OBJCOPY to configure, but it looks like it gets clobbered here:
https://sourceware.org/git/?p=glibc.git;a=blob;f=configure;h=1dc3af60b4146ba5f9fd251a6820e21752c65444;hb=HEAD#l4494
Perhaps I am misunderstanding the configure script, but I think it's overriding the OBJCOPY I'm providing?

I think you are correct that I should reconfigure my toolchain so that '-print-prog-name' works correctly.
But if this is an acceptable use of an explicit OBJCOPY, I'd like to be able
to get by with that for now so I don't have to recompile gcc.


‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Friday, February 5, 2021 3:41 AM, Adhemerval Zanella <adhemerval.zanella@linaro.org> wrote:

> On 03/02/2021 23:01, Ryan Burns via Libc-help wrote:
>
> > Hi Libc-help,
> > I'm having trouble cross-compiling glibc to powerpc64le. Compiling to powerpc64le requires a working objcopy, which I have available via powerpc64le-unknown-linux-gnu-objcopy, and I can provide that at build time using "make OBJCOPY=powerpc64le-unknown-linux-gnu-objcopy".
> > But the toplevel ./configure does OBJCOPY=`$CC -print-prog-name=objcopy` unconditionally, and is unable to find powerpc64le-unknown-linux-gnu-objcopy, so the later version check (to enforce the objcopy 2.26 minimum requirement) fails.
> > Is it possible to manually specify the objcopy binary at configure time, or bypass the configure check for the objcopy version?
> > Thanks,
> > Ryan
>
> If you have a cross-toolchain correctly configured, the '-print-prog-name=objcopy'
> should give the full path to the objcopy. On my system:
>
> $ [...]/powerpc64le-glibc-linux-gnu-gcc -print-prog-name=objcopy
> [...]/compilers/powerpc64le-linux-gnu/bin/../lib/gcc/powerpc64le-glibc-linux-gnu/8.3.1/../../../../powerpc64le-glibc-linux-gnu/bin/objcopy
>
> Otherwise you can explicit set OBJCOPY to the objcopy during configure:
>
> $ [...]/configure --prefix=/usr [...] OBJCOPY=/path/to/objcopy



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Unable to override OBJCOPY during configure
  2021-02-05 23:16   ` Ryan Burns
@ 2021-02-06  0:39     ` H.J. Lu
  0 siblings, 0 replies; 3+ messages in thread
From: H.J. Lu @ 2021-02-06  0:39 UTC (permalink / raw)
  To: Ryan Burns; +Cc: Adhemerval Zanella, GNU C Library

On Fri, Feb 5, 2021 at 4:10 PM Ryan Burns via Libc-alpha
<libc-alpha@sourceware.org> wrote:
>
> Hmm, I tried providing OBJCOPY to configure, but it looks like it gets clobbered here:
> https://sourceware.org/git/?p=glibc.git;a=blob;f=configure;h=1dc3af60b4146ba5f9fd251a6820e21752c65444;hb=HEAD#l4494
> Perhaps I am misunderstanding the configure script, but I think it's overriding the OBJCOPY I'm providing?
>
> I think you are correct that I should reconfigure my toolchain so that '-print-prog-name' works correctly.
> But if this is an acceptable use of an explicit OBJCOPY, I'd like to be able
> to get by with that for now so I don't have to recompile gcc.
>
>
> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
> On Friday, February 5, 2021 3:41 AM, Adhemerval Zanella <adhemerval.zanella@linaro.org> wrote:
>
> > On 03/02/2021 23:01, Ryan Burns via Libc-help wrote:
> >
> > > Hi Libc-help,
> > > I'm having trouble cross-compiling glibc to powerpc64le. Compiling to powerpc64le requires a working objcopy, which I have available via powerpc64le-unknown-linux-gnu-objcopy, and I can provide that at build time using "make OBJCOPY=powerpc64le-unknown-linux-gnu-objcopy".
> > > But the toplevel ./configure does OBJCOPY=`$CC -print-prog-name=objcopy` unconditionally, and is unable to find powerpc64le-unknown-linux-gnu-objcopy, so the later version check (to enforce the objcopy 2.26 minimum requirement) fails.
> > > Is it possible to manually specify the objcopy binary at configure time, or bypass the configure check for the objcopy version?
> > > Thanks,
> > > Ryan
> >
> > If you have a cross-toolchain correctly configured, the '-print-prog-name=objcopy'
> > should give the full path to the objcopy. On my system:
> >
> > $ [...]/powerpc64le-glibc-linux-gnu-gcc -print-prog-name=objcopy
> > [...]/compilers/powerpc64le-linux-gnu/bin/../lib/gcc/powerpc64le-glibc-linux-gnu/8.3.1/../../../../powerpc64le-glibc-linux-gnu/bin/objcopy
> >
> > Otherwise you can explicit set OBJCOPY to the objcopy during configure:
> >
> > $ [...]/configure --prefix=/usr [...] OBJCOPY=/path/to/objcopy
>
>

You can use scripts/build-many-glibcs.py to cross compile glibc.

-- 
H.J.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-02-06  0:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <8zYgCGLOYwM4QgJYHpcrbsF6DkO65RlDeRBJnrDbMymP-oZNm2DkmzE6rd87MdmiS6nRtZF_iKpLXw3Nr3OuvhnCNfZwNPoEzv6zk_yQtNA=@protonmail.com>
2021-02-05 11:41 ` Unable to override OBJCOPY during configure Adhemerval Zanella
2021-02-05 23:16   ` Ryan Burns
2021-02-06  0:39     ` H.J. Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).