public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
From: Zhenqiang Chen <zhenqiang.chen@linaro.org>
To: Peter Barada <peter.barada@logicpd.com>
Cc: "crossgcc@sourceware.org" <crossgcc@sourceware.org>
Subject: Re: parsing multi-lib output for LTIB
Date: Mon, 24 Sep 2012 02:20:00 -0000	[thread overview]
Message-ID: <CACgzC7CSrJgXFSugR+L2UjXr7cj6oJf4WaFNOz8hSOHf4Pccmg@mail.gmail.com> (raw)
In-Reply-To: <505C86A0.8070304@logicpd.com>

On 21 September 2012 23:24, Peter Barada <peter.barada@logicpd.com> wrote:
> I'm trying to build using LTIB with an ARM multi-lib compiler (the
> Linaru 2012.08 gnueabihf compiler), and I need to modify LTIB's
> base_libs.spec to capture all the libraries necessary to install in the
> target.
>
> For a single-library compiler its relatively easy since it uses
> -print-file-name over libc.so.6, lib.c, libgcc_s.so, libstdc++.so,
> libsupc++.a, and crti.o.  However for a mult-lib compiler this doesn't
> capture all the differing library directories so I need to parse the
> output of "gcc -print-multi-lib" to determine the options necessary to
> pass to gcc with -print-file-name.
>
> Given the output:
>
> peter@blitz:~/.../install/arm-linux-gnueabihf$ bin/gcc -print-multi-lib
> .;
> arm-linux-gnueabi;@marm@march=armv4t@mfloat-abi=soft
>
> What option sets would I need?
> Does the above output mean both "" and "-marm -march-armv4t
> -mfloat-abi-soft"?

Yes.

> Does anyone have a script (or pointer to one) that can convert the
> output of -print-mult-lib into the list of options necessary?

Please find the reference scripts in file
scripts/build/libc/glibc-eglibc.sh-common from crosstool-ng
upstream.(http://crosstool-ng.org/)

    multilibs=( $("${CT_TARGET}-gcc" -print-multi-lib 2>/dev/null) )
    for multilib in "${multilibs[@]}"; do
        multi_dir="${multilib%%;*}"
        if [ "${multi_dir}" != "." ]; then
            CT_DoStep INFO "Building for multilib subdir='${multi_dir}'"

            extra_flags="$( echo "${multilib#*;}"       \
                            |${sed} -r -e 's/@/ -/g;'   \
                          )"
            extra_dir="/${multi_dir}"

-Zhenqiang

--
For unsubscribe information see http://sourceware.org/lists.html#faq

      reply	other threads:[~2012-09-24  2:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-21 15:24 Peter Barada
2012-09-24  2:20 ` Zhenqiang Chen [this message]

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=CACgzC7CSrJgXFSugR+L2UjXr7cj6oJf4WaFNOz8hSOHf4Pccmg@mail.gmail.com \
    --to=zhenqiang.chen@linaro.org \
    --cc=crossgcc@sourceware.org \
    --cc=peter.barada@logicpd.com \
    /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).