diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt --- a/llvm/CMakeLists.txt +++ b/llvm/CMakeLists.txt @@ -576,11 +576,6 @@ else() option(LLVM_LINK_LLVM_DYLIB "Link tools against the libllvm dynamic library" OFF) option(LLVM_BUILD_LLVM_C_DYLIB "Build libllvm-c re-export library (Darwin only)" OFF) - set(LLVM_BUILD_LLVM_DYLIB_default OFF) - if(LLVM_LINK_LLVM_DYLIB OR LLVM_BUILD_LLVM_C_DYLIB) - set(LLVM_BUILD_LLVM_DYLIB_default ON) - endif() - option(LLVM_BUILD_LLVM_DYLIB "Build libllvm dynamic library" ${LLVM_BUILD_LLVM_DYLIB_default}) endif() if (LLVM_LINK_LLVM_DYLIB AND BUILD_SHARED_LIBS) @@ -654,7 +649,7 @@ message(STATUS "LLVM default target triple: ${LLVM_DEFAULT_TARGET_TRIPLE}") if(WIN32 OR CYGWIN) - if(BUILD_SHARED_LIBS OR LLVM_BUILD_LLVM_DYLIB) + if(BUILD_SHARED_LIBS) set(LLVM_ENABLE_PLUGINS_default ON) else() set(LLVM_ENABLE_PLUGINS_default OFF) diff --git a/llvm/docs/BuildingADistribution.rst b/llvm/docs/BuildingADistribution.rst --- a/llvm/docs/BuildingADistribution.rst +++ b/llvm/docs/BuildingADistribution.rst @@ -93,10 +93,7 @@ One of the most powerful features of LLVM is its library-first design mentality and the way you can compose a wide variety of tools using different portions of LLVM. Even in this situation using *BUILD_SHARED_LIBS* is not supported. If you -want to distribute LLVM as a shared library for use in a tool, the recommended -method is using *LLVM_BUILD_LLVM_DYLIB*, and you can use *LLVM_DYLIB_COMPONENTS* -to configure which LLVM components are part of libLLVM. -Note: *LLVM_BUILD_LLVM_DYLIB* is not available on Windows. +want to distribute LLVM as a shared library then distribute the libLLVM.so library. Options for Optimizing LLVM =========================== @@ -152,8 +149,8 @@ The most impactful way to reduce binary size is to dynamically link LLVM into all the tools. This reduces code size by decreasing duplication of common code -between the LLVM-based tools. This can be done by setting the following two -CMake options to ``On``: *LLVM_BUILD_LLVM_DYLIB* and *LLVM_LINK_LLVM_DYLIB*. +between the LLVM-based tools. This can be done by setting the following +CMake option to ``On``: *LLVM_LINK_LLVM_DYLIB*. .. warning:: Distributions should never be built using the *BUILD_SHARED_LIBS* CMake @@ -166,7 +163,7 @@ help construct distributions. This is not an exhaustive list, and many additional options are documented in the :doc:`CMake` page. Some key options that are already documented include: *LLVM_TARGETS_TO_BUILD*, -*LLVM_ENABLE_PROJECTS*, *LLVM_BUILD_LLVM_DYLIB*, and *LLVM_LINK_LLVM_DYLIB*. +*LLVM_ENABLE_PROJECTS*, and *LLVM_LINK_LLVM_DYLIB*. **LLVM_ENABLE_RUNTIMES**:STRING When building a distribution that includes LLVM runtime projects (i.e. libcxx, diff --git a/llvm/docs/CMake.rst b/llvm/docs/CMake.rst --- a/llvm/docs/CMake.rst +++ b/llvm/docs/CMake.rst @@ -562,20 +562,9 @@ $CMAKE_INSTALL_PREFIX/Toolchains containing an xctoolchain directory which can be used to override the default system tools. -**LLVM_BUILD_LLVM_DYLIB**:BOOL - If enabled, the target for building the libLLVM shared library is added. - This library contains all of LLVM's components in a single shared library. - Defaults to OFF. This cannot be used in conjunction with BUILD_SHARED_LIBS. - Tools will only be linked to the libLLVM shared library if LLVM_LINK_LLVM_DYLIB - is also ON. - The components in the library can be customised by setting LLVM_DYLIB_COMPONENTS - to a list of the desired components. - This option is not available on Windows. - **LLVM_LINK_LLVM_DYLIB**:BOOL If enabled, tools will be linked with the libLLVM shared library. Defaults - to OFF. Setting LLVM_LINK_LLVM_DYLIB to ON also sets LLVM_BUILD_LLVM_DYLIB - to ON. + to OFF. This option is not available on Windows. **BUILD_SHARED_LIBS**:BOOL @@ -585,8 +574,8 @@ mingw-w64, but not when building with the Microsoft toolchain. .. note:: BUILD_SHARED_LIBS is only recommended for use by LLVM developers. - If you want to build LLVM as a shared library, you should use the - ``LLVM_BUILD_LLVM_DYLIB`` option. + If you want to link against shared libraries, use libLLVM.so, which + is always available. **LLVM_OPTIMIZED_TABLEGEN**:BOOL If enabled and building a debug or asserts build the CMake build system will diff --git a/llvm/docs/GettingStarted.rst b/llvm/docs/GettingStarted.rst --- a/llvm/docs/GettingStarted.rst +++ b/llvm/docs/GettingStarted.rst @@ -618,13 +618,6 @@ | | slow and generates a lot of output. Sphinx version | | | 1.5 or later recommended. | +-------------------------+----------------------------------------------------+ -| LLVM_BUILD_LLVM_DYLIB | Generate libLLVM.so. This library contains a | -| | default set of LLVM components that can be | -| | overridden with ``LLVM_DYLIB_COMPONENTS``. The | -| | default contains most of LLVM and is defined in | -| | ``tools/llvm-shlib/CMakelists.txt``. This option is| -| | not avialable on Windows. | -+-------------------------+----------------------------------------------------+ | LLVM_OPTIMIZED_TABLEGEN | Builds a release tablegen that gets used during | | | the LLVM build. This can dramatically speed up | | | debug builds. | diff --git a/llvm/docs/ReleaseNotes.rst b/llvm/docs/ReleaseNotes.rst --- a/llvm/docs/ReleaseNotes.rst +++ b/llvm/docs/ReleaseNotes.rst @@ -58,8 +58,11 @@ * The BasicBlockPass, BBPassManager and all their uses were deleted in `this revision `_. -* The LLVM_BUILD_LLVM_DYLIB and LLVM_LINK_LLVM_DYLIB CMake options are no longer - available on Windows. +* The LLVM_LINK_LLVM_DYLIB CMake option is no longer available on Windows. + +* The LLVM_BUILD_LLVM_DYLIB option has been removed. The libLLVM shared object + is now always built on all platforms except Windows, so this option is no longer + necessary. .. NOTE If you would like to document a larger change, then you can add a diff --git a/llvm/tools/CMakeLists.txt b/llvm/tools/CMakeLists.txt --- a/llvm/tools/CMakeLists.txt +++ b/llvm/tools/CMakeLists.txt @@ -17,10 +17,6 @@ set(LLVM_TOOL_POLLY_BUILD Off) endif() -if(NOT LLVM_BUILD_LLVM_DYLIB AND NOT LLVM_BUILD_LLVM_C_DYLIB) - set(LLVM_TOOL_LLVM_SHLIB_BUILD Off) -endif() - if(NOT LLVM_USE_INTEL_JITEVENTS ) set(LLVM_TOOL_LLVM_JITLISTENER_BUILD Off) endif() diff --git a/llvm/tools/llvm-config/BuildVariables.inc.in b/llvm/tools/llvm-config/BuildVariables.inc.in --- a/llvm/tools/llvm-config/BuildVariables.inc.in +++ b/llvm/tools/llvm-config/BuildVariables.inc.in @@ -27,7 +27,7 @@ #define LLVM_SYSTEM_LIBS "@LLVM_SYSTEM_LIBS@" #define LLVM_BUILD_SYSTEM "@LLVM_BUILD_SYSTEM@" #define LLVM_HAS_RTTI @LLVM_HAS_RTTI@ -#define LLVM_ENABLE_DYLIB @LLVM_BUILD_LLVM_DYLIB@ +#define LLVM_ENABLE_DYLIB @LLVM_ENABLE_DYLIB@ #define LLVM_LINK_DYLIB @LLVM_LINK_LLVM_DYLIB@ #define LLVM_ENABLE_SHARED @BUILD_SHARED_LIBS@ #define LLVM_DYLIB_COMPONENTS "@LLVM_DYLIB_COMPONENTS_expanded@" diff --git a/llvm/tools/llvm-config/CMakeLists.txt b/llvm/tools/llvm-config/CMakeLists.txt --- a/llvm/tools/llvm-config/CMakeLists.txt +++ b/llvm/tools/llvm-config/CMakeLists.txt @@ -57,8 +57,9 @@ set(LLVM_BUILDMODE ${CMAKE_BUILD_TYPE}) set(LLVM_SYSTEM_LIBS ${SYSTEM_LIBS}) string(REPLACE ";" " " LLVM_TARGETS_BUILT "${LLVM_TARGETS_TO_BUILD}") +set(LLVM_ENABLE_DYLIB NOT CMAKE_SYSTEM_NAME STREQUAL Windows) llvm_canonicalize_cmake_booleans( - LLVM_BUILD_LLVM_DYLIB + LLVM_ENABLE_DYLIB LLVM_LINK_LLVM_DYLIB LLVM_HAS_RTTI LLVM_HAS_GLOBAL_ISEL diff --git a/llvm/tools/llvm-shlib/CMakeLists.txt b/llvm/tools/llvm-shlib/CMakeLists.txt --- a/llvm/tools/llvm-shlib/CMakeLists.txt +++ b/llvm/tools/llvm-shlib/CMakeLists.txt @@ -1,6 +1,5 @@ -# This tool creates a shared library from the LLVM libraries. Generating this -# library is enabled by setting LLVM_BUILD_LLVM_DYLIB=yes on the CMake -# commandline. By default the shared library only exports the LLVM C API. +# This tool creates a shared library from the LLVM libraries. +# By default the shared library only exports the LLVM C API. set(SOURCES libllvm.cpp @@ -10,11 +9,7 @@ message(WARNING "Using LLVM_LINK_LLVM_DYLIB with LLVM_DYLIB_EXPORTED_SYMBOL_FILE may not work. Use at your own risk.") endif() -if(LLVM_BUILD_LLVM_DYLIB) - if(MSVC) - message(FATAL_ERROR "Generating libLLVM is not supported on MSVC") - endif() - +if(NOT CMAKE_SYSTEM_NAME STREQUAL Windows) llvm_map_components_to_libnames(LIB_NAMES ${LLVM_DYLIB_COMPONENTS}) # Exclude libLLVMTableGen for the following reasons: @@ -72,10 +67,6 @@ message(FATAL_ERROR "Generating libLLVM-c is only supported on Darwin") endif() - if(NOT LLVM_BUILD_LLVM_DYLIB) - message(FATAL_ERROR "Generating libLLVM-c requires LLVM_BUILD_LLVM_C_DYLIB on Darwin") - endif() - # To get the export list for a single llvm library: # nm ${LIB_PATH} | awk "/T _LLVM/ { print $3 }" | sort -u | sed -e "s/^_//g" > ${LIB_PATH}.exports