Is it possible to override the CONFIG_COMMAND ?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Is it possible to override the CONFIG_COMMAND ?

Boost - Build mailing list

Our toolchain developers have decided to link with “ld” instead of “gcc”

Propagating there cross-build gcc configuration to Boost jam environment is challenging.

there <linkflags> don’t have “–Wl,” prefix

 

I’m considering a couple of options, but when I experiment with <linker> option in init()

 

    # - linker tool other than default gcc++

    local linker = [ feature.get-values <linker> : $(options) ] ;

    if $(linker)

    {

        toolset.flags gcc.link CONFIG_COMMAND $(condition) : $(linker[1]) ;

    }

 

It’s prepending instead of replacing ..

ldppc -m elf64ppc --oformat=elf64-powerpc ccppc  -o  …..

 

How do I replace instead of prepend?

Do I need to define a “generator”

 

Thanks,

 

Brian Kuhl


_______________________________________________
Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: Is it possible to override the CONFIG_COMMAND ?

Boost - Build mailing list
AMDG

On 08/28/2018 04:16 PM, Kuhl, Brian via Boost-build wrote:

> Our toolchain developers have decided to link with "ld" instead of "gcc"
> Propagating there cross-build gcc configuration to Boost jam environment is challenging.
> there <linkflags> don't have "-Wl," prefix
>
> I'm considering a couple of options, but when I experiment with <linker> option in init()
>
>     # - linker tool other than default gcc++
>     local linker = [ feature.get-values <linker> : $(options) ] ;
>     if $(linker)
>     {
>         toolset.flags gcc.link CONFIG_COMMAND $(condition) : $(linker[1]) ;
>     }
>
> It's prepending instead of replacing ..

That's the standard behavior of flags.  You could
change the action to use $(CONFIG_COMMAND[1]), but
that's kind of hacky.

> ldppc -m elf64ppc --oformat=elf64-powerpc ccppc  -o  .....
>
> How do I replace instead of prepend?
> Do I need to define a "generator"
>

  Yes, you need to define a generator.  The
existing link action hard-codes the -Wl,
prefix, because it assumes that you are using
gcc to link.  There are already a couple
alternate linking generators for mingw and
cygwin.

In Christ,
Steven Watanabe
_______________________________________________
Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: Is it possible to override the CONFIG_COMMAND ?

Boost - Build mailing list
Steven,
Looking at some other generators I don't quite understand?
Once I create an alternate generator, what next? Do I just make an action specifically named for that generator?

Many Thanks,

Brian

g = [ new gcc-linking-generator gcc.vxworks.link
      : OBJ LIB
      : EXE
      : <toolset>gcc <target-os>vxworks ] ;
$(g).set-rule-name gcc.link ;
generators.register $(g) ;

generators.override gcc.vxworks.link : gcc.link ;

.LD ?= ldppc ;

actions gcc.vxworks.link bind LIBRARIES {
    {
    $(.LD) $(USER_OPTIONS) -L"$(LINKPATH)" -o "$(<)" $(CRT0_OBJ) "$(>)" $(START-GROUP) $(LIBRARIES) $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP)  $(OPTIONS)
  }


> -----Original Message-----
> From:  Steven Watanabe via Boost-build
> Sent: Tuesday, August 28, 2018 6:41 PM
> To: Kuhl, Brian via Boost-build
> Subject: Re: [Boost-build] Is it possible to override the CONFIG_COMMAND ?
>
> AMDG
>
> On 08/28/2018 04:16 PM, Kuhl, Brian via Boost-build wrote:
> > Our toolchain developers have decided to link with "ld" instead of "gcc"
> > Propagating there cross-build gcc configuration to Boost jam environment is
> challenging.
> > there <linkflags> don't have "-Wl," prefix
> >
> > I'm considering a couple of options, but when I experiment with
> > <linker> option in init()
> >
> >     # - linker tool other than default gcc++
> >     local linker = [ feature.get-values <linker> : $(options) ] ;
> >     if $(linker)
> >     {
> >         toolset.flags gcc.link CONFIG_COMMAND $(condition) : $(linker[1]) ;
> >     }
> >
> > It's prepending instead of replacing ..
>
> That's the standard behavior of flags.  You could change the action to use
> $(CONFIG_COMMAND[1]), but that's kind of hacky.
>
> > ldppc -m elf64ppc --oformat=elf64-powerpc ccppc  -o  .....
> >
> > How do I replace instead of prepend?
> > Do I need to define a "generator"
> >
>
>   Yes, you need to define a generator.  The existing link action hard-codes the -
> Wl, prefix, because it assumes that you are using gcc to link.  There are already a
> couple alternate linking generators for mingw and cygwin.
>
> In Christ,
> Steven Watanabe
> _______________________________________________
> Unsubscribe & other changes:
> https://lists.boost.org/mailman/listinfo.cgi/boost-build
_______________________________________________
Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: Is it possible to override the CONFIG_COMMAND ?

Boost - Build mailing list
AMDG

On 08/28/2018 08:21 PM, Kuhl, Brian wrote:
> Looking at some other generators I don't quite understand?
> Once I create an alternate generator, what next? Do I just make an action specifically named for that generator?
>

  Yes, that's exactly what you should do,
though I would call it gcc.link.vxworks
to pick up the flags for gcc.link.

> Many Thanks,
>
> Brian
>
> g = [ new gcc-linking-generator gcc.vxworks.link
>       : OBJ LIB
>       : EXE
>       : <toolset>gcc <target-os>vxworks ] ;
> $(g).set-rule-name gcc.link ;
> generators.register $(g) ;
>
> generators.override gcc.vxworks.link : gcc.link ;
>
> .LD ?= ldppc ;
>
> actions gcc.vxworks.link bind LIBRARIES {
>     {
>     $(.LD) $(USER_OPTIONS) -L"$(LINKPATH)" -o "$(<)" $(CRT0_OBJ) "$(>)" $(START-GROUP) $(LIBRARIES) $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP)  $(OPTIONS)
>   }
>
>

In Christ,
Steven Watanabe
_______________________________________________
Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build