[lldb-dev] unable to build lldb on linux

Todd Fiala tfiala at google.com
Sun Apr 6 22:51:00 PDT 2014


Hey Thiago,

Here are some instructions that should get you a gcc 4.8.2 build on Ubuntu
12.04 x86_64.  Including lldb-dev again so I can point others to this.  Let
me know if you hit any issues with it and we'll get that fixed up.

> Yup. Can you help me build gcc? That is a non-trivial task.

Sure thing:

   1. Download gcc 4.8.2 from here.
   2. Unpack it somewhere.  You can run a command sequence like:
      1. mkdir ~/src
      2. cd src
      3. tar xjf ~/Downloads/gcc-4.8.2.tar.bz2
      4. # the above will dump the gcc 4.8.2 source tree in ~/src/gcc-4.8.2
   3. Make sure you have packages installed that gcc will want.
      1. I think you only need to install libmpc-dev to get what is needed
      beyond build-essential.  Run something like this: sudo apt-get install
      build-essential libmpc-dev.
      2. If you run the next step (configure) and it blows up, send me the
      output and I'll figure out what's missing.  There are really only a few
      minor packages and I think that's the only one I have to install
beyond the
      basic build tools.
   4. Configure gcc
      1. We're going to install this in /usr/local/gcc/gcc-4.8.2.  You'll
      have to adjust some of the commands below if you want this to go
somewhere
      else.  This will be the install dir for the compiler.
      2. Run the following sequence of commands
         1. cd ~/src
         2. mkdir build-gcc-4.8.2
         3. cd build-gcc-4.8.2
         4. ../gcc-4.8.2/configure --prefix=/usr/local/gcc/gcc-4.8.2
      5. Build and install gcc
      1. Run the following sequence
         1. # assumes you're still in ~/src/build-gcc-4.8.2
         2. make
         3. sudo make install
      6. Adjust your environment variables
      1. vim/emacs ~/.bashrc
      2. add the following lines to the bottom of your .bashrc file:

export PATH=/usr/local/gcc/gcc-4.8.2/bin:$PATH

export LD_LIBRARY_PATH=/usr/local/gcc/gcc-4.8.2/lib64:$LD_LIBRARY_PATH


At this point you can restart your shell and you should have a gcc 4.8.2
gcc/g++ compiler that gets picked up ahead of the Ubuntu 12.04 gcc 4.6.3.
 Verify this by running "g++ --version" at the command prompt.  It should
say that it is version 4.8.2.  If for some reason you don't get that to
happen, make sure your .bash_profile (or .profile) is picking up the
.bashrc file, and make sure we got all the paths right for where you
installed gcc 4.8.2.

>From here you should be able to run an LLDB configure/make or cmake/ninja
build.

Let me know if you hit any trouble with that.

Sincerely,
Todd Fiala


On Sat, Apr 5, 2014 at 7:47 PM, Thiago Farina <tfarina at chromium.org> wrote:

> Off-list.
>
>
> On Sat, Apr 5, 2014 at 10:13 PM, Todd Fiala <tfiala at google.com> wrote:
>
>> Ok cool.  That's our standard OS over here.
>>
>> I'd recommend:
>>
>> 1. building a gcc 4.8.2 from source.  A standard download, unpack, mkdir
>> on a parallel build dir, configure --prefix=/some/install/path, etc. to
>> give you a gcc 4.8.2 on Ubuntu 12.04.  Let me know if you have trouble with
>> that
>>
> Yup. Can you help me build gcc? That is a non-trivial task.
>
>
>> .  The key here is that you'll get a functional libstdc++ that will work
>> for the later steps in addition to sufficient c++11 support.  You'll need
>> to add the install lib64 path to your LD_LIBRARY_PATH and similarly for
>> linker -L options on the linker command line.
>>
> Can you specify this lib64 step?
>
>
>> 2. build the latest cmake release from source and install somewhere
>> local.  The latest available for Ubuntu 12.04 I think gave me errors since
>> it was too old.
>>
>> I do also build cmake from source already.
>
>
>> 3. grab a configure buildable libedit (we get it from here<http://thrysoee.dk/editline/>).
>>  You might be able to survive with libedit-dev from Ubuntu 12.04 now, but
>> for a while that was not sufficient.  If you build it, you'll need to add
>> the lib64 path to your LD_LIBRARY_PATH, and a -L for the lib path and -I
>> for the header path.
>>
>> OK
>
>
>> 4. Not sure exactly where you got your ninja, build I found on Ubuntu <
>> 13.10 I have to install it from source.  You may have a valid route too,
>> that's just been my experience.
>>
>> I build ninja since its beginning from
> https://github.com/martine/ninja.git :)
>
> --
> Thiago Farina
>



-- 
Todd Fiala | Software Engineer | tfiala at google.com | 650-943-3180
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20140406/34ae7ea1/attachment.html>


More information about the lldb-dev mailing list