llvm.zip and lldb outside linux.

i see from svn that llvm.zip is semi-regularly contributed when updates are made to the archives that it contains which are necessary for building lldb .

i presume that in order to create llvm.zip for this purpose, it’s pretty much necessary to properly build all of llvm. by which i mean if i checked out all or the appropriate parts of llvm, i’d find a makefile that creates the llvm.zip . is that correct?

is there a process in place for this?

i had been of the understanding that some work is being done on building lldb for linux … which would imply that something similar has to be done with linux-specific archives and tools … given that the committed llvm.zip contains mac “fat” archives, and that the extraction scripts use the mac/darwin tool ‘lipo’ to extract the archives for use in building lldb.

any information/help on any work already done on this front would be greatly appreciated.

++ kirk beitz : nokia : austin + san diego : kirk.beitz@nokia.com ++

i see from svn that llvm.zip is semi-regularly contributed when updates are made to the archives that it contains which are necessary for building lldb .

i presume that in order to create llvm.zip for this purpose, it's pretty much necessary to properly build all of llvm. by which i mean if i checked out all or the appropriate parts of llvm, i'd find a makefile that creates the llvm.zip . is that correct?
is there a process in place for this?

Yep, the llvm.zip binary is currently for MacOSX only. It is built using the terminal:

cd lldb
rm -rf llvm.zip llvm
xcodebuild -configuration BuildAndIntegration
./scripts/checkpoint-llvm.pl llvm build/lldb.build/BuildAndIntegration/LLDB.build/DerivedSources/llvm.build build/BuildAndIntegration llvm.zip

Then checkin the new "llvm.zip" file.

You also have the option of building the correct revision of llvm yourself:

% grep llvm_revision build-llvm.pl
our $llvm_revision = "123723";

Then you can

svn co http://llvm.org/svn/llvm-project/llvm/trunk -r 123723 llvm
cd llvm/tools
svn co http://llvm.org/svn/llvm-project/cfe/trunk -r 123723 clang
cd ..
./configure --enable-optimized --disable-assertions --enable-targets=x86_64,arm -arch x86_64
make

Then you can make a symlink to the llvm build folder in lldb:

cd lldb
ln -s ~/my/build/dir/llvm

Then you can build.

i had been of the understanding that some work is being done on building lldb for linux … which would imply that something similar has to be done with linux-specific archives and tools … given that the committed llvm.zip contains mac "fat" archives, and that the extraction scripts use the mac/darwin tool 'lipo' to extract the archives for use in building lldb.

On linux, you checkout LLDB into the tools directory:

svn co http://llvm.org/svn/llvm-project/llvm/trunk -r 123723 llvm
cd llvm/tools
svn co http://llvm.org/svn/llvm-project/cfe/trunk -r 123723 clang
svn co https://$USER@llvm.org/svn/llvm-project/lldb/trunk lldb
cd ..
./configure --enable-optimized --disable-assertions --enable-targets=x86_64,arm
make

This should just build everything you need.

any information/help on any work already done on this front would be greatly appreciated.

Let me know if you have any other questions! But this should get you going.

Greg Clayton

a bit more info … i want to get lldb built using mingw. llvm’s configure seems to create Makefiles in most appropriate places. i’ve got as far as the following (with a workaround for a PERL variable dependency that chokes if the containing windows environment contains a PERL variable that has a windows-specific full-path name):

make[2]: Leaving directory /x/lldb-win/tools/llvm-config' llvm-config: unknown component name: bitreader make[2]: Entering directory /x/lldb-win/tools/opt’
/x/lldb-win/Makefile.rules:939: *** llvm-config --libs failed. Stop.
make[2]: Leaving directory /x/lldb-win/tools/opt' make[1]: *** [opt/.makeall] Error 2 make[1]: Leaving directory /x/lldb-win/tools’
make: *** [all] Error 1

i browsed around in http://llvm.org/svn/llvm-project and don’t see anything obvious called bitreader.

i fgrep’ed for bitreader through what i did get co from svn, and i see some stuff under “bindings”.

do i really need ‘bitreader’ for lldb? is there already a way to turn off support for trying to make it using configure? if it’s not needed for lldb, and if configure doesn’t already have a way to ignore it, i’ll see if i can tweak configure to do so.

thanks for any info or help.
++ kirk

This question would be better suited for the llvmdev list: llvmdev@cs.uiuc.edu

I am not sure what bitreader is used for, but if I had to guess, I would guess it is needed (possibly by the assembler, disassembler, codegen etc).

i am interested in getting lldb build using mingw (which i don’t think has yet been done).

to do so requires first building llvm in order to get the depended-upon clang library, et al.

after installing mingw, i have performed the following steps, as these are what have been used to build lldb on linux (with the targets being my targets of interest):

svn co http://llvm.org/svn/llvm-project/llvm/trunk -r 123723 llvm
cd llvm/tools
svn co http://llvm.org/svn/llvm-project/cfe/trunk -r 123723 clang
svn co http://llvm.org/svn/llvm-project/lldb/trunk lldb
cd …
./configure --enable-optimized --disable-assertions
–enable-targets=host,x86,x86_64,arm,cpp
make

upon invoking make, the following error was reported:

make[2]: Leaving directory /x/lldb-win/tools/llvm-config' llvm-config: unknown component name: bitreader make[2]: Entering directory /x/lldb-win/tools/opt’
/x/lldb-win/Makefile.rules:939: *** llvm-config --libs failed. Stop.
make[2]: Leaving directory /x/lldb-win/tools/opt' make[1]: *** [opt/.makeall] Error 2 make[1]: Leaving directory /x/lldb-win/tools’
make: *** [all] Error 1

being unfamiliar with llvm and thus where i might find a component ‘bitreader’, i browsed around in http://llvm.org/svn/llvm-project ; i don’t see anything obvious. i fgrep’ed for bitreader through what i did get co from svn, and i see some stuff under “bindings”, and various dependencies in some of the clang Makefiles , but the source of these dependencies is not clear to me in attempting to follow the makefile tree.

i browsed the last 6 months of archives for the list, and the only messages with subject lines containing mingw seemed to involve making certain perl is part of the msys distribution. ‘which perl’ tells me ‘/bin/perl’ and ‘perl --version’ tells me ‘This is perl, v5.6.1 built for msys’, so i assume i have the right thing there.

is there something else i have to check out to get the bitreader module (et al … presuming that bitreader might not be the only unknown component, just the first encountered in the attempt to make in lldb-win/tools )?

any information or help in regard to this topic would be greatly appreciated.

++ kirk

++ kirk beitz : nokia : austin + san diego : kirk.beitz@nokia.com ++

after digging into this further in my build logs, i saw that i did not clean up properly after a previous interim failure (due to an environment variable name collision that i resolved and attempted to re-configure, but did not properly clean up).

after a full ‘make clean’, the libclang .a files all appear to have been built as necessary, and i’m moving on to getting lldb to build.

++ kirk

after digging into this further in my build logs, i saw that i did not clean up properly after a previous interim failure (due to an environment variable name collision that i resolved and attempted to re-configure, but did not properly clean up).

after a full ‘make clean’, the libclang .a files all appear to have been built as necessary, and i’m moving on to getting lldb to build.

++ kirk

Great!

I will try and put the MacOSX and Linux LLVM/Clang build instructions up on the web page and if/when you get instructions for MingGW, let me know and I will add them.