This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, Fortran] PR25829: Asynchronous I/O (v2)
Hi Jakub,
>> I do note that if one has, say, 8 files and only one
>> file uses async IO, then during linking of the 8 *.o
>> files to make the final execute -lpthread must be added.
>> How doesn't gfortran communicate that to the loader?
>
> ELF doesn't a way to do this, you'd need to add a special linker plugin for
> that. But is that really necessary?
> Simply let the users link with -lpthread or -pthread if they want real
> asynchronous IO, or without it if they are ok with the gcc <= 8
> behavior and document it.
wouldn't it be better to use a special gfortran flag for that?
-pthread/-lpthread is an implementation detail on some platforms, but
others may not need it (Solaris has folded libpthread into libc and
there are no more single-threaded processes, for example) or need
something different for async io (Windows, ...). IMO it would be better
to abstract this low-level detail away and let the driver DTRT, under
the control of a flag if need be.
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University