This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gfortran patch - g77 record markers


bud davis wrote:
> this patch adds a link time option, -frecord-mark-g77.
> 
> when invoked to make an executable, this selects a different library to 
> be added to the link line, libgfortran_seq_io_g77.  without this option, 
> libgfortran_seq_io is linked in.
> 
> these libraries call a routine which sets a global record marker type to 
> be used when the files are opened.

Great work!

> this implementation may seem tortured, but it provides a whole bunch of 
> flexibility in the future.  the following other solutions to the record 
> mark problem can be supported:
> 
> #1.  environment variable to change the default for an individual unit.
> #2.  an additional parameter to the open statement to select the type of 
> record marker.
> #3.  as many other conventions as desired can be added, and they can all 
> be used from the same executable (the routines go in record_mark.c, only 
> the "selection" is done with the additional libraries)
> 
> so, this should make everyone happy as I have not precluded other 
> desired implementations.

I think the "link a different library" approach is flawed (even though it's a
beautiful idea in principle) for two reasons:
a) every shared library adds complexity to the build
b) the possible inflation of shared libraries, say e.g. you want to add
variations of record markers which support different endiannesses -- you've
just doubled the number of libraries

> two things are not complete; testsuite changes and the info page.  I am 
> not sure how to accomplish either of these.  i assume we want to run any 
> testsuite files that use unformatted sequential I/O with and without 
> this compile option.  request that someone on the list will provide 
> assistance on these two items.

{ dg-options "-frecord-mark-g77" }

There's no way that I'm aware of which allows one to cycle through a list of
options.

- Tobi


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]