Skip to content

Commit

Permalink
libLTO.{so,dylib}: remove unused non-LTO symbols
Browse files Browse the repository at this point in the history
These dissembler symbols are not used by LTO (see Apple ld64's use
in check-llvm-tools-lto). On ELF platforms, these symbols are not defined and are
rejected by ld --no-undefined-version.

I think this is a more proper solution than D139932 and this fixes
-DBUILD_SHARED_LIBS=on for ELF as well.
  • Loading branch information
MaskRay committed Feb 2, 2023
1 parent dd3f7b0 commit c294bdd
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 88 deletions.
6 changes: 1 addition & 5 deletions llvm/tools/lto/CMakeLists.txt
Expand Up @@ -19,11 +19,7 @@ set(SOURCES
lto.cpp
)

if (LLVM_LINK_LLVM_DYLIB)
set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/lto.dylib.exports)
else()
set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/lto.exports)
endif()
set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/lto.exports)

if(CMAKE_SYSTEM_NAME STREQUAL AIX)
set(LTO_LIBRARY_TYPE MODULE)
Expand Down
77 changes: 0 additions & 77 deletions llvm/tools/lto/lto.dylib.exports

This file was deleted.

6 changes: 0 additions & 6 deletions llvm/tools/lto/lto.exports
Expand Up @@ -45,12 +45,6 @@ lto_codegen_compile_optimized
lto_codegen_set_should_internalize
lto_codegen_set_should_embed_uselists
lto_set_debug_options
LLVMCreateDisasm
LLVMCreateDisasmCPU
LLVMDisasmDispose
LLVMDisasmInstruction
LLVMSetDisasmOptions
LLVMCreateDisasmCPUFeatures
thinlto_create_codegen
thinlto_codegen_dispose
thinlto_codegen_add_module
Expand Down

0 comments on commit c294bdd

Please sign in to comment.