[PATCH] D85715: [clangd] Attempt to allow gRPC & Proobuf static linking

Kirill Bobyrev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 11 05:49:00 PDT 2020


kbobyrev added a comment.

Easy way to play around some of the things:

  bash
  ~/playground/grpc-static-linking kbobyrev at kbobyrev-workstation.muc.corp.google.com
  λ cat HelloGRPC.cpp
  #include <grpc++/grpc++.h>
  #include <iostream>
  
  int main() {
    const auto Channel =
        grpc::CreateChannel("0.0.0.0:5000", grpc::InsecureChannelCredentials());
  }
  
  ~/playground/grpc-static-linking kbobyrev at kbobyrev-workstation.muc.corp.google.com
  λ clang++ HelloGRPC.cpp -L /usr/lib/x86_64-linux-gnu/libgrpc++.a -L /usr/lib/x86_64-linux-gnu/libgrpc++_reflection.so
  /usr/bin/ld: /tmp/HelloGRPC-711a27.o: in function `grpc::CreateChannel(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::shared_ptr<grpc_impl::ChannelCredentials> const&)':
  HelloGRPC.cpp:(.text+0xf7): undefined reference to `grpc_impl::CreateChannelImpl(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::shared_ptr<grpc_impl::ChannelCredentials> const&)'
  /usr/bin/ld: /tmp/HelloGRPC-711a27.o: in function `grpc::InsecureChannelCredentials()':
  HelloGRPC.cpp:(.text+0x127): undefined reference to `grpc_impl::InsecureChannelCredentials()'
  clang: error: linker command failed with exit code 1 (use -v to see invocation)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D85715/new/

https://reviews.llvm.org/D85715



More information about the llvm-commits mailing list