[llvm-commits] [PATCH] Configure: if we compile with clang, check that it is not broken
Dmitri Gribenko
gribozavr at gmail.com
Tue Jan 8 07:34:10 PST 2013
Hello,
Some linux distibutions (for example, Mageia 2, Fedora 17) ship Clang
that is essentially broken for the end user. Clang can not find or
compile libstdc++ headers.
The issue is that our configure prefers clang over gcc, thus selecting
a broken Clang when a working GCC is available.
The attached patch detects the issue by compiling a simple program.
If it does not compile -- configure stops with an error suggesting the
user to select a different compiler.
Unfortunately, my autoconf skills are not good enough to implement a
better strategy -- to find the first *working* compiler. But the
current patch to reject a broken compiler is a strict improvement.
Edward Diener tested this on affected platforms. [1]
Please review. My biggest concern is about including cxxabi.h unconditionally.
Dmitri
[1] http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-January/057716.html
--
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: configure-error-on-broken-clang-v1.patch
Type: application/octet-stream
Size: 4208 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130108/4cd77386/attachment.obj>
More information about the llvm-commits
mailing list