<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/89892>89892</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Opt: unknown pass name ‘hello’
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          gihyeonjeon
      </td>
    </tr>
</table>

<pre>
    Hi. I am studying the contents of [https://llvm.org/docs/WritingAnLLVMPass.html 1](https://llvm.org/docs/WritingAnLLVMPass.html). When I enter ‘gmake’ in a build folder and then input
```
opt -load lib/LLVMHello.so -p=hello <hello.bc> /dev/null
```
an error occurs stating
```
opt: unknown pass name 'hello'
```
I don’t understand what ‘legacy’ means, but I saw an answer suggesting to remove the load option, which I did, but the same problem still occurs. When I enter
```
opt -load -p=helloworld <hello.bc> /dev/null
```
the output ‘main’ appears, but I have never created a pass called ‘helloworld’; I want to use a pass called ‘hello’. I am curious about what the problem is and how it can be solved.

I got the reply from the question that I have asked on llvm.
He said that I have to use another command.
```
opt -load-pass-plugin lib/LLVMHello.so  -passes=hello-world <hello.bc>
```
But the new command does not work properly. The following warning message appears.
```
bash: syntax error near unexpected token `newline'
```
I suspect that the problem occurs because of the <>. After modifying the command as follows and entering it, a bug occurred. The output sentence is as follows.
```
Failed to load passes from 'lib/LLVMHello.so'. Request ignored.
Expected<T> must be checked before access or destruction.
Unchecked Expected<T> contained error:
Plugin entry point not found in 'lib/LLVMHello.so'. Is this a legacy plugin?PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: opt -load-pass-plugin lib/LLVMHello.so -passes=hello hello.bc
 #0 0x00006443107a83f6 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/ghjeon/llvm-project-llvmorg-17.0.6/llvm/lib/Support/Unix/Signals.inc:602:22
 #1 0x00006443107a87d5 PrintStackTraceSignalHandler(void*) /home/ghjeon/llvm-project-llvmorg-17.0.6/llvm/lib/Support/Unix/Signals.inc:675:1
 #2 0x00006443107a5e99 llvm::sys::RunSignalHandlers() /home/ghjeon/llvm-project-llvmorg-17.0.6/llvm/lib/Support/Signals.cpp:104:20
 #3 0x00006443107a7d0e SignalHandler(int) /home/ghjeon/llvm-project-llvmorg-17.0.6/llvm/lib/Support/Unix/Signals.inc:413:1
 #4 0x0000769d87042520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #5 0x0000769d870969fc __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
 #6 0x0000769d870969fc __pthread_kill_internal ./nptl/pthread_kill.c:78:10
 #7 0x0000769d870969fc pthread_kill ./nptl/pthread_kill.c:89:10
 #8 0x0000769d87042476 gsignal ./signal/../sysdeps/posix/raise.c:27:6
 #9 0x0000769d870287f3 abort ./stdlib/abort.c:81:7
#10 0x000064430cabe5f4 llvm::SmallVectorTemplateBase<llvm::PassPlugin, false>::mallocForGrow(unsigned long, unsigned long&) /home/ghjeon/llvm-project-llvmorg-17.0.6/llvm/include/llvm/ADT/SmallVector.h:444:4
#11 0x000064430cab93f7 llvm::Expected<llvm::PassPlugin>::assertIsChecked() const /home/ghjeon/llvm-project-llvmorg-17.0.6/llvm/include/llvm/Support/Error.h:714:3
#12 0x000064430cab3280 llvm::Expected<llvm::PassPlugin>::~Expected() /home/ghjeon/llvm-project-llvmorg-17.0.6/llvm/include/llvm/Support/Error.h:550:10
#13 0x000064430caa50e0 main::'lambda'(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)::operator()(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) const /home/ghjeon/llvm-project-llvmorg-17.0.6/llvm/tools/opt/opt.cpp:469:3
#14 0x000064430caa827d void std::__invoke_impl<void, main::'lambda'(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&>(std::__invoke_other, main::'lambda'(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) /usr/include/c++/11/bits/invoke.h:61:67
#15 0x000064430caa7fa1 std::enable_if<is_invocable_r_v<void, main::'lambda'(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&>, void>::type std::__invoke_r<void, main::'lambda'(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&>(main::'lambda'(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) /usr/include/c++/11/bits/invoke.h:117:5
#16 0x000064430caa7cb9 std::_Function_handler<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&), main::'lambda'(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)>::_M_invoke(std::_Any_data const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) /usr/include/c++/11/bits/std_function.h:291:44
#17 0x000064430cab9f99 std::function<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)>::operator()(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) const /usr/include/c++/11/bits/std_function.h:590:66
#18 0x000064430cac6130 llvm::cl::list<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, llvm::cl::parser<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>::handleOccurrence(unsigned int, llvm::StringRef, llvm::StringRef) /home/ghjeon/llvm-project-llvmorg-17.0.6/llvm/include/llvm/Support/CommandLine.h:1670:12
#19 0x00006443106b0ed2 llvm::cl::Option::addOccurrence(unsigned int, llvm::StringRef, llvm::StringRef, bool) /home/ghjeon/llvm-project-llvmorg-17.0.6/llvm/lib/Support/CommandLine.cpp:1854:1
#20 0x00006443106aa0d6 CommaSeparateAndAddOccurrence(llvm::cl::Option*, unsigned int, llvm::StringRef, llvm::StringRef, bool) /home/ghjeon/llvm-project-llvmorg-17.0.6/llvm/lib/Support/CommandLine.cpp:643:32
#21 0x00006443106aa4b4 ProvideOption(llvm::cl::Option*, llvm::StringRef, llvm::StringRef, int, char const* const*, int&) /home/ghjeon/llvm-project-llvmorg-17.0.6/llvm/lib/Support/CommandLine.cpp:683:41
#22 0x00006443106b0343 (anonymous namespace)::CommandLineParser::ParseCommandLineOptions(int, char const* const*, llvm::StringRef, llvm::raw_ostream*, bool) /home/ghjeon/llvm-project-llvmorg-17.0.6/llvm/lib/Support/CommandLine.cpp:1713:36
#23 0x00006443106aee2a llvm::cl::ParseCommandLineOptions(int, char const* const*, llvm::StringRef, llvm::raw_ostream*, char const*, bool) /home/ghjeon/llvm-project-llvmorg-17.0.6/llvm/lib/Support/CommandLine.cpp:1469:47
#24 0x000064430caa54a1 main /home/ghjeon/llvm-project-llvmorg-17.0.6/llvm/tools/opt/opt.cpp:474:30
#25 0x0000769d87029d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#26 0x0000769d87029e40 call_init ./csu/../csu/libc-start.c:128:20
#27 0x0000769d87029e40 __libc_start_main ./csu/../csu/libc-start.c:379:5
#28 0x000064430ca74ee5 _start (/usr/local/bin/opt+0xa33ee5)
Aborted (core dumped)
```
I am still using the LLVM documentation from the previous question. I am following all the steps identically, but only modifying the final ‘opt’ command. Also, I have confirmed that both the LLVM version and the Clang version are 17.0.6.
I entered ‘gmake’ in the build directory when compiling the pass, and I am wondering if there is any problem with this process as well.

Thanks for many helps!
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWltv2zjT_jXMDRFDomQdLnLhpPHXAF1sse3uXhoUNba4oUh9JBXHN-9vfzGUbNmu03bbbrcvUCCIdSBHM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