fix typo in clang Makefile

Justin Bogner mail at justinbogner.com
Fri May 22 16:50:30 PDT 2015


Mathieu Baudet <mathieubaudet at fb.com> writes:
> Hi,
>
> It would appear that I uncovered a very old typo in the Makefile of clang. For
> some reason it wouldn't break the build until recently (maybe https://llvm.org
> /svn/llvm-project/cfe/trunk at 224924 but I haven’t checked).
>
> See the patch in attachment and the test plan below.
>
> Best,
> Mathieu
>
> ----Test plan——
> 1) before the patch
>
> (a) Building with make fails for me
>
> Under Mac OS 10.10.3 (Xcode 6.2), with llvm, clang, compiler-rt, and libcxx
> checked out from recent git hashes, the following steps fail:
> mkdir llvm-release
> cd llvm-release
> ../llvm/configure --enable-libcpp --enable-cxx11 --disable-assertions
> --enable-optimized --disable-bindings
> make -j 8
>
> /Users/mathieubaudet/git/llvm/tools/clang/lib/Frontend/
> CompilerInvocation.cpp:1046:33: error: unknown type name 'CLANG_LIBDIR_SUFFIX'
>     StringRef ClangLibdirSuffix(CLANG_LIBDIR_SUFFIX);
>
> The reason is that "tools/clang/include/clang/Config/config.h" (which defines
> CLANG_LIBDIR_SUFFIX) is screened by "../llvm/tools/clang/include/clang/Config/
> config.h" (which does not).

Why is there a config.h in ../llvm/tools/clang/include/clang/Config/config.h?
That directory should only contain config.h.in and config.h.cmake. I
think that there's something wrong with your checkout.

> (b) From llvm-release, "make -C tools/clang/lib/Frontend printvars” gives:
>
> llvm[0]: Compile.CXX  :   clang++ -I/Users/mathieubaudet/git/llvm-release/
> include -I/Users/mathieubaudet/git/llvm-release/tools/clang/lib/Frontend -I/
> Users/mathieubaudet/git/llvm/include -I/Users/mathieubaudet/git/llvm/tools/
> clang/lib/Frontend  -DNDEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS
> -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/Users/mathieubaudet/git/llvm/
> tools/clang/lib/Frontend/../../include -I/Users/mathieubaudet/git/llvm-release
> /tools/clang/lib/Frontend/../../include -O3  -stdlib=libc++ -std=c++11
> -fvisibility-inlines-hidden -fno-exceptions -fno-rtti -fno-common -Wcast-qual
> -fno-strict-aliasing   -m64 -pedantic -Wno-long-long -Wall -W
> -Wno-unused-parameter -Wwrite-strings  -Wcovered-switch-default
> -Wno-uninitialized  -Wno-missing-field-initializers -Wno-comment -c
>
> 2) after the patch
>
> (a) Building with make (same steps, from an empty release dir) succeeds.
>
> (b) From llvm-release, "make -C tools/clang/lib/Frontend printvars” gives:
>
> llvm[0]: Compile.CXX  :   clang++ -I/Users/mathieubaudet/git/llvm-release/
> include -I/Users/mathieubaudet/git/llvm-release/tools/clang/lib/Frontend -I/
> Users/mathieubaudet/git/llvm/include -I/Users/mathieubaudet/git/llvm/tools/
> clang/lib/Frontend  -DNDEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS
> -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/Users/mathieubaudet/git/
> llvm-release/tools/clang/lib/Frontend/../../include -I/Users/mathieubaudet/git
> /llvm/tools/clang/lib/Frontend/../../include -O3  -stdlib=libc++ -std=c++11
> -fvisibility-inlines-hidden -fno-exceptions -fno-rtti -fno-common -Wcast-qual
> -fno-strict-aliasing   -m64 -pedantic -Wno-long-long -Wall -W
> -Wno-unused-parameter -Wwrite-strings  -Wcovered-switch-default
> -Wno-uninitialized  -Wno-missing-field-initializers -Wno-comment -c
>
>
> diff --git a/Makefile b/Makefile
> index bbc521f..4e70814 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -52,7 +52,7 @@ ifneq ($(ENABLE_DOCS),1)
>  endif
>  
>  # Set common Clang build flags.
> -CPP.Flags += -I$(PROJ_SRC_DIR)/$(CLANG_LEVEL)/include -I$(PROJ_OBJ_DIR)/$(CLANG_LEVEL)/include
> +CPP.Flags += -I$(PROJ_OBJ_DIR)/$(CLANG_LEVEL)/include -I$(PROJ_SRC_DIR)/$(CLANG_LEVEL)/include
>  ifdef CLANG_VENDOR
>  CPP.Flags += -DCLANG_VENDOR='"$(CLANG_VENDOR) "'
>  endif
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits




More information about the cfe-commits mailing list