fix typo in clang Makefile

Mathieu Baudet mathieubaudet at fb.com
Fri May 22 17:11:48 PDT 2015


Damn, that’s right. I did a "git clean -xdf” in llvm but not in clang. So I guess it is only about this Makefile slightly more robust.

On May 22, 2015, at 4:50 PM, Justin Bogner <mail at justinbogner.com<mailto:mail at justinbogner.com>> wrote:

Mathieu Baudet <mathieubaudet at fb.com<mailto: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://urldefense.proofpoint.com/v1/url?u=https://llvm.org/&k=ZVNjlDMF0FElm4dQtryO4A%3D%3D%0A&r=DySJRSwIPwJgrlWcFuOjhjgW2TvEV7mDN%2BhK5RWHkOA%3D%0A&m=6Uk7mqELOepnmwTUZPn4pPBZ5MWWqnsfC34W05M5p0o%3D%0A&s=5af656f21e5d4a4b7c1bee0b3d6cc9372457dfa1230c8830fdd6ac20bab2cc64
/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<mailto:cfe-commits at cs.uiuc.edu>
https://urldefense.proofpoint.com/v1/url?u=http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits&k=ZVNjlDMF0FElm4dQtryO4A%3D%3D%0A&r=DySJRSwIPwJgrlWcFuOjhjgW2TvEV7mDN%2BhK5RWHkOA%3D%0A&m=6Uk7mqELOepnmwTUZPn4pPBZ5MWWqnsfC34W05M5p0o%3D%0A&s=a93eb8ca76932741ece069faaa57e2dc492a491fb481d62d37b8f54dbe9cf0bd

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150523/091a5c17/attachment.html>


More information about the cfe-commits mailing list