Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

DXR on FreeBSD

9 views
Skip to first unread message

Robert Helmer

unread,
Oct 18, 2014, 6:10:47 PM10/18/14
to dev-stati...@lists.mozilla.org
Hello,

I have been flooding IRC about this, but just wanted to mention for
anyone lurking here that I have DXR working on FreeBSD, and am working
on indexing and analyzing the full FreeBSD source tree (kernel +
userland.)

FreeBSD 10.0 uses Clang 3.3 by default, so I haven't really had any
problems on that front (well except that I need to compile the sqlite
trilite extension with clang which does not like a debug macro, which
is easy to hack around) - I hear trilite going away soon anyway.

Right now I have indexing working for a small subset of the kernel and
userland, I think I have everything figured out so dxr-build.py will
be able to call the usual FreeBSD "make buildkernel && make
buildworld" and have it work. I have a kernel config with all options
turned on, and I think I may be able to get even more coverage by
cross-compiling later ("make universe"), working on amd64 first.

I am tracking everything I had to change and current status in:
https://gist.github.com/rhelmer/60bc81c6cee9c507008a

The only problems specific to DXR so far have been:

* "_csv.Error: field larger than field limit (131072)" after build. I
am testing to see if "csv.field_size_limit(sys.maxsize)" in
clang/indexer.py helps

* I have to disable -Werror (the kernel normally builds with this
enabled), or clang complains that the flags DXR adds are invalid. An
example invocation is:

/usr/local/bin/clang33 -Xclang -load -Xclang
/home/vagrant/dxr/dxr/plugins/clang/libclang-index-plugin.so -Xclang
-add-plugin -Xclang dxr-index -Xclang -plugin -arg-dxr-index -Xclang
/usr/src -O2 -pipe -I. -I/usr/src/sys/dev/aic7xxx/aicasm -std=gnu99
-Wsystem-headers -Werror -Wall -Wno-format-y2k -W
-Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes
-Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch
-Wshadow -Wunused-parameter -Wcast-align -Wno-pointer-sign -o aicasm
aicasm.o aicasm_symbol.o aicasm_gram.o aicasm_macro_gram.o
aicasm_scan.o aicasm_macro_scan.o -ll

* compiling LLVM doesn't seem to work, I am just skipping it for now
but as it's part of the BSD base system I'd like to get it indexed and
analyzed along with everything else. It fails on
llvm/tools/clang/lib/Lex/ModuleMap.cpp with "clang: error: unable to
execute command: Illegal instruction (core dumped)" - I saved the code
and clang command-line used, and the same clang invocation works fine
if I remove the DXR-added flags.

Overall I am really happy with how easy it's been to get DXR up and
running, and as I mentioned I can get it running on subsets of the
source tree so I am confident that I'll have the full source tree
indexed and analyzed soon. If anybody has any leads on the above I'd
appreciate it!


Thanks!
Rob
0 new messages