title: ar on an existing .a file?
body: <p>Essentially, what I want to do is this:</p>
  
  <pre><code>gcc foo.c -o foo.o
  ar rcs foo.a foo.o
  gcc bar.c -o boo.o
  ar rcs bar.a bar.o foo.a
  </code></pre>
  
  <p>I want to archive both an object and a static library into another static library. Unfortunately, the last command doesn't end up containing foo.o (it contains bar.o and foo.a), so when I get to the linking stage, the linker can't find the symbols from foo.o.</p>
  
  <p>Is there a way to do what I want here? I'm doing all of this out of make, so I'm looking for a solution that doesn't involve extracting &amp; re-archiving the objects (which seems kinda painful). Is there a way to make this kind of "archive from another archive" setup work?</p>