Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

clang 3.8/3.7 does not link with crypto++ ( CryptoPP::DEFAULT_CHANNEL ) #27005

Open Quuxplusone opened 8 years ago

Quuxplusone commented 8 years ago
Bugzilla Link PR27006
Status NEW
Importance P normal
Reported by Gaetano Mendola (mendola@gmail.com)
Reported on 2016-03-20 15:52:58 -0700
Last modified on 2016-03-21 15:47:05 -0700
Version 3.8
Hardware PC Linux
CC hfinkel@anl.gov, llvm-bugs@lists.llvm.org
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also
The following snippet:

#include <cryptopp/hex.h>
int main() {
  CryptoPP::HexDecoder myHexDecoder;
}

does not link with clang++-3.8/clang++3.7 while it links just fine with gcc5.3.1

$ apt-show-versions libcrypto++-dev
libcrypto++-dev:amd64/xenial 5.6.1-9 uptodate

The error:
$ clang++-3.8 main.cpp -lcrypto++
/tmp/main-1ac893.o: In function
`CryptoPP::Unflushable<CryptoPP::Filter>::Flush(bool, int, bool)':
main.cpp:(.text._ZN8CryptoPP11UnflushableINS_6FilterEE5FlushEbib[_ZN8CryptoPP11UnflushableINS_6FilterEE5FlushEbib]+0xf):
undefined reference to `CryptoPP::DEFAULT_CHANNEL'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Quuxplusone commented 8 years ago
I found out that in Ubuntu 16.04 they compiled libcrpyto with thew new ABI:

$ nm /usr/lib/libcryptopp.a | c++filt | grep DEFAULT_CHANNEL
U CryptoPP::DEFAULT_CHANNEL[abi:cxx11]

That's why the linker fails to find the symbol