Don't export symbols in every binary on linux.
authorRafael Espindola <rafael.espindola@gmail.com>
Thu, 4 Apr 2013 01:01:32 +0000 (01:01 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Thu, 4 Apr 2013 01:01:32 +0000 (01:01 +0000)
On freebsd this makes sure that symbols are exported on the binaries that need
them. The net result is that we should get symbols in the binaries that need
them on every platform.

On linux x86-64 this reduces the size of the bin directory from 262MB to 250MB.

Patch by Stephen Checkoway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178725 91177308-0d34-0410-b5e6-96231b3b80d8

CMakeLists.txt
tools/bugpoint/CMakeLists.txt
tools/opt/CMakeLists.txt
unittests/ExecutionEngine/JIT/CMakeLists.txt

index 80c95a08bc67e7f8fb02e56be19d7b25b09a8d54..95ea3115d30b73615164ae775c1ac51731e28f11 100644 (file)
@@ -390,6 +390,10 @@ if( ${CMAKE_SYSTEM_NAME} MATCHES SunOS )
    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -include llvm/Support/Solaris.h")
 endif( ${CMAKE_SYSTEM_NAME} MATCHES SunOS )
 
+# Make sure we don't get -rdynamic in every binary. For those that need it,
+# use set_target_properties(target PROPERTIES ENABLE_EXPORTS 1)
+set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")
+
 include(AddLLVM)
 include(TableGen)
 
index e990cfcbba48b213deaad5baf50171a529785f72..0000d977acf301e5c5215a63eb9b4b8f6c3c7bd8 100644 (file)
@@ -12,3 +12,4 @@ add_llvm_tool(bugpoint
   ToolRunner.cpp
   bugpoint.cpp
   )
+set_target_properties(bugpoint PROPERTIES ENABLE_EXPORTS 1)
index 1ff8efbed02fde910ae255b37fdc3825dc549ea1..91959119e4911947e8a3520b51614be11e05dd05 100644 (file)
@@ -6,3 +6,4 @@ add_llvm_tool(opt
   PrintSCC.cpp
   opt.cpp
   )
+set_target_properties(opt PROPERTIES ENABLE_EXPORTS 1)
index 3d33e4cb83515dd221ebc7e2aa3bce7cc699bec8..ac45d2e24b9d3a945d928e1e0d03149a6800a281 100644 (file)
@@ -52,6 +52,4 @@ add_llvm_unittest(JITTests
   ${JITTestsSources}
   )
 
-if(MINGW OR CYGWIN)
-  set_property(TARGET JITTests PROPERTY LINK_FLAGS -Wl,--export-all-symbols)
-endif()
+set_target_properties(JITTests PROPERTIES ENABLE_EXPORTS 1)