title: Error trying to link c++ code using llvm 4.2.1
body: <p>I am trying to convert some gpl code(not mine!) from C++ to C so I can use it in a c-only project.  I read about llvm and got excited but I am running into a linker error that I have no idea how to fix:</p>
  
  <p>the error is:</p>
  
  <pre><code>Intrinsic prototype has incorrect number of arguments!
  void (i8*, i8*, i64, i32, i1)* @llvm.memmove.p0i8.p0i8.i64
  Broken module found, compilation aborted!
  Stack dump:
  0.  Running pass 'Function Pass Manager' on module 'ld-temp.o'.
  1.  Running pass 'Module Verifier' on function '@_ZNSt15__copy_backwardILb1ESt26random_access_iterator_tagE8__copy_bIxEEPT_PKS3_S6_S4_'
  </code></pre>
  
  <p>Anyone ever see this before?  Any idea what could cause it?</p>
  
  <p>Here is the commands I used to get this far:</p>
  
  <pre><code>dhcp-100-140:src joeltucci$ llvm-g++ msb.C -c -emit-llvm
  dhcp-100-140:src joeltucci$ llvm-g++ rabincmd.C -c -emit-llvm
  In file included from rabincmd.C:27:
  rabinpoly.h: In member function ‘u_int64_t rabinpoly::append8(u_int64_t, u_char) const’:
  rabinpoly.h:56: warning: format ‘%d’ expects type ‘int’, but argument 3 has type ‘long int’
  rabincmd.C: In function ‘void printChunkContents(u_int64_t, const unsigned char*, int)’:
  rabincmd.C:91: warning: too few arguments for format
  rabincmd.C: In member function ‘virtual void ExtractChunkProcessor::internalCompleteChunk(u_int64_t, u_int64_t)’:
  rabincmd.C:547: warning: deprecated conversion from string constant to ‘char*’
  rabincmd.C:551: warning: deprecated conversion from string constant to ‘char*’
  dhcp-100-140:src joeltucci$ llvm -ld m
  mkrabincmd.sh      msb.C              msb.o              
  mkverboseRabin.sh  msb.h              
  dhcp-100-140:src joeltucci$ llvm -ld *.o -o program
  -bash: llvm: command not found
  dhcp-100-140:src joeltucci$ llvm-ld *.o -o program
  -bash: llvm-ld: command not found
  dhcp-100-140:src joeltucci$ llvm-
  llvm-cpp-4.2  llvm-g++      llvm-g++-4.2  llvm-gcc      llvm-gcc-4.2  
  dhcp-100-140:src joeltucci$ llvm-g++ *.o -o program
  collect2: ld terminated with signal 6 [Abort trap]
  Intrinsic prototype has incorrect number of arguments!
  void (i8*, i8*, i64, i32, i1)* @llvm.memmove.p0i8.p0i8.i64
  Broken module found, compilation aborted!
  Stack dump:
  0.  Running pass 'Function Pass Manager' on module 'ld-temp.o'.
  1.  Running pass 'Module Verifier' on function '@_ZNSt15__copy_backwardILb1ESt26random_access_iterator_tagE8__copy_bIxEEPT_PKS3_S6_S4_'
  dhcp-100-140:src joeltucci$ llvm-gcc --version
  i686-apple-darwin10-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2332.3)
  Copyright (C) 2007 Free Software Foundation, Inc.
  This is free software; see the source for copying conditions.  There is NO
  warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  
  dhcp-100-140:src joeltucci$ 
  dhcp-100-140:src joeltucci$ 
  dhcp-100-140:src joeltucci$ 
  dhcp-100-140:src joeltucci$ llvm-g++ *.o -o program
  llvm-g++      llvm-g++-4.2  
  dhcp-100-140:src joeltucci$ llvm-gcc-4.2 --version
  i686-apple-darwin10-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2332.3)
  Copyright (C) 2007 Free Software Foundation, Inc.
  This is free software; see the source for copying conditions.  There is NO
  warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  </code></pre>