Skip to content

Commit ebf1fea

Browse files
authored
[libcxx] [docs] Update the MinGW build example (#68790)
The previous example wasn't a configuration that we actually test, but was a simplistic configuration with libstdc++ as ABI library. The previous example configuration has bitrotted and broken in a couple different ways since it was added: - In b0fd949, libcxx added uses of weak symbols that can be overridden by the user. GNU ld fails to export such weak symbols on MinGW, resulting in errors like: C:/msys64/mingw64/bin/ld: cannot export _ZNSt3__126__libcpp_assertion_handlerEPKciS1_S1_: symbol wrong type (2 vs 3) By switching to using LLD, -DLLVM_ENABLE_LLD=ON, alternatively -DCMAKE_SHARED_LINKER_FLAGS=-fuse-ld=lld, linking still succeeds. - In a80e65e, building with -DLIBCXX_CXX_ABI=libstdc++ in this configuration started failing. Switch to showing how to build with libcxxabi instead, which is the tested configuration and also is the typical configuration in how it most usually would be used on Windows. These updates allow removing the mentions of the old caveats with the build configuration.
1 parent 06322d4 commit ebf1fea

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

libcxx/docs/BuildingLibcxx.rst

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -157,19 +157,13 @@ e.g. the ``mingw-w64-x86_64-clang`` package), together with CMake and ninja.
157157
> cmake -G Ninja -S runtimes -B build \
158158
-DCMAKE_C_COMPILER=clang \
159159
-DCMAKE_CXX_COMPILER=clang++ \
160-
-DLLVM_ENABLE_RUNTIMES=libcxx \
161-
-DLIBCXX_CXX_ABI=libstdc++
160+
-DLLVM_ENABLE_LLD=ON \
161+
-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi" \
162+
-DLIBCXXABI_ENABLE_SHARED=OFF \
163+
-DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON
162164
> ninja -C build cxx
163-
> cp /mingw64/bin/{libstdc++-6,libgcc_s_seh-1,libwinpthread-1}.dll lib
164165
> ninja -C build check-cxx
165166
166-
As this build configuration ends up depending on a couple other DLLs that
167-
aren't available in path while running tests, copy them into the same
168-
directory as the tested libc++ DLL.
169-
170-
(Building a libc++ that depends on libstdc++ isn't necessarily a config one
171-
would want to deploy, but it simplifies the config for testing purposes.)
172-
173167
.. _`libc++abi`: http://libcxxabi.llvm.org/
174168

175169

0 commit comments

Comments
 (0)