[llvm-commits] [llvm] r143531 - in /llvm/trunk: cmake/modules/TableGen.cmake utils/TableGen/CMakeLists.txt

Chandler Carruth chandlerc at gmail.com
Tue Nov 1 22:27:41 PDT 2011


Bill, Daniel;

This patch (and its sibling r143532) *might* be interesting for 3.0. This
is from a report on IRC of the 3.0 release candidate failing to link
clang-tblgen correctly when LLVM was installed as a separate library.
Daniel and I found the problem via inspection and I don't personally have a
reproduction so I don't have a great idea of how likely (or unlikely)
others hitting this problem will be.

I'll update the thread if the person who reported it is able to reproduce
and confirm that this fixes the issue.

On Tue, Nov 1, 2011 at 10:03 PM, Chandler Carruth <chandlerc at gmail.com>wrote:

> Author: chandlerc
> Date: Wed Nov  2 00:03:06 2011
> New Revision: 143531
>
> URL: http://llvm.org/viewvc/llvm-project?rev=143531&view=rev
> Log:
> The TableGen parts of the CMake build are seriously broken. This fixes
> one aspect of them by having them use the (annoying, if not broken)
> proper library dependency model for adding the LLVMTableGen library as
> a dependency. This could manifest as a link order issue in the presence
> of separate LLVM / Clang source builds with CMake and a linker that
> really cares about such things.
>
> Also, add the Support dependency to llvm-tblgen itself so that it
> doesn't rely on TableGen's transitive Support dependency. A parallel
> change for clang-tblgen will be forthcoming.
>
> Modified:
>    llvm/trunk/cmake/modules/TableGen.cmake
>    llvm/trunk/utils/TableGen/CMakeLists.txt
>
> Modified: llvm/trunk/cmake/modules/TableGen.cmake
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/TableGen.cmake?rev=143531&r1=143530&r2=143531&view=diff
>
> ==============================================================================
> --- llvm/trunk/cmake/modules/TableGen.cmake (original)
> +++ llvm/trunk/cmake/modules/TableGen.cmake Wed Nov  2 00:03:06 2011
> @@ -76,7 +76,10 @@
>  macro(add_tablegen target project)
>   set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVM_TOOLS_BINARY_DIR})
>
> +  set(${target}_OLD_LLVM_LINK_COMPONENTS ${LLVM_LINK_COMPONENTS})
> +  set(LLVM_LINK_COMPONENTS ${LLVM_LINK_COMPONENTS} TableGen)
>   add_llvm_utility(${target} ${ARGN})
> +  set(LLVM_LINK_COMPONENTS ${target}_OLD_LLVM_LINK_COMPONENTS)
>
>   set(${project}_TABLEGEN "${target}" CACHE
>       STRING "Native TableGen executable. Saves building one when
> cross-compiling.")
> @@ -110,7 +113,6 @@
>     endif()
>   endif()
>
> -  target_link_libraries(${target} LLVMSupport LLVMTableGen)
>   if( MINGW )
>     target_link_libraries(${target} imagehlp psapi)
>     if(CMAKE_SIZEOF_VOID_P MATCHES "8")
>
> Modified: llvm/trunk/utils/TableGen/CMakeLists.txt
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CMakeLists.txt?rev=143531&r1=143530&r2=143531&view=diff
>
> ==============================================================================
> --- llvm/trunk/utils/TableGen/CMakeLists.txt (original)
> +++ llvm/trunk/utils/TableGen/CMakeLists.txt Wed Nov  2 00:03:06 2011
> @@ -1,5 +1,6 @@
>  set(LLVM_REQUIRES_EH 1)
>  set(LLVM_REQUIRES_RTTI 1)
> +set(LLVM_LINK_COMPONENTS Support)
>
>  add_tablegen(llvm-tblgen LLVM
>   ARMDecoderEmitter.cpp
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20111101/8f71e69e/attachment.html>


More information about the llvm-commits mailing list