I think that some of these problems are well known. For a recent experience you can follow this:
  
      github.com/tensorflow/tensorflow
  
  
    
  
	  
  

  
    
      cannot build TensorFLow with --config=dbg 26
    

    
      
        opened 
        
          
        
        May 6, 2021
      
      


      
        
          
          bas-aarts
        
      
    
  



  when building opensource TensorFlow with
bazel build --config=dbg --config=cuda --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=0" //tensorflow/tools/pip_package:build_pip_package
(for SM 7.0 only)
The build dies at link time with:
ERROR: /home/baarts/tensorflow-GH/tensorflow/python/BUILD:3373:24: Linking...



    subtype: ubuntu/linux
    subtype:bazel
    type:build/install


  
  
    
    
  
  


In the end there is a draft proposal so If you have something technical to share about your experience please leave a comment in the ticket.