[LLVMdev] A bunch of errors while installing VMKit and compiling LLVM

Vozniuk, Sergii sergii.vozniuk at epfl.ch
Tue Oct 25 04:15:50 PDT 2011

Hi everyone

I wasn't successful in running VMKit on my machine and I'm still struggling
with doing it.
Maybe someone had at least one of my problems and knows how to solve it
(because it seems to me that I ran into every problem that could occur :) ).

Thanks in advance,

So here is the story:
I have a fresh installation of Ubuntu 11.04 64bit with all important
I'll tell in advance that I was careful in trying to compile LLVM and VMKit
(i.e. I had only one version of llvm-gcc and/or clang installed at a
time, I always ran "make clean" before "make" etc.)

To build VMKit we have first to checkout and build LLVM. The VMKit "Getting
guide states: Make sure you have llvm-gcc or clang available when you
configure LLVM.
Alternatively, you can also checkout clang in llvm-scr/tools.

The following steps are not done in sequence, they are alternatives

    1. Install llvm-gcc from Ubuntu repository. In this case the LLVM
       script doesn't see the gcc compiler although it's installed
        ~/llvm/llvm-build$ sudo apt-get install llvm-gcc-4.5
        ~/llvm/llvm-build$ ../llvm-src/configure --enable-optimized
            checking for clang... no
            checking for llvm-gcc... llvm-gcc
            checking for C compiler default output file name... configure:
            error: C compiler cannot create executables

    2. Install older version of llvm-gcc from Ubuntu repository. This
       doesn't create llvm-gcc executable but instead creates llvm-gcc-4.2
so I
       created a symlink to llvm-gcc-4.2. named llvm-gcc. The LLVM
configuration goes fine
       but building LLVM produces an error

        ~/llvm/llvm-build$ sudo apt-get install llvm-gcc-4.2
        ~/llvm/llvm-build$ sudo ln -s /usr/bin/llvm-gcc-4.2
        ~/llvm/llvm-build$ ../llvm-src/configure --enable-optimized
        ~/llvm/llvm-build$ make

            llvm[1]: Compiling Host.cpp for Release+Asserts build
            In file included from /usr/include/c++/4.5/cerrno:43:0,
            /usr/include/errno.h:69:13: error: multiple types in one
            /usr/include/errno.h:69:13: error: declaration does not declare
            /bin/rm: cannot remove
`/home/svozniuk/llvm/llvm-build/lib/Support/Release+Asserts/Host.d.tmp': No
such file or directory
            make[1]: ***
[/home/svozniuk/llvm/llvm-build/lib/Support/Release+Asserts/Host.o] Error 1
            make[1]: Leaving directory
            make: *** [all] Error 1

    3. Download llvm-gcc4.2-2.9-x86_64-linux archive from llvm.org, extract
       it and manually add to the PATH. The configuration script finishes
       but building LLVM produces an error

        ~/llvm/llvm-build$ export
        ~/llvm/llvm-build$ ../llvm-src/configure --enable-optimized
        ~/llvm/llvm-build$ make
            llvm[1]: Compiling CommandLine.cpp for Release+Asserts build
            In file included from

/home/svozniuk/llvm/llvm-src/include/llvm/Support/system_error.h:499: error:
‘EAFNOSUPPORT’ was not declared in this scope

/home/svozniuk/llvm/llvm-src/include/llvm/Support/system_error.h:500: error:
‘EADDRINUSE’ was not declared in this scope
            .........And another 50 errors of the same type follow.........

    4. Install clang from Ubuntu repository (All ways (which I know of) to
build LLVM with
       llvm-gcc available have failed so now I switch to building LLVM with
clang available).
       The configuration finishes successfully but again I get an error
trying to build LLVM

        ~/llvm/llvm-build$ sudo apt-get install clang
        ~/llvm/llvm-build$ ../llvm-src/configure --enable-optimized
        ~/llvm/llvm-build$ make

            llvm[1]: Compiling APFloat.cpp for Release+Asserts build
            In file included from
            In file included from
            In file included from
            In file included from
            In file included from

/home/svozniuk/llvm/llvm-src/include/llvm/Support/type_traits.h:20:10: fatal
error: 'utility' file not found
            #include <utility>
            1 error generated.
            make[1]: ***
[/home/svozniuk/llvm/llvm-build/lib/Support/Release+Asserts/APFloat.o] Error

    5. Checkout clang to llvm-src-clang/tools and build LLVM this way. LLVM
Configuration script finishes
       with no errors. LLVM builds successfully. VMKit configuration script
finishes with no errors.
       Building VMKit produces an error (segmentation fault)
        ~/llvm/llvm-build-clang$ ../llvm-src-clang/configure
        ~/llvm/llvm-build-clang$ make
        ~/llvm/vmkit$ ./configure
        ~/llvm/vmkit$ make

            llvm[2]: Building Release+Asserts Bytecode Module MMTKAlloc.bc
            make[2]: Leaving directory
            make[2]: Entering directory
            make[2]: buildfile: Command not found
            make[2]: [all] Error 127 (ignored)
            llvm[2]: Building Release+Asserts mmtk-vmkit.jar all
            Can't find zip file.
            0  opt             0x000000000093449f
            1  opt             0x0000000000934fda
            2  libpthread.so.0 0x00002b867fa26c60
            3  MMTKMagic.so    0x00002b8680977769
            4  opt             0x00000000008d0177
llvm::MPPassManager::runOnModule(llvm::Module&) + 535
            5  opt             0x00000000008d02db
llvm::PassManagerImpl::run(llvm::Module&) + 187
            6  opt             0x00000000004c4c9f main + 5791
            7  libc.so.6       0x00002b86805faeff __libc_start_main + 255
            8  opt             0x00000000004b4569
            Stack dump:
            0.    Program arguments:
-std-compile-opts -LowerJavaRT -f mmtk-vmkit.bc -o mmtk-vmkit-optimized.bc
            1.    Running pass 'Remove references to RT' on module
            make[2]: *** [all] Segmentation fault
            make[2]: Leaving directory `/home/svozniuk/llvm/vmkit/mmtk/java'

            make[1]: *** [all] Error 1
            make[1]: Leaving directory `/home/svozniuk/llvm/vmkit/mmtk'
            make: *** [all] Error 1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111025/83a16c2d/attachment.html>

More information about the llvm-dev mailing list