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

Attachment: clang_build_fix.patch
Description: clang_build_fix.patch

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to