Clang/LLVM 10 for XP
rev1:
- rebuilt clang and z3 against system msvcrt.dll, no separate c++ runtime installation needed.
- fix libstd++ linkage that cause random segfaults
- add wasi sdk runtime (webassembly)
- add complete docs that buildable into chm
- remove llvm internal import libraries & header, most people want static libs
- backport: ms-bitfields bugfix
set .exe suffix by default on mingw mode
This one built with GCC/MinGW but can be used to impersonate MSVC (cl.exe), the same version bundled with Visual Studio 2019 16.7 which has the last XP compatible runtime.
Requirement: Windows XP
Athlon (Thunderbird) or newer
~256MB for single thread (yes contrary to what it promote, Clang is RAM hungry)
CUDA development need CUDA Toolkit, at least ptxas.exe and header/libs
WSDK, Msvcrt Libs or/with UCRT libs and headers
Target: X86, WebAssembly, NVPTX (CUDA), AMDGPU (GCN OpenCL)
Languages: C, C++, ObjC, ObjC++
Content: LLVM, Clang, LLD, Polly, Compiler-rt (sanitizer for GCC) and extras, Z3 static analyzer
Missing: LLDB (too much to port)
LibC++ and OpenMP (MSVC and GCC already have one)
Goal: when combined with MSVC 2019 16.7 library and headers, XP will have Full C++17 MSVC-compatible Compiler.
Clang can also impersonate VC 2010, 2012, 2013, 2015 and 2017 with appropriate header and libs.
see https://clang.llvm.org/docs/MSVCCompatibility.html
Tips:
Some important flags when targeting XP:
_USING_V110_SDK71_
_WIN32_WINNT=0x0501
WINVER=0x0501
_WIN32_IE=0x0800
Lower or remove Warning flag, some legacy flags (pre VS 2010) are not recognized at all and may trigger harmless error.
STL 16.7 has "mutex" header file that will inline Vista+ init_once function through the call of call_once(), check out STL 15.9 to revert it into XP compatible one.
similarly, the use of shared_mutex will bring SRWLock functions, use shared_timed_mutex instead.
Setup:
While clang with try detect WSDK and MSVC from registry, it still need environment veriables under CMD and it should work under Visual Studio IDE by (drop-in) replace preinstalled MSVC by renaming bin\*.exe to MS equivalent.
To integrate with GCC it need version 10.4.0, configured with --enable-version-specific-runtime-libs, otherwise you will need inspect them yourself.