WebCore
WebCore copied to clipboard
WIP: Support using clang in mingw64 environment on Windows
Primary goal:
-
[x] Build and run JSC built with Clang under windows
-
[ ] Build and test JSC built with Clang and thin-LTO successfully under windows
Other stuff:
-
[x] Support building without Udis86 / Disassembler
-
[x] Support building release with (some) asserts
-
[x] Use UASM instead of MASM
-
[ ] Drop UASM and MASM mostly or entirely if possible
-
[ ] Fix CPU guessing under Clang on Windows
-
[ ] Support building directly from sources instead of "unified sources"
Current CMake magic required to build, to be integrated into CMakeLists or other:
-G "Ninja"
-DRUBY_LIBRARY=/usr/bin/msys-ruby270.dll
-DCMAKE_BUILD_TYPE=Debug
-DINCLUDE_DIRECTORIES:STRING=/usr/include
-DCMAKE_CXX_FLAGS="-g -Og -flto=thin -fuse-ld=lld -fno-rtti -fno-exceptions -stdlib=libc++ -Wno-nonportable-include-path -Wno-ignored-attributes -Wno-implicit-int-float-conversion -UNDEBUG -D_DEBUG"
-DCMAKE_AR="C:\ProgramData\msys64\mingw64\bin\llvm-ar.exe"
-DCMAKE_RANLIB="C:\ProgramData\msys64\mingw64\bin\llvm-ranlib.exe"
-DCMAKE_LINKER="C:\ProgramData\msys64\mingw64\bin\ld.lld.exe --threads"
-DCMAKE_C_LINK_EXECUTABLE="C:\ProgramData\msys64\mingw64\bin\ld.lld.exe --threads"
-DCMAKE_CXX_LINK_EXECUTABLE="C:\ProgramData\msys64\mingw64\bin\ld.lld.exe --threads"
-DCMAKE_EXE_LINKER_FLAGS="-lc++ -lc++abi -lstdc++"
-DCMAKE_SHARED_LINKER_FLAGS="-lc++ -lc++abi -lstdc++"
-DCMAKE_ASM_MASM_COMPILER=uasm
TODO: Look into using CMAKE_SYSROOT, CMAKE_TOOLCHAIN_FILE
This is using Windows CMake instead of MSys/MinGW64 Cmake.
Also needs;
#ifdef __clang__
#define debug_break __builtin_debugtrap
#else
#include <Ultralight/private/util/DebugBreak.h> // or add it inside here
#endif