Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic clang compilation fails #944

Closed
farao opened this issue Jun 18, 2018 · 3 comments
Closed

Automatic clang compilation fails #944

farao opened this issue Jun 18, 2018 · 3 comments

Comments

@farao
Copy link

farao commented Jun 18, 2018

Hi,

I want to use infer on (fedora) linux and thus the only available options seems to be building from source. Unfortunately, building from source apparently means that clang must be compiled as well.

  1. When I choose this option, and wait a long time for clang to compile, linking of clang fails with a lot of error like this:
  • /usr/bin/ld: ../../lib/libLLVMAArch64CodeGen.a(AArch64TargetTransformInfo.cpp.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
  • /usr/bin/ld: ../../lib/libLLVMAArch64CodeGen.a(AArch64SIMDInstrOpt.cpp.o): relocation R_X86_64_32S against `.text' can not be used when making a shared object; recompile with -fPIC
  • ...
    Why is this failing?
  1. The clang version that is being compiled is the same as the clang on my system (6.0) - can I just tell the infer installation routine to use the system clang?

Thanks,
Marius

@jvillard
Copy link
Contributor

jvillard commented Jul 2, 2018

  1. Looks similar to build_infer.sh failed on Ubuntu 18.04 #942. Can you try NO_CMAKE_STRIP=1 ./build-infer.sh?
  2. I think it's possibly but would be non-trivial work. Note that the version in infer is clang 7, not 6. You can try by messing with the CLANG_PREFIX, CLANG_INCLUDES, and CLANG variables when building the plugin manually (make -C facebook-clang-plugins/libtooling CLANG_PREFIX=... ...), possibly with LLVM_CXXFLAGS and LLVM_LDFLAGS too. Check out this Makefile.config in facebook-clong-plugins. The version on your system will need some symbols that are usually stripped by distributions though (in my experience). Also, clang 7 still being in development, it's unlikely that your distribution's version is at the same version exactly and some changing to the plugin may be necessary.

@rbartlensky
Copy link

@farao I had a similar problem, and I've done two things:

@farao
Copy link
Author

farao commented Jul 26, 2018

Thanks, this is resolving my issue. And yes, choosing another CLANG_TMP_DIR was also very helpful - I think this should have another default than /tmp because /tmp is in most distributions now backed by ram and not disk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants