[compiler-rt] r334220 - [CMake] Fix Libc++ Modules build.

Matt Morehouse via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 12 12:52:41 PDT 2018


FYI this was reverted in https://reviews.llvm.org/rCRT334528 along with the
changes it was based on due to bot breakage:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/12522.

On Thu, Jun 7, 2018 at 1:02 PM Eric Fiselier via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: ericwf
> Date: Thu Jun  7 12:57:43 2018
> New Revision: 334220
>
> URL: http://llvm.org/viewvc/llvm-project?rev=334220&view=rev
> Log:
> [CMake] Fix Libc++ Modules build.
>
> When building the dylib, the C++ headers are fundamentally non-module.
> They require special versions of the headers in order to provide C++03 and
> legacy ABI definitions. This causes ODR issues when modules are enabled
> during both the build and the usage of the libc++ headers.
>
> This patch fixes the build error by disabling modules when building the
> libc++ sources.
>
> Modified:
>     compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake
>
> Modified: compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake
> URL:
> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake?rev=334220&r1=334219&r2=334220&view=diff
>
> ==============================================================================
> --- compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake (original)
> +++ compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake Thu Jun  7
> 12:57:43 2018
> @@ -537,6 +537,14 @@ macro(add_custom_libcxx name prefix)
>    string(REPLACE "-Wl,-z,defs" "" LIBCXX_MODULE_LINKER_FLAGS
> "${CMAKE_MODULE_LINKER_FLAGS}")
>    string(REPLACE "-Wl,-z,defs" "" LIBCXX_EXE_LINKER_FLAGS
> "${CMAKE_EXE_LINKER_FLAGS}")
>
> +  # The libc++ sources are fundamentally non-modular. They need special
> +  # versions of the headers in order to provide C++03 and legacy ABI
> definitions.
> +  # NOTE: The public headers can be used with modules in all other
> contexts
> +  if (LLVM_ENABLE_MODULES)
> +    set(LIBCXX_CXX_FLAGS "${LIBCXX_CXX_FLAGS}
> -Wno-unused-command-line-argument")
> +    set(LIBCXX_CXX_FLAGS "${LIBCXX_CXX_FLAGS} -fno-modules")
> +  endif()
> +
>    ExternalProject_Add(${name}
>      DEPENDS ${name}-clobber ${LIBCXX_DEPS}
>      PREFIX ${prefix}
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180612/5a7d4d3c/attachment.html>


More information about the llvm-commits mailing list