title: how to identify all libc calls at compile time?
body: <p>I'd like to do some analysis of C code on Linux/BSD to see the frequency of library functions being used. So basically I'd like to compile the code and after the compilation step somehow print out all the functions this code uses. For example: "chown, mmap, etc, etc". I want to run this over a few thousand open source applications so looking for automation.</p>
  
  <p>Is there a way to do this?</p>
  
  <p>Note. dynamic instrumentation like strace or ptrace wouldn't work for me as I cannot run all the applications and even if i did i may not go through every single code path so might miss some calls that are possible (ie. calls that only happen in error conditions)</p>