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

Error building StaticMain.cpp.o #120

Open
meltq opened this issue Dec 24, 2024 · 3 comments
Open

Error building StaticMain.cpp.o #120

meltq opened this issue Dec 24, 2024 · 3 comments

Comments

@meltq
Copy link

meltq commented Dec 24, 2024

I get this error when trying to build llvm-tutor.

[ 85%] Building CXX object tools/CMakeFiles/static.dir/StaticMain.cpp.o
[ 88%] Building CXX object tools/CMakeFiles/static.dir/__/lib/StaticCallCounter.cpp.o
[ 92%] Linking CXX executable ../bin/static
/usr/bin/ld: CMakeFiles/static.dir/StaticMain.cpp.o: in function `main':
/home/esad/llvm-tutor/tools/StaticMain.cpp:86:(.text+0x5cb): undefined reference to `llvm::SMDiagnostic::print(char const*, llvm::raw_ostream&, bool, bool, bool) const'
/usr/bin/ld: CMakeFiles/static.dir/StaticMain.cpp.o: in function `llvm::SmallPtrSetImplBase::contains_imp(void const*) const':
/home/esad/.vms/shared/llvm-project/llvm/include/llvm/ADT/SmallPtrSet.h:230:(.text._ZNK4llvm19SmallPtrSetImplBase12contains_impEPKv[_ZNK4llvm19SmallPtrSetImplBase12contains_impEPKv]+0x81): undefined reference to `llvm::SmallPtrSetImplBase::doFind(void const*) const'
collect2: error: ld returned 1 exit status
make[2]: *** [tools/CMakeFiles/static.dir/build.make:117: bin/static] Error 1
make[1]: *** [CMakeFiles/Makefile2:770: tools/CMakeFiles/static.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

commands used to build llvm-tutor

cmake -DLT_LLVM_INSTALL_DIR=~/.vms/shared/llvm-project/build ~/llvm-tutor
make

commands used to build llvm-project

cmake -S llvm -B build -G Ninja -DCMAKE_INSTALL_PREFIX=../llvm_tools -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS=clang
cmake --build build -j 12 

Everything else seems to build just fine.

@banach-space
Copy link
Owner

Thanks for reporting and sorry that you are hitting this.

I am traveling and am AFK till next week. In the meantime, which version of LLVM are you using?

-Andrzej

@meltq
Copy link
Author

meltq commented Dec 24, 2024

I ran this on LLVM version 19.1.6 Optimized build. I also tried this on LLVM version 20.0, didn't work on that either.

@banach-space
Copy link
Owner

Thanks!

Please use LLVM 19 (rather than 20) - that’s the officially supported version.

I’m not sure what might be wrong 🤔Similar configuration works fine in CI:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants