Meinersbur wrote:

While the FortranRuntime is written in C++, it is ensured that it does not 
depend on libc++.so/libstdc++.so ([regression 
test](https://github.com/llvm/llvm-project/blob/main/flang/test/Runtime/no-cpp-dep.c)).
 Hence what C++ runtime the user links into their executable shouldn't concern 
the Fortran part.
When mixing Fortran and C++ code with Fortran code in the same 
add_library/add_executable, will use the C++ linker to link all the object 
files together (just as with C and C++). That might be the expected thing to 
do. That means it will care for linking the correct C++ library, but leave out 
the Fortran runtime library, and the user has to add `-lFortranRuntime` 
manually. If I understand correct, with this patch `flang-new -stdlib=libc++` 
will link the C++ and Fortran standard libraries? Unfortunately CMake does not 
know that.

Note that the test will fail when `LLVM_DEFAULT_TARGET_TRIPLE` is set to 
anything else than the host platform. Because of this. Clang tests never invoke 
the linker, but check the output of `-###`. However, Flang already has tests 
with the same issue.

https://github.com/llvm/llvm-project/pull/110598
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to