From: Michael Kruse Date: Thu, 25 Aug 2016 13:21:53 +0000 (+0000) Subject: Add warning for FORCE_STATIC libraries when using BUILD_SHARED_LIBS. X-Git-Tag: llvmorg-4.0.0-rc1~11489 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=225d58382521c6d8ab7af83eba065703ec1613c4;p=platform%2Fupstream%2Fllvm.git Add warning for FORCE_STATIC libraries when using BUILD_SHARED_LIBS. We cannot built ISL as shared object because we build it with -fvisibility=hidden; The created shared object would have no accessible symbols. The reason it is built with -fvisibility=hidden is because opt/clang might load other libraries that have ISL embedded and whose' symbols would conflict with Polly's private ISL. This could happend with Draggonegg. In the future we might instead statically link PollyISL into the Polly shared object to avoid installing the static library. Requested-by: Vedran Miletic See-also: llvm.org/PR27306 llvm-svn: 279737 --- diff --git a/polly/cmake/polly_macros.cmake b/polly/cmake/polly_macros.cmake index cbdbceeb..172e185 100644 --- a/polly/cmake/polly_macros.cmake +++ b/polly/cmake/polly_macros.cmake @@ -16,6 +16,10 @@ macro(add_polly_library name) if (MODULE) set(libkind MODULE) elseif (ARG_FORCE_STATIC) + if (SHARED_LIBRARY OR BUILD_SHARED_LIBS) + message(STATUS "${name} is being built as static library it compiled with -fvisibility=hidden; " + "Its symbols are not visible from outside a shared library") + endif () set(libkind STATIC) elseif (SHARED_LIBRARY) set(libkind SHARED)