[LLVMdev] bugpoint (and possibly others) need to be compiled with -rdynamic

Stephen Checkoway s at pahtak.org
Tue Aug 21 10:01:14 PDT 2012


While running the llvm tests, I get several error messages like these:

[1/1] Running the LLVM regression tests
FAILED: cd /home/steve/llvm-build/test && /usr/local/bin/python /home/steve/llvm/utils/lit/lit.py --param build_config=. --param build_mode=Release -sv --param 
llvm_site_config=/home/steve/llvm-build/test/lit.site.cfg --param llvm_unit_site_config=/home/steve/llvm-build/test/Unit/lit.site.cfg /home/steve/llvm-build/tes
t
-- Testing: 6378 tests, 4 threads --
Testing: 0 
FAIL: LLVM :: BugPoint/metadata.ll (351 of 6378)
******************** TEST 'LLVM :: BugPoint/metadata.ll' FAILED ********************
Script:
--
/home/steve/llvm-build/bin/./bugpoint -load /home/steve/llvm-build/lib/./BugpointPasses.so /usr/home/steve/llvm/test/BugPoint/metadata.ll -output-prefix /usr/ho
me/steve/llvm-build/test/BugPoint/Output/metadata.ll.tmp -bugpoint-crashcalls -silence-passes > /dev/null
/home/steve/llvm-build/bin/./llvm-dis /usr/home/steve/llvm-build/test/BugPoint/Output/metadata.ll.tmp-reduced-simplified.bc -o - | /home/steve/llvm-build/bin/./
FileCheck /usr/home/steve/llvm/test/BugPoint/metadata.ll
--
Exit Code: 1
Command Output (stderr):
--
Error opening '/home/steve/llvm-build/lib/./BugpointPasses.so': /home/steve/llvm-build/lib/./BugpointPasses.so: Undefined symbol "_ZNK4llvm4Pass11getPassNameEv"
  -load request ignored.
bugpoint: Unknown command line argument '-bugpoint-crashcalls'.  Try: '/home/steve/llvm-build/bin/./bugpoint -help'
bugpoint: Did you mean '-simplify-libcalls'?
--

bugpoint defines the symbol:
[sysnet80:~/llvm-build/bin] steve$ nm bugpoint |grep _ZNK4llvm4Pass11getPassNameEv
00000000007c0420 T _ZNK4llvm4Pass11getPassNameEv

Here's a smaller example showing the particular issue <http://pastebin.com/6fGHEy0q>. If you add -rdynamic when compiling a.c, it works correctly:
Linux:
[hilbert:/tmp] steve$ clang -fPIC -rdynamic a.c -ldl
[hilbert:/tmp] steve$ ./a.out

FreeBSD:
[sysnet80:/tmp] steve$ clang -fPIC -rdynamic a.c
[sysnet80:/tmp] steve$ ./a.out

-- 
Stephen Checkoway









More information about the llvm-dev mailing list