<div dir="ltr">FYI this was reverted in <a href="https://reviews.llvm.org/rCRT334528">https://reviews.llvm.org/rCRT334528</a> along with the changes it was based on due to bot breakage:  <a href="http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/12522">http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/12522</a>.</div><br><div class="gmail_quote"><div dir="ltr">On Thu, Jun 7, 2018 at 1:02 PM Eric Fiselier via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: ericwf<br>
Date: Thu Jun  7 12:57:43 2018<br>
New Revision: 334220<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=334220&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=334220&view=rev</a><br>
Log:<br>
[CMake] Fix Libc++ Modules build.<br>
<br>
When building the dylib, the C++ headers are fundamentally non-module.<br>
They require special versions of the headers in order to provide C++03 and<br>
legacy ABI definitions. This causes ODR issues when modules are enabled<br>
during both the build and the usage of the libc++ headers.<br>
<br>
This patch fixes the build error by disabling modules when building the<br>
libc++ sources.<br>
<br>
Modified:<br>
    compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake<br>
<br>
Modified: compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake?rev=334220&r1=334219&r2=334220&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake?rev=334220&r1=334219&r2=334220&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake (original)<br>
+++ compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake Thu Jun  7 12:57:43 2018<br>
@@ -537,6 +537,14 @@ macro(add_custom_libcxx name prefix)<br>
   string(REPLACE "-Wl,-z,defs" "" LIBCXX_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS}")<br>
   string(REPLACE "-Wl,-z,defs" "" LIBCXX_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")<br>
<br>
+  # The libc++ sources are fundamentally non-modular. They need special<br>
+  # versions of the headers in order to provide C++03 and legacy ABI definitions.<br>
+  # NOTE: The public headers can be used with modules in all other contexts<br>
+  if (LLVM_ENABLE_MODULES)<br>
+    set(LIBCXX_CXX_FLAGS "${LIBCXX_CXX_FLAGS} -Wno-unused-command-line-argument")<br>
+    set(LIBCXX_CXX_FLAGS "${LIBCXX_CXX_FLAGS} -fno-modules")<br>
+  endif()<br>
+<br>
   ExternalProject_Add(${name}<br>
     DEPENDS ${name}-clobber ${LIBCXX_DEPS}<br>
     PREFIX ${prefix}<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>