Quantcast

How to make clang toolset use custom archiver and ranlib from user-config.jam?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to make clang toolset use custom archiver and ranlib from user-config.jam?

Boost - Build mailing list
Hi,

ar and ranlib cannot be customized for clang toolset as they are for
gcc which makes it difficult to use in a cross-compilation
environment. When cross-compiling from linux to windows, I can have in
my user-config.jam:

using gcc : : i686-w64-mingw32-g++-6.3.0 :
<archiver>i686-w64-mingw32-ar <ranlib>i686-w64-mingw32-ranlib ;

With the clang toolset, this does not work, archiver and ranlib
options are ignored.

This is why: here is what we find in tools/build/src/tools/clang-darwin.jam

# Default value. Mostly for the sake of clang-linux
# that inherits from gcc, but does not has the same
# logic to set the .AR variable. We can put the same
# logic in clang-linux, but that's hardly worth the trouble
# as on Linux, 'ar' is always available.
.AR = ar ;

...

actions piecemeal archive
{
  "$(.AR)" $(AROPTIONS) rc "$(<)" "$(>)"
  "ranlib" -cs "$(<)"
}

Unfortunately, I do not understand the language of jam files so the
only thing I can do for the time being is to manually edit the file
and replace ar and ranlib by their cross-compiler counterparts but I
am not able to change it so that the archiver and ranlib option can be
used.

Could somebody do that or give hints on how I shoud do it?

Frédéric
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to make clang toolset use custom archiver and ranlib from user-config.jam?

Boost - Build mailing list
Who can help me please?
Regards,
Frédéric

2017-03-22 14:05 GMT+01:00 Frédéric Bron <[hidden email]>:

> Hi,
>
> ar and ranlib cannot be customized for clang toolset as they are for
> gcc which makes it difficult to use in a cross-compilation
> environment. When cross-compiling from linux to windows, I can have in
> my user-config.jam:
>
> using gcc : : i686-w64-mingw32-g++-6.3.0 :
> <archiver>i686-w64-mingw32-ar <ranlib>i686-w64-mingw32-ranlib ;
>
> With the clang toolset, this does not work, archiver and ranlib
> options are ignored.
>
> This is why: here is what we find in tools/build/src/tools/clang-darwin.jam
>
> # Default value. Mostly for the sake of clang-linux
> # that inherits from gcc, but does not has the same
> # logic to set the .AR variable. We can put the same
> # logic in clang-linux, but that's hardly worth the trouble
> # as on Linux, 'ar' is always available.
> .AR = ar ;
>
> ...
>
> actions piecemeal archive
> {
>   "$(.AR)" $(AROPTIONS) rc "$(<)" "$(>)"
>   "ranlib" -cs "$(<)"
> }
>
> Unfortunately, I do not understand the language of jam files so the
> only thing I can do for the time being is to manually edit the file
> and replace ar and ranlib by their cross-compiler counterparts but I
> am not able to change it so that the archiver and ranlib option can be
> used.
>
> Could somebody do that or give hints on how I shoud do it?
>
> Frédéric
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to make clang toolset use custom archiver and ranlib from user-config.jam?

Boost - Build mailing list
In reply to this post by Boost - Build mailing list
Hi,
Who knows boost build and can help?
Regards,
Frédéric

2017-03-22 14:05 GMT+01:00 Frédéric Bron <[hidden email]>:

> Hi,
>
> ar and ranlib cannot be customized for clang toolset as they are for
> gcc which makes it difficult to use in a cross-compilation
> environment. When cross-compiling from linux to windows, I can have in
> my user-config.jam:
>
> using gcc : : i686-w64-mingw32-g++-6.3.0 :
> <archiver>i686-w64-mingw32-ar <ranlib>i686-w64-mingw32-ranlib ;
>
> With the clang toolset, this does not work, archiver and ranlib
> options are ignored.
>
> This is why: here is what we find in tools/build/src/tools/clang-darwin.jam
>
> # Default value. Mostly for the sake of clang-linux
> # that inherits from gcc, but does not has the same
> # logic to set the .AR variable. We can put the same
> # logic in clang-linux, but that's hardly worth the trouble
> # as on Linux, 'ar' is always available.
> .AR = ar ;
>
> ...
>
> actions piecemeal archive
> {
>   "$(.AR)" $(AROPTIONS) rc "$(<)" "$(>)"
>   "ranlib" -cs "$(<)"
> }
>
> Unfortunately, I do not understand the language of jam files so the
> only thing I can do for the time being is to manually edit the file
> and replace ar and ranlib by their cross-compiler counterparts but I
> am not able to change it so that the archiver and ranlib option can be
> used.
>
> Could somebody do that or give hints on how I shoud do it?
>
> Frédéric
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to make clang toolset use custom archiver and ranlib from user-config.jam?

Boost - Build mailing list
In reply to this post by Boost - Build mailing list
Somehow I missed this email (too many email, too little brain time)..

On Wed, Mar 22, 2017 at 8:05 AM, Frédéric Bron via Boost-build <[hidden email]> wrote:
Hi,

ar and ranlib cannot be customized for clang toolset as they are for
gcc which makes it difficult to use in a cross-compilation
environment. When cross-compiling from linux to windows, I can have in
my user-config.jam:

using gcc : : i686-w64-mingw32-g++-6.3.0 :
<archiver>i686-w64-mingw32-ar <ranlib>i686-w64-mingw32-ranlib ;

With the clang toolset, this does not work, archiver and ranlib
options are ignored.

This is why: here is what we find in tools/build/src/tools/clang-darwin.jam

# Default value. Mostly for the sake of clang-linux
# that inherits from gcc, but does not has the same
# logic to set the .AR variable. We can put the same
# logic in clang-linux, but that's hardly worth the trouble
# as on Linux, 'ar' is always available.
.AR = ar ;

...

actions piecemeal archive
{
  "$(.AR)" $(AROPTIONS) rc "$(<)" "$(>)"
  "ranlib" -cs "$(<)"
}

Unfortunately, I do not understand the language of jam files so the
only thing I can do for the time being is to manually edit the file
and replace ar and ranlib by their cross-compiler counterparts but I
am not able to change it so that the archiver and ranlib option can be
used.

Could somebody do that or give hints on how I shoud do it?

Only hint is to look at how gcc.jam does it and copy the behavior to clang-darwin.. Like the comment insinuates.


Or perhaps comment out the default value line. Maybe that will make the target value be used. Sorry I can't be more help.. Would need to debug the jam code to give a detailed answer. And, well, short on time :-(

--
-- Rene Rivera
-- Grafik - Don't Assume Anything
-- Robot Dreams - http://robot-dreams.net
-- rrivera/acm.org (msn) - grafikrobot/aim,yahoo,skype,efnet,gmail

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
Loading...