This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fortran senmentation fault


On 05/02/2012 10:53 AM, vikram_sp wrote:
I am trying to port fortran on arm. But the executables generated
by the cross compiler is giving segmentation fault on the board.

As preremark, I know that gfortran works with RTEMS and VxWorks and on Android (ARM) smart phones. Thus, it shouldn't be very difficult to get it running on your system. (Fingers crossed.)


I want to know what special is needs to be initialized in fortran
program, i mean starup files. And what is to be done for safe termination.

Startup (GCC 4.5 and later): gfortran uses the normal GCC startup, which calls main(). If the (main) PROGRAM is written in Fortran, the generated main function calls some library initialization functions, cf. http://gcc.gnu.org/onlinedocs/gfortran/Non_002dFortran-Main-Program.html


Additionally, the __attribute__((constructor)) is used for some initialization in the run-time library and for coarrays (only with --fcoarray=lib). Similary for the __attribute__((destructor)). See libgfortran/runtime/main.c, libgfortran/intrinsics/{rand,random}.c

For the library, the only more important actions are: Searching for addr2line for backtracing and closing still open files when the program terminates.

I hope that helps. Good luck!

Tobias


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]