[cfe-dev] [libc++] Porting libc++ to Windows

Fulvio Esposito fulvio.esposito at live.it
Thu Jul 2 00:59:41 PDT 2015


Hi Dan,
________________________________
> From: danalbert at google.com 
> 
> I had been looking in to this a while 
> ago: https://github.com/DanAlbert/libcxx/tree/windows 
> 
> It was able to build with mingw, but wasn't too happy in testing under 
> wine. I'm not sure if that's wine related or actually bugs in my code 
> (it looked like both). 
> 
> I got sidetracked and haven't looked back at it, but I was having 
> trouble building it on windows because cmake wasn't letting me use 
> clang. Not really sure why. 

I've managed to rebase your work to the current state of affairs but had to hack a few things to make it compile (I'm using mingw-w64 on windows and doing a 64-bit build). I managed to use clang and ninja to build it (from msys2 repos). A couple of questions:

- Your pthread implementation uses functions requiring Windows Vista or later, is WinXP not a target? Also, I had to manually set _WIN32_WINNT to 0x600 in __config because mingw-w64 defaults to 0x503 or something like that.

- I had to add a few libraries during linking in CMakeLists.txt:

if (MINGW)
  target_link_libraries(cxx mingw32 mingwex msvcr120 msvcrt gcc gcc_eh)
endif()

Is this the correct way to tackle this problem?

Fulvio Esposito
--
"The difference between theory and practice is in theory somewhat smaller than in practice" 		 	   		  



More information about the cfe-dev mailing list