[libcxx] Linux support status?

Hi,

I was wondering if libcxx works on Linux machines. From reading the archives it seems like some people have got it to work. It seems to compile fine for me but I get this error: Could not resolve external global address: std::__1::cout
Am I doing something wrong or should libcxx not work on linux yet?

john@ubuntu:~/src$ clang++ --version
clang version 3.0 (trunk 127576)
Target: x86_64-unknown-linux-gnu
Thread model: posix
john@ubuntu:~/src$ clang++ -std=c++0x -stdlib=libc++ -emit-llvm -c -o world.bc world.cc
john@ubuntu:~/src$ chmod +x world.bc
john@ubuntu:~/src$ ./world.bc 2>&1 | c++filt
LLVM ERROR: Could not resolve external global address: std::__1::cout
john@ubuntu:~/src$ cat world.cc
#include

using namespace std;

int main() {

cout << “hello world!\n”;

return 0;
}

Thanks,
John

Hello,

I was wondering if libcxx works on Linux machines. From reading the archives
it seems like some people have got it to work.

no, it doesn't. At least, anything related to streams or wchar_t will break. Other parts that don't involve as much platform specific code work much better.

john@ubuntu:~/src$ clang++ --version
clang version 3.0 (trunk 127576)
Target: x86_64-unknown-linux-gnu
Thread model: posix
john@ubuntu:~/src$ clang++ -std=c++0x -stdlib=libc++ -emit-llvm -c -o
world.bc world.cc
john@ubuntu:~/src$ chmod +x world.bc
john@ubuntu:~/src$ ./world.bc

Is that really supposed to work?

john@ubuntu:~/src$ cat world.cc
#include <iostream>

using namespace std;

int main() {

cout << "hello world!\n";

return 0;
}

Sorry, hello world is broken and will output some garbage after the normal text.

Hello,

I was wondering if libcxx works on Linux machines. From reading the archives
it seems like some people have got it to work.

no, it doesn’t. At least, anything related to streams or wchar_t will break. Other parts that don’t involve as much platform specific code work much better.

john@ubuntu:~/src$ clang++ --version
clang version 3.0 (trunk 127576)
Target: x86_64-unknown-linux-gnu
Thread model: posix
john@ubuntu:~/src$ clang++ -std=c++0x -stdlib=libc++ -emit-llvm -c -o
world.bc world.cc
john@ubuntu:~/src$ chmod +x world.bc
john@ubuntu:~/src$ ./world.bc

Is that really supposed to work?

Yeah, somewhere on llvm.org there was instructions on setting up Linux to run bitcode directly.

john@ubuntu:~/src$ cat world.cc
#include

using namespace std;

int main() {

cout << “hello world!\n”;

return 0;
}

Sorry, hello world is broken and will output some garbage after the normal text.


Marc Glisse

Thanks for the info and clarification.

–John

There was a small patch to get a hello world to work without printing
garbage:

  http://llvm.org/bugs/show_bug.cgi?id=8992#c7

The more general problem of missing locale functions that have _l
subscript was proposed here:

  http://article.gmane.org/gmane.comp.compilers.clang.devel/13258

However, there's been no feedback to that proposal, and hence, no
follow up to that proposal :frowning:

-Larry