Re: About Clang headers on Debian

2013-10-08 Thread Stephan Bergmann

On 10/07/2013 11:46 PM, julien2412 wrote:

I'm trying to build clang from svn trunk to give a try to MemorySanitizer.
So I followed, http://clang.llvm.org/get_started.html
but I don't know what to put in my autogen.input
Either I get this:
* WARNING : Cannot find Clang headers to build compiler plugins, plugins
disabled
or I get this:
make: *** No rule to make target `/home/julien/llvm-svn/build/bin/clang',
needed by
`/home/julien/compile-libreoffice/libo_clang/compilerplugins/obj/clang-timestamp'.
Stop

Here's the end of my autogen.input when I get last message:
CLANGBUILD=/home/julien/llvm-svn/build
CLANGDIR=/home/julien/llvm-svn/llvm
CC=/home/julien/llvm-svn/build/Debug+Asserts/bin/clang
CXX=/home/julien/llvm-svn/build/Debug+Asserts/bin/clang++


The script with which I build Clang trunk is


#!/bin/bash
set -ex
mkdir "${HOME?}"/clang/trunk
svn co http://llvm.org/svn/llvm-project/llvm/trunk "${HOME?}"/clang/trunk/src
svn co http://llvm.org/svn/llvm-project/cfe/trunk \
 "${HOME?}"/clang/trunk/src/tools/clang
svn co http://llvm.org/svn/llvm-project/clang-tools-extra/trunk \
 "${HOME?}"/clang/trunk/src/tools/clang/tools/extra
svn co http://llvm.org/svn/llvm-project/compiler-rt/trunk \
 "${HOME?}"/clang/trunk/src/projects/compiler-rt
mkdir "${HOME?}"/clang/trunk/build
cd "${HOME?}"/clang/trunk/build
"${HOME?}"/clang/trunk/src/configure --prefix="${HOME?}"/clang/trunk/inst \
 --enable-optimized CC=gcc CXX=g++
make -j12
make install -j12


and then have


CC=/home/sbergman/clang/trunk/inst/bin/clang
CXX=/home/sbergman/clang/trunk/inst/bin/clang++
CLANGBUILD=/home/sbergman/clang/trunk/inst
CLANGDIR=/home/sbergman/clang/trunk/inst


in autogen.input, with CLANGBUILD = CLANGDIR (though IIRC Lubos used a 
somewhat different setup that did involve setting CLANGBUILD != CLANGDIR).



Then if it had worked, I wanted to try this:

CFLAGS="-fsanitize=memory -fsanitize-memory-track-origins
-fno-omit-frame-pointer -g -O2' CXXFLAGS='-fsanitize=memory
-fsanitize-memory-track-origins -fno-omit-frame-pointer -g -O2' make
as I read here:
https://wiki.documentfoundation.org/Development/BuildingOnLinux#Compiler_flags


I once toyed around a little with -fsanitize=undefined, but it took some 
tweaking of solenv/gbuild/ to get the relevant flags properly into the 
build IIRC.  (I have those changes still lying around locally, but never 
came around to look into it again and clean up.  Also, 
-fsanitize=undefined started to fail rather quickly due to problems 
discussed in the thread starting at 
 
"ubsan: check type_info equality via strcmp," which would need fixing in 
our cppumaker-generated headers.)


Stephan
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: About Clang headers on Debian

2013-10-07 Thread julien2412
Hi Stephan,

I'm trying to build clang from svn trunk to give a try to MemorySanitizer.
So I followed, http://clang.llvm.org/get_started.html
but I don't know what to put in my autogen.input
Either I get this:
* WARNING : Cannot find Clang headers to build compiler plugins, plugins
disabled
or I get this:
make: *** No rule to make target `/home/julien/llvm-svn/build/bin/clang',
needed by
`/home/julien/compile-libreoffice/libo_clang/compilerplugins/obj/clang-timestamp'.
 
Stop

Here's the end of my autogen.input when I get last message:
CLANGBUILD=/home/julien/llvm-svn/build
CLANGDIR=/home/julien/llvm-svn/llvm
CC=/home/julien/llvm-svn/build/Debug+Asserts/bin/clang
CXX=/home/julien/llvm-svn/build/Debug+Asserts/bin/clang++

Then if it had worked, I wanted to try this:

CFLAGS="-fsanitize=memory -fsanitize-memory-track-origins
-fno-omit-frame-pointer -g -O2' CXXFLAGS='-fsanitize=memory
-fsanitize-memory-track-origins -fno-omit-frame-pointer -g -O2' make
as I read here:
https://wiki.documentfoundation.org/Development/BuildingOnLinux#Compiler_flags

Julien



--
View this message in context: 
http://nabble.documentfoundation.org/About-Clang-headers-on-Debian-tp4075924p4077147.html
Sent from the Dev mailing list archive at Nabble.com.
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: About Clang headers on Debian

2013-10-07 Thread Stephan Bergmann

On 10/05/2013 06:27 AM, julien2412 wrote:

However trying to launch LO with:
./instdir/unxlngx6/program/soffice
gives:
ERROR 4 forking process

A Google search about this message gives urls from OOo in 2008!
However I gave a try to strace and noticed this:

[pid 20588] dup2(4294967295, 2) = -1 EBADF (Bad file descriptor)
[pid 20588]
execve("/home/julien/compile-libreoffice/libo_clang/instdir/unxlngx6/program/soffice.bin",
["/home/julien/compile-libreoffice"..., "--splash-pipe=5"], [/* 43 vars */])
= -1 ENOENT (No such file or directory)

Indeed, a find of soffice.bin in LO root directory gives only
./workdir/unxlngx6/Headers/Executable/soffice.bin

Any idea? Is it linked to gbuild current changes?


That's odd (and unrelated to Clang); a plain "make" should create the 
executable instdir/unxlngx6/program/soffice.bin.  (But the switch to 
instdir is relatively new, maybe you are working off an incremental 
build that somehow got confused?)


Stephan
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: About Clang headers on Debian

2013-10-05 Thread julien2412
Building with clang succeeded, it's the first time that I can build LO with
clang! :-)
Thank you!

However trying to launch LO with:
./instdir/unxlngx6/program/soffice
gives:
ERROR 4 forking process

A Google search about this message gives urls from OOo in 2008!
However I gave a try to strace and noticed this:

[pid 20588] dup2(4294967295, 2) = -1 EBADF (Bad file descriptor)
[pid 20588]
execve("/home/julien/compile-libreoffice/libo_clang/instdir/unxlngx6/program/soffice.bin",
["/home/julien/compile-libreoffice"..., "--splash-pipe=5"], [/* 43 vars */])
= -1 ENOENT (No such file or directory)

Indeed, a find of soffice.bin in LO root directory gives only
./workdir/unxlngx6/Headers/Executable/soffice.bin

Any idea? Is it linked to gbuild current changes?

Julien
PS : I use Debian testing package clang (Version: 1:3.2repack-11)



--
View this message in context: 
http://nabble.documentfoundation.org/About-Clang-headers-on-Debian-tp4075924p4076672.html
Sent from the Dev mailing list archive at Nabble.com.
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: About Clang headers on Debian

2013-10-04 Thread Stephan Bergmann

On 10/03/2013 07:55 AM, julien2412 wrote:

With master sources updated today, I've got this:
[build XCU]
officecfg/registry/data/org/openoffice/Office/UI/MathWindowState.xcu
/home/julien/compile-libreoffice/libo_clang/solenv/gbuild/Configuration.mk:162:
*** There is no target
/home/julien/compile-libreoffice/libo_clang/workdir/unxlngx6/XcuModuleTarget/officecfg/registry/data/org/openoffice/Office/Addons-onlineupdate.xcu.
Stop.


...which looks completely unrelated to your Clang settings.  Note that 
there were recent gbuild changes around .xcu etc.; maybe they require 
some form of "make clean" under certain conditions.


Stephan
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: About Clang headers on Debian

2013-10-03 Thread julien2412
Thank you for the hints both of you.

I added these lines in my autogen.input:
CC=/usr/lib/llvm-3.2/bin/clang
CXX=/usr/lib/llvm-3.2/bin/clang++
CLANGBUILD=/usr/lib/llvm-3.2
CLANGDIR=/usr/lib/llvm-3.2

+ I created symlink for clang and clang++ since they're present in /usr/bin

With master sources updated today, I've got this:
[build XCU]
officecfg/registry/data/org/openoffice/Office/UI/MathWindowState.xcu
/home/julien/compile-libreoffice/libo_clang/solenv/gbuild/Configuration.mk:162:
*** There is no target
/home/julien/compile-libreoffice/libo_clang/workdir/unxlngx6/XcuModuleTarget/officecfg/registry/data/org/openoffice/Office/Addons-onlineupdate.xcu.
 
Stop.

160 $(call gb_XcuModuleTarget_get_target,%) :
$(gb_XcuTarget_XSLT_AllLang) \
161 | $(gb_Configuration_XSLTCOMMAND_DEPS)
162 $(if $(filter %.xcu,$^),,$(error There is no target $(call
gb_XcuModuleTarget_get_target,$*)))
163 $(call gb_XcuModuleTarget__command,$@,$*,$(filter
%.xcu,$^),$(filter %.xcs,$^))
164 



Julien



--
View this message in context: 
http://nabble.documentfoundation.org/About-Clang-headers-on-Debian-tp4075924p4076124.html
Sent from the Dev mailing list archive at Nabble.com.
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: About Clang headers on Debian

2013-10-02 Thread Stephan Bergmann

On 10/01/2013 11:38 PM, julien2412 wrote:

Should I create a symlink or should I override CLANGBUILD or CLANGBUILD so
autogen.sh can find:
/usr/lib/llvm-3.2/include/clang/AST/RecursiveASTVisitor.h
?


CLANGBUILD and CLANGDIR are the variables of choice here, but I can 
never remember which does what exactly.  As an example, to build LO 
against a trunk Clang build that I installed to /foo/clang/trunk/inst, 
my autogen.input contains:



CC=/foo/clang/trunk/inst/bin/clang
CXX=/foo/clang/trunk/inst/bin/clang++
CLANGBUILD=/foo/clang/trunk/inst
CLANGDIR=/foo/clang/trunk/inst


Stephan
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: About Clang headers on Debian

2013-10-02 Thread Tor Lillqvist
> On pc Debian x86-64 testing updated today, I tried to build with clang.
> But I got this warning after autogen.sh
> Cannot find Clang headers to build compiler plugins, plugins disabled

That is just a warning. Using the Clang plugin is very much optional.
Don't worry.

(But sure, if you can figure out what package to install to get the
Clang API, then you will be able to build our Clang plugin and you
will get warnings about your code in some more cases if you (or
somebody else) introduces dubious things.

--tml
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


About Clang headers on Debian

2013-10-01 Thread julien2412
Hello,

On pc Debian x86-64 testing updated today, I tried to build with clang.
But I got this warning after autogen.sh
Cannot find Clang headers to build compiler plugins, plugins disabled

Checking in configure.ac, I found this:
   5625 CPPFLAGS="$CPPFLAGS -I$CLANGDIR/include
-I$CLANGDIR/tools/clang/include -I$CLANGBUILD/include
-I$CLANGBUILD/tools/clang/include -D__STDC_CONSTANT_MACROS
-D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
   5626 AC_CHECK_HEADER(clang/AST/RecursiveASTVisitor.h,
   5627 [COMPILER_PLUGINS=TRUE],
   5628 [
   5629 if test "$compiler_plugins" = "yes"; then
   5630 AC_MSG_ERROR([Cannot find Clang headers to build
compiler plugins.])

So I checked which package provided "RecursiveASTVisitor.h"
root@julienPC:/home/julien# apt-file search RecursiveASTVisitor.h
libclang-3.4-dev: /usr/lib/llvm-3.4/include/clang/AST/RecursiveASTVisitor.h
libclang-dev: /usr/lib/llvm-3.2/include/clang/AST/RecursiveASTVisitor.h

But this package is already installed:
root@julienPC:/home/julien# apt-get install libclang-dev
Reading package lists... Done
Building dependency tree   
Reading state information... Done
libclang-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.

Should I create a symlink or should I override CLANGBUILD or CLANGBUILD so
autogen.sh can find:
/usr/lib/llvm-3.2/include/clang/AST/RecursiveASTVisitor.h
?
Is/are Debian package(s) for clang/llvm buggy? 

Julien



--
View this message in context: 
http://nabble.documentfoundation.org/About-Clang-headers-on-Debian-tp4075924.html
Sent from the Dev mailing list archive at Nabble.com.
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice