[polly] r279737 - Add warning for FORCE_STATIC libraries when using BUILD_SHARED_LIBS.

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 25 06:21:54 PDT 2016


Author: meinersbur
Date: Thu Aug 25 08:21:53 2016
New Revision: 279737

URL: http://llvm.org/viewvc/llvm-project?rev=279737&view=rev
Log:
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 <vedran at miletic.net>

See-also: llvm.org/PR27306

Modified:
    polly/trunk/cmake/polly_macros.cmake

Modified: polly/trunk/cmake/polly_macros.cmake
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/cmake/polly_macros.cmake?rev=279737&r1=279736&r2=279737&view=diff
==============================================================================
--- polly/trunk/cmake/polly_macros.cmake (original)
+++ polly/trunk/cmake/polly_macros.cmake Thu Aug 25 08:21:53 2016
@@ -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)




More information about the llvm-commits mailing list