Don't export symbols in every binary on linux.

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
This commit is contained in:
Rafael Espindola
2013-04-04 01:01:32 +00:00
parent e3d75ee2a1
commit 436633e2a2
4 changed files with 7 additions and 3 deletions

View File

@@ -390,6 +390,10 @@ if( ${CMAKE_SYSTEM_NAME} MATCHES SunOS )
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -include llvm/Support/Solaris.h") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -include llvm/Support/Solaris.h")
endif( ${CMAKE_SYSTEM_NAME} MATCHES SunOS ) 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(AddLLVM)
include(TableGen) include(TableGen)

View File

@@ -12,3 +12,4 @@ add_llvm_tool(bugpoint
ToolRunner.cpp ToolRunner.cpp
bugpoint.cpp bugpoint.cpp
) )
set_target_properties(bugpoint PROPERTIES ENABLE_EXPORTS 1)

View File

@@ -6,3 +6,4 @@ add_llvm_tool(opt
PrintSCC.cpp PrintSCC.cpp
opt.cpp opt.cpp
) )
set_target_properties(opt PROPERTIES ENABLE_EXPORTS 1)

View File

@@ -52,6 +52,4 @@ add_llvm_unittest(JITTests
${JITTestsSources} ${JITTestsSources}
) )
if(MINGW OR CYGWIN) set_target_properties(JITTests PROPERTIES ENABLE_EXPORTS 1)
set_property(TARGET JITTests PROPERTY LINK_FLAGS -Wl,--export-all-symbols)
endif()