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@isi.edu for the catch.

llvm-svn: 269585
This commit is contained in:
Asiri Rathnayake 2016-05-14 23:58:11 +00:00
parent 0fb2488702
commit 28383a4e03

View File

@ -96,7 +96,8 @@ option(LIBCXX_ENABLE_STATIC_ABI_LIBRARY "Statically link the ABI library" OFF)
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)