<div>Hello,</div><div>it is second report for project "Provide an alternative to libstdc++ with libc++", mentored by Sylvestre Ledru.</div><div><br></div><div>I've focused previous days to better integrate my port of libc++  to clang. Firstly I've changed headers path for libc++ to /usr/include/c++/v1/ - clang is finding here libc++ headers here if invoked with option "-stdlib=libc++".</div>








<div><br></div><div>Next I found way to avoid end-user link  explicitly libc++abi to his application. On Mac it realises with specific linker option -reexport_library=libc++abi when linking libc++, but on Linux ld doesn't have this feature. Also, since 2010 GNU ld doesn't link implicit dependencies (inter-library dependencies,  in this case libc++abi) automaticaly: <a href="http://fedoraproject.org/wiki/Features/ChangeInImplicitDSOLinking" style="color:rgb(17,85,204)" target="_blank">http://fedoraproject.org/wiki/Features/ChangeInImplicitDSOLinking</a>, <a href="http://fedoraproject.org/wiki/UnderstandingDSOLinkChange" style="color:rgb(17,85,204)" target="_blank">http://fedoraproject.org/wiki/UnderstandingDSOLinkChange</a>.</div>








<div><br></div><div>And so I think only way is to create static version of libc++abi, and link it to libc++. On this way I had troubles that libc++ realises some ABI functions itself (in files exceptions.cpp, stdexceptions.cpp, typeinfo.cpp). When compiling these files, cxxabi.h header will connected only if macroses __APPLE__ or LIBCXXRT is defined. In these cases some ABI function will be imported from ABI library. Otherwise these function will be declared and implemented in these files. And when linking libc++ with libc++abi staticaly, these functions will be double implemented, and it causes linking error.</div>








<div><br></div><div>I've succesfully solved this task. Now libc++ abi as libc++ dependecy is removed, because they compiled statically. Also I've created static version of libc++, and with static libc++abi, they are added to libc++-dev and libc++abi-dev packages.</div>





<div><br></div><div>After all libc++ can be simply used with specifying option "-stdlib=libc++" in clang++ command line.</div>


<div><br></div><div>Also I've packaged sources and test cases of libraries to libc++-src and libc++abi-src packages. Test cases for libc++ can be runned by copying folder /usr/lib/libcxx/test directory to place where user have r/w permissions, and running "testit" in this folder. Test cases for libc++abi require sources, so copy src and test folders from /usr/lib/libcxxabi/, and run "testit" in folder "test". Current directory must be "test" folder when running "testit". Testing requires installed binary packages, of course.</div>

<div><br></div><div>Also, I measured time to complete libc++ tests. On my Intel Core i3-350M with 2Gb RAM, 5400 rpm HDD it takes:<div>



<div>real<span style="white-space:pre-wrap">      </span>32m13.624s</div><div>user<span style="white-space:pre-wrap">   </span>28m35.727s</div><div>sys<span style="white-space:pre-wrap">    </span>2m20.129s</div></div><div>I've used cpufreq governor "userspace" and frequency 2.27GHz(maximum). </div>





</div>

<div><br></div><div>Also, some improvements was maked to help updating package with updates in upstream sources.</div><div><span>Currently there is no tarballs of libc++ nor libc++abi (because no releases were for both), only (two separate) svn repositories. So uscan cann't be used.</span></div>



<div><span>So script called libc++-get-orig-source.sh </span>and makefile target get-orig-source in debian/rules were created . Script downloads sources from svn repositories, and packs to gzipped tar. Script takes as argument version of package in two formats: X.Y~svnZ or X.Y. If first form is specified, script uses SVN revision Z when checkouting sources, otherwise, it uses current revision of libc++ SVN repository. Target in debian/rules get-orig-source just invoke script with version specified in debian/changelog file.</div>


<div><br></div><div>And finally, I have uploaded my work to pkg-llvm SVN repository on alioth. Link below can be used to checkout it:</div><div>svn://<a href="http://anonscm.debian.org/pkg-llvm/libcxx/trunk">anonscm.debian.org/pkg-llvm/libcxx/trunk</a>
</div><div><br></div><div><div>To check pkg-llvm repository in browser:</div><div><a href="https://alioth.debian.org/scm/browser.php?group_id=100069" target="_blank">https://alioth.debian.org/scm/browser.php?group_id=100069</a></div>

</div><div><br></div><div>Also I've set property mergeWithUpstream on libcxx/trunk/debian to use with svn-buildpackage. My package could be builded with following commands:</div><div><br></div><div>svn co svn://<a href="http://anonscm.debian.org/pkg-llvm/libcxx/trunk">anonscm.debian.org/pkg-llvm/libcxx/trunk</a> libc++</div>

<div>
mkdir tarballs; cd libc++; </div><div>debian/rules get-orig-source; mv *.tar.gz ../tarballs/</div><div>svn-buildpackage -us -uc -rfakeroot</div><div><br></div><div>On next week I plan to clean and test my package, and so on.</div>