[Libreoffice-bugs] [Bug 42949] EasyHack: accelerating compile times ...

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Nov 21 22:13:39 CET 2011


https://bugs.freedesktop.org/show_bug.cgi?id=42949

--- Comment #6 from August Sodora <augsod at gmail.com> 2011-11-21 13:13:39 PST ---
Steps to build clang:
* Ensure that the appropriate compat c++ libraries are installed for your
system. Typically this means gcc 3.*. For fedora the package is compat-gcc-34.
* Change directory to where you want the llvm directory placed.
* svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
* cd llvm/tools
* svn co http://llvm.org/svn/llvm-project/cfe/trunk clang
* cd ../.. (back to where you started)
* mkdir build (for building without polluting the source dir)
* cd build
* ../llvm/configure --host=x86_64-redhat-linux --target=x86_64-redhat-linux
--build=x86_64-redhat-linux (change the host, target, and build parameters to
suit your system)
* make
* Remember what the value of pwd is here as it will be used when running
include-what-you-use

To build include-what-you-use:
* cd llvm/tools/clang/tools
* svn co http://include-what-you-use.googlecode.com/svn/trunk/
include-what-you-use
* Edit Makefile so that include-what-you-use is one of the subdirs to build.
* make

To run:
* make -srkj3 CXX=<previous value of
pwd>/Debug+Asserts/bin/include-what-you-use 2> iwyu.out

And you should see some lines in the output like the following:

/home/aasodora/Sources/libo/basic/source/app/process.cxx should add these
lines:
#include <debug/map.h>                  // for map, map<>::const_iterator
#include <debug/safe_iterator.h>        // for _Safe_iterator, operator!=
#include <stddef.h>                     // for NULL
#include <map>                          // for _Rb_tree_const_iterator
#include <utility>                      // for pair
#include "basic/sbxdef.hxx"             // for SbxERR_NO_ACTIVE_OBJECT
#include "rtl/ustring.h"                // for rtl_uString, etc
#include "rtl/ustring.hxx"              // for OUString
#include "sal/types.h"                  // for sal_False, sal_Bool, etc
#include "tools/solar.h"                // for String, xub_StrLen

/home/aasodora/Sources/libo/basic/source/app/process.cxx should remove these
lines:
- #include <tools/errcode.hxx>  // lines 33-33
- #include "precompiled_basic.hxx"  // lines 30-30

The full include-list for
/home/aasodora/Sources/libo/basic/source/app/process.cxx:
#include <debug/map.h>                  // for map, map<>::const_iterator
#include <debug/safe_iterator.h>        // for _Safe_iterator, operator!=
#include <osl/process.h>                // for oslProcessInfo, etc
#include <stddef.h>                     // for NULL
#include <basic/process.hxx>            // for Process, Environment
#include <basic/sbxcore.hxx>            // for SbxBase
#include <basic/ttstrhlp.hxx>           // for CUniString
#include <map>                          // for _Rb_tree_const_iterator
#include <osl/file.hxx>                 // for FileBase
#include <tools/string.hxx>             // for String::operator OUString, etc
#include <utility>                      // for pair
#include "basic/sbxdef.hxx"             // for SbxERR_NO_ACTIVE_OBJECT
#include "rtl/ustring.h"                // for rtl_uString, etc
#include "rtl/ustring.hxx"              // for OUString
#include "sal/types.h"                  // for sal_False, sal_Bool, etc
#include "tools/solar.h"                // for String, xub_StrLen

include-what-you-use has a way to deal with some of these false positives, so
that shouldn't be terribly difficult.

Unfortunately there are a couple of extraneous warnings in the output that I
would like to do without. Repeat offenders are:

warning: argument unused during compilation: '-ggdb2'
warning: argument unused during compilation: '-fno-enforce-eh-specs'

I also seem to be getting warnings from boost, the stl, and our own code ,
often like:

In file included from
/home/aasodora/Sources/libo/solver/unxlngx6/inc/boost/ptr_container/detail/static_move_ptr.hpp:23:
/home/aasodora/Sources/libo/solver/unxlngx6/inc/boost/ptr_container/detail/default_deleter.hpp:64:41:
warning: unused parameter 'tt' [-Wunused-parameter]
    default_deleter(default_deleter<TT> tt) { }

The last thing that really bugs me is what I think is an
include-what-you-use-bug:

include-what-you-use:
/home/aasodora/Sources/llvm/tools/clang/tools/include-what-you-use/../../include/clang/AST/Type.h:478:
const clang::ExtQualsTypeCommonBase* clang::QualType::getCommonPtr() const:
Assertion `!isNull() && "Cannot retrieve a NULL type pointer"' failed.
Stack dump:
0.      <eof> parser at end of file
/bin/sh: line 1: 23068 Aborted                
$R/build/Debug+Asserts/bin/include-what-you-use -DCPPU_ENV=gcc3 -DDBG_UTIL
-DENABLE_GRAPHITE -DENABLE_GTK -DGCC -DGXX_INCLUDE_PATH=/usr/include/c++/4.5.1
-DHAVE_GCC_VISIBILITY_FEATURE -DHAVE_THREADSAFE_STATICS -DLINUX
-DOSL_DEBUG_LEVEL=1 -DSOLAR_JAVA -DSUPD=350 -DUNIX -DUNX -DVCL -DX86_64
-D_DEBUG -D_GLIBCXX_DEBUG -D_PTHREADS -D_REENTRANT -Wall -Wendif-labels -Wextra
-fmessage-length=0 -fno-common -pipe -fPIC -Wshadow -Wsign-promo
-Woverloaded-virtual -Wno-non-virtual-dtor -fvisibility=hidden
-fvisibility-inlines-hidden -fno-strict-aliasing -std=c++0x
-Wno-deprecated-declarations -ggdb2 -DEXCEPTIONS_ON -fexceptions
-fno-enforce-eh-specs -O0 -c $S/basic/source/sample/object.cxx -o
$W/CxxObject/basic/source/sample/object.o -MMD -MT
$W/CxxObject/basic/source/sample/object.o -MP -MF
$W/Dep/CxxObject/basic/source/sample/object.d -I$S/basic/source/sample/
-I$O/inc/stl -I$O/inc/external -I$O/inc -I$S/solenv/inc/unxlngx6
-I$S/solenv/inc -I$S/res -I/usr/lib/jvm/java/include
-I/usr/lib/jvm/java/include/linux
-I/usr/lib/jvm/java/include/native_threads/include -I$S/basic/inc/pch
-I$S/basic/source/inc -I$O/inc/udkapi -I$O/inc/offapi



Ideally I would like to clean up the output a little bit before testing the
auto-fix script.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the Libreoffice-bugs mailing list