Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.0] Add support for LLVM's libc++ #3956

Open
hcoona opened this issue Oct 8, 2022 · 6 comments
Open

[2.0] Add support for LLVM's libc++ #3956

hcoona opened this issue Oct 8, 2022 · 6 comments

Comments

@hcoona
Copy link

hcoona commented Oct 8, 2022

Summary

I cannot build any c++ sources with clang++ in Mariner 2.0 Docker image.

I think it's because we upgrade clang to v12.0.1 but still leave libstdc++-devel v11.2.0.

How to reproduce

# image id: 9981cdf1c8ec
docker run --net=host --rm -it mcr.microsoft.com/cbl-mariner/base/core:2.0 /bin/bash
tdnf install -y clang
cat > a.cc << EOF
#include <iostream>
int main() {
  std::cout << "Hello!" << std::endl;
  return 0;
}
EOF
clang++ -std=c++17 -stdlib=libc++ -c a.cc

image

image

image

@hcoona
Copy link
Author

hcoona commented Oct 8, 2022

I think it's introduced by #1428, @christopherco could you help to take a look?

@mfrw
Copy link
Member

mfrw commented Oct 10, 2022

@hcoona
I managed to get it working by installing build-essential

tdnf install build-essential
image

Also, IMHO, libstdc++ 11.2.0-2 is shipped by gcc.
Wondering if is related or not.

@hcoona
Copy link
Author

hcoona commented Oct 10, 2022

@mfrw you are right, libstdc++ is not libc++, my fault.

But it still not works for me.

# image id: 9981cdf1c8ec
docker run --net=host --rm -it mcr.microsoft.com/cbl-mariner/base/core:2.0 /bin/bash
tdnf install -y build-essential clang
cat > a.cc << EOF
#include <iostream>
int main() {
  std::cout << "Hello!" << std::endl;
  return 0;
}
EOF
clang++ -std=c++17 -stdlib=libc++ -c a.cc

image

@mfrw
Copy link
Member

mfrw commented Oct 10, 2022

libc++ is a new implementation of the C++ standard library, which to the best of my knowledge, we do not ship.
In my opinion, installing clang should not mean we get libc++ also.

/cc @christopherco - Please add/correct me if I am mistaken.

@christopherco
Copy link
Contributor

@mfrw is correct here - today we do not ship libc++ which is the new implementation of the C++ standard library from LLVM.org.
In the future, when we do add support libc++, we will likely ship it in a separate package like libc++-<version>.rpm.

@hcoona
Copy link
Author

hcoona commented Oct 11, 2022

OK, thanks for the information. Hope we can add it into schedule. The libc++ has been there at least for 12 years, it's not new. See llvm-mirror/libcxx@bc8d3f9

@oliviacrain oliviacrain changed the title Mariner 2.0 clang didn't work [2.0] Add support for LLVM's libc++ Dec 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants