[flang-commits] [clang] [flang] [flang][driver] Make -stdlib= option visible to flang and silently ignored by it (PR #110598)

Paul Osmialowski via flang-commits flang-commits at lists.llvm.org
Thu Oct 3 07:25:14 PDT 2024


pawosm-arm wrote:

> If this is completely ignored and does not effect the link line, are you sure the resulting binary actually uses the right c++ library?
> 
> Edit: flang will not link a C++ library. It is not a C++ compiler.

As we discussed it offline, in case of this project it does not matter, no calls to the library are actually being made from the C++ code, and it was more important what CMake did with CXXFLAGS (so the headers from the right C++ standard library were used). Also the integration test I've added depicts that flang-new doesn't really need to know anything about the language and standard libraries they use. The trouble here is that linker flags were blindly propagated by CMake (when asked to specify C++ standard library) no matter if it has any use or not. In smaller project, where we know that C++ the part isn't actually calling anything from library, the -stdlib flang should not be used during linking at all, but here we're talking about large scale project, where the Flang/C++ part is just a small part so the project maintainers didn't really care about making an exception in the flags being used when linking just that part.

https://github.com/llvm/llvm-project/pull/110598


More information about the flang-commits mailing list