[cfe-dev] Changing the way Clang's driver computes the library search paths on Linux

Miles Bader miles at gnu.org
Mon Oct 3 23:34:45 PDT 2011


Chandler Carruth <chandlerc at google.com>
writes:
> Most of this is committed as of r141000. Both detection of GCC installations
> and the basic system library paths respect system roots, and the pattern
> matches that of GCC as closely as I could, and appears to be compatible with
> the layout of most of the distributions I tested it on.
>
> There is more work to be done to make the triple-detection and installation
> detection more sysroot aware, and more intelligent. There is also work to be
> done to remove several of the distribution-specific kludges that are no
> longer needed, and to properly support the new Debian multiarch structure.
> I'm also seeing oddities in Ubuntu multilib paths that I'm hoping to
> correct, but these were pre-existing.
>
> If folks see issues, please let me know and I'll try to respond promptly.

It certainly doesn't work on debian yet (sorry if you already knew
that; it's not so clear from what you wrote above what "properly
support" means).

   $ clang-trunk -o hw ~/src/hw.c
   /usr/bin/ld: error: cannot open crt1.o: No such file or directory
   /usr/bin/ld: error: cannot open crti.o: No such file or directory
   /usr/bin/ld: error: cannot open crtn.o: No such file or directory
   clang: error: linker command failed with exit code 1 (use -v to see invocation)

   $ clang-trunk --version
   clang version 3.0 (http://llvm.org/git/clang.git f4e541ccecfc06e9818fba83e7ac3a072b1d849e)
   Target: x86_64-unknown-linux-gnu
   Thread model: posix

The above "crt*.o" files seem to exist in two places on this system:

   /usr/lib/x86_64-linux-gnu/
   /usr/lib32/

[presumably for use with 64-bit or 32-bit compiles]

-Miles

-- 
Immortality, n.  A toy which people cry for, And on their knees apply for,
      Dispute, contend and lie for, And if allowed Would be right proud
      Eternally to die for.




More information about the cfe-dev mailing list