<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:12pt"><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt;">I have been working on building clang 3.4 standalone, and thus have gone over its bundled top-level CMakeLists.txt very carefully.</div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt;"><br></div><div style="font-family: arial, helvetica, sans-serif; font-size: 16px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;">There are numerous issues with this file, English, embedded comments, and logic. A few examples:</div><div style="font-family: arial, helvetica, sans-serif; font-size: 16px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><br></div><div style="background-color: transparent;"><font face="arial, helvetica, sans-serif"><span style="font-weight: bold;">English</span>: </font></div><div
style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16px; font-family: arial, helvetica, sans-serif; font-style: normal;"><span style="background-color: transparent;"><font face="arial, helvetica, sans-serif"><br></font></span></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16px; font-family: arial, helvetica, sans-serif; font-style: normal;"><span style="background-color: transparent;"><font face="arial, helvetica, sans-serif"># If we are not building as a part of LLVM, build Clang as an</font></span></div><div style="background-color: transparent;"><font face="arial, helvetica, sans-serif"># standalone project, using LLVM as an external library:</font></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16px; font-family: arial, helvetica, sans-serif; font-style: normal;"><font face="arial, helvetica, sans-serif"><br></font></div><div style="background-color: transparent;
color: rgb(0, 0, 0); font-size: 16px; font-family: arial, helvetica, sans-serif; font-style: normal;"><font face="arial, helvetica, sans-serif">The above should be revised at least to</font></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16px; font-family: arial, helvetica, sans-serif; font-style: normal;"><font face="arial, helvetica, sans-serif"><br></font></div><div style="font-size: 16px; background-color: transparent; font-family: arial, helvetica, sans-serif;"><span style="background-color: transparent;"># If clang is not built as a part of LLVM, <span style="font-style: italic;">then</span> Clang <span style="font-style: italic;">is built </span>as an</span></div><div style="background-color: transparent; font-size: 16px; font-family: arial, helvetica, sans-serif;"><font face="arial, helvetica, sans-serif"></font></div><div style="background-color: transparent;"><font face="arial, helvetica, sans-serif">#
standalone project, using LLVM as an external library:</font></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16px; font-family: arial, helvetica, sans-serif; font-style: normal;"><font face="arial, helvetica, sans-serif"><br></font></div><div style="background-color: transparent; font-style: normal; font-size: 16px; font-family: arial, helvetica, sans-serif; color: rgb(0, 0, 0);"><font face="arial, helvetica, sans-serif"><span style="font-weight: bold;">Embedded comments</span>:</font></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16px; font-family: arial, helvetica, sans-serif; font-style: normal;"><font face="arial, helvetica, sans-serif"><br></font></div><div style="background-color: transparent;"><span style="font-family: arial, helvetica, sans-serif;"> 9 set(CLANG_PATH_TO_LLVM_BUILD "" CACHE PATH</span></div><div style="background-color:
transparent;"><span style="font-family: arial, helvetica, sans-serif;"> 10 "Path to the directory where LLVM was built or installed.")</span></div><div><br></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16px; font-family: arial, helvetica, sans-serif; font-style: normal;"><span style="font-family: arial, helvetica, sans-serif;">where 9 and 10 are line numbers of the CMakeLists.txt.</span></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16px; font-family: arial, helvetica, sans-serif; font-style: normal;"><span style="font-family: arial, helvetica, sans-serif;"><br></span></div><div style="font-size: 16px; font-family: arial, helvetica, sans-serif; background-color: transparent;"><span style="color: rgb(0, 0, 0); font-style: normal;"><span style="font-family: arial, helvetica, sans-serif;">OK. On a linux system, normally you specify a INSTALL_PREFIX or
simply PREFIX for a software package. Also, depending on the distribution, different parts of LLVM are installed at different places, e.g. all cmake modules go to /usr/share/llvm/cmake, executables go to /usr/bin etc. So, what do you mean by "</span>the directory where LLVM was built or </span><span style="font-style: italic; color: rgb(255, 0, 0);">installed</span>"?</div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16px; font-family: arial, helvetica, sans-serif; font-style: normal;"><br></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16px; font-family: arial, helvetica, sans-serif; font-style: normal;"><span style="font-weight: bold;">Logic</span>:</div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16px; font-family: arial, helvetica, sans-serif; font-style: normal;"><br></div><div style="background-color: transparent; color: rgb(0, 0, 0);
font-size: 16px; font-family: arial, helvetica, sans-serif; font-style: normal;">Despite the fact that at the following statements (CMakeLists.txt line numbers given):</div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16px; font-family: arial, helvetica, sans-serif; font-style: normal;"><br></div><div style="background-color: transparent;"><span style="font-family: arial, helvetica, sans-serif;"> 45 </span></div><div style="background-color: transparent;"><span style="font-family: arial, helvetica, sans-serif;"> 46 set(LLVM_MAIN_INCLUDE_DIR "${LLVM_MAIN_SRC_DIR}/include")</span></div><div style="background-color: transparent;"><span style="font-family: arial, helvetica, sans-serif;"> 47 set(LLVM_BINARY_DIR ${CMAKE_BINARY_DIR})</span></div><div><br></div><div>The two files:</div><div style="background-color: transparent;"><ul><li><span style="font-family:
arial, helvetica, sans-serif; background-color: transparent;">include/clang/Driver/Options.td</span><br></li><li><span style="font-family: arial, helvetica, sans-serif; background-color: transparent;">include/clang/Driver/CC1AsOptions.td</span><br></li></ul></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16px; font-family: 'Times New Roman'; font-style: normal;"><span style="font-family: arial, helvetica, sans-serif; background-color: transparent;">are not aware of them. Thus, standalone build for clang 3.4 would fail unless the include statement in the two files are edited - hackish and kludgy x-(</span><br></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16px; font-family: arial, helvetica, sans-serif; font-style: normal;"><span><span style="font-family: arial, helvetica, sans-serif;"><br></span></span></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16px;
font-family: arial, helvetica, sans-serif; font-style: normal;"><span><span style="font-family: arial, helvetica, sans-serif;">I would be delighted to report more of such defects, but what is the protocol to submit them? I don't work on LLVM as a regular part of my job :(</span></span></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16px; font-family: arial, helvetica, sans-serif; font-style: normal;"><span><span style="font-family: arial, helvetica, sans-serif;"><br></span></span></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16px; font-family: arial, helvetica, sans-serif; font-style: normal;"><span><span style="font-family: arial, helvetica, sans-serif;">-- Zack</span></span></div></div></body></html>