LLVM bitcode for Boost libraries?

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

LLVM bitcode for Boost libraries?

Boost - Users mailing list
I want to build a project I have, which has to link against Boost.System, to WebAssembly, and it seems like I have to generate LLVM bitcode for it first.  Is it possible to use the bootstrapper that comes with the Boost distribution to do this on Windows 10?

The project in question is on GitHub here: https://github.com/DragonOsman/currency_converter .  I switched out the Asio in the Boost distribution with the official Emscripten port of Asio, found here: https://github.com/emscripten-ports/asio .  But I don't know which version of Boost.Asio it's using so I'd like some clarification on that if possible (I opened this issue there: https://github.com/emscripten-ports/asio/issues/2 and have just now updated the question to ask what version of Asio is being used for the port).  




_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: LLVM bitcode for Boost libraries?

Boost - Users mailing list
On 29/11/2018 09:04, Osman Zakir wrote:

> The project in question is on GitHub here:
> https://github.com/DragonOsman/currency_converter .  I switched out the
> Asio in the Boost distribution with the official Emscripten port of
> Asio, found here: https://github.com/emscripten-ports/asio .  But I
> don't know which version of Boost.Asio it's using so I'd like some
> clarification on that if possible (I opened this issue there:
> https://github.com/emscripten-ports/asio/issues/2 and have just now
> updated the question to ask what version of Asio is being used for the
> port).
> <https://github.com/emscripten-ports/asio/issues/2>

I would assume it is not Boost.Asio at all, but rather the standalone
Asio library (http://think-async.com/Asio), albeit an old version of it.

See http://think-async.com/Asio/AsioAndBoostAsio.
_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: LLVM bitcode for Boost libraries?

Boost - Users mailing list
Do you know how I could try to port the latest version, then?  Or should I consult the Emscripten developers after all?

From: Boost-users <[hidden email]> on behalf of Gavin Lambert via Boost-users <[hidden email]>
Sent: Thursday, November 29, 2018 5:02 AM
To: [hidden email]
Cc: Gavin Lambert
Subject: Re: [Boost-users] LLVM bitcode for Boost libraries?
 
On 29/11/2018 09:04, Osman Zakir wrote:
> The project in question is on GitHub here:
> https://github.com/DragonOsman/currency_converter .  I switched out the
> Asio in the Boost distribution with the official Emscripten port of
> Asio, found here: https://github.com/emscripten-ports/asio .  But I
> don't know which version of Boost.Asio it's using so I'd like some
> clarification on that if possible (I opened this issue there:
> https://github.com/emscripten-ports/asio/issues/2 and have just now
> updated the question to ask what version of Asio is being used for the
> port).
> <https://github.com/emscripten-ports/asio/issues/2>

I would assume it is not Boost.Asio at all, but rather the standalone
Asio library (http://think-async.com/Asio), albeit an old version of it.

See http://think-async.com/Asio/AsioAndBoostAsio.
_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: LLVM bitcode for Boost libraries?

Boost - Users mailing list
And what about how to generate LLVM bitcode for Boost libraries?  Can I do it with the bootstrapper tool that comes with the Boost distribution when we download Boost source files?

From: Osman Zakir <[hidden email]>
Sent: Thursday, November 29, 2018 5:05 AM
To: [hidden email]
Subject: Re: [Boost-users] LLVM bitcode for Boost libraries?
 
Do you know how I could try to port the latest version, then?  Or should I consult the Emscripten developers after all?

From: Boost-users <[hidden email]> on behalf of Gavin Lambert via Boost-users <[hidden email]>
Sent: Thursday, November 29, 2018 5:02 AM
To: [hidden email]
Cc: Gavin Lambert
Subject: Re: [Boost-users] LLVM bitcode for Boost libraries?
 
On 29/11/2018 09:04, Osman Zakir wrote:
> The project in question is on GitHub here:
> https://github.com/DragonOsman/currency_converter .  I switched out the
> Asio in the Boost distribution with the official Emscripten port of
> Asio, found here: https://github.com/emscripten-ports/asio .  But I
> don't know which version of Boost.Asio it's using so I'd like some
> clarification on that if possible (I opened this issue there:
> https://github.com/emscripten-ports/asio/issues/2 and have just now
> updated the question to ask what version of Asio is being used for the
> port).
> <https://github.com/emscripten-ports/asio/issues/2>

I would assume it is not Boost.Asio at all, but rather the standalone
Asio library (http://think-async.com/Asio), albeit an old version of it.

See http://think-async.com/Asio/AsioAndBoostAsio.
_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: LLVM bitcode for Boost libraries?

Boost - Users mailing list
On Thu, 29 Nov 2018 at 18:09, Osman Zakir via Boost-users <[hidden email]> wrote:
And what about how to generate LLVM bitcode for Boost libraries?  Can I do it with the bootstrapper tool that comes with the Boost distribution when we download Boost source files?

 I'm cross-posting this from the cfe-dev list [I know nothing about this, just that the questions seem to be the same]

Date: Thu, 29 Nov 2018 09:48:58 +0100
From: Alex Denisov via cfe-dev <[hidden email]>
To: David Greene <[hidden email]>
Cc: "[hidden email]" <[hidden email]>
Subject: Re: [cfe-dev] Getting LLVM IR from clang
Message-ID: <[hidden email]>
Content-Type: text/plain;       charset=us-ascii

Hi David,

There are at least two robust ways to get the Bitcode/IR:

1. LTO. You can enable link-time optimization by adding -flto compiler flags, in the end all object files (*.o) will in fact be bitcode files. I.e.:

    > file gmock.dir/gmock-gtest-all.cc.o
    gmock.dir/gmock-gtest-all.cc.o: LLVM bitcode, wrapper x86_6

2. Embedded bitcode. Clang 3.9 and higher has an option -fembed-bitcode. When enabled, the resulting executable will contain additional section containing bitcode.
You can use this great tool[1] to extract the bitcode from an executable.

Both approaches produce bitcode (binary format), if you need IR (human-readable format), then you can post-process the bitcode by running llvm-dis against each bitcode file.

I hope it helps.

[1] https://github.com/JDevlieghere/LibEBC

> On 28. Nov 2018, at 23:22, David Greene via cfe-dev <[hidden email]> wrote:
>
> How do I get the LLVM IR produced by clang?  I know that -emit-llvm
> produces IR but it seems to be after processing by LLVM (things are
> optimized out, for example).  Is there an "official" way to get the IR
> coming right out of clang's codegen?  I can do a hack with -mllvm
> -print-before-all but that's icky.
>
> Thanks!
>
>                          -David
> _______________________________________________
> cfe-dev mailing list
> [hidden email]
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


degski
--
If something cannot go on forever, it will stop" - Herbert Stein

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: LLVM bitcode for Boost libraries?

Boost - Users mailing list
So can I pass that flag to b2 when building Boost and have it generate bitcode?  How do I configure the Boost.Build to use LLVM/Clang as the compiler toolchain, though?  On Windows, of course.  

From: degski <[hidden email]>
Sent: Friday, November 30, 2018 11:03 AM
To: [hidden email]
Cc: [hidden email]
Subject: Re: [Boost-users] LLVM bitcode for Boost libraries?
 
On Thu, 29 Nov 2018 at 18:09, Osman Zakir via Boost-users <[hidden email]> wrote:
And what about how to generate LLVM bitcode for Boost libraries?  Can I do it with the bootstrapper tool that comes with the Boost distribution when we download Boost source files?

 I'm cross-posting this from the cfe-dev list [I know nothing about this, just that the questions seem to be the same]

Date: Thu, 29 Nov 2018 09:48:58 +0100
From: Alex Denisov via cfe-dev <[hidden email]>
To: David Greene <[hidden email]>
Cc: "[hidden email]" <[hidden email]>
Subject: Re: [cfe-dev] Getting LLVM IR from clang
Message-ID: <[hidden email]>
Content-Type: text/plain;       charset=us-ascii

Hi David,

There are at least two robust ways to get the Bitcode/IR:

1. LTO. You can enable link-time optimization by adding -flto compiler flags, in the end all object files (*.o) will in fact be bitcode files. I.e.:

    > file gmock.dir/gmock-gtest-all.cc.o
    gmock.dir/gmock-gtest-all.cc.o: LLVM bitcode, wrapper x86_6

2. Embedded bitcode. Clang 3.9 and higher has an option -fembed-bitcode. When enabled, the resulting executable will contain additional section containing bitcode.
You can use this great tool[1] to extract the bitcode from an executable.

Both approaches produce bitcode (binary format), if you need IR (human-readable format), then you can post-process the bitcode by running llvm-dis against each bitcode file.

I hope it helps.

[1] https://github.com/JDevlieghere/LibEBC

> On 28. Nov 2018, at 23:22, David Greene via cfe-dev <[hidden email]> wrote:
>
> How do I get the LLVM IR produced by clang?  I know that -emit-llvm
> produces IR but it seems to be after processing by LLVM (things are
> optimized out, for example).  Is there an "official" way to get the IR
> coming right out of clang's codegen?  I can do a hack with -mllvm
> -print-before-all but that's icky.
>
> Thanks!
>
>                          -David
> _______________________________________________
> cfe-dev mailing list
> [hidden email]
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


degski
--
If something cannot go on forever, it will stop" - Herbert Stein

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: LLVM bitcode for Boost libraries?

Boost - Users mailing list
On 11/30/2018 7:47 AM, Osman Zakir via Boost-users wrote:
> So can I pass that flag to b2 when building Boost and have it generate
> bitcode?  How do I configure the Boost.Build to use LLVM/Clang as the
> compiler toolchain, though?  On Windows, of course.

You should not top post.

On Windows: If LLVM/clang is targeting vc++, use the clang-win
toolchain; if LLVM/clang is targeting mingw(-w64)/gcc use the clang
toolchain.

> ------------------------------------------------------------------------
> *From:* degski <[hidden email]>
> *Sent:* Friday, November 30, 2018 11:03 AM
> *To:* [hidden email]
> *Cc:* [hidden email]
> *Subject:* Re: [Boost-users] LLVM bitcode for Boost libraries?
> On Thu, 29 Nov 2018 at 18:09, Osman Zakir via Boost-users
> <[hidden email] <mailto:[hidden email]>> wrote:
>
>     And what about how to generate LLVM bitcode for Boost libraries?
>     Can I do it with the bootstrapper tool that comes with the Boost
>     distribution when we download Boost source files?
>
>
>   I'm cross-posting this from the cfe-dev list [I know nothing about
> this, just that the questions seem to be the same]
>
> Date: Thu, 29 Nov 2018 09:48:58 +0100
> From: Alex Denisov via cfe-dev <[hidden email]
> <mailto:[hidden email]>>
> To: David Greene <[hidden email] <mailto:[hidden email]>>
> Cc: "[hidden email] <mailto:[hidden email]>"
> <[hidden email] <mailto:[hidden email]>>
> Subject: Re: [cfe-dev] Getting LLVM IR from clang
> Message-ID: <[hidden email]
> <mailto:[hidden email]>>
> Content-Type: text/plain;       charset=us-ascii
>
> Hi David,
>
> There are at least two robust ways to get the Bitcode/IR:
>
> 1. LTO. You can enable link-time optimization by adding -flto compiler
> flags, in the end all object files (*.o) will in fact be bitcode files.
> I.e.:
>
>      > file gmock.dir/gmock-gtest-all.cc.o
>      gmock.dir/gmock-gtest-all.cc.o: LLVM bitcode, wrapper x86_6
>
> 2. Embedded bitcode. Clang 3.9 and higher has an option -fembed-bitcode.
> When enabled, the resulting executable will contain additional section
> containing bitcode.
> You can use this great tool[1] to extract the bitcode from an executable.
>
> Both approaches produce bitcode (binary format), if you need IR
> (human-readable format), then you can post-process the bitcode by
> running llvm-dis against each bitcode file.
>
> I hope it helps.
>
> [1] https://github.com/JDevlieghere/LibEBC
>
>  > On 28. Nov 2018, at 23:22, David Greene via cfe-dev
> <[hidden email] <mailto:[hidden email]>> wrote:
>  >
>  > How do I get the LLVM IR produced by clang?  I know that -emit-llvm
>  > produces IR but it seems to be after processing by LLVM (things are
>  > optimized out, for example).  Is there an "official" way to get the IR
>  > coming right out of clang's codegen?  I can do a hack with -mllvm
>  > -print-before-all but that's icky.
>  >
>  > Thanks!
>  >
>  >                          -David
>  > _______________________________________________
>  > cfe-dev mailing list
>  > [hidden email] <mailto:[hidden email]>
>  > http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
>
> degski
> --
> /*/*“*/If something cannot go on forever, it will stop" - Herbert Stein*/
>
> _______________________________________________
> Boost-users mailing list
> [hidden email]
> https://lists.boost.org/mailman/listinfo.cgi/boost-users
>


_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: LLVM bitcode for Boost libraries?

Boost - Users mailing list
From: Boost-users <[hidden email]> on behalf of Edward Diener via Boost-users <[hidden email]>
Sent: Friday, November 30, 2018 6:59 PM
To: [hidden email]
Cc: Edward Diener
Subject: Re: [Boost-users] LLVM bitcode for Boost libraries?
 
On 11/30/2018 7:47 AM, Osman Zakir via Boost-users wrote:
> So can I pass that flag to b2 when building Boost and have it generate
> bitcode?  How do I configure the Boost.Build to use LLVM/Clang as the
> compiler toolchain, though?  On Windows, of course.

> You should not top post.

> On Windows: If LLVM/clang is targeting vc++, use the clang-win
> toolchain; if LLVM/clang is targeting mingw(-w64)/gcc use the clang
> toolchain.

So you mean I should use Clang-C2/Clang with Microsoft CodeGen, aka the clang-cl compiler?  Either way, how do I change the compiler toolchain when building Boost?

> ------------------------------------------------------------------------
> *From:* degski <[hidden email]>
> *Sent:* Friday, November 30, 2018 11:03 AM
> *To:* [hidden email]
> *Cc:* [hidden email]
> *Subject:* Re: [Boost-users] LLVM bitcode for Boost libraries?
> On Thu, 29 Nov 2018 at 18:09, Osman Zakir via Boost-users
> <[hidden email] <[hidden email]>> wrote:
>
>     And what about how to generate LLVM bitcode for Boost libraries?
>     Can I do it with the bootstrapper tool that comes with the Boost
>     distribution when we download Boost source files?
>
>
>   I'm cross-posting this from the cfe-dev list [I know nothing about
> this, just that the questions seem to be the same]
>
> Date: Thu, 29 Nov 2018 09:48:58 +0100
> From: Alex Denisov via cfe-dev <[hidden email]
> <[hidden email]>>
> To: David Greene <[hidden email] <[hidden email]>>
> Cc: "[hidden email] <[hidden email]>"
> <[hidden email] <[hidden email]>>
> Subject: Re: [cfe-dev] Getting LLVM IR from clang
> Message-ID: <[hidden email]
> <[hidden email]>>
> Content-Type: text/plain;       charset=us-ascii
>
> Hi David,
>
> There are at least two robust ways to get the Bitcode/IR:
>
> 1. LTO. You can enable link-time optimization by adding -flto compiler
> flags, in the end all object files (*.o) will in fact be bitcode files.
> I.e.:
>
>      > file gmock.dir/gmock-gtest-all.cc.o
>      gmock.dir/gmock-gtest-all.cc.o: LLVM bitcode, wrapper x86_6
>
> 2. Embedded bitcode. Clang 3.9 and higher has an option -fembed-bitcode.
> When enabled, the resulting executable will contain additional section
> containing bitcode.
> You can use this great tool[1] to extract the bitcode from an executable.
>
> Both approaches produce bitcode (binary format), if you need IR
> (human-readable format), then you can post-process the bitcode by
> running llvm-dis against each bitcode file.
>
> I hope it helps.
>
> [1] https://github.com/JDevlieghere/LibEBC
>
>  > On 28. Nov 2018, at 23:22, David Greene via cfe-dev
> <[hidden email] <[hidden email]>> wrote:
>  >
>  > How do I get the LLVM IR produced by clang?  I know that -emit-llvm
>  > produces IR but it seems to be after processing by LLVM (things are
>  > optimized out, for example).  Is there an "official" way to get the IR
>  > coming right out of clang's codegen?  I can do a hack with -mllvm
>  > -print-before-all but that's icky.
>  >
>  > Thanks!
>  >
>  >                          -David
>  > _______________________________________________
>  > cfe-dev mailing list
>  > [hidden email] <[hidden email]>
>  > http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
>
> degski
> --
> /*/*“*/If something cannot go on forever, it will stop" - Herbert Stein*/
>
> _______________________________________________
> Boost-users mailing list
> [hidden email]
> https://lists.boost.org/mailman/listinfo.cgi/boost-users
>


_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: LLVM bitcode for Boost libraries?

Boost - Users mailing list
On Fri, 30 Nov 2018 at 16:09, Osman Zakir via Boost-users <[hidden email]> wrote:
So you mean I should use Clang-C2/Clang with Microsoft CodeGen, aka the clang-cl compiler?  Either way, how do I change the compiler toolchain when building Boost?

No, that's dead for a [quite] while now, just get and install Clang/LLVM from https://releases.llvm.org/download.html#7.0.0.

AFAIK, the final Boost-1.69 release [or current dev branch] will allow for building with clang-cl **and lld-link** [Thanks to Peter Dimov]. You'll need to have a project-jam file something like this:

import option ;
using clang-win : : "C:\\Program Files\\LLVM\\bin\\clang-cl.exe" -fuse-ld=lld :
    <compatibility>vc14
    <compileflags>-fmsc-version=1915
    <compileflags>-fms-compatibility
    <compileflags>-fno-delayed-template-parsing
    <compileflags>-flto=thin
    <cxxflags>"/std:c++17"
    <cxxflags>"/Zc:forScope"
    <cxxflags>"/Zc:wchar_t"
    <cxxflags>"/EHsc"
    <cxxflags>"/Zc:inline"
    <cxxflags>"/Gd"
    <cxxflags>"/diagnostics:classic"
    <cxxflags>-Wno-unknown-argument
    <cxxflags>-Wno-unknown-pragmas
    <cxxflags>-Wno-macro-redefined
    <cxxflags>-Wno-unused-variable
    <cxxflags>-Wno-mismatched-tags
    <cxxflags>-Wno-deprecated-declarations
    <cxxflags>-D_UNICODE
    <cxxflags>-DUNICODE
    <cxxflags>-DBOOST_USE_WINDOWS_H
    <cxxflags>-DBOOST_NO_ANSI_APIS
    <cxxflags>-DBOOST_USE_WINAPI_VERSION=0x1000
    <cxxflags>-DBOOST_USE_WINDOWS_H=1
    <cxxflags>-DNOMINMAX
    <cxxflags>-DWIN32_LEAN_AND_MEAN
    <cxxflags>-D_CRT_SECURE_NO_WARNINGS
;

But you'll have to adjust that to your needs.

degski
--
If something cannot go on forever, it will stop" - Herbert Stein

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: LLVM bitcode for Boost libraries?

Boost - Users mailing list

 

 

From: Boost-users [mailto:[hidden email]] On Behalf Of degski via Boost-users
Sent: 30 November 2018 20:40
To: [hidden email]
Cc: degski
Subject: Re: [Boost-users] LLVM bitcode for Boost libraries?

 

On Fri, 30 Nov 2018 at 16:09, Osman Zakir via Boost-users <[hidden email]> wrote:

So you mean I should use Clang-C2/Clang with Microsoft CodeGen, aka the clang-cl compiler?  Either way, how do I change the compiler toolchain when building Boost?

 

No, that's dead for a [quite] while now, just get and install Clang/LLVM from https://releases.llvm.org/download.html#7.0.0.

 

AFAIK, the final Boost-1.69 release [or current dev branch] will allow for building with clang-cl **and lld-link** [Thanks to Peter Dimov]. You'll need to have a project-jam file something like this:

 

import option ;
using clang-win : : "C:\\Program Files\\LLVM\\bin\\clang-cl.exe" -fuse-ld=lld :
    <compatibility>vc14
    <compileflags>-fmsc-version=1915
    <compileflags>-fms-compatibility
    <compileflags>-fno-delayed-template-parsing
    <compileflags>-flto=thin
    <cxxflags>"/std:c++17"
    <cxxflags>"/Zc:forScope"
    <cxxflags>"/Zc:wchar_t"
    <cxxflags>"/EHsc"
    <cxxflags>"/Zc:inline"
    <cxxflags>"/Gd"
    <cxxflags>"/diagnostics:classic"
    <cxxflags>-Wno-unknown-argument
    <cxxflags>-Wno-unknown-pragmas
    <cxxflags>-Wno-macro-redefined
    <cxxflags>-Wno-unused-variable
    <cxxflags>-Wno-mismatched-tags
    <cxxflags>-Wno-deprecated-declarations
    <cxxflags>-D_UNICODE
    <cxxflags>-DUNICODE
    <cxxflags>-DBOOST_USE_WINDOWS_H
    <cxxflags>-DBOOST_NO_ANSI_APIS
    <cxxflags>-DBOOST_USE_WINAPI_VERSION=0x1000
    <cxxflags>-DBOOST_USE_WINDOWS_H=1
    <cxxflags>-DNOMINMAX
    <cxxflags>-DWIN32_LEAN_AND_MEAN
    <cxxflags>-D_CRT_SECURE_NO_WARNINGS
;

 

But you'll have to adjust that to your needs.

 

Before I bash my head against this configuration again, please can you confirm that this does this work for you to build the Boost libraries **on Windows** so that one can use the Boost.Test library (not header-only)?

 

Am I right on thinking that

 

All the / items are to allow compilation of MSVC stuff.

 

Is it essential to use <cxxflags>"/EHsc"  ? when

 

test suite using Boost. emits a warning that EHa should be enabled:

warning C4535: calling _set_se_translator() requires /EHa

 

All the –Wno- items are to deal with a blizzard of warnings from MSVC stuff?

 

    <cxxflags>-D_CRT_SECURE_NO_WARNINGS is need to avoid C runtime warnings.

 

And all the other –D items are only needed if you want to use more than empty project console applications?

 

Thanks

 

Paul

 

 


_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: LLVM bitcode for Boost libraries?

Boost - Users mailing list
On Tue, 4 Dec 2018 at 13:08, Paul A. Bristow via Boost-users <[hidden email]> wrote:

 

 

From: Boost-users [mailto:[hidden email]] On Behalf Of degski via Boost-users
Sent: 30 November 2018 20:40
To: [hidden email]
Cc: degski
Subject: Re: [Boost-users] LLVM bitcode for Boost libraries?

 

On Fri, 30 Nov 2018 at 16:09, Osman Zakir via Boost-users <[hidden email]> wrote:

So you mean I should use Clang-C2/Clang with Microsoft CodeGen, aka the clang-cl compiler?  Either way, how do I change the compiler toolchain when building Boost?

 

No, that's dead for a [quite] while now, just get and install Clang/LLVM from https://releases.llvm.org/download.html#7.0.0.

 

AFAIK, the final Boost-1.69 release [or current dev branch] will allow for building with clang-cl **and lld-link** [Thanks to Peter Dimov]. You'll need to have a project-jam file something like this:

 

import option ;
using clang-win : : "C:\\Program Files\\LLVM\\bin\\clang-cl.exe" -fuse-ld=lld :
    <compatibility>vc14
    <compileflags>-fmsc-version=1915
    <compileflags>-fms-compatibility
    <compileflags>-fno-delayed-template-parsing
    <compileflags>-flto=thin
    <cxxflags>"/std:c++17"
    <cxxflags>"/Zc:forScope"
    <cxxflags>"/Zc:wchar_t"
    <cxxflags>"/EHsc"
    <cxxflags>"/Zc:inline"
    <cxxflags>"/Gd"
    <cxxflags>"/diagnostics:classic"
    <cxxflags>-Wno-unknown-argument
    <cxxflags>-Wno-unknown-pragmas
    <cxxflags>-Wno-macro-redefined
    <cxxflags>-Wno-unused-variable
    <cxxflags>-Wno-mismatched-tags
    <cxxflags>-Wno-deprecated-declarations
    <cxxflags>-D_UNICODE
    <cxxflags>-DUNICODE
    <cxxflags>-DBOOST_USE_WINDOWS_H
    <cxxflags>-DBOOST_NO_ANSI_APIS
    <cxxflags>-DBOOST_USE_WINAPI_VERSION=0x1000
    <cxxflags>-DBOOST_USE_WINDOWS_H=1
    <cxxflags>-DNOMINMAX
    <cxxflags>-DWIN32_LEAN_AND_MEAN
    <cxxflags>-D_CRT_SECURE_NO_WARNINGS
;

 

But you'll have to adjust that to your needs.

 

Before I bash my head against this configuration again, please can you confirm that this does this work for you to build the Boost libraries **on Windows** so that one can use the Boost.Test library (not header-only)?

 

Am I right on thinking that

 

All the / items are to allow compilation of MSVC stuff.

 

Is it essential to use <cxxflags>"/EHsc"  ? when

 

test suite using Boost. emits a warning that EHa should be enabled:

warning C4535: calling _set_se_translator() requires /EHa

 

All the –Wno- items are to deal with a blizzard of warnings from MSVC stuff?

 

    <cxxflags>-D_CRT_SECURE_NO_WARNINGS is need to avoid C runtime warnings.


And all the other –D items are only needed if you want to use more than empty project console applications?


You can probably forget everything after the line <cxxflags>"/std:c++17", the rest is indeed mostly to have a build log with as little nonsense as possible and I picked /EHsc, because this seems to be the default in the IDE. I don't build the test suite, but the libs build quite nicely.

degski
PS: @Paul, was not clear to me who wrote what [who was abusing his head], so maybe I missed something.
--
If something cannot go on forever, it will stop" - Herbert Stein

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: LLVM bitcode for Boost libraries?

Boost - Users mailing list
On 5/12/2018 05:27, degski wrote:
> PS: @Paul, was not clear to me who wrote what [who was abusing his
> head], so maybe I missed something.

Pro-tip (@Osman): don't use Outlook for any mailing list (except the few
where top-posting is tolerated) because Outlook cannot cope with
anything except top-posting, especially in HTML formatted email.

And they steadfastly refuse to provide a way to "split" a quote block,
which is all it would take to make this scenario actually work.

(In a pinch you can convert the email to text-only in Outlook first and
then you can successfully reply to it, but that loses the quote markers
so you'll have to add those in manually.)
_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: LLVM bitcode for Boost libraries?

Boost - Users mailing list
Or I can just delete all of the quotes from below, like here.  Isn't this okay too?

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: LLVM bitcode for Boost libraries?

Boost - Users mailing list
In reply to this post by Boost - Users mailing list
> -----Original Message-----
> From: Boost-users [mailto:[hidden email]] On Behalf Of Gavin Lambert via Boost-users
> Sent: 04 December 2018 22:22
> To: [hidden email]
> Cc: Gavin Lambert
> Subject: Re: [Boost-users] LLVM bitcode for Boost libraries?
>
> On 5/12/2018 05:27, degski wrote:
> > PS: @Paul, was not clear to me who wrote what [who was abusing his
> > head], so maybe I missed something.
>
> Pro-tip (@Osman): don't use Outlook for any mailing list (except the few
> where top-posting is tolerated) because Outlook cannot cope with
> anything except top-posting, especially in HTML formatted email.
>
> And they steadfastly refuse to provide a way to "split" a quote block,
> which is all it would take to make this scenario actually work.
>
> (In a pinch you can convert the email to text-only in Outlook first and
> then you can successfully reply to it, but that loses the quote markers
> so you'll have to add those in manually.)

The head-abusing Paul forgot to click format as plain-text :-(

And yes Outlook is a nuisance making bottom posting messy, but I normally manage it well enough.

Paul



_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: LLVM bitcode for Boost libraries?

Boost - Users mailing list
In reply to this post by Boost - Users mailing list
On 5/12/2018 12:39, Osman Zakir wrote:
> Or I can just delete all of the quotes from below, like here.  Isn't
> this okay too?

For people using a threaded mail client, it's ok (though not preferred).
  But it may confuse people using unthreaded clients or digests,
especially in a thread with several branches.

Proper style is to quote just the part you're actually directly replying
to, in order to provide context without duplicating the whole chain.
_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users