[cfe-dev] driver search paths and library discovery.
    Iain Sandoe 
    iain at codesourcery.com
       
    Thu Apr  9 05:08:11 PDT 2015
    
    
  
Hi Bob,
A short while ago, I was working on some test-code which uses -nostdlib but requires that the libclang_rt.osx.a is used to provide some built-in support.  Essentially, a requirement to be able to find the relevant libclang_rt.a for the compiler-under-test.
On OS X (at least) it seems that:
clang -print-search-dirs
produces a single library path pointing to the resource dir.  That is, it points neither to the "lib" dir containing dylibs nor to the <resource>/lib/darwin/ dir which contains the lib<clang,compiler>_rt.a.
This means that 
clang -print-file-name=libclang_rt.osx.a fails, 
whereas:
 clang -print-file-name=lib/darwin/libclang_rt.osx.a suceeds.
Jim and I were chatting about this on irc, but couldn't come up with a reason why it's done this way - can you shed some light?
thanks
Iain
    
    
More information about the cfe-dev
mailing list