[llvm] r217484 - Attempt to fix PR20884

Dan Liew dan at su-root.co.uk
Wed Sep 10 11:55:32 PDT 2014


Hi Tom,

This is one of two patches that it would be good to have in a 3.5.x
release. Unfortunately this patch is slightly broken because it
prevents make clean from being run which was picked up by the
buildbots. r217490 fixes this.

Eric Christopher gave approval for this patch in [1] but I did not get
approval for r217490 because I wanted to fix the buildbots as quickly
as possible.

[1] http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-September/076609.html

On 10 September 2014 11:18, Dan Liew <dan at su-root.co.uk> wrote:
> Author: delcypher
> Date: Wed Sep 10 05:18:59 2014
> New Revision: 217484
>
> URL: http://llvm.org/viewvc/llvm-project?rev=217484&view=rev
> Log:
> Attempt to fix PR20884
>
> This fixes the generation of broken LLVMExports.cmake file by
> the Autoconf/Makefile build system when --enable-shared is passed to
> configure.
>
> When --enable_shared is passed the Makefile.rules does not set the
> LLVMConfigLibs variable which cmake/modules/Makefile previously relied
> on. Now it runs the llvm-config command itself to get the library names.
>
> This still isn't perfect because the generated LLVM targets refer to the
> static libraries and not the shared library but that is much larger
> problem to fix.
>
> Modified:
>     llvm/trunk/cmake/modules/Makefile
>
> Modified: llvm/trunk/cmake/modules/Makefile
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/Makefile?rev=217484&r1=217483&r2=217484&view=diff
> ==============================================================================
> --- llvm/trunk/cmake/modules/Makefile (original)
> +++ llvm/trunk/cmake/modules/Makefile Wed Sep 10 05:18:59 2014
> @@ -33,6 +33,16 @@ else
>         LLVM_ENABLE_RTTI := 0
>  endif
>
> +LLVM_LIBS_TO_EXPORT := $(subst -l,,$(shell $(LLVM_CONFIG) --libs $(LINK_COMPONENTS) || echo Error))
> +
> +ifeq ($(LLVM_LIBS_TO_EXPORT),Error)
> +$(error llvm-config --libs failed)
> +endif
> +
> +ifndef LLVM_LIBS_TO_EXPORT
> +$(error LLVM_LIBS_TO_EXPORT cannot be empty)
> +endif
> +
>  OBJMODS := LLVMConfig.cmake LLVMConfigVersion.cmake LLVMExports.cmake
>
>  $(PROJ_OBJ_DIR)/LLVMConfig.cmake: LLVMConfig.cmake.in $(LLVMBuildCMakeFrag)
> @@ -45,7 +55,7 @@ $(PROJ_OBJ_DIR)/LLVMConfig.cmake: LLVMCo
>           -e 's/@LLVM_VERSION_PATCH@/'"$(LLVM_VERSION_PATCH)"'/' \
>           -e 's/@PACKAGE_VERSION@/'"$(LLVMVersion)"'/' \
>           -e 's/@LLVM_COMMON_DEPENDS@//' \
> -         -e 's/@LLVM_AVAILABLE_LIBS@/'"$(subst -l,,$(LLVMConfigLibs))"'/' \
> +         -e 's/@LLVM_AVAILABLE_LIBS@/'"$(LLVM_LIBS_TO_EXPORT)"'/' \
>           -e 's/@LLVM_ALL_TARGETS@/'"$(ALL_TARGETS)"'/' \
>           -e 's/@LLVM_TARGETS_TO_BUILD@/'"$(TARGETS_TO_BUILD)"'/' \
>           -e 's/@LLVM_TARGETS_WITH_JIT@/'"$(TARGETS_WITH_JIT)"'/' \
> @@ -83,7 +93,7 @@ $(PROJ_OBJ_DIR)/LLVMExports.cmake: $(LLV
>         $(Echo) 'Generating LLVM CMake target exports file'
>         $(Verb) ( \
>           echo '# LLVM CMake target exports.  Do not include directly.' && \
> -         for lib in $(subst -l,,$(LLVMConfigLibs)); do \
> +         for lib in $(LLVM_LIBS_TO_EXPORT); do \
>             echo 'add_library('"$$lib"' STATIC IMPORTED)' && \
>             echo 'set_property(TARGET '"$$lib"' PROPERTY IMPORTED_LOCATION "'"$(PROJ_libdir)/lib$$lib.a"'")' ; \
>           done && \
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



-- 
Dan Liew
PhD Student - Imperial College London



More information about the llvm-commits mailing list