[libcxx] r269585 - Disable LIBCXX_ENABLE_ABI_LINKER_SCRIPT for static library builds.

Asiri Rathnayake via cfe-commits cfe-commits at lists.llvm.org
Sat May 14 16:58:11 PDT 2016


Author: asiri
Date: Sat May 14 18:58:11 2016
New Revision: 269585

URL: http://llvm.org/viewvc/llvm-project?rev=269585&view=rev
Log:
Disable LIBCXX_ENABLE_ABI_LINKER_SCRIPT for static library builds.

This option is geared towards shared library builds and causes static
library builds to fail if not explicitly disabled.

This patch fixes PR27706: https://llvm.org/bugs/show_bug.cgi?id=27706

Thanks rgoodfel at isi.edu for the catch.

Modified:
    libcxx/trunk/CMakeLists.txt

Modified: libcxx/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/CMakeLists.txt?rev=269585&r1=269584&r2=269585&view=diff
==============================================================================
--- libcxx/trunk/CMakeLists.txt (original)
+++ libcxx/trunk/CMakeLists.txt Sat May 14 18:58:11 2016
@@ -96,7 +96,8 @@ option(LIBCXX_ENABLE_STATIC_ABI_LIBRARY
 set(ENABLE_LINKER_SCRIPT_DEFAULT_VALUE OFF)
 if (LLVM_HAVE_LINK_VERSION_SCRIPT AND NOT LIBCXX_ENABLE_STATIC_ABI_LIBRARY
       AND NOT LIBCXX_CXX_ABI_LIBNAME STREQUAL "none"
-      AND PYTHONINTERP_FOUND)
+      AND PYTHONINTERP_FOUND
+      AND LIBCXX_ENABLE_SHARED)
     set(ENABLE_LINKER_SCRIPT_DEFAULT_VALUE ON)
 endif()
 
@@ -203,6 +204,9 @@ if (LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
     if (NOT PYTHONINTERP_FOUND)
       message(FATAL_ERROR "LIBCXX_ENABLE_ABI_LINKER_SCRIPT requires python but it was not found.")
     endif()
+    if (NOT LIBCXX_ENABLE_SHARED)
+      message(FATAL_ERROR "LIBCXX_ENABLE_ABI_LINKER_SCRIPT is only available for shared library builds.")
+    endif()
 endif()
 
 if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY AND LIBCXX_ENABLE_ABI_LINKER_SCRIPT)




More information about the cfe-commits mailing list