<div dir="ltr"><div>Hey there, guys!</div><div><br></div><div>I've added an intrinsic to an input code using an LLVM pass.</div><div>I'm able to see the intrinsic call, yet I can't figure out</div><div>how to compile the code to my target architecture (x86_64).</div><div>I'm running the following command:</div><div><br></div><div>    clang++ $(llvm-config --ldflags --libs all) ff.s -o foo</div><div><br></div><div>But the linker complains about undefined references:</div><div><br></div><div>    /tmp/ff-2ada42.o: In function `fact(unsigned int)':</div><div>    /home/rubens/Desktop/ff.cpp:9: undefined reference to `llvm.x86.sse3.mwait.i32.i32.i32'</div><div>    /tmp/ff-2ada42.o: In function `fib(unsigned int)':</div><div>    /home/rubens/Desktop/ff.cpp:16: undefined reference to `llvm.x86.sse3.mwait.i32.i32.i32'</div><div>    /home/rubens/Desktop/ff.cpp:16: undefined reference to `llvm.x86.sse3.mwait.i32.i32.i32'</div><div>    /home/rubens/Desktop/ff.cpp:16: undefined reference to `llvm.x86.sse3.mwait.i32.i32.i32'</div><div><br></div><div>Despite using ldflags from llvm-config, the compilation</div><div>does not proceed. Any ideas on what should be done</div><div>for the code to compile properly?</div><div><br></div><div>To generate the assembly code, I've done the following:</div><div><br></div><div>    # Generating optimized code</div><div>    clang++ $(llvm-config --cxxflags) -emit-llvm -c ff.cpp -o ff.bc</div><div>    opt ff.bc -load path/to/mypass.so -mypass > opt_ff.bc</div><div><br></div><div>    # Generating assembly</div><div>    llc opt_ff.bc -o ff.s</div><div><br></div><div>I'm currently using llvm version 3.4.2; clang version 3.4.2</div><div>(tags/RELEASE_34/dot2-final); gcc version 4.9.2 (GCC);</div><div>and Linux 3.17.2-1-ARCH x86_64.</div><div><br></div><div><br></div><div>Regards!</div></div>