This is an archive of the discontinued LLVM Phabricator instance.

Some notes in `LLVM_ENABLE_LIBCXX`
AbandonedPublic

Authored by ldionne on Aug 27 2019, 6:40 AM.

Details

Summary

Reference: https://bugs.llvm.org/show_bug.cgi?id=43105

I've found a bug when libc++ is the only STL on system and cmake will fail building llvm.
It looks like this is not a serious issue so no one is working on that. But I think it's better to mention it in doc.

This is not a fix but just a document enhancement.

Diff Detail

Repository
rL LLVM

Event Timeline

oraluben created this revision.Aug 27 2019, 6:40 AM

I would MUCH prefer that the compiler checker actually use the right library. Also, this isn't completely correct, MacOS Clang doesn't have libstdc++ available at all, yet works fine.

I would MUCH prefer that the compiler checker actually use the right library. Also, this isn't completely correct, MacOS Clang doesn't have libstdc++ available at all, yet works fine.

You are right, it only fails if clang's default STL is not libc++. And I agree that this is not the proper way of resolving the issue.

If your system only has libc++ available but the compiler shipped with it doesn't work out of the box (i.e. without passing -stdlib=libc++), isn't your compiler broken? In other words, it seems to me that your system compiler should always work out of the box without having to pass -stdlib=XXX -- do we agree? If so, I think the bug should be reported to whoever vends the compiler on the platform where you encountered this issue.

If your system only has libc++ available but the compiler shipped with it doesn't work out of the box (i.e. without passing -stdlib=libc++), isn't your compiler broken? In other words, it seems to me that your system compiler should always work out of the box without having to pass -stdlib=XXX -- do we agree? If so, I think the bug should be reported to whoever vends the compiler on the platform where you encountered this issue.

I agree, and that makes a ton of sense to me. If your compiler doesn't work as shipped, it is an issue with the configuration.

I was finally able to view the bug, and it appears to be an ubuntu 18 docker image, compiling with Clang. I'm not sure how @oraluben managed to configure that system in a way to cause that problem, but I would think this is a configuration issue.

If your system only has libc++ available but the compiler shipped with it doesn't work out of the box (i.e. without passing -stdlib=libc++), isn't your compiler broken? In other words, it seems to me that your system compiler should always work out of the box without having to pass -stdlib=XXX -- do we agree? If so, I think the bug should be reported to whoever vends the compiler on the platform where you encountered this issue.

If I don't misunderstand, clang is supposed to use libc++ on Linux if there's not a libstdc++ installed?

If your system only has libc++ available but the compiler shipped with it doesn't work out of the box (i.e. without passing -stdlib=libc++), isn't your compiler broken? In other words, it seems to me that your system compiler should always work out of the box without having to pass -stdlib=XXX -- do we agree? If so, I think the bug should be reported to whoever vends the compiler on the platform where you encountered this issue.

If I don't misunderstand, clang is supposed to use libc++ on Linux if there's not a libstdc++ installed?

Whatever the answer to that is (and I would guess it's "yes" but that's up to whoever produces the toolchain for Linux), that probably depends where libc++ is installed. Is your libc++ installed at "standard" locations on your Linux system?

This has been a while and I still don't understand the purpose of this added note. Should we abandon this?

ldionne requested changes to this revision.May 15 2020, 7:18 AM

Requesting changes so it shows up properly in the review queue.

This revision now requires changes to proceed.May 15 2020, 7:18 AM
ldionne commandeered this revision.Sep 15 2020, 7:58 AM
ldionne edited reviewers, added: oraluben; removed: ldionne.

No answer in a while -- it looks like this isn't relevant anymore. Cleaning up the review queue.

This revision now requires review to proceed.Sep 15 2020, 7:58 AM
ldionne abandoned this revision.Sep 15 2020, 7:58 AM