-----Original Message----- From: Boost [mailto:boost-bounces@lists.boost.org] On Behalf Of Edward Diener Sent: 03 September 2015 16:23 To: boost@lists.boost.org Subject: Re: [boost] Compiling with Clang 3.7.0 from windows
On 9/3/2015 10:02 AM, Paul A. Bristow wrote:
I've downloaded the shiny new Clang 3.7 and added this to my user-config
This is my experience with clang built from source:
If you are running clang as a 64-bit compiler you need to "use" a 64-bit version of mingw-64, and not mingw which is only 32-bits. By "use" I mean one of two things. Either the 'bin' directory of the 64-bit version should be prepended to your Windows PATH when invoking clang++ or you use the '-- sysroot=some_mingw' option on the command line when invoking clang++, where 'some_mingw' is the path to the 64-bit mingw implementation. I have not used the second method but have been told it should work.
What I do, in a batch file before invoking clang++, is to prepend to the Windows PATH the clang++ bin directory followed by the bin directory of the mingw-64 implementation I want clang to use. Then when clang++ is invoked it finds everything properly. If you are compiling clang++ for 32-bit code you need to "use" a 32-bit version of mingw(-64)/gcc and if you are compiling clang++ for 64-bit code you need to "use" a 64-bit version of mingw-64/gcc.
As far as pre-built versions of clang I have used clang 3.6.2, 3.5.2, and clang 3.4.1. None of these versions could "use" mingw-64 but only mingw. This means that none of these versions could be used to compile 64-bit code since mingw only supports 32-bit code. I have not tried the new pre-build clang 3.7 yet, which supposedly is capable of using mingw-64 ( I know the latest clang built from source can "use" mingw-64 but I am not sure if this capability got into the 3.7 release ).
I'm a bit wary of working on a solution that requires a bat file to manipulate the PATH. (It is also potentially inconvenient because it complicates other b2 code?) Surely Boost.Build user-config.jam should be able to do this? If only we knew what Clang needs? I've downloaded from mingw64 C:\Program Files\mingw-w64\x86_64-5.1.0-win32-seh-rt_v4-rev0\mingw64\bin (Assuming that for Windows the SEH option is best? - but user-config.jam should also cater for Linux hosts? So there should be different setups for Windows?) I've also got this C:\MinGW\mingw32\bin But I'm not sure if I need this at all. I'm completely confused about exactly what the Clang compiler is using mingw for. Is it the loader ld.exe? Is it libstdc++? Paul --- Paul A. Bristow Prizet Farmhouse Kendal UK LA8 8AB +44 (0) 1539 561830