title: GCC gives "--: unknown option"
body: <p>I am trying to compile the current code: <a href="https://github.com/Cyan4973/zstd" rel="nofollow">https://github.com/Cyan4973/zstd</a></p>
  
  <p>But when running the "make" command I get:</p>
  
  <pre><code>user@pc:~/dev/zstd$ make
  make -C programs
  make[1]: Entering directory `~/dev/zstd/programs'
  cc      -I../lib -DZSTD_VERSION=\"0.4.6\" -I../lib/legacy -I./legacy -DZSTD_LEGACY_SUPPORT=1 -O3   -std=c99 -Wall -Wextra -Wundef -Wshadow -Wcast-qual -Wcast-align -Wstrict-prototypes -Wstrict-aliasing=1   ../lib/zstd_compress.c ../lib/zstd_decompress.c ../lib/fse.c ../lib/huff0.c ../lib/legacy/zstd_v01.c ../lib/legacy/zstd_v02.c ../lib/legacy/zstd_v03.c ../lib/zstd_buffered.c zstdcli.c fileio.c legacy/fileio_legacy.c bench.c xxhash.c datagen.c -o zstd
  /system/bin/sh: /system/bin/sh: --: unknown option
  /system/bin/sh: /system/bin/sh: --: unknown option
  /system/bin/sh: /system/bin/sh: --: unknown option
  /system/bin/sh: /system/bin/sh: --: unknown option
  /system/bin/sh: /system/bin/sh: --: unknown option
  /system/bin/sh: /system/bin/sh: --: unknown option
  /system/bin/sh: /system/bin/sh: --: unknown option
  /system/bin/sh: /system/bin/sh: --: unknown option
  /system/bin/sh: /system/bin/sh: --: unknown option
  /system/bin/sh: /system/bin/sh: --: unknown option
  /system/bin/sh: /system/bin/sh: --: unknown option
  /system/bin/sh: /system/bin/sh: --: unknown option
  /system/bin/sh: /system/bin/sh: --: unknown option
  /system/bin/sh: /system/bin/sh: --: unknown option
  /tmp/ccTBDu2H.o: file not recognized: File truncated
  collect2: ld returned 1 exit status
  make[1]: *** [zstd] Error 1
  make[1]: Leaving directory `~/dev/zstd/programs'
  make: *** [zstdprogram] Error 2
  </code></pre>
  
  <p>I checked the Makefile and does not contain any "--", also <code>/system/bin/sh</code> is not in my computer, and if I copy <code>/bin/sh</code> there it does not change anything.</p>
  
  <p>Debugging the makefile with <code>make -d</code> also does not give any extra info on the problem.</p>
  
  <p>Any ideas?</p>
  
  <p>I have ubuntu 12.04.</p>
  
  <p><strong>EDIT: I discovered it is GCC 4.6.4 giving the error. Witch is not descriptive at all...</strong></p>
  
  <p><strong>EDIT2: I fixed it by using <code>clang</code> in the compilation process (a newer GCC should also fix it), however I leave the question open since I have still no clue what error GCC has. Also it may be useful for future people having the same problem.</strong></p>