public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libfortran/22298] New: libgfortran init() constructor isn't called if executable is statically linked
@ 2005-07-04 21:18 fxcoudert at gcc dot gnu dot org
2005-07-04 21:32 ` [Bug libfortran/22298] " daniel dot franke at imbs dot uni-luebeck dot de
2005-07-06 4:45 ` pinskia at gcc dot gnu dot org
0 siblings, 2 replies; 3+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2005-07-04 21:18 UTC (permalink / raw)
To: gcc-bugs
$ cat a_fortran.f90
subroutine f
print *, '##'
end
$ gfortran -c a_fortran.f90
$ cat a.c
extern void f_(void);
int main (void)
{
f_ ();
}
$ ./irun/bin/gcc -c a.c
$ gfortran -static a.o a_fortran.o && ./a.out
Fortran runtime error: End of record
$ gfortran a.o a_fortran.o && ./a.out
##
This happens because the init() constructor (libgfortran/runtime/main.c) is not
called when a.out is executed, if it was linked statically.
According to Andrew, one way to make sure that init() is called is to reference
it in an object file we're sure will be used. I'm thinking of runtime/error.c.
--
Summary: libgfortran init() constructor isn't called if
executable is statically linked
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: libfortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: fxcoudert at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22298
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-07-06 4:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-04 21:18 [Bug libfortran/22298] New: libgfortran init() constructor isn't called if executable is statically linked fxcoudert at gcc dot gnu dot org
2005-07-04 21:32 ` [Bug libfortran/22298] " daniel dot franke at imbs dot uni-luebeck dot de
2005-07-06 4:45 ` pinskia at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).