unable to load plugin liboptfe.so due to undefined symbol
czchen opened this issue · 4 comments
Hi,
I am trying to setup stack for my project. However, the following message shows when I use stack-build
. Please help to solve this problem, thanks.
error: unable to load plugin '/mnt/disk/home/czchen/Trend/experimental/stack/stack/build/bin/stack/../../lib/liboptfe.so':
'/mnt/disk/home/czchen/Trend/experimental/stack/stack/build/bin/stack/../../lib/liboptfe.so: undefined symbol: _ZN5clang14FrontendAction22shouldEraseOutputFilesEv'
The make check
result looks like the same as #20, so I think the build is okay.
Expected Passes : 11
Unresolved Tests : 2
Unexpected Failures: 1
My environment is
- debian testing x86_64
- gcc (Debian 4.8.2-12) 4.8.2
- clang version 3.4 (tags/RELEASE_34/final)
Do you have the stack and the clang (the one you compiled yourself) binaries at the beginning of your PATH? I could solve the same problem by adding both directories to my PATH.
Hope that helps
Same here. clang version 3.4 tag/RELEASE_34/final) and it's got nothing to do with PATH:
/usr/bin/clang -no-integrated-as -DHAVE_CONFIG_H -I. -I../../src -D_POSIX_C_SOURCE=201001L -D_XOPEN_SOURCE=700 -D_BSD_SOURCE -MT instant.lo -MD -MP -MF .deps/instant.Tpo -c -fPIC -DPIC -o .libs/instant.o -o - -Qunused-arguments -w -S -flto -O0 -g -D_FORTIFY_SOURCE=0 -Xclang -load -Xclang /home/freundt/usr/lib/liboptfe.so.0.0.0 -Xclang -plugin -Xclang intfe ../../src/instant.c
error: unable to load plugin '/home/freundt/usr/lib/liboptfe.so.0.0.0': '/home/freundt/usr/lib/liboptfe.so.0.0.0: undefined symbol: _ZN5clang14FrontendAction22shouldEraseOutputFilesEv'
@hroptatyr you need to use the clang you just built, as described in INSTALL. The system one /usr/bin/clang won't work.
xiw, yes, that's what I did.
$ -rwxr-xr-x 1 freundt users 432920434 2014-11-03T14:09:24 /home/freundt/usr/bin/clang
that's a freshly built clang which also happens to be in $PATH
. Nonetheless, I get:
clang -no-integrated-as -DHAVE_CONFIG_H -I. -I../../src -D_POSIX_C_SOURCE=201001L \
-D_XOPEN_SOURCE=700 -D_BSD_SOURCE -MT instant.lo -MD -MP -MF .deps/instant.Tpo \
-c -fPIC -DPIC -o .libs/instant.o -o - -Qunused-arguments -w -S -flto -O0 \
-g -D_FORTIFY_SOURCE=0 -Xclang -load -Xclang /home/freundt/usr/lib/liboptfe.so.0.0.0 \
-Xclang -plugin -Xclang intfe ../../src/instant.c
error: unable to load plugin '/home/freundt/usr/lib/liboptfe.so.0.0.0': '/home/freundt/usr/lib/liboptfe.so.0.0.0: undefined symbol: _ZN5clang14FrontendAction22shouldEraseOutputFilesEv'