While we can enable both LIBCXX_ENABLE_SHARED and LIBCXX_ENABLE_STATIC because we only build one set of objects this inadvertently ends up messing up the flags of one of the two builds.
This is because _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS should be set for a static build but not for a shared build.
Also on that note static and shared builds need to be able to decide which type of abi library to link to independently so
I have introduced LIBCXX_ENABLE_STATIC_ABI_LIBRARY_FOR_STATIC and LIBCXX_ENABLE_STATIC_ABI_LIBRARY_FOR_SHARED
(better naming suggestions are also welcome)
The default is currently off for both but I would like to suggest we set LIBCXX_ENABLE_STATIC_ABI_LIBRARY_FOR_STATIC to ON by default.
I believe static builds by default should try to use a static libc++abi and combine them into one library.
Shared builds should remain using a shared libc++abi as the default.
This gives the power at the cmake level to override this and link shared with static and static with shared if desired.
I also cleaned up some small nits also.
llvm-ar exports COFF objects as .obj so the python script to combine the libs should allow not just .o
compiler-rt is added to the default libs in config-ix.cmake so we should not manually add -rtlib=compiler-rt to the link flags