In terms of clang and mingw-w64 going forward I think the goal should be to get clang working without gcc.
I have achieved this but currently we look relative to the gcc program.
I need input on how to best change this
The patch does several things atm
- it adds the -no-pthread option
while mingw doesn't add -lpthread by default mingw-w64 does.
I saw a note recently in the source with a FIXME on how to handle this.
I think the best way to fix this would be to set a bool in the driver.
Currently we check for mingw-w64's folder layout and then mingw org if that fails
We could set the bool here and use that to decide if we should use pthread by default ?
Ideally however mingw-w64 should support c11 threads and we should not link to pthreads by default but thats not down to us
I may work on this in the future from that end.
mingw-w64 is provided with a -no-pthread option by gcc because of this inconsistency and it is needed to build mingw-w64 from source.
To have clang be able to build mingw-w64 we nned to handle / ignore this option without ending complination.
- It adds support for using compiler-rt and sets it to the default
The user can override this with -rtlib=libgcc if they want that but I think the default should be a clang standalone toolchain
Relative compiler-rt diff http://reviews.llvm.org/D11085
- It adds support for using libc++ and sets it to the default
The user can override this with -stdlib=libstdc++ if they want that but I think the default should be libc++ for that standalone toolchain
- It adds support for lld but does not set it to the default because it is not ready for gnu mode on windows
I have submitted patches to lld to support this
- It adds support for thumb2pe machine for the linker
I have patches for binutils that will be merged once I fill in my FSF waiver and get it merged
Thanks for taking the time to read :)