<div>This CL is probably apropos to the issue described below..</div><div><br></div><div>We here in the PNaCL team are building llvm+clang using a specially bootstrapped version of llvm-gcc.</div><div>Unfortunately, the configure is picking up system clang even though we force set CC and CXX during the configure process.  </div>

<div><br></div><div><div><br></div><div><font class="Apple-style-span" size="1" face="'courier new', monospace">llvm[2]: Compiling CommandLine.cpp for Release+Asserts build</font></div><div><font class="Apple-style-span" size="1" face="'courier new', monospace">if  clang++ -I<LLVMSRC>/include -I<LLVMSRC>/lib/Support -I<ObjDir>/BuildTools/include -I<ObjDir>/BuildTools/lib/Support  -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -O3 -fomit-frame-pointer -fno-exceptions -fPIC -Woverloaded-virtual -Wcast-qual    -Wall -W -Wno-unused-parameter -Wwrite-strings -c -MMD -MP -MF "<ObjDir>/BuildTools/lib/Support/Release+Asserts/CommandLine.d.tmp" -MT "<ObjDir>/BuildTools/lib/Support/Release+Asserts/CommandLine.o" -MT "<ObjDir>/BuildTools/lib/Support/Release+Asserts/CommandLine.d" <LLVMSRC>/lib/Support/CommandLine.cpp -o <ObjDir>/BuildTools/lib/Support/Release+Asserts/CommandLine.o ; \</font></div>

<div><font class="Apple-style-span" size="1" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">  </span>        then /bin/mv -f "<ObjDir>/BuildTools/lib/Support/Release+Asserts/CommandLine.d.tmp" "<ObjDir>/BuildTools/lib/Support/Release+Asserts/CommandLine.d"; else /bin/rm "<ObjDir>/BuildTools/lib/Support/Release+Asserts/CommandLine.d.tmp"; exit 1; fi</font></div>

<div><font class="Apple-style-span" size="1" face="'courier new', monospace">In file included from <LLVMSRC>/lib/Support/APFloat.cpp:15:</font></div><div><font class="Apple-style-span" size="1" face="'courier new', monospace">In file included from <LLVMSRC>/lib/Support/Atomic.cpp:14:</font></div>

</div><div><br></div>
<div><br></div><div>I've seen a similar problem once before in llvm side where it was picking up a sytem llvm-gcc to run the tests in lieu of the on just built.</div><div>  </div><div><div>In some cases we see both clang, and g++ being invoked during the llvm+clang build process during the building of the BuildTools/  directory(!)</div>


</div><div>The following snippet is from the SAME build log (!)</div><div><br></div><div><div><div><font face="'courier new', monospace" size="1">if  g++ -I<LLVMSRC>/include -I<LLVMSRC>/lib/Support -I<2ndStageObjDir>/BuildTools/include -I<2ndStageObjDir>/BuildTools/lib/Support  -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -O3 -fomit-frame-pointer -fno-exceptions -fPIC -Woverloaded-virtual -Wcast-qual    -Wall -W -Wno-unused-parameter -Wwrite-strings -c -MMD -MP -MF "<2ndStageObjDir>/BuildTools/lib/Support/Release+Asserts/CrashRecoveryContext.d.tmp" -MT "<2ndStageObjDir>/BuildTools/lib/Support/Release+Asserts/CrashRecoveryContext.o" -MT "<2ndStageObjDir>/BuildTools/lib/Support/Release+Asserts/CrashRecoveryContext.d" <LLVMSRC>/lib/Support/CrashRecoveryContext.cpp -o <2ndStageObjDir>/BuildTools/lib/Support/Release+Asserts/CrashRecoveryContext.o ; \</font></div>


<div><font face="'courier new', monospace" size="1">               then /bin/mv -f "<2ndStageObjDir>/BuildTools/lib/Support/Release+Asserts/CrashRecoveryContext.d.tmp" "<2ndStageObjDir>/BuildTools/lib/Support/Release+Asserts/CrashRecoveryContext.d"; else /bin/rm "<2ndStageObjDir>/BuildTools/lib/Support/Release+Asserts/CrashRecoveryContext.d.tmp"; exit 1; fi</font></div>


<div><font face="'courier new', monospace" size="1">...</font></div><div><font face="'courier new', monospace" size="1">if  clang -I<LLVMSRC>/include -I<LLVMSRC>/lib/Support -I<2ndStageObjDir>/BuildTools/include -I<2ndStageObjDir>/BuildTools/lib/Support  -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -O3 -fomit-frame-pointer -fPIC    -Wall -W -Wno-unused-parameter -Wwrite-strings -c -MMD -MP -MF "<2ndStageObjDir>/BuildTools/lib/Support/Release+Asserts/regcomp.d.tmp" -MT "<2ndStageObjDir>/BuildTools/lib/Support/Release+Asserts/regcomp.o" -MT "<2ndStageObjDir>/BuildTools/lib/Support/Release+Asserts/regcomp.d" <LLVMSRC>/lib/Support/regcomp.c -o <2ndStageObjDir>/BuildTools/lib/Support/Release+Asserts/regcomp.o ; \</font></div>


<div><font face="'courier new', monospace" size="1">               then /bin/mv -f "<2ndStageObjDir>/BuildTools/lib/Support/Release+Asserts/CrashRecoveryContext.d.tmp" "<2ndStageObjDir>/BuildTools/lib/Support/Release+Asserts/CrashRecoveryContext.d"; else /bin/rm "<2ndStageObjDir>/BuildTools/lib/Support/Release+Asserts/CrashRecoveryContext.d.tmp"; exit 1; fi</font></div>


</div><div><br></div><div>I might not have noticed at all except for the fact that system clang++ is broken on my cross compiling chroot  :-(</div><div><br></div><div>What is a reliable way to set  CC and CXX during the build process? setting CC/CXX_FOR_BUILD and BUILD_CC/CXX to the correct native compiler during the configure process did not seem to do what I expected.</div>

<div>
<br></div><div>Thanks</div><div>-jason</div><div><br></div><div><br></div><div class="gmail_quote">On Fri, Sep 16, 2011 at 1:36 PM, Eric Christopher <span dir="ltr"><<a href="mailto:echristo@apple.com" target="_blank">echristo@apple.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: echristo<br>
Date: Fri Sep 16 15:36:16 2011<br>
New Revision: 139934<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=139934&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=139934&view=rev</a><br>
Log:<br>
Have the llvm configure process look for clang, then llvm-gcc, and then gcc<br>
on all platforms.<br>
<br>
Modified:<br>
    llvm/trunk/autoconf/<a href="http://configure.ac" target="_blank">configure.ac</a><br>
    llvm/trunk/configure<br>
<br>
Modified: llvm/trunk/autoconf/<a href="http://configure.ac" target="_blank">configure.ac</a><br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/configure.ac?rev=139934&r1=139933&r2=139934&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/configure.ac?rev=139934&r1=139933&r2=139934&view=diff</a><br>



==============================================================================<br>
--- llvm/trunk/autoconf/<a href="http://configure.ac" target="_blank">configure.ac</a> (original)<br>
+++ llvm/trunk/autoconf/<a href="http://configure.ac" target="_blank">configure.ac</a> Fri Sep 16 15:36:16 2011<br>
@@ -967,8 +967,8 @@<br>
<br>
 dnl Check for compilation tools<br>
 AC_PROG_CPP<br>
-AC_PROG_CC(gcc)<br>
-AC_PROG_CXX(g++)<br>
+AC_PROG_CC(clang llvm-gcc gcc)<br>
+AC_PROG_CXX(clang++ llvm-g++ g++)<br>
<br>
 AC_PROG_NM<br>
 AC_SUBST(NM)<br>
<br>
Modified: llvm/trunk/configure<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/configure?rev=139934&r1=139933&r2=139934&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/configure?rev=139934&r1=139933&r2=139934&view=diff</a><br>



==============================================================================<br>
--- llvm/trunk/configure (original)<br>
+++ llvm/trunk/configure Fri Sep 16 15:36:16 2011<br>
@@ -5817,7 +5817,7 @@<br>
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'<br>
 ac_compiler_gnu=$ac_cv_c_compiler_gnu<br>
 if test -n "$ac_tool_prefix"; then<br>
-  for ac_prog in gcc<br>
+  for ac_prog in clang llvm-gcc gcc<br>
   do<br>
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.<br>
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2<br>
@@ -5861,7 +5861,7 @@<br>
 fi<br>
 if test -z "$CC"; then<br>
   ac_ct_CC=$CC<br>
-  for ac_prog in gcc<br>
+  for ac_prog in clang llvm-gcc gcc<br>
 do<br>
   # Extract the first word of "$ac_prog", so it can be a program name with args.<br>
 set dummy $ac_prog; ac_word=$2<br>
@@ -6386,7 +6386,7 @@<br>
     CXX=$CCC<br>
   else<br>
     if test -n "$ac_tool_prefix"; then<br>
-  for ac_prog in g++<br>
+  for ac_prog in clang++ llvm-g++ g++<br>
   do<br>
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.<br>
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2<br>
@@ -6430,7 +6430,7 @@<br>
 fi<br>
 if test -z "$CXX"; then<br>
   ac_ct_CXX=$CXX<br>
-  for ac_prog in g++<br>
+  for ac_prog in clang++ llvm-g++ g++<br>
 do<br>
   # Extract the first word of "$ac_prog", so it can be a program name with args.<br>
 set dummy $ac_prog; ac_word=$2<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>