Repository: tensorflow
Issue: Tensorflow build without boringssl on Power architecture
Labels: stat:awaiting tensorflower,type:feature,type:build/install

Hello,
We are trying to build tensorflow 2.16.1 without boringssl as boringssl no more supports Power/s390x architecture. 

TF has a direct dependency on boringssl as well as curl and grpc which in turn pulls boringssl. 
For this, our approach is to use TF_SYSTEM_LIBS set to curl, boringssl and grpc and remove direct bazel dependency in tensorflow/workspace2.bzl for boringssl.
I'd first tried to use only boringssl, curl and grpc from system libraries. After doing some changes in the TF's source code, I was able to compile almost 95% of code but linking of libtensorflow_cc.so failed as grpc being used from system is probably not compatible with the abseil-cpp built by bazel. Errors were as follows -

```
ERROR: /home/nishi/ppc/tensorflow/tensorflow/BUILD:1314:21: Linking tensorflow/libtensorflow_cc.so.2.16.1 failed: (Exit 1): gcc failed: error executing command (from target //tensorflow:libtensorflow_cc.so.2.16.1) /opt/rh/gcc-toolset-12/root/usr/bin/gcc @bazel-out/ppc-opt/bin/tensorflow/libtensorflow_cc.so.2.16.1-2.params
bazel-out/ppc-opt/bin/tensorflow/core/debug/_objs/debug_service_cc_grpc_proto/debug_service.grpc.pb.pic.o:debug_service.grpc.pb.cc:function grpc::internal::ClientCallbackReaderWriterImpl<tensorflow::Event, tensorflow::EventReply>::Read(tensorflow::EventReply*): error: undefined reference to 'absl::lts_20211102::Mutex::Lock()'
bazel-out/ppc-opt/bin/tensorflow/core/debug/_objs/debug_service_cc_grpc_proto/debug_service.grpc.pb.pic.o:debug_service.grpc.pb.cc:function grpc::internal::ClientCallbackReaderWriterImpl<tensorflow::Event, tensorflow::EventReply>::Read(tensorflow::EventReply*): error: undefined reference to 'absl::lts_20211102::Mutex::Unlock()'
bazel-out/ppc-opt/bin/tensorflow/core/debug/_objs/debug_service_cc_grpc_proto/debug_service.grpc.pb.pic.o:debug_service.grpc.pb.cc:function grpc::internal::ClientCallbackReaderWriterImpl<tensorflow::Event, tensorflow::EventReply>::Read(tensorflow::EventReply*): error: undefined reference to 'absl::lts_20211102::Mutex::Unlock()'
bazel-out/ppc-opt/bin/tensorflow/core/debug/_objs/debug_service_cc_grpc_proto/debug_service.grpc.pb.pic.o:debug_service.grpc.pb.cc:function grpc::internal::ClientCallbackReaderWriterImpl<tensorflow::Event, tensorflow::EventReply>::Write(tensorflow::Event const*, grpc::WriteOptions): error: undefined reference to 'absl::lts_20211102::Mutex::Lock()'
bazel-out/ppc-opt/bin/tensorflow/core/debug/_objs/debug_service_cc_grpc_proto/debug_service.grpc.pb.pic.o:debug_service.grpc.pb.cc:function grpc::internal::ClientCallbackReaderWriterImpl<tensorflow::Event, tensorflow::EventReply>::Write(tensorflow::Event const*, grpc::WriteOptions): error: undefined reference to 'absl::lts_20211102::Mutex::Unlock()'
```
After investigating I found that system level abseil-cpp library has these symbols but TF doesn't use it probably and it uses its own built abseil-cpp. Explicitly adding options like `-labsl_synchronization -L/usr/lib64` in  `@bazel-out/ppc-opt/bin/tensorflow/libtensorflow_cc.so.2.16.1-2.params` worked and I could see libtensorflow_cc.so generated. But probably this would be fusion of two versions of abseil-cpp which is not guaranteed to work.

Next I tried to use abseil-cpp as well from system by modifying TF_SYSTEM_LIBS. But it looks like absl BUILD files at `third_party/absl/` are absolete and not compatible with TF's code anymore. There were many problems, I fixed a few but there are actually many. So, I want to understand if TF community will be supporting/updating BUILD files for abseil-cpp.

Also, if anyone could help us in understanding if we can replace boringssl with System OpenSSL in Tensorflow, it would be of great help.