This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: New option: -fstatic-libgfortran
- From: Bernhard Fischer <rep dot dot dot nop at gmail dot com>
- To: François-Xavier Coudert <fxcoudert at gmail dot com>
- Cc: "fortran at gcc dot gnu dot org List" <fortran at gcc dot gnu dot org>, GCC Development <gcc at gcc dot gnu dot org>
- Date: Fri, 20 Apr 2007 13:34:59 +0200
- Subject: Re: New option: -fstatic-libgfortran
- References: <19c433eb0704200115r39a6be52qc12ac8ce45912ebf@mail.gmail.com>
On Fri, Apr 20, 2007 at 10:15:34AM +0200, François-Xavier Coudert wrote:
>Hi all,
>
>Attached is a first draft of a patch to add a -fstatic-libgfortran
>option. This new option is recognized by the driver and instead of
>adding "-lgfortran" to the various subprocesses, it adds "-Wl,-Bstatic
>-lgfortran -Wl,-Bdynamic". I have two questions about this:
> + linkers other than the GNU linker might have problems with that.
>is there a more general way of doing this? or should it be conditional
>on some macro, like HAVE_LD_STATIC_DYNAMIC?
> + when -static is used later in the command line, this trick doesn't
>work; would "%{!static:-Wl,-Bstatic} -lgfortran
>%{!static:-Wl,-Bdynamic}" be a good replacement?
>
>Thanks for the help, I'm a bit a loss with non-GNU linkers... :(
Perhaps looking at how stuff is done for libgcc.a in
gcc/{Makefile.in,gccspec.c} would help?