From: Doug Kehn <rdkehn@yahoo.com>
To: crossgcc@sourceware.org,
"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Subject: Re: libc.so GROUP Statement
Date: Tue, 29 Dec 2009 18:58:00 -0000 [thread overview]
Message-ID: <653197.83614.qm@web52005.mail.re2.yahoo.com> (raw)
In-Reply-To: <200912291912.36584.yann.morin.1998@anciens.enib.fr>
Hi Yann,
--- On Tue, 12/29/09, Yann E. MORIN <yann.morin.1998@anciens.enib.fr> wrote:
> From: Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
> Subject: Re: libc.so GROUP Statement
> To: crossgcc@sourceware.org
> Cc: "Doug Kehn" <rdkehn@yahoo.com>
> Date: Tuesday, December 29, 2009, 1:12 PM
> Hello Doug!
> Hello All!
>
> On Tuesday 29 December 2009 18:28:10 Doug Kehn wrote:
> > I'm building arm-cortex_a8-linux-gnueabi with
> crosstool-ng-1.5.2.
> > The resulting libc.so contains:
> >
> > /* GNU ld script
> > Use the shared library, but some
> functions are only in
> > the static library, so try that
> secondarily. */
> > OUTPUT_FORMAT(elf32-littlearm)
> > GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a
> AS_NEEDED ( /lib/ld-linux.so.3 ) )
>
> This is (should be!) black magic used by glibc, and is to
> be interpreted
> relative to the sysroot.
>
> > Cross compiling some applications I receive the
> following error:
> > .../arm-cortex_a8-linux-gnueabi/bin/ld: cannot find
> /usr/lib/libc_nonshared.a
> > collect2: ld returned 1 exit status
>
> How do you call your compiler? If you did set CT_PREFIX_DIR
> to (eg.):
> /opt/toolchain
>
> Then you call the compiler with :
> /opt/toolchain/bin/arm-cortex_a8-linux-gnueabi-gcc
>
> Ot you set PATH="${PATH}:/opt/toolchain/bin" and you call:
> arm-cortex_a8-linux-gnueabi-gcc
>
> Do *not* call gcc like that:
> /opt/toolchain/arm-cortex_a8-linux-gnueabi/bin/gcc
>
I use the PATH method: PATH=/opt/toolchain/bin:$PATH. Then set CC=arm-cortex_a8-linux-gnueabi-gcc
> > If I manually change the GROUP statement in libc.so
> to:
> > GROUP ( libc.so.6 libc_nonshared.a AS_NEEDED (
> ld-linux.so.3 ) )
> > the applications cross compile without error.
>
> This is an error. As I said, the paths in GROUP are
> relative to the
> sysroot, and gcc should find them (if called as above).
>
> > Am I doing something wrong when cross compiling the
> applications?
> >
> > The arm-cortex_a8-linux-gnueabi crosstool.config has
> CT_USE_SYSROOT=y
> > (and CT_SYSROOT_DIR_PREFIX=""). I thought the path in
> the libc.so GROUP
> > statement would be pointing to the toolchain's sysroot
> directory.
>
> Hehe! glibc's black magic. See:
> http://www.gnu.org/software/libc/manual/html_node/Linux.html
> around the end of the page.
>
> > I'm basing this on glibc.sh running make with
> install_root=$(CT_SYSROOT_DIR).
> > Am I not reading the script correctly?
>
> Yes, that in the end is telling glibc to strip
> 'install_root' from the
> paths, so that when you move the toolchain around, the
> sysroot stuff
> continues to work. The toolchain is thus relocatable.
>
Ah ... I was interpreting install_root as a prefix instead of a strip. Thanks.
> > Is there a way to configure the toolchain to alter the
> paths in the
> > libc.so GROUP statement?
>
> I never needed to do that, and most important, in my
> understanding, that
> would break glibc.
>
> Please, confirm the way you are calling the compiler, and
> if you indeed
> call it the way I explained above, then we'll see for a
> proper fix.
>
I'll keep investigating.
Thanks,
...doug
--
For unsubscribe information see http://sourceware.org/lists.html#faq
next prev parent reply other threads:[~2009-12-29 18:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-29 17:28 Doug Kehn
2009-12-29 18:12 ` Yann E. MORIN
2009-12-29 18:58 ` Doug Kehn [this message]
2009-12-29 22:59 ` Doug Kehn
2009-12-30 16:35 ` Yann E. MORIN
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=653197.83614.qm@web52005.mail.re2.yahoo.com \
--to=rdkehn@yahoo.com \
--cc=crossgcc@sourceware.org \
--cc=yann.morin.1998@anciens.enib.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).