This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See crosstool-NG for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: parsing multi-lib output for LTIB


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]