On Fri, Jun 15, 2018 at 10:59 PM Joseph Myers <jos...@codesourcery.com> wrote: > > On Fri, 15 Jun 2018, Thomas Koenig wrote: > > > Hi Richard, > > > > > First and foremost we need a syntax that actually works for the > > > Fortran frontend and a way to automatically include this special > > > header / module. > > > > I can imagine parsing the relevant headers while compiling gfortran > > and generating C code from it, which could then be #included in the > > compiler source code. It should be possible to extend mathbuiltins.def > > that way. > > The libmvec functions present depend on the multilib (for example, glibc > only currently supports them for x86_64, not for 32-bit x86). Given this > multilib dependence, parsing the glibc headers when building the compiler > itself is probably not a sensible option.
I'm thinking of sth like the C stdc-predef.h header which is always included by the compiler. So it needs to be sth parseable by gfortran which means it needs to be a module or sth equivalent to a fortran include file. GCC supports -include on the command-line, gfortran does not and it could also support sth like -use FOO to import module FOO. The rest could be then done by specs processing (or similar to the stdc-predef.h via a fortran specific target hook). Richard. > > -- > Joseph S. Myers > jos...@codesourcery.com