<div dir="ltr"><div class="gmail_quote">Package: aspectc++,llvm-toolchain-3.4<br>X-Debbugs-CC: <a href="mailto:aspectc-developers@aspectc.org">aspectc-developers@aspectc.org</a>, <a href="mailto:olaf.spinczyk@tu-dortmund.de">olaf.spinczyk@tu-dortmund.de</a><br>
<br><br>Hi,</div><div class="gmail_quote"><br><div dir="ltr"><div class="gmail_default" style="font-family:'courier new',monospace;display:inline">​​</div>Backround:<br>AspectC++ is a language extension to C++ that brings AspectJ-like AOP features to C++. For more information, please see the upstream homepage at <a href="http://aspectc.org">http://aspectc.org</a><br>
<br></div><div dir="ltr">Upstream has asked me to explore the options for updating the aspectc++ package to the AspectClang<div class="gmail_default" style="font-family:'courier new',monospace;display:inline">​ ​</div>
branch,<div class="gmail_default" style="font-family:'courier new',monospace;display:inline">​ ​</div>which<div class="gmail_default" style="font-family:'courier new',monospace;display:inline">​ ​</div>was merged this weekend to svn HEAD:<br>
<br></div><div dir="ltr"><a href="https://svn.aspectc.org/repos/AspectC++/trunk">https://svn.aspectc.org/repos/AspectC++/trunk</a><br><br>So far, AspectC++ has used the Puma C++ Parsing and Manipulation library. In the last years, work has been done to port AspectC++ to using LLVM. Its readme file gives the following instructions to building AspectC++ against LLVM:<div>
<br><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><font face="courier new, monospace"><div class="gmail_default" style="display:inline">

​​</div>Installation<br>============<br>1. Download LLVM 3.4 and clang 3.4 from <a href="http://llvm.org" target="_blank">llvm.org</a>.<br>2. Unpack in the AspectC++ root.<br>2.1. Rename the extracted directory to llvm.<br>
2.2. Unpack and rename clang into llvm/tools/clang.<br>
3. Apply <b><div class="gmail_default" style="font-family:'courier new',monospace;display:inline">​​</div>aspectclang-3.4.diff</b> in the new clang directory.<br>     cd llvm/tools/clang && patch -p0 < ../../../AspectC++/aspectclang-3.4.diff<br>
4. Run in the LLVM directory: ./configure --enable-optimized --enable-assertions --disable-terminfo --disable-clang-arcmt --disable-clang-static-analyzer --enable-targets=x86<br>
4.1. If you have a cross-compilation or 32 bit userland with a 64 bit kernel add<br>--target=your-target to the configure line. The target argument can be<br>determined with:<br>    gcc -v 2>&1 | grep Target<br>   It might also be necessary to specify the name of the installed compiler as in ...<br>

   ./configure --enable-optimized --enable-assertions --disable-terminfo --disable-clang-arcmt --disable-clang-static-analyzer --enable-targets=x86 --target=i486-linux-gnu CC=gcc CXX=g++<br>5. Run: make REQUIRES_RTTI=1<br>

   You may add -j<Number> on a multicore machine to reduce compilation time.<br>6. Compile AspectC++ as usual.</font></blockquote><div><br></div><div>For Debian, we would need to use the Debian LLVM sources instead of the ones from<div class="gmail_default" style="font-family:'courier new',monospace;display:inline">
​ ​</div>LLVM<div class="gmail_default" style="font-family:'courier new',monospace;display:inline">​ ​</div>upstream. The challenge here is the patch aspectclang-3.4.diff that needs to be applied to the LLVM sources:<br>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div class="gmail_default"><div class="gmail_default"><font face="courier new, monospace"><br></font></div><div class="gmail_default"><font face="courier new, monospace">>> diffstat aspectclang-3.4.diff</font></div>
</div></div>
<div><div class="gmail_default"><div class="gmail_default"><font face="courier new, monospace"> include/clang/Parse/Parser.h               |    8 ++++</font></div></div></div><div><div class="gmail_default"><div class="gmail_default">

<font face="courier new, monospace"> include/clang/Rewrite/Frontend/Rewriters.h |   11 +++++</font></div></div></div><div><div class="gmail_default"><div class="gmail_default"><font face="courier new, monospace"> include/clang/Sema/Sema.h                  |   37 ++++++++++++++++++</font></div>

</div></div><div><div class="gmail_default"><div class="gmail_default"><font face="courier new, monospace"> lib/Lex/Lexer.cpp                          |    3 +</font></div></div></div><div><div class="gmail_default"><div class="gmail_default">

<font face="courier new, monospace"> lib/Lex/PPLexerChange.cpp                  |    2 -</font></div></div></div><div><div class="gmail_default"><div class="gmail_default"><font face="courier new, monospace"> lib/Parse/ParseDeclCXX.cpp                 |   57 +++++++++++++++++++++++++++--</font></div>

</div></div><div><div class="gmail_default"><div class="gmail_default"><font face="courier new, monospace"> lib/Parse/Parser.cpp                       |    9 ++++</font></div></div></div><div><div class="gmail_default"><div class="gmail_default">

<font face="courier new, monospace"> lib/Rewrite/Frontend/InclusionRewriter.cpp |   26 +++++++++----</font></div></div></div><div><div class="gmail_default"><div class="gmail_default"><font face="courier new, monospace"> lib/Sema/Sema.cpp                          |    3 +</font></div>

</div></div><div><div class="gmail_default"><div class="gmail_default"><font face="courier new, monospace"> 9 files changed, 142 insertions(+), 14 deletions(-)</font></div></div></div></blockquote><div class="gmail_default" style="font-family:'courier new',monospace">

​​</div><br>After several discussions with AspectC++ upstream, it seems rather unlikely that this patch gets applied upstream any time soon. Therefore, I'm exploring other options:<br><ol><li>Make llvm-toolchain-3.4 provide a "llvm-clang-3.4-source" binary package that provides the unpatched source code, so that the AspectC++ source package can build-depend on that, copy the sources into the build directory and follow the rest of the instructions outline in README.LLVM<br>
</li><li>Integrate AspectC++ into the llvm-toolchain package<br></li><li>Provide a build/installation script in /usr/share/doc/aspectc++/build_with_clang.sh that uses 'apt-get source llvm-toolchain-3.4' and 'apt-get source aspectc++ to obtain the clang and aspectc++ sources, and implements the instructions in the README.LLVM. This would provide a user-local copy of ac++ with clang, and increases maintenance work<br>
</li></ol>
</div></div></div></div><br><div>I'm happy to hearing<div class="gmail_default" style="font-family:'courier new',monospace;display:inline">​ ​</div>further suggestions.<br><br>What do the debian llvm maintainers think about these options? Would you be willing to implement option 1, that is, to provide the llvm sources in a binary package so that aspectc++ can build-depend on it?<br>
--<br>regards,<br>    Reinhard<br><div><br></div></div></div>