This is an archive of the discontinued LLVM Phabricator instance.

[VE] Fix initializer visibility
ClosedPublic

Authored by trofi on Oct 17 2020, 12:30 PM.

Details

Summary

Before the change attempt to link libLTO.so against shared
LLVM library failed as:

[ 76%] Linking CXX shared library ../../lib/libLTO.so
... /usr/bin/cmake -E cmake_link_script CMakeFiles/LTO.dir/link.txt --verbose=1
c++ -o ...libLTO.so.12git ...ibLLVM-12git.so
ld: CMakeFiles/LTO.dir/lto.cpp.o: in function `llvm::InitializeAllTargetInfos()':
include/llvm/Config/Targets.def:31: undefined reference to `LLVMInitializeVETargetInfo'

It happens because on linux llvm build system sets default
symbol visibility to "hidden". The fix is to set visibility
back to "default" for exported APIs with LLVM_EXTERNAL_VISIBILITY.

Bug: https://bugs.llvm.org/show_bug.cgi?id=47847
Signed-off-by: Sergei Trofimovich <slyfox@inbox.ru>

Diff Detail

Event Timeline

trofi created this revision.Oct 17 2020, 12:30 PM
trofi requested review of this revision.Oct 17 2020, 12:30 PM
simoll accepted this revision.Oct 19 2020, 2:18 AM

Thanks!

This revision is now accepted and ready to land.Oct 19 2020, 2:18 AM
This revision was landed with ongoing or failed builds.Oct 19 2020, 2:55 PM
This revision was automatically updated to reflect the committed changes.