[llvm-commits] [llvm] r139934 - in /llvm/trunk: autoconf/configure.ac configure

This CL is probably apropos to the issue described below…

We here in the PNaCL team are building llvm+clang using a specially bootstrapped version of llvm-gcc.
Unfortunately, the configure is picking up system clang even though we force set CC and CXX during the configure process.

llvm[2]: Compiling CommandLine.cpp for Release+Asserts build
if clang++ -I/include -I/lib/Support -I/BuildTools/include -I/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 “/BuildTools/lib/Support/Release+Asserts/CommandLine.d.tmp” -MT “/BuildTools/lib/Support/Release+Asserts/CommandLine.o” -MT “/BuildTools/lib/Support/Release+Asserts/CommandLine.d” /lib/Support/CommandLine.cpp -o /BuildTools/lib/Support/Release+Asserts/CommandLine.o ;
then /bin/mv -f “/BuildTools/lib/Support/Release+Asserts/CommandLine.d.tmp” “/BuildTools/lib/Support/Release+Asserts/CommandLine.d”; else /bin/rm “/BuildTools/lib/Support/Release+Asserts/CommandLine.d.tmp”; exit 1; fi
In file included from /lib/Support/APFloat.cpp:15:
In file included from /lib/Support/Atomic.cpp:14:

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.

In some cases we see both clang, and g++ being invoked during the llvm+clang build process during the building of the BuildTools/ directory(!)

The following snippet is from the SAME build log (!)

if g++ -I/include -I/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” /lib/Support/CrashRecoveryContext.cpp -o <2ndStageObjDir>/BuildTools/lib/Support/Release+Asserts/CrashRecoveryContext.o ;
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

if clang -I/include -I/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” /lib/Support/regcomp.c -o <2ndStageObjDir>/BuildTools/lib/Support/Release+Asserts/regcomp.o ;
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

I might not have noticed at all except for the fact that system clang++ is broken on my cross compiling chroot :frowning:

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.

Thanks
-jason

What's the configure line? Is there some way of duplicating this problem?

-eric