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

unknown pass name 'hello-world' #96

Open
sunheyi6 opened this issue Aug 25, 2023 · 4 comments
Open

unknown pass name 'hello-world' #96

sunheyi6 opened this issue Aug 25, 2023 · 4 comments

Comments

@sunheyi6
Copy link

image

@banach-space
Copy link
Owner

Please submit steps to reproduce.

@sunheyi6
Copy link
Author

sunheyi6 commented Aug 28, 2023

Please submit steps to reproduce.

@banach-space I followed the instructions in the README and proceeded with the operation.
First,

wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-add-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main"
sudo apt-get update
sudo apt-get install -y llvm-16 llvm-16-dev llvm-16-tools clang-16

Second,

cd /root/llvm-tutor/build/
cmake -DLT_LLVM_INSTALL_DIR=/usr/lib/llvm-16 /root/llvm-tutor
make

Third

root@LAPTOP-OJLO0M82:~# cd llvm-tutor/build/
root@LAPTOP-OJLO0M82:~/llvm-tutor/build# ls
CMakeCache.txt  CMakeFiles  Makefile  cmake_install.cmake  input_for_hello.ll
root@LAPTOP-OJLO0M82:~/llvm-tutor/build#
root@LAPTOP-OJLO0M82:~/llvm-tutor/build# pwd
/root/llvm-tutor/build
root@LAPTOP-OJLO0M82:~/llvm-tutor/build# /usr/lib/llvm-16/bin/opt -load-pass-plugin ./libHelloWorld.so           -passes=hello-world -disable-output input_for_hello.ll
Failed to load passes from './libHelloWorld.so'. Request ignored.
/usr/lib/llvm-16/bin/opt: unknown pass name 'hello-world'

@banach-space
Copy link
Owner

Thanks for getting back to me. I've just checked this invocation works for me fine:

/opt/llvm-16/bin/opt -load-pass-plugin ./libHelloWorld.so -passes=hello-world -disable-output input_for_hello.ll
(llvm-tutor) Hello from: foo
(llvm-tutor)   number of arguments: 1
(llvm-tutor) Hello from: bar
(llvm-tutor)   number of arguments: 2
(llvm-tutor) Hello from: fez
(llvm-tutor)   number of arguments: 3
(llvm-tutor) Hello from: main
(llvm-tutor)   number of arguments: 2

Can you double check the command line that you are using the run the example?

@adwait
Copy link

adwait commented Sep 8, 2023

You might have the wrong path to libHelloWorld.so. cmake -DLT_LLVM_INSTALL_DIR=/usr/lib/llvm-16 /root/llvm-tutor places all plugin libraries into <build-dir>/lib for me.

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

3 participants