This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [libgfortran,patch] Protect uses of {f,l,}stat with autoconf macros
- From: Jerry DeLisle <jvdelisle at verizon dot net>
- To: FX Coudert <fxcoudert at gmail dot com>
- Cc: "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: Sun, 01 Apr 2007 08:49:33 -0700
- Subject: Re: [libgfortran,patch] Protect uses of {f,l,}stat with autoconf macros
- References: <82C09F13-A1EF-41C0-B608-2B5F1906EA1A@gmail.com>
FX Coudert wrote:
Attached patch fixes PR libfortran/31335: we have unconditional calls to
fstat, lstat and stat in libgfortran/intrinsics/stat.c. I simply propose
to follow the pattern laid in the rest of the library, and only define
the FSTAT and STAT library functions when fstat() and stat() library
calls are available. LSTAT is a bit different, because on systems that
don't support it, it is equivalent to stat() and thus can be provided
anyway.
This bug prevented libgfortran from building as a DLL. With this fix,
and Steve Ellcey's libtool patch, it will be possible to build
libgfortran as a DLL on windows with as little as a two-lines patch
(adding -no-undefined to libgfortran_LT_FLAGS in Makefile.am, and adding
LT_INIT([shared static win32-dll dlopen]) to configure.ac
Built and tested on i386-pc-mingw32 and x86_64-unknown-linux-gnu. OK for
mainline?
Thanks,
FX
:REVIEWMAIL:
This is OK.