title: How to force Bazel to use gcc?
body: <blockquote>
    <p>Ubuntu 17.10</p>
    
    <p>GCC Version: 5.4</p>
    
    <p>Bazel Version: 0.9.0</p>
    
    <p>TensorFlow: r1.5</p>
    
    <p>CUDA 8.0 / cuDNN 6 / GTX 1080 Ti</p>
  </blockquote>
  
  <p>How do I make Bazel use gcc for building TensorFlow from source?</p>
  
  <p>While building, its running into compiler errors like: </p>
  
  <pre><code>error: 'errno' was not declared in this scope
  while (nanosleep(&amp;ts, &amp;ts) != 0 &amp;&amp; errno == EINTR) {}
  </code></pre>
  
  <p>Setting --verbose_failures flag, it shows that its not using /usr/bin/gcc-5 or /usr/bin/gcc for compiling</p>
  
  <pre><code>external/local_config_cuda/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -fPIE -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 -DNDEBUG -ffunction-sections -fdata-sections -g0 -DGEMMLOWP_ALLOW_SLOW_SCALAR_FALLBACK '-march=native' '-std=c++11' -g0 -MD -MF
  </code></pre>
  
  <p>Searching online, I found that the path to gcc and CC, CXX variables must be set in tools/cpp/CROSSTOOL. But where exactly is tools/cpp/CROSSTOOL?? How do I force bazel to use gcc-5?</p>