Code Monkey home page Code Monkey logo

Comments (13)

erikrose avatar erikrose commented on June 14, 2024

What version of LLVM and clang are you using? dxr is known to work with 3.2 and to not work with 3.1 or 3.3.

from dxr.

kraptr avatar kraptr commented on June 14, 2024

Yes, I am using the 3.2 version for both LLVM and Clang.

from dxr.

kraptr avatar kraptr commented on June 14, 2024

The exact failure log from the make in tests/test_basic:

Build command for 'code' failed, exited non-zero! Log follows:
| make[1]: Entering directory /home/lokeshk/oss/dxr/tests/test_basic/code' | rm -rf code | make[1]: Leaving directory/home/lokeshk/oss/dxr/tests/test_basic/code'
| make[1]: Entering directory /home/lokeshk/oss/dxr/tests/test_basic/code' | clang++ -Xclang -load -Xclang /home/lokeshk/oss/dxr/dxr/plugins/clang/libclang-index-plugin.so -Xclang -add-plugin -Xclang dxr-index -Xclang -plugin-arg-dxr-index -Xclang /home/lokeshk/oss/dxr/tests/test_basic/code -o code main.cc | error: unable to load plugin '/home/lokeshk/oss/dxr/dxr/plugins/clang/libclang-index-plugin.so': '/home/lokeshk/oss/dxr/dxr/plugins/clang/libclang-index-plugin.so: undefined symbol: _ZTIN5clang11PPCallbacksE' | make[1]: *** [code] Error 1 | make[1]: Leaving directory/home/lokeshk/oss/dxr/tests/test_basic/code'

from dxr.

sanirudh avatar sanirudh commented on June 14, 2024

The headers you include might belong to a previous/later version of clang. Make sure that the clang headers in the include paths (/usr/local/include/ etc) are from version 3.2

from dxr.

xsyr avatar xsyr commented on June 14, 2024

Hi, I saw a commit said "Add support for clang 3.4.", and it still doesn't work with Clang 3.4.

~/src/dxr/tests/test_basic$ make

# Link paths in dxr.config.in to current working directory # replaces PWD with pwd and produces dxr.config
cat dxr.config.in | sed -e 's?PWD?'pwd'?g' > dxr.config
# Navigate into the DXR folder, build using config file LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../../trilite dxr-build.py Generating target folder Creating tables Indexing files from the 'code' tree (finished in 0:00:00.055884) Building the 'code' tree Build command for 'code' failed, exited non-zero. Log follows: | make[1]: Entering directory/home/xsyr/src/dxr/tests/test_basic/code'
| rm -rf code
| make[1]: Leaving directory /home/xsyr/src/dxr/tests/test_basic/code' | make[1]: Entering directory/home/xsyr/src/dxr/tests/test_basic/code'
| clang++ -Xclang -load -Xclang /home/xsyr/src/dxr/dxr/plugins/clang/libclang-index-plugin.so -Xclang -add-plugin -Xclang dxr-index -Xclang -plugin-arg-dxr-index -Xclang /home/xsyr/src/dxr/tests/test_basic/code -o code main.c
| clang-3.4: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated
| error: unable to load plugin '/home/xsyr/src/dxr/dxr/plugins/clang/libclang-index-plugin.so': '/home/xsyr/src/dxr/dxr/plugins/clang/libclang-index-plugin.so: undefined symbol: _ZTIN5clang11PPCallbacksE'
| make[1]: *** [code] Error 1
| make[1]: Leaving directory `/home/xsyr/src/dxr/tests/test_basic/code'

make: *** [all] Error 1

from dxr.

erikrose avatar erikrose commented on June 14, 2024

I noticed that as well the other day when I tried to upgrade the OS on the Vagrant box to Saucy. I should have filed it then; you folks really keep me on my toes. :-) I thought we had tried 3.4, but apparently we did not. @abbeyj?

from dxr.

abbeyj avatar abbeyj commented on June 14, 2024

I'm using 3.4 built from source with no issues. Are you sure your headers
and binaries match? Perhaps you have v3.2 headers and v3.4 binaries or
something?
What's the output from the following?
which llvm-config
which clang++
llvm-config --version
clang++ --version
llvm-config --includedir
cat $(llvm-config --includedir)/clang/Basic/Version.inc
grep LLVM_VERSION $(llvm-config --includedir)/llvm/Config/config.h

On Mon, Feb 10, 2014 at 11:29 AM, Erik Rose [email protected]:

I noticed that as well the other day when I tried to upgrade the OS on the
Vagrant box to Saucy. I should have filed it then; you folks really keep me
on my toes. :-) I thought we had tried 3.4, but apparently we did not.
@abbeyj https://github.com/abbeyj?

Reply to this email directly or view it on GitHubhttps://github.com//issues/131#issuecomment-34651062
.

from dxr.

erikrose avatar erikrose commented on June 14, 2024

It's possible I hadn't linked llvm-config to the llvm-config-3.4 at the time. I don't have that box around anymore. Let's see what Chenglin says.

from dxr.

xsyr avatar xsyr commented on June 14, 2024

The error mean the symbol _ZTIN5clang11PPCallbacksE can not be found when load libclang-index-plugin.so, it declare in clang/Lex/Lexer.h. But it isn't exported by clang or libclangLex.a.

My machine:
Linux xsyr-ubuntu 3.11.0-12-generic #19-Ubuntu SMP Wed Oct 9 16:20:46 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

gcc 4.8.1
clang 3.4 build from source

which llvm-config:
/usr/bin/llvm-config

which clang++:
/usr/bin/clang++

llvm-config --version:
3.4svn

clang++ --version:
clang version 3.4 (201150)
Target: x86_64-unknown-linux-gnu
Thread model: posix

llvm-config --includedir:
/usr/include

cat $(llvm-config --includedir)/clang/Basic/Version.inc:

#define CLANG_VERSION 3.4
#define CLANG_VERSION_MAJOR 3
#define CLANG_VERSION_MINOR 4
#if 0
#define CLANG_VERSION_PATCHLEVEL 
#endif

grep LLVM_VERSION $(llvm-config --includedir)/llvm/Config/config.h:

#define LLVM_VERSION_MAJOR 3
#define LLVM_VERSION_MINOR 4

from dxr.

abbeyj avatar abbeyj commented on June 14, 2024

_ZTIN5clang11PPCallbacksE demangles to "typeinfo for clang::PPCallbacks"
but the plugin should have been compiled with -fno-rtti and not be
dependent on typeinfos. What does "llvm-config --cxxflags" produce for
you? If you run "make clean" and then "make" in the dxr/dxr/plugins/clang/
directory can you capture the command being used to compile dxr-index.cpp?

On Tue, Feb 11, 2014 at 10:58 AM, Chenglin Huang
[email protected]:

The error mean the symbol _ZTIN5clang11PPCallbacksE can not be found when
load libclang-index-plugin.so, it declare in clang/Lex/Lexer.h. But it
isn't exported by clang or libclangLex.a.

My machine:
Linux xsyr-ubuntu 3.11.0-12-generic #19-Ubuntu SMP Wed Oct 9 16:20:46 UTC
2013 x86_64 x86_64 x86_64 GNU/Linux

gcc 4.8.1
clang 3.4 build from source

which llvm-config:
/usr/bin/llvm-config

which clang++:
/usr/bin/clang++

llvm-config --version:
3.4svn

clang++ --version:
clang version 3.4 (201150)
Target: x86_64-unknown-linux-gnu
Thread model: posix

llvm-config --includedir:
/usr/include

cat $(llvm-config --includedir)/clang/Basic/Version.inc:

#define CLANG_VERSION 3.4#define CLANG_VERSION_MAJOR 3#define CLANG_VERSION_MINOR 4#if 0#define CLANG_VERSION_PATCHLEVEL #endif

grep LLVM_VERSION $(llvm-config --includedir)/llvm/Config/config.h:

#define LLVM_VERSION_MAJOR 3#define LLVM_VERSION_MINOR 4

Reply to this email directly or view it on GitHubhttps://github.com//issues/131#issuecomment-34768288
.

from dxr.

xsyr avatar xsyr commented on June 14, 2024

@abbeyj You are right, after add -fno-rtti option, everything works fine. Thanks.

from dxr.

abbeyj avatar abbeyj commented on June 14, 2024

Thanks for confirming that that worked. It should have been picked up
automatically though. Would you consider posting the output from
"llvm-config --cxxflags" and from running "make clean; make" so we can try
to track down what went wrong and avoid this problem for other people in
the future?

On Wed, Feb 12, 2014 at 6:11 AM, Chenglin Huang [email protected]:

@abbeyj https://github.com/abbeyj You are right, after add -fno-rttioption, everything works fine. Thanks.

Reply to this email directly or view it on GitHubhttps://github.com//issues/131#issuecomment-34859090
.

from dxr.

xsyr avatar xsyr commented on June 14, 2024

$ llvm-config --cxxflags
-I/usr/include -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wnon-virtual-dtor -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS

from dxr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.