cyb70289 commented on pull request #11524:
URL: https://github.com/apache/arrow/pull/11524#issuecomment-954477426


   Thanks @lidavidm , the test program is working fine on my side.
   
   One last issue is that grpc reflection is broken on ubuntu.
   grpcurl fails with `server does not support the reflection API`.
   
   From grpc reflection 
[doc](https://github.com/grpc/grpc/blob/master/doc/server_reflection_tutorial.md#enable-server-reflection-in-c-servers):
   ```
   Some platforms (e.g. Ubuntu 11.10 onwards) only link in libraries that
   directly contain symbols used by the application.
   
   On these platforms, LD flag --no-as-needed is needed for dynamic linking
   and --whole-archive is needed for static linking.
   ```
   
   I manually added `-Wl,--whole-archive` before *libgrpc++_reflection.a*, and 
`-Wl,--no-whole-archive` after. It fixes the issue. But I don't know how to 
adapt cmake.
   
   Original link command (doesn't support reflection)
   ```
   /usr/bin/clang++-10 ... \
      -o debug/flight_grpc_example ... \
      grpc_ep-install/lib/libgrpc++.a  \
      grpc_ep-install/lib/libgrpc++_reflection.a \
      ...
   ```
   
   Manually updated link command (supports reflection)
   ```
   /usr/bin/clang++-10 ... \
      -o debug/flight_grpc_example ... \
      grpc_ep-install/lib/libgrpc++.a  \
      -Wl,--whole-archive grpc_ep-install/lib/libgrpc++_reflection.a 
-Wl,--no-whole-archive \
      ...
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to