title: use gcc compile a project that shows "undefined reference to `abort'"
body: <p>I wrote a printf myselef that use va_list/va_arg/va_start/va_end/va_arg.</p>
  
  <pre><code>typedef char *va_list;
  #define  _AUPBND                (sizeof (acpi_native_int) - 1)
  #define  _ADNBND                (sizeof (acpi_native_int) - 1)
  #define _bnd(X, bnd)            (((sizeof (X)) + (bnd)) &amp; (~(bnd)))
  #define va_arg(ap, T)           (*(T *)(((ap) += (_bnd (T, _AUPBND))) - (_bnd (T,_ADNBND))))
  #define va_end(ap)              (void) 0
  #define va_start(ap, A)         (void) ((ap) = (((char *) &amp;(A)) + (_bnd (A,_AUPBND))))
  </code></pre>
  
  <p>At first,I copy these macros from linux kernel and the printf can print 32-bit integer correct but cannot print 64-bit integer and print double/float may fail or collapse.Then I check the code and I guess the va_* may have errors,so I use __builtin_va_* instead of kernel's va_*.</p>
  
  <pre><code>typedef __builtin_va_list va_list;
  #define va_start(v,l)   __builtin_va_start(v,l)
  #define va_end(v)       __builtin_va_end(v)
  #define va_arg(v,l)     __builtin_va_arg(v,l)
  </code></pre>
  
  <p>But gcc prompt "undefined reference to `abort'",so I write a empty abort() and myprintf works corretly.
  My questions are:</p>
  
  <ol>
  <li>Why linux kernel's <code>va_list/va_arg/va_start/va_end/va_arg</code> can not used for <code>printf</code> 64-bit integer and double/float?</li>
  <li>When I used <code>__builtin_va_start/__builtin_va_arg/__builtin_va_end/__builtin_va_list</code>, why gcc prompt "undefined reference to <code>abort'"? But I can not find the definition of</code>__builtin_va_*`, where're their definition?</li>
  </ol>