Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libclc/amdgcn: prepare-builtins.cpp.o: undefined reference to symbol '_ZN4llvm7parseIRENS_15MemoryBufferRefERNS_12SMDiagnosticERNS_11LLVMContextENS_15ParserCallbacksE' #91551

Closed
illwieckz opened this issue May 9, 2024 · 2 comments
Labels
build-problem cmake Build system in general and CMake in particular libclc libclc OpenCL library

Comments

@illwieckz
Copy link
Contributor

I'm trying to build libclc from llvmorg-18.1.5 tag and I get this linkage error:

BUILDING amdgcn-mesa-mesa3d
	DEVICE: tahiti ( pitcairn;verde;oland;hainan;bonaire;kabini;kaveri;hawaii;mullins;tonga;tongapro;iceland;carrizo;fiji;stoney;polaris10;polaris11;gfx602;gfx705;gfx805;gfx900;gfx902;gfx904;gfx906;gfx908;gfx909;gfx90a;gfx90c;gfx940;gfx941;gfx942;gfx1010;gfx1011;gfx1012;gfx1013;gfx1030;gfx1031;gfx1032;gfx1033;gfx1034;gfx1035;gfx1036;gfx1100;gfx1101;gfx1102;gfx1103;gfx1150;gfx1151;gfx1200;gfx1201 )
BUILDING r600--
	DEVICE: cedar ( palm;sumo;sumo2;redwood;juniper )
	DEVICE: cypress ( hemlock )
	DEVICE: barts ( turks;caicos )
	DEVICE: cayman ( aruba )
BUILDING spirv-mesa3d-
	DEVICE: none (  )
BUILDING spirv64-mesa3d-
	DEVICE: none (  )
-- Configuring done (0.2s)
-- Generating done (0.0s)
-- Build files have been written to: llvm-project/libclc/build
[1/65] Linking CXX executable prepare_builtins
FAILED: prepare_builtins 
: && /usr/bin/c++ -fno-lto -O3 -DNDEBUG -fno-lto     -Wl,--gc-sections CMakeFiles/prepare_builtins.dir/utils/prepare-builtins.cpp.o -o prepare_builtins  -Wl,-rpath,"\$ORIGIN/../lib"  install/lib/libLLVMBitWriter.so.18.1  install/lib/libLLVMBitReader.so.18.1  install/lib/libLLVMCore.so.18.1  install/lib/libLLVMSupport.so.18.1 && :
/usr/bin/ld: CMakeFiles/prepare_builtins.dir/utils/prepare-builtins.cpp.o: undefined reference to symbol '_ZN4llvm7parseIRENS_15MemoryBufferRefERNS_12SMDiagnosticERNS_11LLVMContextENS_15ParserCallbacksE'
/usr/bin/ld: install/lib/../lib/../lib/libLLVMIRReader.so.18.1: error adding symbols: DSO missing from command line

The error is very similar to #62018:

I'm working on a patch.

@illwieckz
Copy link
Contributor Author

illwieckz commented May 9, 2024

It looks like a variant of the patch has been merged in main very recently:

diff --git a/libclc/CMakeLists.txt b/libclc/CMakeLists.txt
index 9236f09d3667..2d000cf5cad8 100644
--- a/libclc/CMakeLists.txt
+++ b/libclc/CMakeLists.txt
@@ -113,9 +119,10 @@ set(LLVM_LINK_COMPONENTS
   BitReader
   BitWriter
   Core
+  IRReader
   Support
 )

It would be good to backport this to then LLVM 18 version.

On my end only this part (adding IRReader to LLVM_LINK_COMPONENTS) is enough to fix the libclc build.

@EugeneZelenko EugeneZelenko added build-problem libclc libclc OpenCL library and removed new issue labels May 9, 2024
illwieckz added a commit to illwieckz/llvm-project that referenced this issue May 9, 2024
illwieckz added a commit to illwieckz/llvm-project that referenced this issue May 9, 2024
illwieckz added a commit to illwieckz/llvm-project that referenced this issue May 9, 2024
llvm-git-migration pushed a commit to llvm-git-migration/llvm-project that referenced this issue May 9, 2024
tstellar pushed a commit to illwieckz/llvm-project that referenced this issue May 15, 2024
@illwieckz
Copy link
Contributor Author

@EugeneZelenko EugeneZelenko added the cmake Build system in general and CMake in particular label May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build-problem cmake Build system in general and CMake in particular libclc libclc OpenCL library
Projects
None yet
Development

No branches or pull requests

2 participants