llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

Facing "undefined symbol: llvm::detail::TakeError(llvm::Error)" while building XRayTest-x86_64-Test

Open BalaRishi-AMD opened this issue 8 years ago • 7 comments

Bugzilla Link 39070
Version unspecified
OS Linux
CC @rui314
Fixed by commit(s) r343280

Extended Description

Facing the below error while Generating XRayTest-x86_64-Test of 'make check-all': ld.lld: warning: found local symbol '__bss_start' in global part of symbol table in file /home/amd/JENKINS/workspace/CPUPC_Mirror_Branch/BUILD_DIR/lib/libLLVM-8svn.so ld.lld: warning: found local symbol '_end' in global part of symbol table in file /home/amd/JENKINS/workspace/CPUPC_Mirror_Branch/BUILD_DIR/lib/libLLVM-8svn.so ld.lld: warning: found local symbol '_edata' in global part of symbol table in file /home/amd/JENKINS/workspace/CPUPC_Mirror_Branch/BUILD_DIR/lib/libLLVM-8svn.so ld.lld: error: undefined symbol: llvm::detail::TakeError(llvm::Error)

Repository Revision info: project: llvm/tools/clang at revision: e0d61134f09e29b71a0f6eea9502a2ffcf26fcdf project: llvm/projects/compiler-rt at revision: 706829da93a37ad9059950c01e623114319df4c7 project: flang at revision: 498be068d81465f7483bf8ad92713a23cc49dd17 project: llvm/tools/lld at revision: fe9f98f141d3a3bfbf0359f033d5b26542ecc0f2 project: llvm at revision: 7b129940425f14653692ae13dc7a33d551413444

The below commands used on RHEL 7.3 and encountered the issue:

  • cmake -G"Unix Makefiles" -DLLVM_BUILD_LLVM_DYLIB:STRING=ON -DLLVM_LINK_LLVM_DYLIB=ON -DLLVM_ENABLE_LIBEDIT=OFF -DCMAKE_BUILD_TYPE:STRING=RELEASE -DCLANG_DEFAULT_LINKER:STRING=lld -DLLVM_BUILD_EXTERNAL_COMPILER_RT=ON -DLLVM_TARGETS_TO_BUILD:STRING=X86 -DLLVM_ENABLE_ASSERTIONS:BOOL=ON -DPACKAGE_VERSION=AMD.LLVM.8.0.0.S.2018_09_24 -DCLANG_VENDOR=AMD.LLVM.S.2018_09_24 -DCLANG_REPOSITORY_STRING=CLANG: -DCMAKE_CXX_FLAGS='-Wno-error=pedantic' -DCMAKE_INSTALL_PREFIX:PATH=/home/amd/MyInstall-Dir1 /home/amd/latest_src/llvm
  • make
  • make check
  • make check-all

BalaRishi-AMD avatar Sep 25 '18 09:09 BalaRishi-AMD

Could you please elaborate "- libLLVM would not contain that symbol if it was built properly".

Since LLVMTestingSupport symbols are not part of libLLVM, we get this error and the list of command line options doesn't indicate exclusion of the LLVMTestingSupport.

llvmbot avatar Oct 01 '18 06:10 llvmbot

Can you provide the full command-line that caused the error? I'm wondering why:

  • libLLVM is being used instead of the individual libraries which host that particular symbol (in this case, it should be LLVMTestingSupport which should appear in the link command (which should include -lLLVMTestingSupport).

  • libLLVM would not contain that symbol if it was built properly.

llvmbot avatar Sep 30 '18 05:09 llvmbot

Dean, Seen the issue with the latest source also. Thanks.

BalaRishi-AMD avatar Sep 28 '18 18:09 BalaRishi-AMD

Bala, do you mind trying again past r343280? I'm going to mark this fixed, please re-open if this is still an issue.

llvmbot avatar Sep 28 '18 03:09 llvmbot

It seems this might be an issue with the XRay runtime test configuration. I'm working on improving the unit testing support there. I'm taking this bug, with a pending change for review.

llvmbot avatar Sep 27 '18 10:09 llvmbot

It seems that this is because linking the unit test can't find the LLVMTestingSupport library (and its dependencies). Is this still a problem past r342859 where changes were made to the CMake config for compiler-rt?

llvmbot avatar Sep 26 '18 01:09 llvmbot

You cannot put symbols in an ELF symbol table in an arbitrary order. All local symbols must precede global symbols in a symbol table, and the index of the first global symbol is set to the symbol table's sh_info field.

If a local symbol appears after the index that is specified by sh_info, lld issues the warning.

So, /home/amd/JENKINS/workspace/CPUPC_Mirror_Branch/BUILD_DIR/lib/libLLVM-8svn.so seems corrupted. How did you create that shared object file?

rui314 avatar Sep 25 '18 13:09 rui314