fix typo in clang Makefile

Mathieu Baudet mathieubaudet at fb.com
Fri May 22 16:38:13 PDT 2015


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@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).

(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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150522/0db4e8ad/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clang_build_fix.patch
Type: application/octet-stream
Size: 460 bytes
Desc: clang_build_fix.patch
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150522/0db4e8ad/attachment.obj>


More information about the cfe-commits mailing list