I think "Part I: Invoking GNU Fortran" of the gfortran documentation should have a section on "Compiling (and linking) mixed-language programs". Whether this should be a section or a subsection I don't know, but it's really a commonly asked question and we ought to have explanations and examples of that in the doc.
I've posted explanations and examples on comp.lang.fortran that might be used as a starting point: http://groups.google.com/group/comp.lang.fortran/msg/a62f1aa0c1592838 Linking to C++ and other languages might also be interesting. Also, when documentation about our calling conventions is written, we can link these two parts. PS: Maybe we should also add information on how to create shared libraries of gfortran-compiled Fortran code? Or is that too generic to be in our doc?
I think we can close this. The preferred way is to use C interop. Anybody mind if I close this?
> I think we can close this. The preferred way is to > use C interop. Anybody mind if I close this? Or "is there important things to add to 7 Mixed-Language Programming?".
It seems that at least Thomas and Dominique believe that this can be closed.
(In reply to Jürgen Reuter from comment #4) > It seems that at least Thomas and Dominique believe that this can be closed. with which status?
(In reply to Eric Gallager from comment #5) > (In reply to Jürgen Reuter from comment #4) > > It seems that at least Thomas and Dominique believe that this can be closed. > > with which status? We need to extend that chapter with the new status for gcc 9 after Paul's fixes have all gone in. After that, I we should close this as FIXED.
(In reply to Thomas Koenig from comment #6) > (In reply to Eric Gallager from comment #5) > > (In reply to Jürgen Reuter from comment #4) > > > It seems that at least Thomas and Dominique believe that this can be closed. > > > > with which status? > > We need to extend that chapter with the new status for gcc 9 after > Paul's fixes have all gone in. > > After that, I we should close this as FIXED. Have Paul's fixes all gone in yet?
Sandra Loosemore and Martin Liska have been discussing how to update the fortran docs on gcc-patches lately; cc-ing them
Well, it looks to me like we currently do not document exactly how to link mixed-language programs, although chapter 7 does cover related concepts like what you have to do to initialize libgfortran if you are linking e.g. a fortran library with a main in some other language. I think this topic does belong in chapter 7 and not any other part of the manual, and that we should not close it. I'll add it to my queue.
The master branch has been updated by Sandra Loosemore <sandra@gcc.gnu.org>: https://gcc.gnu.org/g:452a0afbace650d7c0f2811e2b47e62dcd18e1fd commit r12-4959-g452a0afbace650d7c0f2811e2b47e62dcd18e1fd Author: Sandra Loosemore <sandra@codesourcery.com> Date: Fri Nov 5 14:01:03 2021 -0700 Fortran: Add more documentation for mixed-language programming [PR35276] 2021-11-05 Sandra Loosemore <sandra@codesourcery.com> PR fortran/35276 gcc/fortran/ * gfortran.texi (Mixed-Language Programming): Talk about C++, and how to link.
Should be fixed now. I added paragraphs about both C++ compatibility and how to link.