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

Jason Kim jasonwkim at google.com
Wed Oct 12 12:43:22 PDT 2011


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<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 ; \
        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
In file included from <LLVMSRC>/lib/Support/APFloat.cpp:15:
In file included from <LLVMSRC>/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<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
; \
               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<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 ; \
               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  :-(

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


On Fri, Sep 16, 2011 at 1:36 PM, Eric Christopher <echristo at apple.com>wrote:

> Author: echristo
> Date: Fri Sep 16 15:36:16 2011
> New Revision: 139934
>
> URL: http://llvm.org/viewvc/llvm-project?rev=139934&view=rev
> Log:
> Have the llvm configure process look for clang, then llvm-gcc, and then gcc
> on all platforms.
>
> Modified:
>    llvm/trunk/autoconf/configure.ac
>    llvm/trunk/configure
>
> Modified: llvm/trunk/autoconf/configure.ac
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/configure.ac?rev=139934&r1=139933&r2=139934&view=diff
>
> ==============================================================================
> --- llvm/trunk/autoconf/configure.ac (original)
> +++ llvm/trunk/autoconf/configure.ac Fri Sep 16 15:36:16 2011
> @@ -967,8 +967,8 @@
>
>  dnl Check for compilation tools
>  AC_PROG_CPP
> -AC_PROG_CC(gcc)
> -AC_PROG_CXX(g++)
> +AC_PROG_CC(clang llvm-gcc gcc)
> +AC_PROG_CXX(clang++ llvm-g++ g++)
>
>  AC_PROG_NM
>  AC_SUBST(NM)
>
> Modified: llvm/trunk/configure
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/configure?rev=139934&r1=139933&r2=139934&view=diff
>
> ==============================================================================
> --- llvm/trunk/configure (original)
> +++ llvm/trunk/configure Fri Sep 16 15:36:16 2011
> @@ -5817,7 +5817,7 @@
>  ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS
> conftest.$ac_ext $LIBS >&5'
>  ac_compiler_gnu=$ac_cv_c_compiler_gnu
>  if test -n "$ac_tool_prefix"; then
> -  for ac_prog in gcc
> +  for ac_prog in clang llvm-gcc gcc
>   do
>     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a
> program name with args.
>  set dummy $ac_tool_prefix$ac_prog; ac_word=$2
> @@ -5861,7 +5861,7 @@
>  fi
>  if test -z "$CC"; then
>   ac_ct_CC=$CC
> -  for ac_prog in gcc
> +  for ac_prog in clang llvm-gcc gcc
>  do
>   # Extract the first word of "$ac_prog", so it can be a program name with
> args.
>  set dummy $ac_prog; ac_word=$2
> @@ -6386,7 +6386,7 @@
>     CXX=$CCC
>   else
>     if test -n "$ac_tool_prefix"; then
> -  for ac_prog in g++
> +  for ac_prog in clang++ llvm-g++ g++
>   do
>     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a
> program name with args.
>  set dummy $ac_tool_prefix$ac_prog; ac_word=$2
> @@ -6430,7 +6430,7 @@
>  fi
>  if test -z "$CXX"; then
>   ac_ct_CXX=$CXX
> -  for ac_prog in g++
> +  for ac_prog in clang++ llvm-g++ g++
>  do
>   # Extract the first word of "$ac_prog", so it can be a program name with
> args.
>  set dummy $ac_prog; ac_word=$2
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20111012/a4ddac45/attachment.html>


More information about the llvm-commits mailing list