This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
[gfortran,patch] Pass command-line options to libgfortran in a more ABI-stable manner
- From: FX Coudert <fxcoudert at gmail dot com>
- To: "fortran at gcc dot gnu dot org List" <fortran at gcc dot gnu dot org>, gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 9 Jul 2007 23:43:23 +0100
- Subject: [gfortran,patch] Pass command-line options to libgfortran in a more ABI-stable manner
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:mime-version:to:message-id:content-type:subject:date:x-mailer:from; b=VcBLY88EAlXF87J+iN5yS/EEkPU1QT54jTg1IVO1SuYcZnRsdNCyizhjkKPuF+2fu+Qe+9D3h/SdC0siPGwF0DebNGFg7xqM4+QJtrnkDM1QS065D6/dxRWpsmH0y3J4IxZ6DtmCJJvqy54vvgE/cIpqp/pes7Rqxu0/bqWnwJ4=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:mime-version:to:message-id:content-type:subject:date:x-mailer:from; b=inG7LxmS5/A5lEjYUn2B46QgpI7NZhgbs41s+YXGk+AC3CLi/4LXR0T9MhZB0KcLZGUOTsuiI1soT4mA+gt085jFQKVIfG4V3ILDZnBOFHf4hrC5EcLR66PQf8Vm2GrMGcN0yxj8N2dkjXSL4CIbGOlHs1CFXcaBgfAYPpJL4LI=
Hi all,
I've been wanting to write this patch for more than a year now, and
it's here at last. Some important compile-time options are passed to
the library to influence runtime behaviour (-std value, -pedantic, -
fbacktrace, -fcore-dump flags). This is currently done by a function
with the following prototype :
_gfortran_set_std (int warn_std, int allow_std, int pedantic,
int backtrace, int dump_core);
This does not easily accomodate evolutions by adding a new flag and
passing it to the library, while keeping the ABI stable. On the
contrary, I propose to change this function call into:
_gfortran_set_options (int num, int options[]);
where num is the number of options that the front-end knows about and
has put into options[]. For this reason it is easy to change the
_gfortran_set_options code so that, for older code, we initialize the
new options with default values yielding the same behaviour as before.
Bootstrapped and regtested on x86_64-linux, OK for mainline? (I keep
the old function around, so that we don't break ABI for such a little
reorganization)
:ADDPATCH fortran:
Attachment:
set_options.ChangeLog
Description: Binary data
Attachment:
set_options.diff
Description: Binary data