LWN.net Logo

LFCS 2012: LLVM and Linux

LFCS 2012: LLVM and Linux

Posted May 1, 2012 22:29 UTC (Tue) by kmccarty (subscriber, #12085)
In reply to: LFCS 2012: LLVM and Linux by jwakely
Parent article: LFCS 2012: LLVM and Linux

Yes, it changed. At one time you needed to hack the source. Then you needed to use --with-cxx-include-root and --with-cxx-include-arch at configure-time, now you just use --with-gcc-toolchain and it does the right thing. It took a while getting there though.

Thanks much for the update, this appears to work as advertised. I guess it is only available in SVN trunk, though, not in the 3.0 release?

I can get rid of my local Clang patches except for a couple lines to disable adding the --no-add-needed linker option when "IsRedhat(Distro)" returns true. (I'm not sure whether this distro autodetection is still enabled when GCC_INSTALL_PREFIX is pre-#define'd, but I didn't want to chance having to do yet another rebuild.)

I was even able to remove a bunch of -isystem flags pointing at GCC headers from the Clang-invoking wrapper scripts I have. I can't say that the relevant parts of Clang source code got very much prettier, though ;-)


(Log in to post comments)

LFCS 2012: LLVM and Linux

Posted May 2, 2012 9:00 UTC (Wed) by jwakely (subscriber, #60262) [Link]

> I guess it is only available in SVN trunk, though, not in the 3.0 release?

Dunno, sorry, I only use trunk

LFCS 2012: LLVM and Linux

Posted May 2, 2012 16:04 UTC (Wed) by kmccarty (subscriber, #12085) [Link]

(Replying to myself)

I was even able to remove a bunch of -isystem flags pointing at GCC headers from the Clang-invoking wrapper scripts I have.

Sadly I spoke too soon -- Clang compiled with --with-gcc-toolchain is not finding omp.h, which is under the GCC installation at <gccroot>/lib/gcc/x86_64-unknown-linux-gnu/4.2.4/include together with a few other things like float.h, varargs.h and limits.h. Ought I to file a bug?

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds