Questions about libc++ for linux and its git repository (if any)

Hi there,

I just started using llvm and clang so forgive me for this
very simple question.

I'm looking for a git repository for the libcxx (the libcxx.llvm.org
website only list svn) and also looking for some info about the
current Linux support.

Thanks,
Salvatore

If no git repository is available you can always do a "git svn clone".

Hi there,

I just started using llvm and clang so forgive me for this
very simple question.

I'm looking for a git repository for the libcxx (the libcxx.llvm.org
website only list svn) and also looking for some info about the
current Linux support.

I don't know what other projects (apart llvm and clang) are available here, but libcxx can be found at http://llvm.org/git/libcxx.git and compiler-rt at http://llvm.org/git/compiler-rt.git

Thanks,
Salvatore
_______________________________________________
cfe-dev mailing list
cfe-dev@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

-- Jean-Daniel

Perfect thanks! May I suggest to have that listed in the project page?

Anyway what about the Linux support? Where do I start from?

I wanted to start using it for a project of mine (clang++ & libcxx) in
C++11, and even though
I'm not a C++ guru, some part of the STL should still be usable right?
As long as I pass my own
allocator to a container for instance, I should have not problem using
it (exception and memory allocation
excluded).

How do I tell clang++ where to look for libcxx (excluded the obvious
-I option)? Any readings you can point me
too?

Thanks again.

Regards,
Salvatore

If you checkout the libcxx project in the llvm sources (in projects/libcxx) and build/install clang using autoconf, the headers will automatically be installed where clang++ driver expects them.

You can also install them manually in "<prefix>/lib/c++ /v1".

When invoking clang++, don't forget to pass "-stdlib=libc++" to tell clang you want to use libc++.

I never tried to use it on Linux, so I can't tell where clang look for the libc++ binary when it invoke the linker. You may have to copy it in a standard path (/usr/lib or /usr/local/lib).

-- Jean-Daniel

Hi there,

I just started using llvm and clang so forgive me for this
very simple question.

I'm looking for a git repository for the libcxx (the libcxx.llvm.org
website only list svn) and also looking for some info about the
current Linux support.

I don't know what other projects (apart llvm and clang) are available here, but libcxx can be found at http://llvm.org/git/libcxx.git and compiler-rt at http://llvm.org/git/compiler-rt.git

Perfect thanks! May I suggest to have that listed in the project page?

Anyway what about the Linux support? Where do I start from?

I wanted to start using it for a project of mine (clang++ & libcxx) in
C++11, and even though
I'm not a C++ guru, some part of the STL should still be usable right?
As long as I pass my own
allocator to a container for instance, I should have not problem using
it (exception and memory allocation
excluded).

How do I tell clang++ where to look for libcxx (excluded the obvious
-I option)? Any readings you can point me
too?

If you checkout the libcxx project in the llvm sources (in projects/libcxx) and build/install clang using autoconf, the headers will automatically be installed where clang++ driver expects them.

OK, re-running configure gives me the following in config.log

configure:3508: WARNING: Unknown project (libcxx) won't be configured
automatically

which doesn't look very good. I pulled libcxx into projects.

You can also install them manually in "<prefix>/lib/c++ /v1".

OK, how do I build and configure it outside llvm? The project page
doesn't say much,
except for running builtit.

When invoking clang++, don't forget to pass "-stdlib=libc++" to tell clang you want to use libc++.

I never tried to use it on Linux, so I can't tell where clang look for the libc++ binary when it invoke the linker. You may have to copy it in a standard path (/usr/lib or /usr/local/lib).

OK perfect.

Thanks,
Salvatore

Hi there,

I just started using llvm and clang so forgive me for this
very simple question.

I'm looking for a git repository for the libcxx (the libcxx.llvm.org
website only list svn) and also looking for some info about the
current Linux support.

I don't know what other projects (apart llvm and clang) are available here, but libcxx can be found at http://llvm.org/git/libcxx.git and compiler-rt at http://llvm.org/git/compiler-rt.git

Perfect thanks! May I suggest to have that listed in the project page?

Anyway what about the Linux support? Where do I start from?

I wanted to start using it for a project of mine (clang++ & libcxx) in
C++11, and even though
I'm not a C++ guru, some part of the STL should still be usable right?
As long as I pass my own
allocator to a container for instance, I should have not problem using
it (exception and memory allocation
excluded).

How do I tell clang++ where to look for libcxx (excluded the obvious
-I option)? Any readings you can point me
too?

If you checkout the libcxx project in the llvm sources (in projects/libcxx) and build/install clang using autoconf, the headers will automatically be installed where clang++ driver expects them.

OK, re-running configure gives me the following in config.log

configure:3508: WARNING: Unknown project (libcxx) won't be configured
automatically

This is expected. libc++ does not require "configuration" step. Nonetheless, "make install" will properly find the libc++ headers and install them where needed.

which doesn't look very good. I pulled libcxx into projects.

You can also install them manually in "<prefix>/lib/c++ /v1".

OK, how do I build and configure it outside llvm? The project page
doesn't say much,
except for running builtit.

There is no configure or install script in libc++. You run buildit to build the dynamic library, and then you have to copy it where needed

When invoking clang++, don't forget to pass "-stdlib=libc++" to tell clang you want to use libc++.

I never tried to use it on Linux, so I can't tell where clang look for the libc++ binary when it invoke the linker. You may have to copy it in a standard path (/usr/lib or /usr/local/lib).

OK perfect.

Thanks,
Salvatore

-- Jean-Daniel

We had a chat about this a little while ago, you may find something useful in this thread:
http://thread.gmane.org/gmane.comp.compilers.clang.devel/22540

tldr; libc++ requires an abi and unwind library, there are options.

Hopefully I'll get round to testing this and writing up a guide on the weekend.

Ben

....

OK, re-running configure gives me the following in config.log

configure:3508: WARNING: Unknown project (libcxx) won't be configured
automatically

This is expected. libc++ does not require "configuration" step. Nonetheless, "make install" will properly find the libc++ headers and install them where needed.

What about cross-compiling? I configured llvm in order to have
different targets (arm and x86_64).
Is the libcxx automagically compiled for both architecture?

Anyway I did install it just fine. I only had to remove a chgrp
root:wheel as I don't have
that group on my ubuntu, and honestly don't even know what it is. :slight_smile:

S.

Unfortunately is not working out of the box and not even by adding the
path with isystem.

$ clang++ -ccc-gcc-name arm-none-linux-gnueabi-g++ -ccc-host-triple
thumbv7m-none-gnueabi -stdlib=libc++ -print-search-dirs
programs: =/home/emitrax/bin/llvm/bin
libraries: =/home/emitrax/bin/llvm/bin/../lib/clang/3.2

which is OK only for clang. That's where I've installed everything.

$ clang++ -stdlib=libc++ -print-search-dirs
programs: =/home/emitrax/bin/llvm/bin:/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../x86_64-linux-gnu/bin
libraries: =/home/emitrax/bin/llvm/bin/../lib/clang/3.2:/usr/lib/gcc/x86_64-linux-gnu/4.6:/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu:/lib/x86_64-linux-gnu:/lib/../lib64:/usr/lib/x86_64-linux-gnu:/usr/lib/gcc/x86_64-linux-gnu/4.6/../../..:/lib:/usr/lib

still wouldn't find the headers for c++ as the are under
/home/emitrax/bin/llvm/lib/c++/v1

It only find the wanted header if I use the obvious
-I/home/emitrax/bin/llvm/lib/c++/v1, but beside being
utterly wrong, it gives me other errors like global symbols missing.

In file included from /home/emitrax/bin/llvm/lib/c++/v1/list:177:
In file included from /home/emitrax/bin/llvm/lib/c++/v1/algorithm:596:
/home/emitrax/bin/llvm/lib/c++/v1/cstdlib:96:9: error: no member named
'lldiv_t' in the global namespace
using ::lldiv_t;
      ~~^
/home/emitrax/bin/llvm/lib/c++/v1/cstdlib:100:9: error: no member
named 'atoll' in the global namespace
using ::atoll;

Any suggestions about how to fix this ?

Regards,
Salvatore