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: [PATCH 1 of 2] scripts/build/gcc.sh: When compiling a Canadian Cross avoid using -print-multi-lib


Hi Yann, Mike, Ralf, All

On 20 September 2012 06:57, Yann E. MORIN <yann.morin.1998@free.fr> wrote:
>
> David, All,
>
> On Wednesday 19 September 2012 05:42:48 David Holsgrove wrote:
> > # HG changeset patch
> > # User David Holsgrove <david.holsgrove@xilinx.com>
> > # Date 1348016639 -36000
> > # Node ID 95abeed3a485c4d5b02e4860fc554d6841e1cc41
> > # Parent  2858a24a584642e263a920b4214c815c172ed547
> > scripts/build/gcc.sh: When compiling a Canadian Cross avoid using
> > -print-multi-lib
> >
> > With a candian cross, attempting to ${CT_TARGET}-gcc -print-multi-lib
> > will fail
>
> That's right. But the fix you suggest is wrong, see below.
>
> > As this is only for pretty log output, can safely sidestep
> >
> > diff -r 2858a24a5846 -r 95abeed3a485 scripts/build/cc/gcc.sh
> > --- a/scripts/build/cc/gcc.sh Sun Aug 12 07:45:42 2012 -0400
> > +++ b/scripts/build/cc/gcc.sh Wed Sep 19 11:03:59 2012 +1000
> > @@ -460,7 +460,8 @@
> >      [ -z "${file}" ] || ext=".${file##*.}"
> >      CT_DoExecLog ALL ln -sfv "${CT_TARGET}-gcc${ext}"
> > "${prefix}/bin/${CT_TARGET}-cc${ext}"
> >
> > -    if [ "${CT_MULTILIB}" = "y" ]; then
> > +    # Skip for Canadian Build, can't run on the system and only gives
> > pretty log output.
> > +    if [ "${CT_MULTILIB}" = "y" -a "${CT_CANADIAN}" != "y" ]; then
>
> This is the part that deals with the core pass-1 and pass-2 compilers,
> so they are expected to run on the build machine, so we should be able
> to run them (hell, they're gonna be used later to build the C library!)
>
> Unfortunately, that part also deals with the final compiler for bare
> metal,
> which we indeed can not run when it's canadian.
>

Yes, this is the reason for my change to the do_cc_core_backend as
well as the do_cc_backend version of this print-multi-lib log output,
my use cases are for canadian cross baremetal / canadian cross linux toolchains.

Perhaps a less obtrusive change for this would be;

 if [ "${CT_MULTILIB}" = "y"  ]; then
        if [ "${CT_CANADIAN}" = "y" -a "${CT_BARE_METAL}" = "y" ]; then
            CT_DoLog WARN "Canadian Cross Baremetal unable to confirm
multilibs configured correctly"
        else
            multilibs=( $( "${prefix}/bin/${CT_TARGET}-gcc" -print-multi-lib   \
                           |tail -n +2 ) )
[SNIP]
        fi
    fi


> >          multilibs=( $( "${prefix}/bin/${CT_TARGET}-gcc"
> > -print-multi-lib   \
>
> Simply doing the following:
>           multilibs=( $( "${CT_TARGET}-gcc" -print-multi-lib   \
>
> is not enough here, as that would call:
>   1- in cross-mode, and not bare-metal: only the core compiler
>   2- in cross-mode, and bare-metal: the final compiler
>   3- in canadian-mode, and not bare-metal: always the core compiler
>   4- in canadian-mode, and bare-metal: always the core compiler
>
> This is not possible, because:
>   1- is OK
>   2- is OK
>   3- is OK
>   4- is wrong: we want to know the final compiler multilib support, not
>      the core compiler multilib support
>
> >                         |tail -n +2 ) )
> >          if [ ${#multilibs[@]} -ne 0 ]; then
> > @@ -815,7 +816,8 @@
> >      [ -z "${file}" ] || ext=".${file##*.}"
> >      CT_DoExecLog ALL ln -sfv "${CT_TARGET}-gcc${ext}"
> > "${CT_PREFIX_DIR}/bin/${CT_TARGET}-cc${ext}"
> >
> > -    if [ "${CT_MULTILIB}" = "y" ]; then
> > +    # Skip for Canadian Build, can't run on the system and only gives
> > pretty log output.
> > +    if [ "${CT_MULTILIB}" = "y" -a "${CT_CANADIAN}" != "y" ]; then
>
> Here, that's right. This is the part that deals with the final gcc for non
> bare-metal. So we can only run it if its not canadian.
>
> >          multilibs=( $( "${CT_PREFIX_DIR}/bin/${CT_TARGET}-gcc"
> > -print-multi-lib \
>                            ^^^^^^^^^^^^^^^^
> There's a latent bug here --/      That should be ${prefix}
>
> I'll fix here.
>
> So, do we still need to print the multilib status, after all?
> Could we just remove that?
>

It's a nice check, but in the conditions mentioned its impossible, and
is only a CT_DoLog EXTRA / CT_DoLog WARN in any case.

thanks,
David

> Regards,
> Yann E. MORIN.
>
> --
>
> .-----------------.--------------------.------------------.--------------------.
> |  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics'
> conspiracy: |
> | +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___
> |
> | +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is
> no  |
> | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v
> conspiracy.  |
>
> '------------------------------^-------^------------------^--------------------'
>
> --
> For unsubscribe information see http://sourceware.org/lists.html#faq
>

--
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]