title: Cabal update fails with unix package configure error
body: <p>I have a very old Cabal (1.16.0) installed from my distro's repo (Linux Mint). Today, I tried updating it and got:</p>
  
  <pre><code>cabal install cabal-install -v3
  ...
  unix-2.7.2.2 failed during the configure step. The exception was:
  ExitFailure 1
  zlib-0.6.1.2 failed during the building phase. The exception was:
  ExitFailure 1
  </code></pre>
  
  <p>I also see</p>
  
  <pre><code>checking for suffix of executables... 
  checking whether we are cross compiling... configure: error: in `/tmp/unix-2.7.2.2-2138/unix-2.7.2.2':
  configure: error: cannot run C compiled programs.
  If you meant to cross compile, use `--host'.
  See `config.log' for more details
  sh returned ExitFailure 1
  </code></pre>
  
  <p>After checking the config.log, I see some errors but I am not sure they are related and the configuration failed on them:</p>
  
  <pre><code>Thread model: posix
  gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3) 
  configure:2738: $? = 0
  configure:2727: gcc -V &gt;&amp;5
  gcc: error: unrecognized command line option '-V'
  gcc: fatal error: no input files
  compilation terminated.
  configure:2738: $? = 4
  configure:2727: gcc -qversion &gt;&amp;5
  gcc: error: unrecognized command line option '-qversion'
  gcc: fatal error: no input files
  compilation terminated.
  configure:2738: $? = 4
  configure:2758: checking whether the C compiler works
  configure:2780: gcc -Wl,--hash-size=31 -Wl,--reduce-memory-overheads   conftest.c  &gt;&amp;5
  configure:2784: $? = 0
  configure:2832: result: yes
  configure:2835: checking for C compiler default output file name
  configure:2837: result: a.out
  configure:2843: checking for suffix of executables
  configure:2850: gcc -o conftest -Wl,--hash-size=31 -Wl,--reduce-memory-overheads   conftest.c  &gt;&amp;5
  configure:2854: $? = 0
  configure:2876: result: 
  configure:2898: checking whether we are cross compiling
  configure:2906: gcc -o conftest -Wl,--hash-size=31 -Wl,--reduce-memory-overheads   conftest.c  &gt;&amp;5
  </code></pre>
  
  <p>This is weird (I tried running the gcc.. command and it was also fine). Any help with this error is welcome.</p>