This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


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

howto debug this damned thing?


Hi,
it's me again - sorry.

I finally succeeded with compiling shared libs with g77 and
linking the result to programs compiled by native compilers
on Solaris 2.[56], HP UX 9 (i had to add a -fPIC for compiling 
everything below libf2c there), 
Linux ('native' compiler is pgcc/pgf77 from protland group) 
and partly SUN OS 4.1.4. 
On the latter one i have a problem:

I create the libs by 
g77 -g -fno-second-underscore -shared -o library.so source.f \
    libg2c.a libgcc.a -lm -lc
to link in the runtime support for g77 (otherwise i get a whole
mess while linking by dlopen).

Everything works fine until i try to use a write statement.
This looks like this:
      CHARACTER*256 STRING
      INTEGER*4 N
      ...
      WRITE(STRING,10) N
 10   FORMAT('NUMBER=',I6)

This is the line where it bombs with a seg fault.
(Or an illegal instruction and bus error, if i do more 
optimization and -fomit-frame-pointer)

Could anybody tell me, how i should debug that? This code is 
dynamically linked to the main prog by dlopen and friends at 
runtime (using RTL_LAZY, because there is nothing else on SUN4).

The only thing i could assume is, that it tries to use the native
compilers write or some of its helper routines and not those of g77.
the code works fine if i compile the whole program with g77.
But it is a big circuit simulator which has to run very fast, so i 
would like to stick with the native compiler for that.

Has anybody a good hint?

gcc -v:
Reading specs from 
/home/kahlert/EGCS/SUN4/lib/gcc-lib/sparc-sun-sunos4.1.4/egcs-2.91.60/specs
gcc version egcs-2.91.60 19981201 (egcs-1.1.1 release)

Thanks in advance,
Martin.

PS: Does anybody know, why i had to add a -fPIC flag only on HPs?
All other architectures i tried on worked well without that - only hp
told me, that libg2c.a contains position dependant code.

-- 
Your mouse has moved. Windows must be restarted for the change
to take effect. Reboot now?


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