[libgfortran,patch] Protect uses of {f,l,}stat with autoconf macros

FX Coudert fxcoudert@gmail.com
Sat Mar 24 18:46:00 GMT 2007


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



:ADDPATCH libgfortran:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stat.ChangeLog
Type: application/octet-stream
Size: 339 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20070324/44a5c912/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stat.diff
Type: application/octet-stream
Size: 2196 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20070324/44a5c912/attachment-0001.obj>


More information about the Fortran mailing list